Skip to content

Commit

Permalink
Merge pull request #1633 from ProjectTSB/fix/main-cooldown-bar
Browse files Browse the repository at this point in the history
🐛 メインクールダウンバーが終了時に一瞬で消えるのを修正
  • Loading branch information
ChenCMD authored Nov 17, 2024
2 parents 3567e00 + c0eca3b commit 4c7360f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# @within tag/function asset:artifact/**

# storage asset:context idのfeet/legs/chest/head/mainhand/offhandに装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する
execute if data storage asset:context id{hotbar:[2147483647]} run function asset:artifact/example/trigger/2.check_condition
execute if data storage asset:context id{mainhand:2147483647} run function asset:artifact/example/trigger/2.check_condition
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
#declare score_holder $LCD
#declare score_holder $TCD

# スコアに移す (TCD は null の可能性があるためデフォルト値として -1 を入れる)
# スコアに移す (TCD は null の可能性があるためデフォルト値として -16 を入れる)
scoreboard players set $TCD Temporary -16
execute store result score $LCD Temporary run data get storage asset:artifact LCD.Value
execute store result score $TCD Temporary run data get storage asset:artifact TCD.Value
execute if data storage asset:artifact TCD 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 CD set from storage asset:artifact LCD
execute if score $LCD Temporary <= $TCD Temporary run data modify storage asset:artifact CD set from storage asset:artifact TCD
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
data modify storage asset:artifact CooldownType.Type set from storage asset:artifact CopiedEquipmentCooldownTypes[-1]
function asset_manager:artifact/cooldown/common/find_type_cooldown with storage asset:artifact CooldownType

# TCD が存在する場合、LCD と TCD のうちクールダウン最大値が大きい方を CDs に入れる
execute if data storage asset:artifact TCD run function asset_manager:artifact/cooldown/common/compare_cooldown
execute if data storage asset:artifact TCD run data modify storage asset:artifact CDs append from storage asset:artifact CD
# TCD が null の場合、問答無用で LCD を入れる
execute unless data storage asset:artifact TCD run data modify storage asset:artifact CDs append from storage asset:artifact LCD
# LCD と TCD のうちクールダウン最大値が大きい方を CDs に入れる
function asset_manager:artifact/cooldown/common/compare_cooldown
data modify storage asset:artifact CDs append from storage asset:artifact CD

# 末尾削除
data remove storage asset:artifact CopiedEquipmentCooldownTypes[-1]
Expand Down

0 comments on commit 4c7360f

Please sign in to comment.