diff --git a/data/discgun/functions/entity/disc/main.mcfunction b/data/discgun/functions/entity/disc/main.mcfunction index 1bc87a8..3381f92 100644 --- a/data/discgun/functions/entity/disc/main.mcfunction +++ b/data/discgun/functions/entity/disc/main.mcfunction @@ -3,8 +3,10 @@ # 移動 execute if entity @s[tag=!Chuz.HitWall] run function disc_wall_hit_collision:api/col_check - execute at @e[type=area_effect_cloud,tag=D.Gun_Rotater] if score @e[type=area_effect_cloud,tag=D.Gun_Rotater,limit=1,sort=nearest] D.Gun_Mo.ID = @s D.Gun_Mo.ID rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,limit=1,sort=nearest] run function discgun:move - execute rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,limit=1,sort=nearest] positioned ^ ^ ^-2 run particle electric_spark ~ ~0.3 ~ 0.05 0.05 0.05 0 2 force + tag @s add D.Gun_This + execute as @e[type=area_effect_cloud,tag=D.Gun_Rotater,distance=..3] if score @s D.Gun_Mo.ID = @e[type=pig,tag=D.Gun_This,distance=..0,limit=1] D.Gun_Mo.ID rotated as @s run function discgun:move + tag @s remove D.Gun_This + execute rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,distance=..3,sort=nearest,limit=1] positioned ^ ^ ^-2 run particle electric_spark ~ ~0.3 ~ 0.05 0.05 0.05 0 2 force # 壁反射 function discgun:entity/rotater/ricochet @@ -31,7 +33,7 @@ # プレイヤーから出るまでヒット判定ナシ #execute at @a[distance=5..10] if score @s D.Gun_En.ID = @p D.Gun_Pl.ID run tag @s remove D.Gun_NoHit -# 一定時間経過まで判定ナシ +# 一定時間経過まで判定ナシ tag @s[scores={D.Gun_Time=4..}] remove D.Gun_NoHit # プレイヤーの衝突判定 diff --git a/data/discgun/functions/entity/disc_charged/main.mcfunction b/data/discgun/functions/entity/disc_charged/main.mcfunction index 5bfff37..47fc5f5 100644 --- a/data/discgun/functions/entity/disc_charged/main.mcfunction +++ b/data/discgun/functions/entity/disc_charged/main.mcfunction @@ -3,8 +3,10 @@ # 移動 execute if entity @s[tag=!Chuz.HitWall] run function disc_wall_hit_collision:api/col_check - execute at @e[type=area_effect_cloud,tag=D.Gun_Rotater] if score @e[type=area_effect_cloud,tag=D.Gun_Rotater,limit=1,sort=nearest] D.Gun_Mo.ID = @s D.Gun_Mo.ID rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,limit=1,sort=nearest] run function discgun:move - execute rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,limit=1,sort=nearest] positioned ^ ^ ^-2 run function discgun:entity/disc_charged/particle + tag @s add D.Gun_This + execute as @e[type=area_effect_cloud,tag=D.Gun_Rotater,distance=..3] if score @s D.Gun_Mo.ID = @e[type=pig,tag=D.Gun_This,distance=..0,limit=1] D.Gun_Mo.ID rotated as @s run function discgun:move + tag @s remove D.Gun_This + execute rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,distance=..3,sort=nearest,limit=1] positioned ^ ^ ^-2 run particle electric_spark ~ ~0.3 ~ 0.05 0.05 0.05 0 2 force # 壁反射 function discgun:entity/rotater/ricochet diff --git a/data/discgun/functions/entity/disc_charged_2/main.mcfunction b/data/discgun/functions/entity/disc_charged_2/main.mcfunction index bf1dce6..943e75c 100644 --- a/data/discgun/functions/entity/disc_charged_2/main.mcfunction +++ b/data/discgun/functions/entity/disc_charged_2/main.mcfunction @@ -3,8 +3,10 @@ # 移動 execute if entity @s[tag=!Chuz.HitWall] run function disc_wall_hit_collision:api/col_check - execute at @e[type=area_effect_cloud,tag=D.Gun_Rotater] if score @e[type=area_effect_cloud,tag=D.Gun_Rotater,limit=1,sort=nearest] D.Gun_Mo.ID = @s D.Gun_Mo.ID rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,limit=1,sort=nearest] run function discgun:move - execute rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,limit=1,sort=nearest] positioned ^ ^ ^-2 run function discgun:entity/disc_charged_2/particle + tag @s add D.Gun_This + execute as @e[type=area_effect_cloud,tag=D.Gun_Rotater,distance=..3] if score @s D.Gun_Mo.ID = @e[type=pig,tag=D.Gun_This,distance=..0,limit=1] D.Gun_Mo.ID rotated as @s run function discgun:move + tag @s remove D.Gun_This + execute rotated as @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Init,distance=..3,sort=nearest,limit=1] positioned ^ ^ ^-2 run particle electric_spark ~ ~0.3 ~ 0.05 0.05 0.05 0 2 force # 壁反射 function discgun:entity/rotater/ricochet diff --git a/data/discgun/functions/entity/model/main.mcfunction b/data/discgun/functions/entity/model/main.mcfunction index 37e8795..4757d5d 100644 --- a/data/discgun/functions/entity/model/main.mcfunction +++ b/data/discgun/functions/entity/model/main.mcfunction @@ -1,12 +1,14 @@ # 角度 - execute store result entity @s Pose.Head[0] float 1 run data get entity @e[type=area_effect_cloud,limit=1,sort=nearest,tag=D.Gun_Rotater,tag=!D.Gun_Rotater_Disable] Rotation[1] - execute store result entity @s Pose.Head[1] float 1 run data get entity @e[type=area_effect_cloud,limit=1,sort=nearest,tag=D.Gun_Rotater,tag=!D.Gun_Rotater_Disable] Rotation[0] + execute store result entity @s Pose.Head[0] float 1 run data get entity @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Rotater_Disable,distance=..3,sort=nearest,limit=1] Rotation[1] + execute store result entity @s Pose.Head[1] float 1 run data get entity @e[type=area_effect_cloud,tag=D.Gun_Rotater,tag=!D.Gun_Rotater_Disable,distance=..3,sort=nearest,limit=1] Rotation[0] # スコア所持済みなら横取りされないように execute if entity @s[scores={D.Gun_Mo.ID=1..}] run tag @s add D.Gun_Model_Already # TPでくっつく - execute at @e[tag=D.Gun_Common] if score @s D.Gun_Mo.ID = @e[tag=D.Gun_Common,limit=1,sort=nearest] D.Gun_Mo.ID run tp @s ~ ~-0.45 ~ + tag @s add D.Gun_This + execute at @s as @e[type=pig,tag=D.Gun_Common,distance=..3] if score @e[type=armor_stand,tag=D.Gun_This,distance=..3,limit=1] D.Gun_Mo.ID = @s D.Gun_Mo.ID at @s run tp @e[type=armor_stand,tag=D.Gun_This,distance=..3,limit=1] ~ ~-0.45 ~ + tag @s remove D.Gun_This # 時間経過で消える diff --git a/data/discgun/functions/storage.mcfunction b/data/discgun/functions/storage.mcfunction index 1b73728..0b09a79 100644 --- a/data/discgun/functions/storage.mcfunction +++ b/data/discgun/functions/storage.mcfunction @@ -6,8 +6,8 @@ # リロード execute if entity @s[tag=D.Gun_Hold,scores={D.Gun_Throw=0..}] run function discgun:item/reload -# リロードできるアイテムなら - execute unless data storage chuz:context Item.Mainhand.tag{Reloadable:true} run tag @s remove D.Gun_Hold +# タグ削除 + tag @s remove D.Gun_Hold # 武器 execute if data storage chuz:context Item.Mainhand.tag.ChuzData{ItemID:DiscGun} run function discgun:item/discgun/main