diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/attack/.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/attack/.mcfunction index be390682db..609cd15075 100644 --- a/Asset/data/asset/functions/mob/0235.orange_thrower/attack/.mcfunction +++ b/Asset/data/asset/functions/mob/0235.orange_thrower/attack/.mcfunction @@ -13,7 +13,7 @@ execute at @p[tag=Victim,distance=..6] run playsound entity.generic.explode hostile @a ~ ~ ~ 0.3 1 0 # ダメージ - data modify storage api: Argument.Damage set value 21f + data modify storage api: Argument.Damage set from storage asset:context this.Damage.Vanilla data modify storage api: Argument.AttackType set value "Physical" data modify storage api: Argument.ElementType set value "Water" data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによって橙色になった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]' diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/load.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/load.mcfunction deleted file mode 100644 index 87e5233830..0000000000 --- a/Asset/data/asset/functions/mob/0235.orange_thrower/load.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> asset:mob/0235.orange_thrower/load -# -# Mobに利用するスコアボード等の初期化処理 -# -# @within tag/function asset:mob/load - -#> 定義類はここに -# @within function asset:mob/0235.orange_thrower/** - scoreboard objectives add 6J.ResetTick dummy diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/register.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/register.mcfunction index aac7e7b6c8..dae0035b4c 100644 --- a/Asset/data/asset/functions/mob/0235.orange_thrower/register.mcfunction +++ b/Asset/data/asset/functions/mob/0235.orange_thrower/register.mcfunction @@ -56,4 +56,5 @@ data modify storage asset:mob Resist.Thunder set value 1.2 # フィールド - data modify storage asset:mob Field.Damage set value 18f + data modify storage asset:mob Field.Damage set value {Vanilla:21f,Orange:18f} + data modify storage asset:mob Field.OrangeCount set value 0 diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/.mcfunction index 4b89a09277..6173ff84ea 100644 --- a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/.mcfunction +++ b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/.mcfunction @@ -11,17 +11,13 @@ # スコアが0以上なら強制的に増やす # Tickの処理順の関係で0以上の方を先に書く execute if entity @s[scores={General.Mob.Tick=0..}] run scoreboard players add @s General.Mob.Tick 1 - execute if entity @s[scores={General.Mob.Tick=..0}] if entity @p[distance=..10] run scoreboard players add @s General.Mob.Tick 1 + execute if entity @s[scores={General.Mob.Tick=..0}] if entity @p[gamemode=!spectator,distance=..10] run scoreboard players add @s General.Mob.Tick 1 # スコアが0の時、周囲にプレイヤーがいなければスコアを戻す - execute if entity @s[scores={General.Mob.Tick=0}] unless entity @p[distance=..10] run scoreboard players set @s General.Mob.Tick -60 + execute if entity @s[scores={General.Mob.Tick=0}] unless entity @p[gamemode=!spectator,distance=..10] run scoreboard players set @s General.Mob.Tick -60 -# 何回みかんを召喚するかを難易度値で決める -# (2 * 難易度値 - 1)個召喚する -# 2(10 * (難易度値 - 1))Tick後にリセットするのでリセットするスコアを決めておく - execute if entity @s[scores={General.Mob.Tick=0}] run function api:global_vars/get_difficulty - execute if entity @s[scores={General.Mob.Tick=0}] store result score @s 6J.ResetTick run data get storage api: Return.Difficulty 20 - execute if entity @s[scores={General.Mob.Tick=0}] run scoreboard players remove @s 6J.ResetTick 20 +# 何回みかんを召喚するかをで決める + execute if entity @s[scores={General.Mob.Tick=0}] run function asset:mob/0235.orange_thrower/tick/set_orange_count # みかん召喚 execute if entity @s[scores={General.Mob.Tick=0..}] run function asset:mob/0235.orange_thrower/tick/attack diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/attack.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/attack.mcfunction index da54c63fd9..0e0c57b14f 100644 --- a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/attack.mcfunction +++ b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/attack.mcfunction @@ -8,11 +8,11 @@ # @private #declare score_holder $Temp -# 10tick間隔で蜜柑を召喚 +# 10tick間隔でみかんを召喚 scoreboard players operation $Temp Temporary = @s General.Mob.Tick scoreboard players operation $Temp Temporary %= $10 Const - execute if score $Temp Temporary matches 0 run function asset:mob/0235.orange_thrower/tick/summon + execute if score $Temp Temporary matches 0 at @p[gamemode=!spectator,distance=..10] positioned ~ ~2.5 ~ run function asset:mob/0235.orange_thrower/tick/summon scoreboard players reset $Temp Temporary -# リセット - execute if score @s General.Mob.Tick >= @s 6J.ResetTick run function asset:mob/0235.orange_thrower/tick/reset +# 残り個数が0ならリセット + execute if data storage asset:context this{OrangeCount:0} run function asset:mob/0235.orange_thrower/tick/reset diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/reset.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/reset.mcfunction index f4104f2ccf..b6be99ba3e 100644 --- a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/reset.mcfunction +++ b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/reset.mcfunction @@ -4,8 +4,5 @@ # # @within function asset:mob/0235.orange_thrower/tick/attack -# スコアをリセット - scoreboard players reset @s 6J.ResetTick - # 次の攻撃タイミングをランダムにする execute store result score @s General.Mob.Tick run random value -80..-50 diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/set_orange_count.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/set_orange_count.mcfunction new file mode 100644 index 0000000000..6407461a13 --- /dev/null +++ b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/set_orange_count.mcfunction @@ -0,0 +1,9 @@ +#> asset:mob/0235.orange_thrower/tick/set_orange_count +# +# +# +# @within function asset:mob/0235.orange_thrower/tick/ + +# みかんを(難易度値*2 - 1)個召喚する + function api:global_vars/get_difficulty + execute store result storage asset:context this.OrangeCount int 0.9999999999 run data get storage api: Return.Difficulty 2 diff --git a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/summon.mcfunction b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/summon.mcfunction index 8710c4b277..a37d3488b6 100644 --- a/Asset/data/asset/functions/mob/0235.orange_thrower/tick/summon.mcfunction +++ b/Asset/data/asset/functions/mob/0235.orange_thrower/tick/summon.mcfunction @@ -4,8 +4,11 @@ # # @within function asset:mob/0235.orange_thrower/tick/attack +# みかんの数のデクリメント + execute store result storage asset:context this.OrangeCount int 0.9999999999 run data get storage asset:context this.OrangeCount + # みかんを召喚 data modify storage api: Argument.ID set value 2079 - data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage + data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage.Orange execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @s MobUUID - execute at @p[distance=..10] positioned ~ ~2.5 ~ run function api:object/summon + function api:object/summon diff --git a/Asset/data/asset/tags/functions/mob/load.json b/Asset/data/asset/tags/functions/mob/load.json index c7c1c9d582..ad6aae9bd1 100644 --- a/Asset/data/asset/tags/functions/mob/load.json +++ b/Asset/data/asset/tags/functions/mob/load.json @@ -21,7 +21,6 @@ "asset:mob/0376.convict_v2/load", "asset:mob/0378.red_knight_v3/load", "asset:mob/0369.prominence_spellbook/load", - "asset:mob/0235.orange_thrower/load", "asset:mob/0321.mini_guardian/load", "asset:mob/0311.blazing_inferno/load", "asset:mob/0059.jack_o_lantern/load",