-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
904af1d
commit eb239f8
Showing
11 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#> asset_manager:artifact/triggers/heal/ | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m | ||
|
||
# フラグが存在しているか確認する | ||
execute unless data storage asset:artifact ArtifactEvents.Heal[0] run return fail | ||
# イベントを取得する | ||
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.Heal[] | ||
# それぞれについて処理する | ||
function asset_manager:artifact/triggers/heal/foreach | ||
|
||
# リセット | ||
data remove storage asset:artifact Events |
19 changes: 19 additions & 0 deletions
19
...sing/data/asset_manager/functions/artifact/triggers/heal/add_tag_each_receiver.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#> asset_manager:artifact/triggers/heal/add_tag_each_receiver | ||
# | ||
# | ||
# | ||
# @within function | ||
# asset_manager:artifact/triggers/heal/foreach | ||
# asset_manager:artifact/triggers/heal/add_tag_each_receiver | ||
|
||
#> Private | ||
# @private | ||
#declare score_holder $HealTarget | ||
|
||
execute store result score $HealTarget Temporary run data get storage asset:artifact HealTargets[-1] | ||
data remove storage asset:artifact HealTargets[-1] | ||
|
||
execute as @a if score @s UserID = $HealTarget Temporary run tag @s add Receiver | ||
|
||
scoreboard players reset $HealTarget Temporary | ||
execute if data storage asset:artifact HealTargets[0] run function asset_manager:artifact/triggers/heal/add_tag_each_receiver |
8 changes: 8 additions & 0 deletions
8
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/check.m.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#> asset_manager:artifact/triggers/heal/check.m | ||
# | ||
# | ||
# | ||
# @input args id : int | ||
# @within function asset_manager:artifact/triggers/heal/foreach | ||
|
||
$function asset:artifact/alias/$(id)/heal/check |
33 changes: 33 additions & 0 deletions
33
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/foreach.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#> asset_manager:artifact/triggers/heal/foreach | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/triggers/heal/* | ||
|
||
# イベントデータ処理 | ||
# データを取得 | ||
data modify storage asset:context Heal set from storage asset:artifact Events[-1] | ||
# ヒール先を取得し、Receiver を付与する (null の可能性もある) | ||
data modify storage asset:artifact HealTargets set from storage asset:context Heal.To | ||
function asset_manager:artifact/triggers/heal/add_tag_each_receiver | ||
# 最大ヒール量の計算 | ||
function lib:array/session/open | ||
data modify storage lib: Array set from storage asset:context Heal.Amounts | ||
function lib:array/math/max | ||
data modify storage asset:context Heal.Amount set from storage lib: MaxResult | ||
function lib:array/session/close | ||
|
||
# 使用条件を満たしているか確認する | ||
function asset_manager:artifact/check/ | ||
function asset_manager:artifact/triggers/heal/check.m with storage asset:context | ||
# 条件を満たしていれば使用する | ||
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/heal/use | ||
|
||
# リセット | ||
tag @a[tag=Receiver] remove Receiver | ||
tag @s remove CanUsed | ||
data remove storage asset:context Heal | ||
data remove storage asset:artifact HealTargets | ||
data remove storage asset:artifact Events[-1] | ||
# 要素が残っているなら再帰 | ||
execute if data storage asset:artifact Events[0] run function asset_manager:artifact/triggers/heal/foreach |
8 changes: 8 additions & 0 deletions
8
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/heal.m.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#> asset_manager:artifact/triggers/heal/heal.m | ||
# | ||
# | ||
# | ||
# @input args id : int | ||
# @within function asset_manager:artifact/triggers/heal/use | ||
|
||
$function asset:artifact/alias/$(id)/heal/ |
19 changes: 19 additions & 0 deletions
19
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/use.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#> asset_manager:artifact/triggers/heal/use | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/triggers/heal/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/heal/heal.m with storage asset:context | ||
|
||
# リセット | ||
data remove storage asset:context BrokeItem | ||
data remove storage asset:context Count |
15 changes: 15 additions & 0 deletions
15
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#> asset_manager:artifact/triggers/receive_heal/ | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/triggers/trigger/foreach/call.m | ||
|
||
# フラグが存在しているか確認する | ||
execute unless data storage asset:artifact ArtifactEvents.ReceiveHeal[0] run return fail | ||
# イベントを取得する | ||
data modify storage asset:artifact Events append from storage asset:artifact ArtifactEvents.ReceiveHeal[] | ||
# それぞれについて処理する | ||
function asset_manager:artifact/triggers/receive_heal/foreach | ||
|
||
# リセット | ||
data remove storage asset:artifact Events |
8 changes: 8 additions & 0 deletions
8
...kyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/check.m.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#> asset_manager:artifact/triggers/receive_heal/check.m | ||
# | ||
# | ||
# | ||
# @input args id : int | ||
# @within function asset_manager:artifact/triggers/receive_heal/foreach | ||
|
||
$function asset:artifact/alias/$(id)/receive_heal/check |
31 changes: 31 additions & 0 deletions
31
...kyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/foreach.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#> asset_manager:artifact/triggers/receive_heal/foreach | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/triggers/receive_heal/* | ||
|
||
#> Private | ||
# @private | ||
#declare score_holder $HealedFrom | ||
|
||
# イベントデータ処理 | ||
# データを取得 | ||
data modify storage asset:context ReceiveHeal set from storage asset:artifact Events[-1] | ||
# ヒール元を取得し、Healer を付与する (null の可能性もある) | ||
execute if data storage asset:context ReceiveHeal.From store result score $HealedFrom Temporary run data get storage asset:context ReceiveHeal.From | ||
execute if data storage asset:context ReceiveHeal.From as @a if score @s UserID = $HealedFrom Temporary run tag @s add Healer | ||
scoreboard players reset $HealedFrom Temporary | ||
|
||
# 使用条件を満たしているか確認する | ||
function asset_manager:artifact/check/ | ||
function asset_manager:artifact/triggers/receive_heal/check.m with storage asset:context | ||
# 条件を満たしていれば使用する | ||
execute if entity @s[tag=CanUsed] run function asset_manager:artifact/triggers/receive_heal/use | ||
|
||
# リセット | ||
tag @a[tag=Healer] remove Healer | ||
tag @s remove CanUsed | ||
data remove storage asset:context ReceiveHeal | ||
data remove storage asset:artifact Events[-1] | ||
# 要素が残っているなら再帰 | ||
execute if data storage asset:artifact Events[0] run function asset_manager:artifact/triggers/receive_heal/foreach |
8 changes: 8 additions & 0 deletions
8
...ing/data/asset_manager/functions/artifact/triggers/receive_heal/receive_heal.m.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#> asset_manager:artifact/triggers/receive_heal/receive_heal.m | ||
# | ||
# | ||
# | ||
# @input args id : int | ||
# @within function asset_manager:artifact/triggers/receive_heal/use | ||
|
||
$function asset:artifact/alias/$(id)/receive_heal/ |
19 changes: 19 additions & 0 deletions
19
TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/use.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#> asset_manager:artifact/triggers/receive_heal/use | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/triggers/receive_heal/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/receive_heal/receive_heal.m with storage asset:context | ||
|
||
# リセット | ||
data remove storage asset:context BrokeItem | ||
data remove storage asset:context Count |