Skip to content

Commit

Permalink
🧑‍💻 被ダメージフラグの処理を追加
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Nov 17, 2024
1 parent 8ffe8a9 commit 6dea091
Show file tree
Hide file tree
Showing 61 changed files with 925 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset_manager:artifact/triggers/damage/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Damage[0] run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Damage[]
# それぞれについて処理する
function asset_manager:artifact/triggers/damage/foreach

# リセット
data remove storage asset:artifact Events
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage/foreach

$function asset:artifact/alias/$(id)/damage/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage/damage.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage/use

$function asset:artifact/alias/$(id)/damage/
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset_manager:artifact/triggers/damage/foreach
#
#
#
# @within function asset_manager:artifact/triggers/damage/*

# イベントデータ処理
# データを取得
data modify storage asset:context Damage set from storage asset:artifact Events[-1]
# 攻撃元を取得し、Attacker を付与する (null の可能性もある)
function asset_manager:artifact/triggers/event/damage/add_tag_attacker

# 使用条件を満たしているか確認する
function asset_manager:artifact/check/
function asset_manager:artifact/triggers/damage/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/damage/use

# リセット
tag @e[type=#lib:living,type=!player,tag=Attacker] remove Attacker
tag @s remove CanUsed
data remove storage asset:context Damage
data remove storage asset:artifact AttackTargets
data remove storage asset:artifact Events[-1]
# 要素が残っているなら再帰
execute if data storage asset:artifact Events[0] run function asset_manager:artifact/triggers/damage/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/damage/use
#
#
#
# @within function asset_manager:artifact/triggers/damage/foreach

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/damage/damage.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset_manager:artifact/triggers/damage_drowning/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Damage[{Type:"vanilla_drowning"}] run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Damage[{Type:"vanilla_drowning"}]
# それぞれについて処理する
function asset_manager:artifact/triggers/damage_drowning/foreach

# リセット
data remove storage asset:artifact Events
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_drowning/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_drowning/foreach

$function asset:artifact/alias/$(id)/damage_drowning/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_drowning/damage_drowning.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_drowning/use

$function asset:artifact/alias/$(id)/damage_drowning/
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset_manager:artifact/triggers/damage_drowning/foreach
#
#
#
# @within function asset_manager:artifact/triggers/damage_drowning/*

# イベントデータ処理
# データを取得
data modify storage asset:context Damage set from storage asset:artifact Events[-1]
# 攻撃元を取得し、Attacker を付与する (null の可能性もある)
function asset_manager:artifact/triggers/event/damage/add_tag_attacker

# 使用条件を満たしているか確認する
function asset_manager:artifact/check/
function asset_manager:artifact/triggers/damage_drowning/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/damage_drowning/use

# リセット
tag @e[type=#lib:living,type=!player,tag=Attacker] remove Attacker
tag @s remove CanUsed
data remove storage asset:context Damage
data remove storage asset:artifact AttackTargets
data remove storage asset:artifact Events[-1]
# 要素が残っているなら再帰
execute if data storage asset:artifact Events[0] run function asset_manager:artifact/triggers/damage_drowning/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/damage_drowning/use
#
#
#
# @within function asset_manager:artifact/triggers/damage_drowning/foreach

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/damage_drowning/damage_drowning.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset_manager:artifact/triggers/damage_entity/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Damage[].From run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Damage[]
# それぞれについて処理する
function asset_manager:artifact/triggers/damage_entity/foreach

# リセット
data remove storage asset:artifact Events
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_entity/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_entity/foreach

$function asset:artifact/alias/$(id)/damage_entity/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_entity/damage_entity.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_entity/use

$function asset:artifact/alias/$(id)/damage_entity/
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset_manager:artifact/triggers/damage_entity/foreach
#
#
#
# @within function asset_manager:artifact/triggers/damage_entity/*

# イベントデータ処理
# データを取得
data modify storage asset:context Damage set from storage asset:artifact Events[-1]
# 攻撃元を取得し、Attacker を付与する (null の可能性もある)
function asset_manager:artifact/triggers/event/damage/add_tag_attacker

# 使用条件を満たしているか確認する
execute if entity @e[type=#lib:living,type=!player,tag=Attacker] run function asset_manager:artifact/check/
execute if entity @e[type=#lib:living,type=!player,tag=Attacker] run function asset_manager:artifact/triggers/damage_entity/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/damage_entity/use

# リセット
tag @e[type=#lib:living,type=!player,tag=Attacker] remove Attacker
tag @s remove CanUsed
data remove storage asset:context Damage
data remove storage asset:artifact AttackTargets
data remove storage asset:artifact Events[-1]
# 要素が残っているなら再帰
execute if data storage asset:artifact Events[0] run function asset_manager:artifact/triggers/damage_entity/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/damage_entity/use
#
#
#
# @within function asset_manager:artifact/triggers/damage_entity/foreach

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/damage_entity/damage_entity.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset_manager:artifact/triggers/damage_entity_explosion/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Damage[{Type:"vanilla_explosion"}].From run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Damage[{Type:"vanilla_explosion"}]
# それぞれについて処理する
function asset_manager:artifact/triggers/damage_entity_explosion/foreach

# リセット
data remove storage asset:artifact Events
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_entity_explosion/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_entity_explosion/foreach

$function asset:artifact/alias/$(id)/damage_entity_explosion/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_entity_explosion/damage_entity_explosion.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_entity_explosion/use

$function asset:artifact/alias/$(id)/damage_entity_explosion/
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset_manager:artifact/triggers/damage_entity_explosion/foreach
#
#
#
# @within function asset_manager:artifact/triggers/damage_entity_explosion/*

# イベントデータ処理
# データを取得
data modify storage asset:context Damage set from storage asset:artifact Events[-1]
# 攻撃元を取得し、Attacker を付与する (null の可能性もある)
function asset_manager:artifact/triggers/event/damage/add_tag_attacker

# 使用条件を満たしているか確認する
execute if entity @e[type=#lib:living,type=!player,tag=Attacker] run function asset_manager:artifact/check/
execute if entity @e[type=#lib:living,type=!player,tag=Attacker] run function asset_manager:artifact/triggers/damage_entity_explosion/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/damage_entity_explosion/use

# リセット
tag @e[type=#lib:living,type=!player,tag=Attacker] remove Attacker
tag @s remove CanUsed
data remove storage asset:context Damage
data remove storage asset:artifact AttackTargets
data remove storage asset:artifact Events[-1]
# 要素が残っているなら再帰
execute if data storage asset:artifact Events[0] run function asset_manager:artifact/triggers/damage_entity_explosion/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/damage_entity_explosion/use
#
#
#
# @within function asset_manager:artifact/triggers/damage_entity_explosion/foreach

# 共通処理
# アイテムを破壊するとBrokeItemが追加される
function asset_manager:artifact/use/

# 処理対象の神器の重複数を取得する
execute store result storage asset:context Count int 1 if data storage asset:artifact TargetItemList[]

# 神器を呼び出し
function asset_manager:artifact/triggers/damage_entity_explosion/damage_entity_explosion.m with storage asset:context

# リセット
data remove storage asset:context BrokeItem
data remove storage asset:context Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset_manager:artifact/triggers/damage_entity_melee/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Damage[{Type:"vanilla_melee"}].From run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Damage[{Type:"vanilla_melee"}]
# それぞれについて処理する
function asset_manager:artifact/triggers/damage_entity_melee/foreach

# リセット
data remove storage asset:artifact Events
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_entity_melee/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_entity_melee/foreach

$function asset:artifact/alias/$(id)/damage_entity_melee/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/damage_entity_melee/damage_entity_melee.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/damage_entity_melee/use

$function asset:artifact/alias/$(id)/damage_entity_melee/
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset_manager:artifact/triggers/damage_entity_melee/foreach
#
#
#
# @within function asset_manager:artifact/triggers/damage_entity_melee/*

# イベントデータ処理
# データを取得
data modify storage asset:context Damage set from storage asset:artifact Events[-1]
# 攻撃元を取得し、Attacker を付与する (null の可能性もある)
function asset_manager:artifact/triggers/event/damage/add_tag_attacker

# 使用条件を満たしているか確認する
execute if entity @e[type=#lib:living,type=!player,tag=Attacker] run function asset_manager:artifact/check/
execute if entity @e[type=#lib:living,type=!player,tag=Attacker] run function asset_manager:artifact/triggers/damage_entity_melee/check.m with storage asset:context
# 条件を満たしていれば使用する
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/damage_entity_melee/use

# リセット
tag @e[type=#lib:living,type=!player,tag=Attacker] remove Attacker
tag @s remove CanUsed
data remove storage asset:context Damage
data remove storage asset:artifact AttackTargets
data remove storage asset:artifact Events[-1]
# 要素が残っているなら再帰
execute if data storage asset:artifact Events[0] run function asset_manager:artifact/triggers/damage_entity_melee/foreach
Loading

0 comments on commit 6dea091

Please sign in to comment.