-
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
Showing
7 changed files
with
116 additions
and
26 deletions.
There are no files selected for viewing
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
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
14 changes: 14 additions & 0 deletions
14
...essing/data/asset_manager/functions/artifact/cooldown/mini_bar/choose_max_cds/.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,14 @@ | ||
#> asset_manager:artifact/cooldown/mini_bar/choose_max_cds/ | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/cooldown/mini_bar/ | ||
|
||
# コピーしておく | ||
data modify storage asset:artifact CopiedEquipmentCooldownTypes set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].EquipmentCooldownTypes | ||
|
||
# CopiedEquipmentCooldownTypes(normal) + LCDs(normal) -> CDs(inverted) | ||
function asset_manager:artifact/cooldown/mini_bar/choose_max_cds/foreach | ||
|
||
# リセット | ||
data remove storage asset:artifact CopiedEquipmentCooldownTypes |
25 changes: 25 additions & 0 deletions
25
...data/asset_manager/functions/artifact/cooldown/mini_bar/choose_max_cds/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,25 @@ | ||
#> asset_manager:artifact/cooldown/mini_bar/choose_max_cds/foreach | ||
# | ||
# | ||
# | ||
# @within function | ||
# asset_manager:artifact/cooldown/mini_bar/choose_max_cds/ | ||
# asset_manager:artifact/cooldown/mini_bar/choose_max_cds/foreach | ||
|
||
# () -> TCD | ||
data modify storage asset:artifact CooldownType.Type set from storage asset:artifact CopiedEquipmentCooldownTypes[-1] | ||
function asset_manager:artifact/cooldown/mini_bar/choose_max_cds/get_tcd with storage asset:artifact CooldownType | ||
|
||
# TCD が存在する場合、LCD と TCD のうちクールダウン最大値が大きい方を CDs に入れる | ||
execute if data storage asset:artifact TCD run function asset_manager:artifact/cooldown/mini_bar/choose_max_cds/push_compare_result | ||
# TCD が null の場合、問答無用で LCD を入れる | ||
execute unless data storage asset:artifact TCD run data modify storage asset:artifact CDs append from storage asset:artifact LCDs[-1] | ||
|
||
# 末尾削除 | ||
data remove storage asset:artifact CopiedEquipmentCooldownTypes[-1] | ||
data remove storage asset:artifact LCDs[-1] | ||
# リセット | ||
data remove storage asset:artifact CooldownType | ||
data remove storage asset:artifact TCD | ||
# 要素がまだあるなら再帰 | ||
execute if data storage asset:artifact LCDs[0] run function asset_manager:artifact/cooldown/mini_bar/choose_max_cds/foreach |
8 changes: 8 additions & 0 deletions
8
...data/asset_manager/functions/artifact/cooldown/mini_bar/choose_max_cds/get_tcd.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/cooldown/mini_bar/choose_max_cds/get_tcd | ||
# | ||
# | ||
# @input args | ||
# Type: string | ||
# @within function asset_manager:artifact/cooldown/mini_bar/choose_max_cds/foreach | ||
|
||
$data modify storage asset:artifact TCD set from storage asset:artifact TCDs[{Type:$(Type)}] |
39 changes: 39 additions & 0 deletions
39
...anager/functions/artifact/cooldown/mini_bar/choose_max_cds/push_compare_result.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,39 @@ | ||
#> asset_manager:artifact/cooldown/mini_bar/choose_max_cds/push_compare_result | ||
# | ||
# | ||
# | ||
# @within function asset_manager:artifact/cooldown/mini_bar/choose_max_cds/foreach | ||
|
||
# #> Private | ||
# # @private | ||
# #declare score_holder $LCDMax | ||
# #declare score_holder $LCD | ||
# #declare score_holder $TCDMax | ||
|
||
# # スコアに移す (TCD は null の可能性があるためデフォルト値として -1 を入れる) | ||
# execute store result score $LCD Temporary run data get storage asset:artifact LCDs[-1].Value | ||
# execute store result score $LCDMax Temporary run data get storage asset:artifact LCDs[-1].Max | ||
# execute store result score $TCDMax Temporary run data get storage asset:artifact TCD.Max | ||
# # 比較して追加 | ||
# execute if score $LCD Temporary matches 1.. if score $LCDMax Temporary > $TCDMax Temporary run data modify storage asset:artifact CDs append from storage asset:artifact LCDs[-1] | ||
# execute if score $LCD Temporary matches 1.. if score $LCDMax Temporary <= $TCDMax Temporary run data modify storage asset:artifact CDs append from storage asset:artifact TCD | ||
# execute if score $LCD Temporary matches ..0 run data modify storage asset:artifact CDs append from storage asset:artifact TCD | ||
# # リセット | ||
# scoreboard players reset $LCDMax Temporary | ||
# scoreboard players reset $TCDMax Temporary | ||
|
||
|
||
#> Private | ||
# @private | ||
#declare score_holder $LCD | ||
#declare score_holder $TCD | ||
|
||
# スコアに移す (TCD は null の可能性があるためデフォルト値として -1 を入れる) | ||
execute store result score $LCD Temporary run data get storage asset:artifact LCDs[-1].Value | ||
execute store result score $TCD Temporary run data get storage asset:artifact TCD.Value | ||
# 比較して追加 | ||
execute if score $LCD Temporary > $TCD Temporary run data modify storage asset:artifact CDs append from storage asset:artifact LCDs[-1] | ||
execute if score $LCD Temporary <= $TCD Temporary run data modify storage asset:artifact CDs append from storage asset:artifact TCD | ||
# リセット | ||
scoreboard players reset $LCD Temporary | ||
scoreboard players reset $TCD Temporary |
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