Skip to content

Commit

Permalink
ディメンションソードの実装 半分終了
Browse files Browse the repository at this point in the history
  • Loading branch information
EllaCoat committed Aug 12, 2024
1 parent af9a08d commit e6ffa16
Show file tree
Hide file tree
Showing 20 changed files with 455 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#declare tag AV.DimSword
#declare tag AV.DimSwordDisplay
#declare tag AV.ShockWave
#declare tag AV.CriticalHit

#> val
# @within function asset:mob/0391.axia_first/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# @within function
# asset:mob/0391.axia_first/ai/animation/3_0_triple_slash/
# asset:mob/0391.axia_first/ai/animation/7_0_zangekihou/
# asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/

# 攻撃対象にTagを付与
tag @p[tag=!PlayerShouldInvulnerable,distance=..100] add AV.Temp.Target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#
# @within function
# asset:mob/0391.axia_first/ai/animation/7_0_zangekihou/
# asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/

execute anchored eyes run summon item_display ^ ^ ^2 {interpolation_duration:0,teleport_duration:0,Tags:["AV.AnnounceInit"],brightness:{sky:15,block:15},transformation:{left_rotation:[0f,0f,0.383f,0.924f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,13.5f],scale:[0.1f,0.1f,25f]},item:{id:"air",Count:1b}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,74 @@
#
# @within function asset:mob/0391.axia_first/ai/animation/

# 近くのプレイヤーの方を向く
# 一部の時間のみ向く処理を入れる
#ToDo ハードのみ41~50間は偏差処理を入れつつ向く
tag @s add AV.Temp.This
execute if score @s AV.AnimationTick matches 1..98 as @p[tag=!PlayerShouldInvulnerable,distance=..100] run function asset:mob/0391.axia_first/ai/general/2.rotate
execute if score @s AV.AnimationTick matches 99..114 if predicate api:global_vars/difficulty/max/normal as @p[tag=!PlayerShouldInvulnerable,distance=..100] run function asset:mob/0391.axia_first/ai/general/2.rotate
execute if score @s AV.AnimationTick matches 99..114 if predicate api:global_vars/difficulty/min/hard if entity @p[distance=..100] run function asset:mob/0391.axia_first/ai/animation/3_0_triple_slash/predict/
execute if score @s AV.AnimationTick matches 125..152 as @p[tag=!PlayerShouldInvulnerable,distance=..100] run function asset:mob/0391.axia_first/ai/general/2.rotate
execute if score @s AV.AnimationTick matches 125..152 if predicate api:global_vars/difficulty/min/hard if entity @p[distance=..100] run function asset:mob/0391.axia_first/ai/animation/3_0_triple_slash/predict/
tag @s remove AV.Temp.This

# アニメーション再生
execute if score @s AV.AnimationTick matches 1 as @e[type=item_display,tag=AV.Root.This,distance=..100] run function animated_java:axia/animations/11_0_dimension_slash/play

# アニメーション終了処理
execute if score @s AV.AnimationTick matches 191 run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/end

## ディメンションソード 召喚
## 偏差撃ち
# tag @s add AV.Temp.This
# execute if score @s AV.AnimationTick matches 31 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict
# execute if score @s AV.AnimationTick matches 41 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict
# execute if score @s AV.AnimationTick matches 51 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict
# execute if score @s AV.AnimationTick matches 61 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict
# execute if score @s AV.AnimationTick matches 71 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict
# execute if score @s AV.AnimationTick matches 81 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict
#
## ランダム撃ち
# execute if score @s AV.AnimationTick matches 36 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal
# execute if score @s AV.AnimationTick matches 46 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal
# execute if score @s AV.AnimationTick matches 56 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal
# execute if score @s AV.AnimationTick matches 66 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal
# execute if score @s AV.AnimationTick matches 76 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal
# execute if score @s AV.AnimationTick matches 86 as @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=2] at @s run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal
#
## ハード限定拡散
# execute if score @s AV.AnimationTick matches 33 if predicate api:global_vars/difficulty/min/hard run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal_hard
# execute if score @s AV.AnimationTick matches 43 if predicate api:global_vars/difficulty/min/hard run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal_hard
# execute if score @s AV.AnimationTick matches 53 if predicate api:global_vars/difficulty/min/hard run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal_hard
# execute if score @s AV.AnimationTick matches 63 if predicate api:global_vars/difficulty/min/hard run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal_hard
# execute if score @s AV.AnimationTick matches 73 if predicate api:global_vars/difficulty/min/hard run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal_hard
# execute if score @s AV.AnimationTick matches 83 if predicate api:global_vars/difficulty/min/hard run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal_hard
# tag @s remove AV.Temp.This
#

# 斬撃飛ばし
execute if score @s AV.AnimationTick matches 124 run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/slash_summon
execute if score @s AV.AnimationTick matches 124 run function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/slash_sonic_start
execute if score @s AV.AnimationTick matches 99 run function asset:mob/0391.axia_first/ai/animation/7_0_zangekihou/announce_line

# TP
execute if score @s AV.AnimationTick matches 141 at @s run tp @s ^ ^0.2 ^ ~ ~
execute if score @s AV.AnimationTick matches 142 at @s run tp @s ^ ^0.3 ^ ~ ~
execute if score @s AV.AnimationTick matches 143 at @s run tp @s ^ ^0.4 ^ ~ ~
execute if score @s AV.AnimationTick matches 144 at @s run tp @s ^ ^0.5 ^ ~ ~
execute if score @s AV.AnimationTick matches 145 at @s run tp @s ^ ^0.4 ^ ~ ~
execute if score @s AV.AnimationTick matches 146 at @s run tp @s ^ ^0.3 ^ ~ ~
execute if score @s AV.AnimationTick matches 147 at @s run tp @s ^ ^0.2 ^ ~ ~
execute if score @s AV.AnimationTick matches 148 at @s run tp @s ^ ^0.1 ^ ~ ~

execute if score @s AV.AnimationTick matches 155 at @s run tp @s ^ ^-0.1 ^ ~ ~
execute if score @s AV.AnimationTick matches 156 at @s run tp @s ^ ^-0.2 ^ ~ ~
execute if score @s AV.AnimationTick matches 157 at @s run tp @s ^ ^-0.3 ^ ~ ~
execute if score @s AV.AnimationTick matches 158 at @s run tp @s ^ ^-0.4 ^ ~ ~
execute if score @s AV.AnimationTick matches 159 at @s run tp @s ^ ^-0.5 ^ ~ ~
execute if score @s AV.AnimationTick matches 160 at @s run tp @s ^ ^-0.4 ^ ~ ~
execute if score @s AV.AnimationTick matches 161 at @s run tp @s ^ ^-0.3 ^ ~ ~
execute if score @s AV.AnimationTick matches 162 at @s run tp @s ^ ^-0.2 ^ ~ ~

# 中央ダメージエリア
execute if score @s AV.AnimationTick matches 141 at @s run function asset:mob/0391.axia_first/ai/projectile/critical/0.summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#> asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/slash_sonic_start
#
# 斬撃飛ばし 召喚
#
# @within function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/

# サウンド
function asset:mob/0391.axia_first/ai/projectile/slash_sonic/3.sound

# Tempタグ付与
tag @s add AV.Temp.This

# ディスプレイ召喚
summon item_display ^0 ^1 ^1 {interpolation_duration:0,teleport_duration:1,Tags:["AV.SlashSonicInit"],brightness:{sky:15,block:15},transformation:{left_rotation:[-0.5610f,-0.4305f,-0.5610f,0.4305f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[3f,5f,0.1f]},item:{id:"air",Count:1b}}

# ディスプレイの位置調整
execute positioned ^0 ^1 ^1 as @e[tag=AV.SlashSonicInit,distance=..0.1] facing entity @e[type=wither_skeleton,tag=AV.Temp.This,distance=..64,sort=nearest,limit=1] feet rotated ~180 0 run tp @s ^ ^ ^ ~ ~

# 斬撃エフェクト初期化
execute positioned ^0 ^1 ^1 as @e[tag=AV.SlashSonicInit,distance=..0.1] run function asset:mob/0391.axia_first/ai/projectile/slash_sonic/1.init

# Tempタグ消去
tag @s remove AV.Temp.This
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/slash_summon
#
# 斬撃エフェクト 召喚
#
# @within function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/

# Tempタグ付与
tag @s add AV.Temp.This

# ディスプレイ召喚
summon item_display ^0 ^1.2 ^1 {interpolation_duration:0,Tags:["AV.SlashEffectInit"],brightness:{sky:15,block:15},transformation:{left_rotation:[0.5f,-0.5f,0.354f,0.612f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[6f,6f,0.1f]},item:{id:"air",Count:1b}}

# ディスプレイの位置調整
execute positioned ^0 ^1.2 ^1 as @e[tag=AV.SlashEffectInit,distance=..0.1] facing entity @e[type=wither_skeleton,tag=AV.Temp.This,distance=..64,sort=nearest,limit=1] feet rotated ~180 0 run tp @s ^ ^ ^ ~ ~

# 斬撃エフェクト初期化
execute positioned ^0 ^1.2 ^1 as @e[tag=AV.SlashEffectInit,distance=..0.1] run function asset:mob/0391.axia_first/ai/projectile/slash_effect/1.init.m {Num:-7}

# Tempタグ消去
tag @s remove AV.Temp.This
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal
#
# ランダム拡散
#
# @within function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/

# Markerを呼び出す
tp 0-0-0-0-0 ^ ^ ^ ~ ~
# 拡散値
data modify storage lib: Argument.Bounds set value [[6d,6d],[0d,0d],[6d,6d]]
# 拡散する
execute as 0-0-0-0-0 at @s run function lib:spread_entity/
# ソード召喚
execute at 0-0-0-0-0 run function asset:mob/0391.axia_first/ai/projectile/sword/0.summon
# Makerを戻してあげる
execute in overworld run tp 0-0-0-0-0 0.0 0.0 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#> asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/normal_hard
#
# ハード専用 ランダム拡散召喚
#
# @within function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/

# Markerを呼び出す
execute as @e[type=wither_skeleton,tag=AV.Temp.This,distance=..64,sort=nearest,limit=1] at @s run tp 0-0-0-0-0 ^ ^ ^ ~ ~
# 拡散値
data modify storage lib: Argument.Bounds set value [[15d,15d],[0d,0d],[15d,15d]]
# 拡散する
execute as 0-0-0-0-0 at @s run function lib:spread_entity/
# ソード召喚
execute at 0-0-0-0-0 run function asset:mob/0391.axia_first/ai/projectile/sword/0.summon
# Makerを戻してあげる
execute in overworld run tp 0-0-0-0-0 0.0 0.0 0.0

# Markerを呼び出す
execute as @e[type=wither_skeleton,tag=AV.Temp.This,distance=..64,sort=nearest,limit=1] at @s run tp 0-0-0-0-0 ^ ^ ^ ~ ~
# 拡散値
data modify storage lib: Argument.Bounds set value [[15d,15d],[0d,0d],[15d,15d]]
# 拡散する
execute as 0-0-0-0-0 at @s run function lib:spread_entity/
# ソード召喚
execute at 0-0-0-0-0 run function asset:mob/0391.axia_first/ai/projectile/sword/0.summon
# Makerを戻してあげる
execute in overworld run tp 0-0-0-0-0 0.0 0.0 0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict.m
#
# @input args
# X : Double
# Z : Double
# @within function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict

# マーカー召喚
$execute positioned ~$(X) ~ ~$(Z) as @e[type=wither_skeleton,tag=AV.Temp.This,distance=..64,sort=nearest,limit=1] run function asset:mob/0391.axia_first/ai/projectile/sword/0.summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#> asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict
#
# ディメンションソード 偏差撃ち
#
# @within function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/

# 攻撃対象のベクトルを取得
function api:player_vector/get

# セッション開ける
function lib:array/session/open

# ベクトルを35倍する
data modify storage lib: Array set from storage api: Return.Vector
data modify storage lib: Mul set value 35
function lib:array/math/scalar_multiply

# 別のstorageに移す
data modify storage asset:temp Predict.X set from storage lib: MulResult[0]
data modify storage asset:temp Predict.Z set from storage lib: MulResult[2]

# セッション閉じる
function lib:array/session/close

# マクロで偏差撃ちする
function asset:mob/0391.axia_first/ai/animation/9_0_dimension_slash/sword/predict.m with storage asset:temp Predict

# リセット
data remove storage asset:temp Predict
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/0391.axia_first/ai/projectile/critical/0.summon
#
# クリティカルヒット 召喚
#
# @within function asset:mob/0391.axia_first/**

# 元となるMobを召喚
execute summon marker run function asset:mob/0391.axia_first/ai/projectile/critical/1.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset:mob/0391.axia_first/ai/projectile/critical/1.init
#
# 初期化処理
#
# @within function asset:mob/0391.axia_first/ai/projectile/critical/0.summon

# マーカーを呼ぶ
tp 0-0-0-0-0 ^ ^ ^ ~ ~

# 演出のためにランダムな方向を向かせる
execute store result entity 0-0-0-0-0 Rotation[0] float 0.01 run function lib:random/

# TP
execute at 0-0-0-0-0 run tp @s ~ ~ ~ ~ 0

# マーカーを戻してあげる
execute in overworld run tp 0-0-0-0-0 0.0 0.0 0.0

# タグ付け
tag @s add AV.CriticalHit

# スコア初期化
scoreboard players set @s AV.ProjectileTick 0

# ループ処理
scoreboard players set $AV.Temp Temporary 32
execute if block ~ ~ ~ #lib:no_collision unless block ~ ~-0.25 ~ #lib:no_collision run scoreboard players set $AV.Temp Temporary -100
execute at @s if score $AV.Temp Temporary matches 1.. run function asset:mob/0391.axia_first/ai/projectile/sword/1.1.loop

# ループしてもダメだったらキル
execute if score $AV.Temp Temporary matches 0 run kill @s

# リセット
scoreboard players reset $AV.Temp Temporary
execute at @s run tag @e[tag=AV.Temp.This,distance=..0.001] remove AV.Temp.This
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:mob/0391.axia_first/ai/projectile/critical/2.tick
#
# クリティカルヒット Tick処理
#
# @within function asset:mob/0391.axia_first/tick/

# スコア上昇
scoreboard players add @s AV.ProjectileTick 1

# 回転・演出
tp @s ~ ~ ~ ~10 0
execute at @s run function asset:mob/0391.axia_first/ai/projectile/critical/vfx/tick
execute if score @s AV.ProjectileTick matches 1 run playsound entity.zombie_villager.converted hostile @a[distance=..32] ~ ~ ~ 1 1.5 0

# 処理
execute if score @s AV.ProjectileTick matches 21 run function asset:mob/0391.axia_first/ai/projectile/critical/3.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#> asset:mob/0391.axia_first/ai/projectile/shock_wave/3.cast
#
# 爆発処理
#
# @within function asset:mob/0391.axia_first/ai/projectile/critical/2.tick

# 演出
function asset:mob/0391.axia_first/ai/projectile/critical/vfx/cast

# 引数の設定
# 与えるダメージ
# ノーマルなら 100f
execute if predicate api:global_vars/difficulty/max/normal run data modify storage lib: Argument.Damage set value 100f
# ハードなら 9999f
execute if predicate api:global_vars/difficulty/min/hard run data modify storage lib: Argument.Damage set value 9999ff
# 第一属性
data modify storage lib: Argument.AttackType set value "Physical"
# 第二属性
data modify storage lib: Argument.ElementType set value "Fire"
# 悪いがこれにあたったら死んでね☆
execute if predicate api:global_vars/difficulty/min/hard run data modify storage lib: Argument.FixedDamage set value true
# デスログ
data modify storage lib: Argument.DeathMessage append value '[{"translate": "%2$sの攻撃が200回転した! %1$sは死んだ!","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
execute as @e[tag=this,distance=..100] run function lib:damage/modifier
# ダメージを与える
execute as @a[gamemode=!creative,distance=..6] at @s run function lib:damage/
# リセット
function lib:damage/reset

# キル
kill @s
Loading

0 comments on commit e6ffa16

Please sign in to comment.