diff --git a/Asset/data/asset/functions/mob/0274.death_saw_jiki/0.load.mcfunction b/Asset/data/asset/functions/mob/0274.death_saw_jiki/0.load.mcfunction deleted file mode 100644 index 74fa2aedc5..0000000000 --- a/Asset/data/asset/functions/mob/0274.death_saw_jiki/0.load.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> asset:mob/0274.death_saw_jiki/0.load -# -# MOBに利用するスコアボード等の初期化処理 -# -# @within tag/function asset:mob/load - -#> 定義類はここに -# @within function asset:mob/0274.death_saw_jiki/** - scoreboard objectives add 7M.CoolTime dummy diff --git a/Asset/data/asset/functions/mob/0274.death_saw_jiki/init/.mcfunction b/Asset/data/asset/functions/mob/0274.death_saw_jiki/init/.mcfunction index 26901f8a43..91bc3f6edf 100644 --- a/Asset/data/asset/functions/mob/0274.death_saw_jiki/init/.mcfunction +++ b/Asset/data/asset/functions/mob/0274.death_saw_jiki/init/.mcfunction @@ -1,4 +1,8 @@ #> asset:mob/0274.death_saw_jiki/init/ # @within asset:mob/alias/274/init -scoreboard players set @s 7M.CoolTime 20 +# IsBabyの1.5倍を打ち消す + execute store result entity @s Attributes[{Name:"minecraft:generic.movement_speed"}].Base double 0.006667 run attribute @s generic.movement_speed base get 100 + +# 最寄りのプレイヤーのほうを向く + execute facing entity @p[gamemode=!spectator,distance=..32] feet rotated ~ 0 run tp @s ~ ~ ~ ~ ~ diff --git a/Asset/data/asset/functions/mob/0274.death_saw_jiki/move/.mcfunction b/Asset/data/asset/functions/mob/0274.death_saw_jiki/move/.mcfunction new file mode 100644 index 0000000000..28e86ae344 --- /dev/null +++ b/Asset/data/asset/functions/mob/0274.death_saw_jiki/move/.mcfunction @@ -0,0 +1,9 @@ +#> asset:mob/0274.death_saw_jiki/move/ +# +# 継承先などから実行される処理 +# +# @within asset:mob/alias/274/move + +# 壁貫通のないように移動 + data modify storage lib: Argument.SlideMove.Speed set from storage asset:context this.Speed + function lib:slide_move/ diff --git a/Asset/data/asset/functions/mob/0274.death_saw_jiki/register.mcfunction b/Asset/data/asset/functions/mob/0274.death_saw_jiki/register.mcfunction index 42074d1332..ccbf596d1c 100644 --- a/Asset/data/asset/functions/mob/0274.death_saw_jiki/register.mcfunction +++ b/Asset/data/asset/functions/mob/0274.death_saw_jiki/register.mcfunction @@ -1,6 +1,12 @@ #> asset:mob/0274.death_saw_jiki/register # @within asset:mob/alias/274/register +# 継承(オプション) + data modify storage asset:mob Extends append value 2004 + function asset:mob/extends +# 継承されることを前提とした、抽象的なモブであるかどうか(boolean) + data modify storage asset:mob IsAbstract set value false + # ID (int) data modify storage asset:mob ID set value 274 # Type (string) Wikiを参照 @@ -54,3 +60,10 @@ data modify storage asset:mob Resist.Water set value 1.2 # 雷倍率 (float) (オプション) data modify storage asset:mob Resist.Thunder set value 0.8 + +# ダメージ + data modify storage asset:mob Field.Damage set value 36f + +# 攻撃のクールダウン (出現してすぐはダメージを与えない) + data modify storage asset:mob Field.AttackCT._ set value 20 + data modify storage asset:mob Field.AttackCT.Max set value 20 diff --git a/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/.mcfunction b/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/.mcfunction index 9356dfaba8..e480a6af38 100644 --- a/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/.mcfunction +++ b/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/.mcfunction @@ -5,25 +5,27 @@ # @within function asset:mob/alias/274/tick # 足元が空気なら少し落下 - execute if block ~ ~-0.5 ~ #lib:no_collision run tp @s ~ ~-0.5 ~ + execute if block ~ ~-0.5 ~ #lib:no_collision/ run tp @s ~ ~-0.5 ~ # 前方が階段状なら上にTPする - execute unless block ^ ^ ^1 #lib:no_collision if block ^ ^1 ^1 #lib:no_collision at @s run tp ~ ~1 ~ + execute unless block ^ ^ ^1 #lib:no_collision/ if block ^ ^1 ^1 #lib:no_collision/ at @s run tp ~ ~1 ~ # 前方が壁なら方向転換 - execute unless block ^ ^ ^1 #lib:no_collision unless block ^ ^1 ^1 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~ + execute unless block ^ ^ ^1 #lib:no_collision/ unless block ^ ^1 ^1 #lib:no_collision/ at @s run tp @s ~ ~ ~ ~45 ~ # 前方が2m穴なら適当に方向転換 - execute unless block ~ ~-1 ~ #lib:no_collision if block ^ ^ ^1 #lib:no_collision if block ^ ^-1 ^1 #lib:no_collision if block ^ ^-2 ^1 #lib:no_collision at @s run tp @s ~ ~ ~ ~45 ~ + execute unless block ~ ~-1 ~ #lib:no_collision/ if block ^ ^ ^1 #lib:no_collision/ if block ^ ^-1 ^1 #lib:no_collision/ if block ^ ^-2 ^1 #lib:no_collision/ at @s run tp @s ~ ~ ~ ~45 ~ -# プレイヤーが近くにいないなら前進する - execute unless entity @a[distance=..10] at @s rotated ~ 0 run tp ^ ^ ^0.2 # プレイヤーが近くにいるなら追尾する - execute if entity @p[distance=5..10] at @s facing entity @p eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-400 facing entity @s eyes positioned as @s rotated ~ 0 run tp @s ^ ^ ^0.2 ~ ~ - execute if entity @p[distance=..5] at @s facing entity @p eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-100 facing entity @s eyes positioned as @s rotated ~ 0 run tp @s ^ ^ ^0.2 ~ ~ + execute at @s unless entity @p[gamemode=!spectator,distance=..5] facing entity @p[gamemode=!spectator,distance=..10] eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-400 facing entity @s eyes positioned as @s rotated ~ 0 run tp @s ~ ~ ~ ~ ~ + execute at @s facing entity @p[gamemode=!spectator,distance=..5] eyes positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-100 facing entity @s eyes positioned as @s rotated ~ 0 run tp @s ~ ~ ~ ~ ~ + +# 前進 + function asset:mob/call.m {method:"get_speed"} + execute at @s run function asset:mob/call.m {method:"move"} # 演出 playsound entity.sheep.shear hostile @a ~ ~ ~ 0.4 2 -# クールダウン - scoreboard players remove @s[scores={7M.CoolTime=1..}] 7M.CoolTime 1 -# ダメージ(スペクテイターでも発動するけどしゃーなし) - execute unless score @s 7M.CoolTime matches 1.. if entity @e[type=#lib:living,tag=Friend,distance=..0.75] run function asset:mob/0274.death_saw_jiki/tick/3.damage +# 攻撃のクールダウン + execute store result storage asset:context this.AttackCT._ int 0.9999999999 run data get storage asset:context this.AttackCT._ +# プレイヤーに接触したら攻撃 + execute if data storage asset:context this.AttackCT{_:0} positioned ~-0.5 ~-0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] at @s run function asset:mob/0274.death_saw_jiki/tick/damage diff --git a/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/3.damage.mcfunction b/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/3.damage.mcfunction deleted file mode 100644 index 4bef457d6b..0000000000 --- a/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/3.damage.mcfunction +++ /dev/null @@ -1,34 +0,0 @@ -#> asset:mob/0274.death_saw_jiki/tick/3.damage -# -# -# -# @within function asset:mob/0274.death_saw_jiki/tick/ - -#> private -# @private - #declare tag DamageTarget - -# 演出 - particle dust 1.000 0.741 0.141 1.3 ~ ~1.2 ~ 0.5 0.4 0.5 0 20 normal - playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 1.5 0 - playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 2.0 0 - -# 属性ダメージ - # 与えるダメージ - data modify storage api: Argument.Damage set value 36f - # 第一属性 - data modify storage api: Argument.AttackType set value "Physical" - # 第二属性 - data modify storage api: Argument.ElementType set value "Thunder" - # 補正functionを実行 - function api:damage/modifier - # 対象に - tag @e[type=#lib:living,type=!player,tag=Friend,distance=..1] add DamageTarget - tag @a[tag=!PlayerShouldInvulnerable,distance=..1] add DamageTarget - execute as @e[type=#lib:living,tag=DamageTarget,distance=..1] run function api:damage/ - # リセット - function api:damage/reset - tag @e[type=#lib:living,tag=DamageTarget,distance=..2] remove DamageTarget - -# クールタイムを与える - scoreboard players set @s 7M.CoolTime 20 diff --git a/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/damage.mcfunction b/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/damage.mcfunction new file mode 100644 index 0000000000..c1cf45d5ea --- /dev/null +++ b/Asset/data/asset/functions/mob/0274.death_saw_jiki/tick/damage.mcfunction @@ -0,0 +1,21 @@ +#> asset:mob/0274.death_saw_jiki/tick/damage +# +# +# +# @within function asset:mob/0274.death_saw_jiki/tick/ + +# 演出 + particle dust 1.000 0.741 0.141 1.3 ~ ~1.2 ~ 0.5 0.4 0.5 0 20 normal + playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 1.5 0 + playsound minecraft:entity.firework_rocket.twinkle hostile @a ~ ~ ~ 0.7 2.0 0 + +# ダメージ + data modify storage api: Argument.Damage set from storage asset:context this.Damage + data modify storage api: Argument.AttackType set value "Physical" + data modify storage api: Argument.ElementType set value "Thunder" + function api:damage/modifier + execute positioned ~-0.5 ~-0.5 ~-0.5 as @a[tag=!PlayerShouldInvulnerable,dx=0] run function api:damage/ + function api:damage/reset + +# クールタイムを与える + data modify storage asset:context this.AttackCT._ set from storage asset:context this.AttackCT.Max diff --git a/Asset/data/asset/functions/mob/alias/274/move.mcfunction b/Asset/data/asset/functions/mob/alias/274/move.mcfunction new file mode 100644 index 0000000000..f2a42a91c0 --- /dev/null +++ b/Asset/data/asset/functions/mob/alias/274/move.mcfunction @@ -0,0 +1,8 @@ +#> asset:mob/alias/274/move +# +# メソッド処理のエイリアス +# +# @within asset_manager:mob/triggers/call_method/run_method.m + +# 本来の処理を呼び出す + function asset:mob/0274.death_saw_jiki/move/ \ No newline at end of file diff --git a/Asset/data/asset/tags/functions/mob/load.json b/Asset/data/asset/tags/functions/mob/load.json index 3c05053eb5..8889bbd361 100644 --- a/Asset/data/asset/tags/functions/mob/load.json +++ b/Asset/data/asset/tags/functions/mob/load.json @@ -44,7 +44,6 @@ "asset:mob/0292.trample_bot/0.load", "asset:mob/0287.burning_stomper/0.load", "asset:mob/0234.walleye/0.load", - "asset:mob/0274.death_saw_jiki/0.load", "asset:mob/0245.fire_creeper/load", "asset:mob/0021.demon_eye/load", "asset:mob/0175.queen_bee/load",