Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [神器1068] 燃える蝶の夢の作成 #90

Merged
merged 19 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1068.dream_of_burning_butterfly/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

execute if data storage asset:context {id:1068} run function asset:artifact/1068.dream_of_burning_butterfly/give/2.give
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#> asset:artifact/1068.dream_of_burning_butterfly/give/2.give
#
# 神器の作成部 ここでID等を定義する
#
# @user
# @within function asset:artifact/1068.dream_of_burning_butterfly/give/1.trigger

# 神器の説明や消費MPなどをここで設定する。
# 最後にasset:artifact/common/giveを実行することで入手可能。

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1068
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"燃える蝶の夢","color":"dark_red"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"発動時、失っている体力10につき、","color":"white"}','[{"text":"火攻撃+5%","color":"red"},{"text":"を10秒間得る。(最大25%)","color":"white"}]','{"text":"灼炎の如く燃えている蝶。","color":"gray"}','{"text":"命を燃やすかのように紅く輝いている。","color":"gray"}']
# MP以外の消費物 (TextComponentString) (オプション)
# data modify storage asset:artifact CostText set value
# 使用回数 (int) (オプション)
# data modify storage asset:artifact RemainingCount set value
# 神器を発動できるスロット (string) Wikiを参照
data modify storage asset:artifact Slot set value "hotbar"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onDamageFromEntity"
# 神器の発動条件 (TextComponentString) (オプション)
data modify storage asset:artifact Condition set value '{"text":"体力を10以上失っている","color":"white"}'
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.Damage set value [0,0]
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.AttackType set value [Physical,Magic]
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.ElementType set value [Fire,Water,Thunder,None]
# 攻撃に関する情報 -防御無視 (boolean) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.BypassResist set value
# 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.IsRangeAttack set value
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.AttackRange set value
# MP消費量 (int)
data modify storage asset:artifact MPCost set value 0
# MP必要量 (int) (オプション)
# data modify storage asset:artifact MPRequire set value
# 神器のクールダウン (int) (オプション)
data modify storage asset:artifact LocalCooldown set value 200
# グローバルクールダウン (int) (オプション)
# data modify storage asset:artifact SpecialCooldown set value
# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
data modify storage asset:artifact DisableCooldownMessage set value true
# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション)
# data modify storage asset:artifact DisableMPMessage set value
# 扱える神 (string[]) Wikiを参照
data modify storage asset:artifact CanUsedGod set value ["Urban", "Nyaptov", "Rumor"]
# カスタムNBT (NBTCompound) 追加で指定したいNBT (オプション)
# data modify storage asset:artifact CustomNBT set value {}

# 神器の入手用function
function asset:artifact/common/give
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1068.dream_of_burning_butterfly/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

data modify storage asset:artifact RarityRegistry[3] append value 1068
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1068.dream_of_burning_butterfly/trigger/1.trigger
#
# 指定したイベントタイミングで実行されるfunction
#
# @within tag/function asset:artifact/**

# storage asset:idの%slot%に装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する
execute if data storage asset:context id{hotbar:[1068]} run function asset:artifact/1068.dream_of_burning_butterfly/trigger/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#> asset:artifact/1068.dream_of_burning_butterfly/trigger/2.check_condition
#
# 神器の発動条件をチェックします
#
# @within function asset:artifact/1068.dream_of_burning_butterfly/trigger/1.trigger

# ID指定する
data modify storage asset:artifact TargetID set value 1068
# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/hotbar
# 他にアイテム等確認する場合はここに書く

# 体力を10以上失っているかチェックする

# 最大体力と現在体力を取得
execute store result score $MaxHealth Temporary run attribute @s generic.max_health get
function api:data_get/health
execute store result score $Health Temporary run data get storage api: Health

# (最大体力 - 現在体力) >= 10 か否かをチェックする
execute store result score $LostHealth Temporary run scoreboard players operation $MaxHealth Temporary -= $Health Temporary
execute unless score $LostHealth Temporary matches 10.. run tag @s remove CanUsed

# ログを埋め尽くさないように発動失敗のメッセージは無い

# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed] run function asset:artifact/1068.dream_of_burning_butterfly/trigger/3.main

# リセット
scoreboard players reset $MaxHealth Temporary
scoreboard players reset $Health Temporary
scoreboard players reset $LostHealth Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#> asset:artifact/1068.dream_of_burning_butterfly/trigger/3.main
#
# 神器のメイン処理部
#
# @within function asset:artifact/1068.dream_of_burning_butterfly/trigger/2.check_condition

# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う
function asset:artifact/common/use/hotbar

# ここから先は神器側の効果の処理を書く

# 演出
particle flame ~ ~1.3 ~ 0.4 0.6 0.4 0.15 25
particle small_flame ~ ~1.3 ~ 0.4 0.6 0.4 0.3 25
particle dripping_lava ~ ~1.7 ~ 0.4 0.6 0.4 0 25
particle dust_color_transition 0.733 0.039 0.039 1 1 0.58 0.188 ~ ~1.3 ~ 0.4 0.6 0.4 0 30
playsound block.fire.ambient player @a ~ ~ ~ 0.8 1
playsound block.fire.ambient player @a ~ ~ ~ 0.8 1.2
playsound block.fire.ambient player @a ~ ~ ~ 0.8 1.4
playsound block.fire.extinguish player @a ~ ~ ~ 0.3 1.4

# 失った体力10につき、火攻撃+5%(最大25%)
# 補正はEffectAsset側で実装する

# 最大体力と現在体力を取得する
execute store result score $MaxHealth Temporary run attribute @s generic.max_health get
function api:data_get/health
execute store result score $Health Temporary run data get storage api: Health

# 失った体力を計算する
execute store result score $LostHealth Temporary run scoreboard players operation $MaxHealth Temporary -= $Health Temporary

# 失った体力を10で割る
scoreboard players operation $LostHealth Temporary /= $10 Const
haiiro2gou marked this conversation as resolved.
Show resolved Hide resolved

# $LostHealthの数値をStackとして燃える蝶の夢エフェクトを付与
data modify storage api: Argument.ID set value 220
execute store result storage api: Argument.Stack int 1 run scoreboard players get $LostHealth Temporary
function api:entity/mob/effect/give

# リセット
scoreboard players reset $MaxHealth Temporary
scoreboard players reset $Health Temporary
scoreboard players reset $LostHealth Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1068.dream_of_burning_butterfly/trigger/_index.d
# @private

#> tag
# @within function asset:artifact/1068.dream_of_burning_butterfly/trigger/**
#declare score_holder $MaxHealth
#declare score_holder $Health
#declare score_holder $LostHealth
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/220.dream_of_burning_butterfly/_/end
#
# Effectの効果の終了時に実行されるfunction
#
# @within tag/function asset:effect/end

execute if data storage asset:context {id:220} run function asset:effect/220.dream_of_burning_butterfly/end/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/220.dream_of_burning_butterfly/_/given
#
# Effectが付与された時に実行されるfunction
#
# @within tag/function asset:effect/given

execute if data storage asset:context {id:220} run function asset:effect/220.dream_of_burning_butterfly/given/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/220.dream_of_burning_butterfly/_/re-given
#
# Effectが上書きされた時に実行されるfunction
#
# @within tag/function asset:effect/re-given

execute if data storage asset:context {id:220} run function asset:effect/220.dream_of_burning_butterfly/re-given/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/220.dream_of_burning_butterfly/_/register
#
#
#
# @within tag/function asset:effect/register

execute if data storage asset:context {id:220} run function asset:effect/220.dream_of_burning_butterfly/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/220.dream_of_burning_butterfly/_/remove
#
# Effectが神器や牛乳によって削除された時に実行されるfunction
#
# @within tag/function asset:effect/remove

execute if data storage asset:context {id:220} run function asset:effect/220.dream_of_burning_butterfly/remove/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/220.dream_of_burning_butterfly/_/tick
#
# Effectが発動している間毎tick実行されるfunction
#
# @within tag/function asset:effect/tick

execute if data storage asset:context {id:220} run function asset:effect/220.dream_of_burning_butterfly/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/220.dream_of_burning_butterfly/end/
#
# Effectの効果が切れた時の処理
#
# @within function asset:effect/220.dream_of_burning_butterfly/_/end

# 補正を削除する
function asset:effect/220.dream_of_burning_butterfly/modifier/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/220.dream_of_burning_butterfly/given/
#
# Effectが付与された時の処理
#
# @within function asset:effect/220.dream_of_burning_butterfly/_/given

# 補正を付与する
function asset:effect/220.dream_of_burning_butterfly/modifier/add
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#> asset:effect/220.dream_of_burning_butterfly/modifier/add
#
# 補正を付与する
#
# @within function
# asset:effect/220.dream_of_burning_butterfly/given/
# asset:effect/220.dream_of_burning_butterfly/re-given/

# (Stack × 5)%の火攻撃補正を付与
data modify storage api: Argument.UUID set value [I;1,3,220,0]
execute store result storage api: Argument.Amount double 0.05 run data get storage asset:context Stack
data modify storage api: Argument.Operation set value "multiply"
function api:modifier/attack/fire/add
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:effect/220.dream_of_burning_butterfly/modifier/remove
#
# 補正を削除する
#
# @within function
# asset:effect/220.dream_of_burning_butterfly/end/
# asset:effect/220.dream_of_burning_butterfly/re-given/
# asset:effect/220.dream_of_burning_butterfly/remove/

# 火攻撃補正を削除
data modify storage api: Argument.UUID set value [I;1,3,220,0]
function api:modifier/attack/fire/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:effect/220.dream_of_burning_butterfly/re-given/
#
# Effectが上書きされた時の処理
#
# @within function asset:effect/220.dream_of_burning_butterfly/_/re-given

# 補正を削除する
function asset:effect/220.dream_of_burning_butterfly/modifier/remove

# 補正を付与する
function asset:effect/220.dream_of_burning_butterfly/modifier/add
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset:effect/220.dream_of_burning_butterfly/register
#
# Effectのデータを指定
#
# @within function asset:effect/220.dream_of_burning_butterfly/_/register

# ExtendsSafe (boolean) (default = false)
data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 220
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text":"燃える蝶の夢","color":"dark_red"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value '{"与える火属性ダメージが上昇する"}'
# 効果時間 (int) (default = API || error)
data modify storage asset:effect Duration set value 200
# スタック (int) (default = API || 1)
# data modify storage asset:effect Stack set value
# 効果時間の操作方法 (default = API || "replace")
# data modify storage asset:effect DurationOperation set value
# スタックの操作方法 (default = API || "replace")
# data modify storage asset:effect StackOperation set value
# 最大効果時間 (int) (default = 2147483647)
data modify storage asset:effect MaxDuration set value 200
# 最大スタック (int) (default = 2147483647)
data modify storage asset:effect MaxStack set value 5
# 悪い効果か否か (boolean)
data modify storage asset:effect IsBadEffect set value false
# 死亡時のエフェクトの処理 (default = "remove")
# data modify storage asset:effect ProcessOnDied set value
# 消すのに必要なレベル (int) (default = 1)
data modify storage asset:effect RequireClearLv set value 3

# フィールド
# data modify storage asset:effect Field.myValue set value
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/220.dream_of_burning_butterfly/remove/
#
# Effectが削除された時の処理
#
# @within function asset:effect/220.dream_of_burning_butterfly/_/remove

# 補正を削除する
function asset:effect/220.dream_of_burning_butterfly/modifier/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:effect/220.dream_of_burning_butterfly/tick/
#
# Effectのtick処理
#
# @within function asset:effect/220.dream_of_burning_butterfly/_/tick

# 演出
execute if predicate lib:random_pass_per/20 run particle flame ~ ~1.3 ~ 0.4 0.6 0.4 0 1
execute if predicate lib:random_pass_per/10 run particle dripping_lava ~ ~1.3 ~ 0.4 0.6 0.4 0 2
execute if predicate lib:random_pass_per/20 run particle dust_color_transition 0.733 0.039 0.039 1 1 0.58 0.188 ~ ~1.3 ~ 0.4 0.6 0.4 0 2
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1068.dream_of_burning_butterfly/trigger/1.trigger",
"asset:artifact/0914.reactive_armor_feet/trigger/1.trigger",
"asset:artifact/0913.reactive_armor_legs/trigger/1.trigger",
"asset:artifact/0912.reactive_armor_chest/trigger/1.trigger",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/give.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1068.dream_of_burning_butterfly/give/1.trigger",
"asset:artifact/0900.pure_water_bracelet/give/1.trigger",
"asset:artifact/0772.dolphin_amulet/give/1.trigger",
"asset:artifact/0702.bright_lamp/give/1.trigger",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/register.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1068.dream_of_burning_butterfly/register",
"asset:artifact/0900.pure_water_bracelet/register",
"asset:artifact/0772.dolphin_amulet/register",
"asset:artifact/0702.bright_lamp/register",
Expand Down
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/end.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/220.dream_of_burning_butterfly/_/end"
]
}
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/given.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/220.dream_of_burning_butterfly/_/given"
]
}
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/re-given.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/220.dream_of_burning_butterfly/_/re-given"
]
}
Loading
Loading