Skip to content

Commit

Permalink
🩹 ストレージ部分を微修正
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Nov 4, 2024
1 parent ae38ed3 commit ac5f580
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#declare score_holder $ID

# キーチェック
execute store result score $ID Temporary run data get storage asset:context IDList[-1]
execute store result score $ID Temporary run data get storage lib: Array[-1]
# IDが正しければプルする
execute if score $ID Temporary matches 1.. run function asset_manager:artifact/data/new/fetch_data/fetch
execute unless score $ID Temporary matches 1.. run data modify storage asset:artifact New.ItemData append value {ID:-2,Triggers:[],EquipID:-2,Modifiers:[],CanUsedGod:[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
scoreboard players reset $SlotIndex Temporary
data remove storage asset:artifact EquipmentChanges
data remove storage asset:artifact ArtifactEvents
function asset_manager:artifact/data/current/reset
data remove storage asset:artifact New
data remove storage asset:artifact Old
tag @s remove Believe.Changed
tag @s remove TriggerFlag.ClickCarrot
tag @s remove TriggerFlag.UseItem
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset_manager:artifact/triggers/tick
#
# 各神器処理へデータ受け渡し
#
# @within function asset_manager:artifact/triggers/

# トリガー一覧を取得
data modify storage asset:artifact IDList set from storage asset:artifact New.ItemData[].Triggers[{Trigger:"tick"}]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# 音
execute unless data storage asset:artifact TargetItems[-1].tag.TSB{DisableBreakSound:true} run playsound entity.item.break player @a
# そのスロットを消し飛ばす
execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage api: SelectedItemSlot set from storage asset:context SelectedItemSlot
execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage api: SelectedItemSlot set from storage asset:artifact New.SelectedItemSlot
execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run function api:inventory/refer_selected_item_slot/replace_air
execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} run item replace entity @s weapon.offhand with air
execute if data storage asset:artifact {TargetDefaultSlot:"feet"} run item replace entity @s armor.feet with air
Expand All @@ -17,4 +17,4 @@
execute if data storage asset:artifact {TargetDefaultSlot:"hotbar"} store result storage api: SelectedItemSlot int 1 run data get storage asset:artifact TargetItems[-1].Slot
execute if data storage asset:artifact {TargetDefaultSlot:"hotbar"} run function api:inventory/refer_selected_item_slot/replace_air
# current更新
function asset_manager:artifact/data/current/update/
function asset_manager:artifact/data/current/update/
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
execute if data storage asset:artifact CopiedSlot run data modify storage asset:artifact TargetItems[-1].Slot set from storage asset:artifact CopiedSlot
execute unless data storage asset:artifact CopiedSlot run data remove storage asset:artifact TargetItems[-1].Slot
# 新しい神器で上書きする
execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage api: SelectedItemSlot set from storage asset:context SelectedItemSlot
execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage api: SelectedItemSlot set from storage asset:artifact New.SelectedItemSlot
execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run function api:inventory/refer_selected_item_slot/replace_from_shulker_box
execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} run loot replace entity @s weapon.offhand 1 mine 10000 0 10000 debug_stick
execute if data storage asset:artifact {TargetDefaultSlot:"feet"} run loot replace entity @s armor.feet 1 mine 10000 0 10000 debug_stick
Expand All @@ -41,4 +41,4 @@
function asset_manager:artifact/data/current/update/
# リセット
data remove storage asset:artifact Name
data remove storage asset:artifact CopiedSlot
data remove storage asset:artifact CopiedSlot
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
# asset_manager:artifact/use/item/update_local_cooldown/non-hotbar

# 設定
execute if data storage asset:artifact {SpecificTargetSlot:0b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[05].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[05].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:1b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[06].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[06].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:2b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[07].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[07].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:3b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[08].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[08].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:4b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[09].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[09].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:5b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[10].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[10].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:6b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[11].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[11].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:7b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[12].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[12].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {SpecificTargetSlot:8b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[13].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[13].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:0b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[05].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[05].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:1b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[06].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[06].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:2b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[07].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[07].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:3b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[08].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[08].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:4b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[09].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[09].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:5b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[10].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[10].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:6b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[11].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[11].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:7b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[12].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[12].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact New{SpecificTargetSlot:8b} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[13].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[13].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
# リセット
data remove storage asset:artifact SpecificTargetSlot
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#
# @within function asset_manager:artifact/use/item/update_local_cooldown/

execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} store result storage asset:artifact SpecificTargetSlot byte 1 run data get storage asset:context SelectedItemSlot
execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run function asset_manager:artifact/use/item/update_local_cooldown/hotbar
execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[0].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[0].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
execute if data storage asset:artifact {TargetDefaultSlot:"feet"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[1].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[1].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,4 @@
#
# @within function core:tick/

data remove storage asset:context New
data remove storage asset:context Old
data remove storage asset:context id
data remove storage asset:context Items
data remove storage asset:context Inventory

0 comments on commit ac5f580

Please sign in to comment.