diff --git a/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/give/2.give.mcfunction b/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/give/2.give.mcfunction index 9ec242a399..672866dbdc 100644 --- a/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/give/2.give.mcfunction +++ b/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/give/2.give.mcfunction @@ -15,7 +15,7 @@ # 神器の名前 (TextComponentString) data modify storage asset:artifact Name set value '{"text":"失速する速力のポーション","color":"dark_aqua"}' # 神器の説明文 (TextComponentString[]) - data modify storage asset:artifact Lore set value ['{"text":"力は一時的な物でしかない。","color":"gray"}','{"text":"その欲求を求め続けるなら","color":"gray"}','{"text":"代償を支払うものだ。","color":"gray"}'] + data modify storage asset:artifact Lore set value ['{"text":"- 50秒間、移動速度にバフを得る","color":"white"}','{"translate":"%1$sこのバフは%2$sから始まり","color":"white","with":[{"text":"\\u0010","font":"space"},{"text":"80%"}]}','{"translate":"%1$s10秒経つごとに効果量が%2$sされる","color":"white","with":[{"text":"\\u0010","font":"space"},{"text":"-20%"}]}','{"translate":"- バフ終了後に20秒間、移動速度が%1$s低下する","color":"white","with":[{"text":"20%"}]}','{"text":"- バフ効果時間中に再使用すると","color":"white"}','{"translate":"%1$s最大体力の%2$s分のダメージを受ける","color":"white","with":[{"text":"\\u0010","font":"space"},{"text":"20%"}]}','{"text":"力は一時的な物でしかない。","color":"gray"}','{"text":"その欲求を求め続けるなら","color":"gray"}','{"text":"代償を支払うものだ。","color":"gray"}'] # 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション) # data modify storage asset:artifact ConsumeItem.Item set value # data modify storage asset:artifact ConsumeItem.Count set value diff --git a/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/trigger/3.main.mcfunction b/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/trigger/3.main.mcfunction index ad922f30ef..0cf8005301 100644 --- a/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/trigger/3.main.mcfunction +++ b/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/trigger/3.main.mcfunction @@ -9,17 +9,22 @@ # ここから先は神器側の効果の処理を書く -# 薄れゆく速さデバフ(ID:211)があるかどうかチェックする - #data modify storage api: Argument.ID set value 211 - #function api:entity/mob/effect/get/from_id +# 薄れゆく速さバフ(ID:210)があるかどうかチェックする + data modify storage api: Argument.ID set value 210 + function api:entity/mob/effect/get/from_id -# デバフがなければ薄れゆく速さバフ(ID:210)を、あればデバフ(ID:211)を付与 - #execute unless data storage api: Return.Effect run data modify storage api: Argument.ID set value 210 - #execute if data storage api: Return.Effect run data modify storage api: Argument.ID set value 211 +# バフがあるならダメージ + execute if data storage api: Return.Effect{ID:210} run function asset:artifact/0456.potion_of_stalling_power/trigger/reuse_damage # 薄れゆく速さバフを付与 -# EffectAssetのendのタイミングでエフェクトをgiveしても上手くいかないため -# TODO: 治り次第直す +# 仕様書 +# ((Stack - 1) * Amount)%から始まり、Durationが切れるたびにスタックが1減少し、効果時間が元に戻る +# スタックが1の状態で時間切れになるとデバフに変化する data modify storage api: Argument.ID set value 210 + data modify storage api: Argument.Stack set value 5 + data modify storage api: Argument.Duration set value 200 + data modify storage api: Argument.FieldOverride.Amount set value 0.2 + data modify storage api: Argument.FieldOverride.Debuff.Duration set value 400 + data modify storage api: Argument.FieldOverride.Debuff.Amount set value -0.2 function api:entity/mob/effect/give function api:entity/mob/effect/reset diff --git a/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/trigger/reuse_damage.mcfunction b/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/trigger/reuse_damage.mcfunction new file mode 100644 index 0000000000..facb3168a2 --- /dev/null +++ b/Asset/data/asset/functions/artifact/0456.potion_of_stalling_power/trigger/reuse_damage.mcfunction @@ -0,0 +1,18 @@ +#> asset:artifact/0456.potion_of_stalling_power/trigger/reuse_damage +# +# +# +# @within function asset:artifact/0456.potion_of_stalling_power/trigger/3.main + +# 演出 + particle minecraft:dragon_breath ~ ~1 ~ 0.1 0.1 0.1 0.03 100 + playsound minecraft:entity.evoker.prepare_summon player @a + +# 最大体力に比例した固定ダメージを受ける + function api:modifier/max_health/get + execute store result storage api: Argument.Damage double 0.2 run data get storage api: Return.MaxHealth + data modify storage api: Argument.AttackType set value "Physical" + data modify storage api: Argument.FixedDamage set value true + data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sは速度の代償を払った","with":[{"selector":"@s"}]}]' + function api:damage/ + function api:damage/reset diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/end/.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/end/.mcfunction index 9a20aac115..7809d57106 100644 --- a/Asset/data/asset/functions/effect/0210.fading_speed/end/.mcfunction +++ b/Asset/data/asset/functions/effect/0210.fading_speed/end/.mcfunction @@ -7,7 +7,9 @@ # 補正を削除する function asset:effect/0210.fading_speed/modifier/remove -# 効果時間終了時、デバフを付与 +# 薄れゆく速さ(デバフ)を付与 data modify storage api: Argument.ID set value 211 + data modify storage api: Argument.Duration set from storage asset:context this.Debuff.Duration + data modify storage api: Argument.FieldOverride.Amount set from storage asset:context this.Debuff.Amount function api:entity/mob/effect/give function api:entity/mob/effect/reset diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/given/.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/given/.mcfunction index 2651fda6c0..b2e02b06df 100644 --- a/Asset/data/asset/functions/effect/0210.fading_speed/given/.mcfunction +++ b/Asset/data/asset/functions/effect/0210.fading_speed/given/.mcfunction @@ -4,5 +4,8 @@ # # @within function asset:effect/0210.fading_speed/_/given +# 初期化 + function asset:effect/0210.fading_speed/init/ + # 補正を付与する function asset:effect/0210.fading_speed/modifier/add diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/init/.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/init/.mcfunction new file mode 100644 index 0000000000..f6518c6bd0 --- /dev/null +++ b/Asset/data/asset/functions/effect/0210.fading_speed/init/.mcfunction @@ -0,0 +1,10 @@ +#> asset:effect/0210.fading_speed/init/ +# +# +# +# @within function +# asset:effect/0210.fading_speed/given/ +# asset:effect/0210.fading_speed/re-given/ + +# Durationをそのままフィールドに入れておく + data modify storage asset:context this.Duration set from storage asset:context Duration diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/load.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/load.mcfunction deleted file mode 100644 index 2c16b57e78..0000000000 --- a/Asset/data/asset/functions/effect/0210.fading_speed/load.mcfunction +++ /dev/null @@ -1,10 +0,0 @@ -#> asset:effect/0210.fading_speed/load -# -# Effectに利用するスコアボード等の初期化処理 -# ※ExtendsSafeを有効化した状態での使用は非推奨です -# -# @within tag/function asset:effect/load - -#> 定義類はここに -# @within function asset:effect/0210.fading_speed/** - scoreboard objectives add 5U.Tick dummy diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/modifier/add.m.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/modifier/add.m.mcfunction new file mode 100644 index 0000000000..51a681928e --- /dev/null +++ b/Asset/data/asset/functions/effect/0210.fading_speed/modifier/add.m.mcfunction @@ -0,0 +1,8 @@ +#> asset:effect/0210.fading_speed/modifier/add.m +# +# +# +# @within function asset:effect/0210.fading_speed/modifier/add + +# + $attribute @s generic.movement_speed modifier add 00000001-0000-0003-0000-00d200000000 "210.FadingSpeed" $(Amount) multiply diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/modifier/add.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/modifier/add.mcfunction index 6473ecdcc9..6f5c63a3cc 100644 --- a/Asset/data/asset/functions/effect/0210.fading_speed/modifier/add.mcfunction +++ b/Asset/data/asset/functions/effect/0210.fading_speed/modifier/add.mcfunction @@ -5,6 +5,23 @@ # @within function # asset:effect/0210.fading_speed/given/ # asset:effect/0210.fading_speed/re-given/ +# asset:effect/0210.fading_speed/tick/reduce_stack -# 移動速度+80% - attribute @s generic.movement_speed modifier add 00000001-0000-0003-0000-00d200000000 "210.FadingSpeed" 0.8 multiply +#> Private +# @private + #declare score_holder $Stack + #declare score_holder $Amount + +# そもそもStackが1なら補正を付ける意味がないのでreturn + execute if data storage asset:context {Stack:1} run return fail + +# 移動速度を((Stack - 1) * Amount)% 得る + execute store result score $Stack Temporary run data get storage asset:context Stack 0.9999999999 + execute store result score $Amount Temporary run data get storage asset:context this.Amount 100 + execute store result storage asset:temp Args.Amount float 0.01 run scoreboard players operation $Stack Temporary *= $Amount Temporary + function asset:effect/0210.fading_speed/modifier/add.m with storage asset:temp Args + +# リセット + scoreboard players reset $Stack Temporary + scoreboard players reset $Amount Temporary + data remove storage asset:temp Args diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/modifier/remove.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/modifier/remove.mcfunction index ca07ac4be1..ad25ee4a3f 100644 --- a/Asset/data/asset/functions/effect/0210.fading_speed/modifier/remove.mcfunction +++ b/Asset/data/asset/functions/effect/0210.fading_speed/modifier/remove.mcfunction @@ -6,9 +6,7 @@ # asset:effect/0210.fading_speed/end/ # asset:effect/0210.fading_speed/re-given/ # asset:effect/0210.fading_speed/remove/ +# asset:effect/0210.fading_speed/tick/reduce_stack # 移動速度バフを削除 attribute @s generic.movement_speed modifier remove 00000001-0000-0003-0000-00d200000000 - -# ついでにスコアもリセット - scoreboard players reset @s 5U.Tick diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/re-given/.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/re-given/.mcfunction index d89024d21c..212fdec22c 100644 --- a/Asset/data/asset/functions/effect/0210.fading_speed/re-given/.mcfunction +++ b/Asset/data/asset/functions/effect/0210.fading_speed/re-given/.mcfunction @@ -4,22 +4,8 @@ # # @within function asset:effect/0210.fading_speed/_/re-given -# 演出 - particle minecraft:dragon_breath ~ ~1 ~ 0.1 0.1 0.1 0.03 100 - playsound minecraft:entity.evoker.prepare_summon player @a - -# 最大体力の20%分の固定ダメージを受ける -# 5U.Tickが800以上なら50%の割合ダメージに変化 - execute store result storage api: Argument.Damage double 0.2 run attribute @s generic.max_health get - execute if entity @s[scores={5U.Tick=800..}] store result storage api: Argument.Damage double 0.5 run attribute @s generic.max_health get - data modify storage api: Argument.AttackType set value "Physical" - data modify storage api: Argument.FixedDamage set value true - data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sは速度の代償を払った","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]' - function api:damage/ - function api:damage/reset - -# スコアを初期化 - scoreboard players reset @s 5U.Tick +# 初期化 + function asset:effect/0210.fading_speed/init/ # 補正を削除 function asset:effect/0210.fading_speed/modifier/remove diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/register.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/register.mcfunction index 59707947b7..65385c577d 100644 --- a/Asset/data/asset/functions/effect/0210.fading_speed/register.mcfunction +++ b/Asset/data/asset/functions/effect/0210.fading_speed/register.mcfunction @@ -13,17 +13,17 @@ # 説明文 (TextComponentString[]) data modify storage asset:effect Description set value ['{"text":"移動速度が極端に上昇するが、徐々に低下していく"}'] # 効果時間 (int) (default = API || error) - data modify storage asset:effect Duration set value 1000 + # data modify storage asset:effect Duration set value 200 # スタック (int) (default = API || 1) - data modify storage asset:effect Stack set value 1 + # data modify storage asset:effect Stack set value 5 # 効果時間の操作方法 (default = API || "replace") - # data modify storage asset:effect DurationOperation set value + data modify storage asset:effect DurationOperation set value "forceReplace" # スタックの操作方法 (default = API || "replace") - # data modify storage asset:effect StackOperation set value + data modify storage asset:effect StackOperation set value "forceReplace" # 最大効果時間 (int) (default = 2147483647) # data modify storage asset:effect MaxDuration set value # 最大スタック (int) (default = 2147483647) - data modify storage asset:effect MaxStack set value 1 + # data modify storage asset:effect MaxStack set value 1 # 悪い効果か否か (boolean) data modify storage asset:effect IsBadEffect set value false # 死亡時のエフェクトの処理 (default = "remove") @@ -33,7 +33,9 @@ # エフェクトをUIに表示するか (boolean) (default = true) # data modify storage asset:effect Visible set value # エフェクトのスタックををUIに表示するか (boolean) (default = true) - data modify storage asset:effect StackVisible set value false + # data modify storage asset:effect StackVisible set value false # フィールド - # data modify storage asset:effect Field set value {} + data modify storage asset:effect Field.Amount set value 0.2 + data modify storage asset:effect Field.Debuff.Duration set value 400 + data modify storage asset:effect Field.Debuff.Amount set value -0.2 diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/tick/.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/tick/.mcfunction index 0394505e2c..9da3e7c474 100644 --- a/Asset/data/asset/functions/effect/0210.fading_speed/tick/.mcfunction +++ b/Asset/data/asset/functions/effect/0210.fading_speed/tick/.mcfunction @@ -4,20 +4,5 @@ # # @within function asset:effect/0210.fading_speed/_/tick -# スコア - scoreboard players add @s 5U.Tick 1 - -# 初期速度 +80% -# 200tick経過するごとに移動速度-20% -# 0 - 199 80% -# 200 - 399 60% -# 400 - 599 40% -# 600 - 799 20% -# 800 - 999 0% - execute if entity @s[scores={5U.Tick=200}] run attribute @s generic.movement_speed modifier remove 00000001-0000-0003-0000-00d200000000 - execute if entity @s[scores={5U.Tick=200}] run attribute @s generic.movement_speed modifier add 00000001-0000-0003-0000-00d200000000 "210.FadingSpeed" 0.6 multiply - execute if entity @s[scores={5U.Tick=400}] run attribute @s generic.movement_speed modifier remove 00000001-0000-0003-0000-00d200000000 - execute if entity @s[scores={5U.Tick=400}] run attribute @s generic.movement_speed modifier add 00000001-0000-0003-0000-00d200000000 "210.FadingSpeed" 0.4 multiply - execute if entity @s[scores={5U.Tick=600}] run attribute @s generic.movement_speed modifier remove 00000001-0000-0003-0000-00d200000000 - execute if entity @s[scores={5U.Tick=600}] run attribute @s generic.movement_speed modifier add 00000001-0000-0003-0000-00d200000000 "210.FadingSpeed" 0.2 multiply - execute if entity @s[scores={5U.Tick=800}] run attribute @s generic.movement_speed modifier remove 00000001-0000-0003-0000-00d200000000 +# 効果時間が1になるごとにスタックを1下げる + execute if data storage asset:context {Duration:1} run function asset:effect/0210.fading_speed/tick/reduce_stack diff --git a/Asset/data/asset/functions/effect/0210.fading_speed/tick/reduce_stack.mcfunction b/Asset/data/asset/functions/effect/0210.fading_speed/tick/reduce_stack.mcfunction new file mode 100644 index 0000000000..5e6dcdebc9 --- /dev/null +++ b/Asset/data/asset/functions/effect/0210.fading_speed/tick/reduce_stack.mcfunction @@ -0,0 +1,18 @@ +#> asset:effect/0210.fading_speed/tick/reduce_stack +# +# +# +# @within function asset:effect/0210.fading_speed/tick/ + +# スタックが1ならreturn + execute if data storage asset:context {Stack:1} run return fail + +# スタックを1減らす + execute store result storage asset:context Stack int 0.9999999999 run data get storage asset:context Stack + +# 補正を更新 + function asset:effect/0210.fading_speed/modifier/remove + function asset:effect/0210.fading_speed/modifier/add + +# 効果時間を元に戻す + data modify storage asset:context Duration set from storage asset:context this.Duration diff --git a/Asset/data/asset/functions/effect/0211.fading_speed/modifier/add.m.mcfunction b/Asset/data/asset/functions/effect/0211.fading_speed/modifier/add.m.mcfunction new file mode 100644 index 0000000000..b57aa05d2b --- /dev/null +++ b/Asset/data/asset/functions/effect/0211.fading_speed/modifier/add.m.mcfunction @@ -0,0 +1,7 @@ +#> asset:effect/0211.fading_speed/modifier/add.m +# +# +# +# @within function asset:effect/0211.fading_speed/modifier/add + + $attribute @s generic.movement_speed modifier add 00000001-0000-0003-0000-00d300000000 "211.fading_speed" $(Amount) multiply diff --git a/Asset/data/asset/functions/effect/0211.fading_speed/modifier/add.mcfunction b/Asset/data/asset/functions/effect/0211.fading_speed/modifier/add.mcfunction index ad32fb6bdd..6099133f6f 100644 --- a/Asset/data/asset/functions/effect/0211.fading_speed/modifier/add.mcfunction +++ b/Asset/data/asset/functions/effect/0211.fading_speed/modifier/add.mcfunction @@ -4,6 +4,5 @@ # # @within function asset:effect/0211.fading_speed/given/ -# 移動速度低下-20% - attribute @s generic.movement_speed modifier add 00000001-0000-0003-0000-00d300000000 "211.fading_speed" -0.2 multiply - +# 移動速度低下 + function asset:effect/0211.fading_speed/modifier/add.m with storage asset:context this diff --git a/Asset/data/asset/functions/effect/0211.fading_speed/register.mcfunction b/Asset/data/asset/functions/effect/0211.fading_speed/register.mcfunction index 386f93b8bf..a2eeb9ae22 100644 --- a/Asset/data/asset/functions/effect/0211.fading_speed/register.mcfunction +++ b/Asset/data/asset/functions/effect/0211.fading_speed/register.mcfunction @@ -13,7 +13,7 @@ # 説明文 (TextComponentString[]) data modify storage asset:effect Description set value ['{"text":"移動速度が大きく低下する"}'] # 効果時間 (int) (default = API || error) - data modify storage asset:effect Duration set value 400 + # data modify storage asset:effect Duration set value 400 # スタック (int) (default = API || 1) data modify storage asset:effect Stack set value 1 # 効果時間の操作方法 (default = API || "replace") diff --git a/Asset/data/asset/tags/functions/effect/load.json b/Asset/data/asset/tags/functions/effect/load.json index 6fe4e83f31..45971e08a5 100644 --- a/Asset/data/asset/tags/functions/effect/load.json +++ b/Asset/data/asset/tags/functions/effect/load.json @@ -7,7 +7,6 @@ "asset:effect/0191.night_vision/load", "asset:effect/0605.aurora_corrosion/load", "asset:effect/0601.conviction/load", - "asset:effect/0210.fading_speed/load", "asset:effect/0603.domination/load", "asset:effect/0258.spirit_melody/load" ]