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 6dea091 commit 904af1d
Show file tree
Hide file tree
Showing 23 changed files with 324 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].From int 1 run scoreboard players get @s UserID
# プレイヤーにイベントを追加する
function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed append value {Type: "api",IsVanilla:false}
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].To int 1 run scoreboard players get $DamagerUUID Temporary
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].Amount double 0.01 run scoreboard players get $Damage Temporary
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].AttackType set from storage api: Argument.AttackType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].ElementType set from storage api: Argument.ElementType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed[-1].Metadata set from storage api: Argument.Metadata
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill append value {Type: "api",IsVanilla:false}
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].To int 1 run scoreboard players get $DamagerUUID Temporary
execute store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].Amount double 0.01 run scoreboard players get $Damage Temporary
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].AttackType set from storage api: Argument.AttackType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].ElementType set from storage api: Argument.ElementType
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill[-1].Metadata set from storage api: Argument.Metadata
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#> asset_manager:artifact/triggers/event/kill/add_tag_victim
#
#
#
# @within function asset_manager:artifact/triggers/kill*/foreach

#> Private
# @private
#declare score_holder $KillTarget

execute if data storage asset:context Kill.To store result score $KillTarget Temporary run data get storage asset:context Kill.To
execute if data storage asset:context Kill.To as @e[type=#lib:living,type=!player,distance=..150] if score @s MobUUID = $KillTarget Temporary run tag @s add Victim
scoreboard players reset $KillTarget Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset_manager:artifact/triggers/kill/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Kill[0] run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Kill[]
# それぞれについて処理する
function asset_manager:artifact/triggers/kill/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/kill/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill/foreach

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

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

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

# リセット
tag @e[type=#lib:living,type=!player,tag=Victim] remove Victim
tag @s remove CanUsed
data remove storage asset:context Kill
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/kill/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/kill/kill.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill/use

$function asset:artifact/alias/$(id)/kill/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/kill/use
#
#
#
# @within function asset_manager:artifact/triggers/kill/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/kill/kill.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/kill_explosion/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Kill[{Type:"vanilla_explosion"}] run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Kill[{Type:"vanilla_explosion"}]
# それぞれについて処理する
function asset_manager:artifact/triggers/kill_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/kill_explosion/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill_explosion/foreach

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

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

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

# リセット
tag @e[type=#lib:living,type=!player,tag=Victim] remove Victim
tag @s remove CanUsed
data remove storage asset:context Kill
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/kill_explosion/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/kill_explosion/kill_explosion.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill_explosion/use

$function asset:artifact/alias/$(id)/kill_explosion/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/kill_explosion/use
#
#
#
# @within function asset_manager:artifact/triggers/kill_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/kill_explosion/kill_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/kill_melee/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Kill[{Type:"vanilla_melee"}] run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Kill[{Type:"vanilla_melee"}]
# それぞれについて処理する
function asset_manager:artifact/triggers/kill_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/kill_melee/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill_melee/foreach

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

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

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

# リセット
tag @e[type=#lib:living,type=!player,tag=Victim] remove Victim
tag @s remove CanUsed
data remove storage asset:context Kill
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/kill_melee/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/kill_melee/kill_melee.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill_melee/use

$function asset:artifact/alias/$(id)/kill_melee/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/kill_melee/use
#
#
#
# @within function asset_manager:artifact/triggers/kill_melee/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/kill_melee/kill_melee.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/kill_projectile/
#
#
#
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m

# フラグが存在しているか確認する
execute unless data storage asset:artifact ArtifactEvents.Kill[{Type:"vanilla_projectile"}] run return fail
# イベントを取得する
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Kill[{Type:"vanilla_projectile"}]
# それぞれについて処理する
function asset_manager:artifact/triggers/kill_projectile/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/kill_projectile/check.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill_projectile/foreach

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

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

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

# リセット
tag @e[type=#lib:living,type=!player,tag=Victim] remove Victim
tag @s remove CanUsed
data remove storage asset:context Kill
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/kill_projectile/foreach
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/kill_projectile/kill_projectile.m
#
#
#
# @input args id : int
# @within function asset_manager:artifact/triggers/kill_projectile/use

$function asset:artifact/alias/$(id)/kill_projectile/
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset_manager:artifact/triggers/kill_projectile/use
#
#
#
# @within function asset_manager:artifact/triggers/kill_projectile/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/kill_projectile/kill_projectile.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
Expand Up @@ -6,7 +6,7 @@

# プレイヤーにイベントを追加する
execute as @p[tag=this] run function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Killed append from storage asset:context Attack
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents.Kill append from storage asset:context Attack
# Mob にもイベントを追加する
function oh_my_dat:please
data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death append from storage asset:context Attack
Expand Down

0 comments on commit 904af1d

Please sign in to comment.