Skip to content

Commit

Permalink
ホーリーレイ 実装
Browse files Browse the repository at this point in the history
  • Loading branch information
EllaCoat committed Aug 26, 2024
1 parent b60d2a9 commit 2725633
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
function lib:damage/reset

# 着弾タグを消す
tag @p[tag=LandingTarget] remove LandingTarget
tag @p[tag=LandingTarget] remove LandingTarget
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
#
# @within function asset:mob/0392.ecual_first/ai/animation/

# 近くのプレイヤーの方を向く
# 対象プレイヤー保存
execute if score @s AW.AnimationTick matches 1 run scoreboard players operation @s AW.UUID = @r[tag=!PlayerShouldInvulnerable,distance=..100] UserID

# プレイヤーの方を向く
# 移動中は対象プレイヤーの方を向く
tag @s add AW.Temp.This
execute as @p[tag=!PlayerShouldInvulnerable,distance=..100] run function asset:mob/0392.ecual_first/ai/general/2.rotate
tag @s remove AW.Temp.This
scoreboard players operation $AW.Temp AW.UUID = @s AW.UUID
execute as @a if score @s UserID = $AW.Temp AW.UUID run function asset:mob/0392.ecual_first/ai/general/2.rotate
scoreboard players reset $AW.Temp AW.UUID

# アニメーション再生
execute if score @s AW.AnimationTick matches 1 as @e[type=item_display,tag=AW.Root.This,distance=..100] run function animated_java:ecual/animations/7_0_holy_ray/play
Expand All @@ -16,7 +21,7 @@
execute if score @s AW.AnimationTick matches 176 run function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/end

# ビーム発射
execute if score @s AW.AnimationTick matches 66..146 positioned ^ ^1 ^1.25 run function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/
execute if score @s AW.AnimationTick matches 66..146 positioned ^ ^0.65 ^1.75 run function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/

# TP
execute if score @s AW.AnimationTick matches 16 at @s run tp @s ^ ^0.3 ^ ~ ~
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
# ビーム発射
#
# @within function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/

# 演出
playsound item.spyglass.use hostile @a ~ ~ ~ 2 1.4
playsound entity.illusioner.prepare_mirror hostile @a ~ ~ ~ 2 2 0

# ループ処理
function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/loop

# タグ外し
tag @s remove AW.Landing
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#> asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/damage
#
# ダメージ処理
#
# @within function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/loop

# ダメージ設定
# ダメージ
data modify storage lib: Argument.Damage set value 20.0f
# 第一属性
data modify storage lib: Argument.AttackType set value "Magic"
# 第二属性
data modify storage lib: Argument.ElementType set value "Water"
# 死亡ログ
data modify storage lib: Argument.DeathMessage set value '[{"translate": "%1$sは%2$sの光線により身を焼かれて息絶えた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# ダメージを与える
execute as @e[tag=this,distance=..100] run function lib:damage/modifier
execute as @a[tag=AW.Temp.Target,distance=..5] run function lib:damage/
# リセット
function lib:damage/reset

# 着弾タグを消す
tag @a[tag=AW.Temp.Target,distance=..5] remove AW.Temp.Target
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#> asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/loop
#
# ループ処理
#
# @within function
# asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/
# asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/loop

# ビームはブロックを破壊します
execute unless block ^ ^ ^0.5 #lib:air unless block ^ ^ ^0.5 #lib:unbreakable run setblock ^ ^ ^0.5 air destroy

# 着弾検知
execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run tag @s add AW.Landing
execute unless block ^ ^ ^1 #lib:no_collision run tag @s add AW.Landing

# ターゲットにタグ付与
tag @a[tag=!PlayerShouldInvulnerable,dx=0] add AW.Temp.Target

# 演出
particle dust 0.72 1 1 1 ~ ~ ~ 0.1 0.1 0.1 0 1
particle electric_spark ~ ~ ~ 0.15 0.15 0.15 0.1 2
particle fishing ~ ~ ~ 0.15 0.15 0.15 0.1 2
execute if predicate lib:random_pass_per/5 run particle end_rod ~ ~ ~ 0.15 0.15 0.15 0 1
execute if predicate lib:random_pass_per/25 run particle glow ~ ~ ~ 0.15 0.15 0.15 0 1

# 着弾
execute if entity @s[tag=AW.Landing] run function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/damage

# 再起
execute positioned ^ ^ ^0.5 if entity @s[tag=!AW.Landing,distance=..45] run function asset:mob/0392.ecual_first/ai/animation/7_0_holy_ray/beam/loop

0 comments on commit 2725633

Please sign in to comment.