Skip to content

Commit

Permalink
見ろよ、スーパーディスクガンがまるで羽毛のようだよ
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuzume committed Aug 15, 2021
1 parent ca14cc2 commit 193857b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
8 changes: 5 additions & 3 deletions data/discgun/functions/entity/disc/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

# プレイヤーの衝突判定
Expand Down
6 changes: 4 additions & 2 deletions data/discgun/functions/entity/disc_charged/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions data/discgun/functions/entity/disc_charged_2/main.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions data/discgun/functions/entity/model/main.mcfunction
Original file line number Diff line number Diff line change
@@ -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


# 時間経過で消える
Expand Down
4 changes: 2 additions & 2 deletions data/discgun/functions/storage.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 193857b

Please sign in to comment.