diff --git a/TheSkyBlessing/data/api/functions/artifact/box/from_id.mcfunction b/TheSkyBlessing/data/api/functions/artifact/box/from_id.mcfunction index 0c4dca2cca..885eb44a52 100644 --- a/TheSkyBlessing/data/api/functions/artifact/box/from_id.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/box/from_id.mcfunction @@ -7,14 +7,10 @@ # validate execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ID","color":"red"}] -# 既存にasset:context idが存在する場合に備えて退避させる - function asset_manager:common/context/id/stash -# 代入 - data modify storage asset:context id set from storage api: Argument.ID - data modify storage asset:context Type set value "box" + execute unless data storage api: Argument.ID run return fail # 呼び出し - execute if data storage api: Argument.ID run function #asset:artifact/give -# 退避させたasset:context idを戻す - function asset_manager:common/context/id/pop + data modify storage api: Argument.Type set value "box" + function api:artifact/core/from_id # リセット data remove storage api: Argument.ID + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/api/functions/artifact/box/from_rarity.mcfunction b/TheSkyBlessing/data/api/functions/artifact/box/from_rarity.mcfunction index 9a4d8bdf88..00d103e339 100644 --- a/TheSkyBlessing/data/api/functions/artifact/box/from_rarity.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/box/from_rarity.mcfunction @@ -7,8 +7,10 @@ # validate execute unless data storage api: Argument.Rarity run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" Rarity","color":"red"}] + execute unless data storage api: Argument.Rarity run return fail # 呼び出し - data modify storage asset:context Type set value "box" - execute if data storage api: Argument.Rarity run function asset_manager:artifact/give/ + data modify storage api: Argument.Type set value "box" + function api:artifact/core/from_rarity/ # リセット data remove storage api: Argument.Rarity + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/api/functions/artifact/core/from_id.mcfunction b/TheSkyBlessing/data/api/functions/artifact/core/from_id.mcfunction new file mode 100644 index 0000000000..6db3b8ec4e --- /dev/null +++ b/TheSkyBlessing/data/api/functions/artifact/core/from_id.mcfunction @@ -0,0 +1,32 @@ +#> api:artifact/core/from_id +# @within function +# api:artifact/*/from_id +# api:artifact/core/from_rarity/foreach + +# 既存にasset:context idが存在する場合に備えて退避させる + function asset_manager:common/context/id/stash +# 既存にasset:context thisが存在する場合に備えて退避させる + function asset_manager:common/context/this/stash + +# ID + data modify storage asset:context id set from storage api: Argument.ID +# データ登録 + data modify storage asset:artifact Give set value 1b + function asset_manager:artifact/give/register.m with storage asset:context + data remove storage asset:artifact Give +# validate + execute unless data storage asset:artifact ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" ID","color":"red"}] + execute unless data storage asset:artifact ID run return fail +# フィールド設定 + data modify storage asset:context this set from storage asset:context Field + data modify storage asset:context this merge from storage api: Argument.FieldOverride +# データをfill + data modify storage asset:context Type set from storage api: Argument.Type + execute if data storage asset:context {Type:"drop"} run data modify storage asset:context Important set from storage api: Argument.Important +# 神器をgive + function asset_manager:artifact/give/ + +# 退避させたasset:context idを戻す + function asset_manager:common/context/id/pop +# 退避させたasset:context thisを戻す + function asset_manager:common/context/this/pop diff --git a/TheSkyBlessing/data/api/functions/artifact/core/from_rarity/.mcfunction b/TheSkyBlessing/data/api/functions/artifact/core/from_rarity/.mcfunction new file mode 100644 index 0000000000..beea368980 --- /dev/null +++ b/TheSkyBlessing/data/api/functions/artifact/core/from_rarity/.mcfunction @@ -0,0 +1,55 @@ +#> api:artifact/core/from_rarity/ +# +# +# +# @within function api:artifact/*/from_rarity + +#> For calc +# @private + #declare score_holder $CandidateLength + #declare score_holder $Argument.Index + #declare score_holder $Pulls + +# セッション開ける + function lib:array/session/open +# 該当レアリティのデータを取得 + execute if data storage api: Argument{Rarity:1} run data modify storage lib: Array set from storage asset:artifact ShardPool[1] + execute if data storage api: Argument{Rarity:2} run data modify storage lib: Array set from storage asset:artifact ShardPool[2] + execute if data storage api: Argument{Rarity:3} run data modify storage lib: Array set from storage asset:artifact ShardPool[3] + execute if data storage api: Argument{Rarity:4} run data modify storage lib: Array set from storage asset:artifact ShardPool[4] +# データサイズを取得 + execute store result score $CandidateLength Temporary if data storage lib: Array[] +# 対象Indexを決定 + execute if data storage api: Argument{Rarity:1} run data modify storage lib: Args.key set value "artifact_lv-1" + execute if data storage api: Argument{Rarity:2} run data modify storage lib: Args.key set value "artifact_lv-2" + execute if data storage api: Argument{Rarity:3} run data modify storage lib: Args.key set value "artifact_lv-3" + execute if data storage api: Argument{Rarity:4} run data modify storage lib: Args.key set value "artifact_lv-4" + execute store result storage lib: Args.max int 1 run scoreboard players get $CandidateLength Temporary + execute store result storage lib: Args.scarcity_history_size int 0.35 run scoreboard players get $CandidateLength Temporary + execute store result score $Argument.Index Lib run function lib:random/with_biased/manual.m with storage lib: Args +# 候補データを操作して対象Indexを-1に持ってくる + function lib:array/move +# 一旦リセット + data modify storage asset:artifact Picks set from storage lib: Array[-1] + function lib:array/session/close +# 候補データの再設定 + function lib:array/session/open + data modify storage lib: Array set from storage asset:artifact Picks + data remove storage asset:artifact Picks +# プル数を乱数により設定 +# $Pulls = floor( $CandidateLength * 0.30~0.70(e2) ) / e2 + execute store result score $CandidateLength Temporary if data storage lib: Array[] + scoreboard players remove $CandidateLength Temporary 1 + execute store result score $Pulls Temporary run function lib:random/ + scoreboard players operation $Pulls Temporary %= $41 Const + scoreboard players add $Pulls Temporary 30 + scoreboard players operation $Pulls Temporary *= $CandidateLength Temporary + scoreboard players operation $Pulls Temporary /= $100 Const +# シャッフルして取り出す + scoreboard players add $CandidateLength Temporary 1 + execute if data storage asset:artifact Picks[0] run function api:artifact/core/from_rarity/foreach +# リセット + function lib:array/session/close + scoreboard players reset $CandidateLength Temporary + scoreboard players reset $Pulls Temporary + data remove storage lib: Args diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/give/candidates.mcfunction b/TheSkyBlessing/data/api/functions/artifact/core/from_rarity/foreach.mcfunction similarity index 63% rename from TheSkyBlessing/data/asset_manager/functions/artifact/give/candidates.mcfunction rename to TheSkyBlessing/data/api/functions/artifact/core/from_rarity/foreach.mcfunction index e803729707..a9b26328cb 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/give/candidates.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/core/from_rarity/foreach.mcfunction @@ -7,22 +7,17 @@ #declare score_holder $Argument.Index #declare score_holder $Pulls -# asset:context idがある場合は退避 - function asset_manager:common/context/id/stash # 配列をランダムに動かす execute store result score $Argument.Index Lib run function lib:random/ scoreboard players operation $Argument.Index Lib %= $CandidateLength Temporary function lib:array/move # 引数に代入 - data modify storage asset:context id set from storage lib: Array[-1] - data modify storage asset:context Type set from storage asset:artifact Type + data modify storage api: Argument.ID set from storage lib: Array[-1] # 呼び出し - function #asset:artifact/give -# asset:context idを戻す - function asset_manager:common/context/id/pop + function api:artifact/core/from_id # リセット&ループ data remove storage lib: Array[-1] scoreboard players remove $CandidateLength Temporary 1 scoreboard players remove $Pulls Temporary 1 - execute if score $Pulls Temporary matches 0.. if data storage lib: Array[0] run function asset_manager:artifact/give/candidates + execute if score $Pulls Temporary matches 0.. if data storage lib: Array[0] run function api:artifact/core/from_rarity/foreach diff --git a/TheSkyBlessing/data/api/functions/artifact/give/from_id.mcfunction b/TheSkyBlessing/data/api/functions/artifact/give/from_id.mcfunction index fb7dc8a5e9..ab005682c3 100644 --- a/TheSkyBlessing/data/api/functions/artifact/give/from_id.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/give/from_id.mcfunction @@ -7,14 +7,10 @@ # validate execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ID","color":"red"}] -# 既存にasset:context idが存在する場合に備えて退避させる - function asset_manager:common/context/id/stash -# 代入 - data modify storage asset:context id set from storage api: Argument.ID - data modify storage asset:context Type set value "give" + execute unless data storage api: Argument.ID run return fail # 呼び出し - execute if data storage api: Argument.ID run function #asset:artifact/give -# 退避させたasset:context idを戻す - function asset_manager:common/context/id/pop + data modify storage api: Argument.Type set value "give" + function api:artifact/core/from_id # リセット data remove storage api: Argument.ID + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/api/functions/artifact/give/from_rarity.mcfunction b/TheSkyBlessing/data/api/functions/artifact/give/from_rarity.mcfunction index 3286ff99fc..c2750fc220 100644 --- a/TheSkyBlessing/data/api/functions/artifact/give/from_rarity.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/give/from_rarity.mcfunction @@ -7,8 +7,10 @@ # validate execute unless data storage api: Argument.Rarity run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" Rarity","color":"red"}] + execute unless data storage api: Argument.Rarity run return fail # 呼び出し - data modify storage asset:context Type set value "give" - execute if data storage api: Argument.Rarity run function asset_manager:artifact/give/ + data modify storage api: Argument.Type set value "give" + function api:artifact/core/from_rarity/ # リセット data remove storage api: Argument.Rarity + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/api/functions/artifact/replace/from_id.mcfunction b/TheSkyBlessing/data/api/functions/artifact/replace/from_id.mcfunction index 8a571b4c4b..5d9943d4fa 100644 --- a/TheSkyBlessing/data/api/functions/artifact/replace/from_id.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/replace/from_id.mcfunction @@ -3,22 +3,18 @@ # 神器Assetの入手処理を叩く処理 # # @input storage api: -# Argument.ID -# Argument.Slot +# Argument.ID : int +# Argument.Slot? : string (default: "mainhand") # @api # validate execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ID","color":"red"}] -# 既存にasset:context idが存在する場合に備えて退避させる - function asset_manager:common/context/id/stash -# 代入 - data modify storage asset:context id set from storage api: Argument.ID - execute if data storage api: Argument.Slot run data modify storage asset:context Slot set from storage api: Argument.Slot - data modify storage asset:context Type set value "replace" + execute unless data storage api: Argument.ID run return fail + execute unless data storage api: Argument.Slot run data modify storage api: Argument.Slot set value "mainhand" # 呼び出し - execute if data storage api: Argument.ID run function #asset:artifact/give -# 退避させたasset:context idを戻す - function asset_manager:common/context/id/pop + data modify storage api: Argument.Type set value "replace" + function api:artifact/core/from_id # リセット data remove storage api: Argument.ID data remove storage api: Argument.Slot + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/api/functions/artifact/replace/from_rarity.mcfunction b/TheSkyBlessing/data/api/functions/artifact/replace/from_rarity.mcfunction index 3c65c27a16..f0ce78fb4b 100644 --- a/TheSkyBlessing/data/api/functions/artifact/replace/from_rarity.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/replace/from_rarity.mcfunction @@ -2,13 +2,19 @@ # # 神器Assetの入手処理を叩く処理 # -# @input storage api: Argument.Rarity +# @input storage api: +# Argument.Rarity : (1 | 2 | 3 | 4) +# Argument.Slot? : string (default: "mainhand") # @api # validate execute unless data storage api: Argument.Rarity run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" Rarity","color":"red"}] + execute unless data storage api: Argument.Rarity run return fail + execute unless data storage api: Argument.Slot run data modify storage api: Argument.Slot set value "mainhand" # 呼び出し - data modify storage asset:context Type set value "replace" - execute if data storage api: Argument.Rarity run function asset_manager:artifact/give/ + data modify storage api: Argument.Type set value "replace" + function api:artifact/core/from_rarity/ # リセット data remove storage api: Argument.Rarity + data remove storage api: Argument.Slot + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/api/functions/artifact/spawn/from_id.mcfunction b/TheSkyBlessing/data/api/functions/artifact/spawn/from_id.mcfunction index a902bd56d1..9ec1c71523 100644 --- a/TheSkyBlessing/data/api/functions/artifact/spawn/from_id.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/spawn/from_id.mcfunction @@ -3,23 +3,18 @@ # 神器Assetの入手処理を叩く処理 # # @input storage api: -# Argument.Rarity : (1 | 2 | 3 | 4) -# Argument.Important : boolean +# Argument.ID : int +# Argument.Important? : boolean (default: true) # @api # validate execute unless data storage api: Argument.ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" ID","color":"red"}] -# 既存にasset:context idが存在する場合に備えて退避させる - function asset_manager:common/context/id/stash -# 代入 - data modify storage asset:context id set from storage api: Argument.ID - data modify storage asset:context Type set value "drop" - data modify storage asset:context Important set from storage api: Argument.Important + execute unless data storage api: Argument.ID run return fail + execute unless data storage api: Argument.Important run data modify storage api: Argument.Important set value true # 呼び出し - execute if data storage api: Argument.ID run function #asset:artifact/give -# 退避させたasset:context idを戻す - function asset_manager:common/context/id/pop + data modify storage api: Argument.Type set value "drop" + function api:artifact/core/from_id # リセット - data remove storage asset:context Important data remove storage api: Argument.ID data remove storage api: Argument.Important + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/api/functions/artifact/spawn/from_rarity.mcfunction b/TheSkyBlessing/data/api/functions/artifact/spawn/from_rarity.mcfunction index 4bec0faf18..8e8a189b93 100644 --- a/TheSkyBlessing/data/api/functions/artifact/spawn/from_rarity.mcfunction +++ b/TheSkyBlessing/data/api/functions/artifact/spawn/from_rarity.mcfunction @@ -4,16 +4,17 @@ # # @input storage api: # Argument.Rarity : (1 | 2 | 3 | 4) -# Argument.Important : boolean +# Argument.Important? : boolean (default: fa;se) # @api # validate execute unless data storage api: Argument.Rarity run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません","color":"white"},{"text":" Rarity","color":"red"}] + execute unless data storage api: Argument.Rarity run return fail + execute unless data storage api: Argument.Important run data modify storage api: Argument.Important set value true # 呼び出し - data modify storage asset:context Type set value "drop" - data modify storage asset:context Important set from storage api: Argument.Important - execute if data storage api: Argument.Rarity run function asset_manager:artifact/give/ + data modify storage api: Argument.Type set value "drop" + function api:artifact/core/from_rarity/ # リセット - data remove storage asset:context Important data remove storage api: Argument.Rarity data remove storage api: Argument.Important + data remove storage api: Argument.Type diff --git a/TheSkyBlessing/data/asset/functions/artifact/alias/65534/attack.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/attack.mcfunction new file mode 100644 index 0000000000..c1a570817e --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/attack.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/alias/65534/attack +# +# 神器の攻撃時の処理のエイリアス +# +# @within asset_manager:artifact/triggers/attack/attack.m + +# 元の登録処理を呼び出す + function asset:artifact/ex.2/attack/ diff --git a/TheSkyBlessing/data/asset/functions/artifact/alias/65534/dis-equip.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/dis-equip.mcfunction new file mode 100644 index 0000000000..6af6c1f007 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/dis-equip.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/alias/65534/dis_equip +# +# 神器の装備解除時の処理のエイリアス +# +# @within asset_manager:artifact/triggers/dis_equip/dis-equip.m + +# 元の登録処理を呼び出す + function asset:artifact/ex.2/dis-equip/ diff --git a/TheSkyBlessing/data/asset/functions/artifact/alias/65534/equip.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/equip.mcfunction new file mode 100644 index 0000000000..d509fd391a --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/equip.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/alias/65534/equip +# +# 神器の装備時の処理のエイリアス +# +# @within asset_manager:artifact/triggers/equip/equip.m + +# 元の登録処理を呼び出す + function asset:artifact/ex.2/equip/ diff --git a/TheSkyBlessing/data/asset/functions/artifact/alias/65534/register.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/register.mcfunction new file mode 100644 index 0000000000..c0fa397183 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/alias/65534/register.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/alias/65534/register +# +# 神器のデータ指定処理のエイリアス +# +# @within asset_manager:artifact/triggers/register.m + +# 元の登録処理を呼び出す + function asset:artifact/ex.2/register diff --git a/TheSkyBlessing/data/asset/functions/artifact/alias/65535/attack.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/alias/65535/attack.mcfunction new file mode 100644 index 0000000000..c9bfce56b8 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/alias/65535/attack.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/alias/65535/attack +# +# 神器の攻撃時の処理のエイリアス +# +# @within asset_manager:artifact/triggers/attack/attack.m + +# 元の登録処理を呼び出す + function asset:artifact/ex.1/attack/ diff --git a/TheSkyBlessing/data/asset/functions/artifact/alias/65535/register.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/alias/65535/register.mcfunction new file mode 100644 index 0000000000..0a16490629 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/alias/65535/register.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/alias/65535/register +# +# 神器のデータ指定処理のエイリアス +# +# @within asset_manager:artifact/triggers/register.m + +# 元の登録処理を呼び出す + function asset:artifact/ex.1/register diff --git a/TheSkyBlessing/data/asset/functions/artifact/common/give.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/common/give.mcfunction deleted file mode 100644 index f5064dc24f..0000000000 --- a/TheSkyBlessing/data/asset/functions/artifact/common/give.mcfunction +++ /dev/null @@ -1,76 +0,0 @@ -#> asset:artifact/common/give -# -# 神器を入手します -# -# @input storage asset:artifact -# ID : int -# Item : ItemID -# Name : TextComponent -# Lore : TextComponent[] -# RemainingCount? : int -# Slot : Slot -# Trigger : Trigger -# Condition? : TextComponent -# EnableDuplication? : boolean -# AttackInfo? : Component -# MPCost : int -# MPRequire? : int -# CostText? : TextComponent -# LocalCooldown? : int -# SpecialCooldown? : int -# DisableCooldownMessage? : boolean -# DisableMPMessage? : boolean -# DisableBreakSound? : boolean -# CanUsedGod : God[] -# @output item 神器 -# @within function asset:artifact/*/give/2.give - -#> Inv -# @private -#declare score_holder $InvSize - -# storage検証 - execute unless data storage asset:artifact ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" ID","color":"red"}] - execute unless data storage asset:artifact Item run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Item","color":"red"}] - execute unless data storage asset:artifact Name run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Name","color":"red"}] - execute unless data storage asset:artifact Lore run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Lore","color":"red"}] - execute unless data storage asset:artifact Slot run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Slot","color":"red"}] - execute unless data storage asset:artifact Trigger run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Trigger","color":"red"}] - execute unless data storage asset:artifact MPCost run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" MPCost","color":"red"}] - execute unless data storage asset:artifact CanUsedGod run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" CanUsedGod","color":"red"}] -# 各データ設定 - function asset_manager:artifact/create/set_data -# 神器排出 - execute unless data storage asset:context Type run data modify storage asset:context Type set value "give" - # execute if data storage asset:context {Type:"box"} // 何もする必要がない - execute if data storage asset:context {Type:"drop"} run loot spawn ~ ~ ~ mine 10000 0 10000 debug_stick - execute if data storage asset:context {Type:"drop",Important:true} as @e[type=item,nbt={Item:{tag:{TSB:{}}}},distance=..0.3] run function asset:artifact/common/protect - execute if data storage asset:context {Type:"give"} run function api:inventory/get_size - execute if data storage asset:context {Type:"give"} if score $InvSize Lib matches ..35 run loot give @s mine 10000 0 10000 debug_stick - execute if data storage asset:context {Type:"give"} if score $InvSize Lib matches 36.. run loot spawn ~ ~ ~ mine 10000 0 10000 debug_stick - execute if data storage asset:context {Type:"give"} if score $InvSize Lib matches 36.. as @e[type=item,nbt={Item:{tag:{TSB:{}}}},distance=..0.3] run function asset:artifact/common/protect - execute if data storage asset:context {Type:"replace"} run function asset:artifact/common/replace - -# リセット - scoreboard players reset $InvSize Lib - data remove storage asset:context Type - data remove storage asset:artifact ID - data remove storage asset:artifact Item - data remove storage asset:artifact Name - data remove storage asset:artifact Lore - data remove storage asset:artifact RemainingCount - data remove storage asset:artifact Slot - data remove storage asset:artifact Trigger - data remove storage asset:artifact Condition - data remove storage asset:artifact EnableDuplication - data remove storage asset:artifact AttackInfo - data remove storage asset:artifact MPCost - data remove storage asset:artifact MPRequire - data remove storage asset:artifact CostText - data remove storage asset:artifact CanUsedGod - data remove storage asset:artifact CustomNBT - data remove storage asset:artifact LocalCooldown - data remove storage asset:artifact SpecialCooldown - data remove storage asset:artifact DisableCooldownMessage - data remove storage asset:artifact DisableMPMessage - data remove storage asset:artifact DisableBreakSound diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/.mcfunction new file mode 100644 index 0000000000..3a5d100fe6 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/.mcfunction @@ -0,0 +1,19 @@ +#> asset:artifact/ex.1/attack/ +# +# 神器の攻撃時の処理 +# +# @within function asset:artifact/alias/65535/attack + +# VFX + execute at @e[type=#lib:living,type=!player,tag=Victim,distance=..60] run particle dust -1 0 0 1 ~ ~1.5 ~ 0.05 1 0.05 0 30 + execute at @e[type=#lib:living,type=!player,tag=Victim,distance=..60] run playsound minecraft:entity.elder_guardian.curse player @a ~ ~ ~ 0.15 1.4 + +# 各エンティティにダメージを与える + data modify storage asset:temp ffff.Targets set from storage asset:context Attack.To + data modify storage asset:temp ffff.Amounts set from storage asset:context Attack.Amounts + execute if data storage asset:temp ffff.Targets[-1] run function asset:artifact/ex.1/attack/foreach/ + +# リセット + data remove storage asset:temp ffff.Targets + data remove storage asset:temp ffff.Amounts + function api:damage/reset diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/damage.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/damage.mcfunction new file mode 100644 index 0000000000..50b5e525a8 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/damage.mcfunction @@ -0,0 +1,18 @@ +#> asset:artifact/ex.1/attack/damage +# @within function asset:artifact/ex.1/attack/ + +#> private +# @private + #declare score_holder $Damage + #declare score_holder $Amplifier + +# ダメージを取得する + execute store result storage api: Argument.Damage float 0.20 run data get storage asset:context Attack.Amount + +# ダメージ/その他の設定 + data modify storage api: Argument.AttackType set value "Physical" + data modify storage api: Argument.ElementType set value "None" + execute if data storage asset:context this{Pierce:1b} run data modify storage api: Argument.FixedDamage set value 1b + execute as @p[tag=this] run function api:damage/modifier + function api:damage/ + function api:damage/reset diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/foreach/.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/foreach/.mcfunction new file mode 100644 index 0000000000..88774488e3 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/foreach/.mcfunction @@ -0,0 +1,19 @@ +#> asset:artifact/ex.1/attack/foreach/ +# @within function +# asset:artifact/ex.1/attack/ +# asset:artifact/ex.1/attack/foreach/ + +#> private +# @private + #declare score_holder $Target + +# 一つ抽出 + execute store result score $Target Temporary run data get storage asset:temp ffff.Targets[-1] + +# ターゲットを捜索する + execute as @e[type=#lib:living,type=!player,tag=Victim,distance=..60] if score @s MobUUID = $Target Temporary run function asset:artifact/ex.1/attack/foreach/damage + +# リセット&ループ + data remove storage asset:temp ffff.Targets[-1] + data remove storage asset:temp ffff.Amounts[-1] + execute if data storage asset:temp ffff.Targets[0] run function asset:artifact/ex.1/attack/foreach/ diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/foreach/damage.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/foreach/damage.mcfunction new file mode 100644 index 0000000000..2fd6b4ed23 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.1/attack/foreach/damage.mcfunction @@ -0,0 +1,10 @@ +#> asset:artifact/ex.1/attack/foreach/damage +# @within function asset:artifact/ex.1/attack/foreach/ + +execute store result storage api: Argument.Damage float 0.20 run data get storage asset:temp ffff.Amounts[-1] +data modify storage api: Argument.AttackType set value "Physical" +data modify storage api: Argument.ElementType set value "None" +data modify storage api: Argument.FixedDamage set value 1b +execute unless data storage api: {DamageLibModified:true} as @p[tag=this] run function api:damage/modifier +execute if data storage api: {DamageLibModified:true} as @p[tag=this] run function api:damage/modifier_continuation +function api:damage/ diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.1/register.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.1/register.mcfunction new file mode 100644 index 0000000000..731d9ba7ce --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.1/register.mcfunction @@ -0,0 +1,26 @@ +#> asset:artifact/ex.1/register +# +# 神器の作成部 ここでID等を定義する +# +# @within +# tag/function asset:artifact/register +# function asset:artifact/alias/65535/register + +# data modify storage asset:artifact Extends append value +# function asset:artifact/extends +data modify storage asset:artifact ExtendsSafe set value true +data modify storage asset:artifact IsAbstract set value false + +data modify storage asset:artifact ID set value 65535 +data modify storage asset:artifact Item set value "minecraft:stick" +data modify storage asset:artifact Name set value '{"text":"","extra":[{"text":"偽典・イーカロス","color":"red"}]}' +data modify storage asset:artifact Lore set value ['{"text":"遠き古に失われた魔術兵装。"}','{"text":"攻撃した敵の傷口をさらに開き、ダメージを与える。"}'] +# data modify storage asset:artifact CostText set value '{"text":""}' +# data modify storage asset:artifact RemainingCount set value +data modify storage asset:artifact Triggers set value [] +data modify storage asset:artifact Triggers append value {Slot:"hotbar",Trigger:"attack",AttackInfo:{Damage:["???"],AttackType:[Physical],ElementType:[None],IsrangeAttack:never},MPCost:20,LocalCooldown:50,DisableCooldownMessage:true,DisableMPMessage:true} +data modify storage asset:artifact CanUsedGod set value "ALL" +# data modify storage asset:artifact CustomNBT set value {} +# data modify storage asset:artifact Field set value {} + +execute unless data storage asset:artifact {Give:1b} run function asset_manager:artifact/give/put_data_to_map diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.2/attack/.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.2/attack/.mcfunction new file mode 100644 index 0000000000..ab30e0687c --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.2/attack/.mcfunction @@ -0,0 +1,15 @@ +#> asset:artifact/ex.2/attack/ +# +# 神器の攻撃時の処理 +# +# @within function asset:artifact/alias/65534/attack + +# VFX + execute at @e[type=#lib:living,type=!player,tag=Victim,distance=..60] run particle dust -1 0 0 1 ~ ~1.5 ~ 0.05 1 0.05 0 150 + execute at @e[type=#lib:living,type=!player,tag=Victim,distance=..60] run playsound minecraft:entity.elder_guardian.curse player @a ~ ~ ~ 0.6 1.4 + +# 各エンティティにダメージを与える + execute as @e[type=#lib:living,type=!player,tag=Victim,distance=..60] run function asset:artifact/ex.2/attack/damage + +# リセット + function api:damage/reset diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.2/attack/damage.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.2/attack/damage.mcfunction new file mode 100644 index 0000000000..653be2009a --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.2/attack/damage.mcfunction @@ -0,0 +1,10 @@ +#> asset:artifact/ex.2/attack/damage +# @within function asset:artifact/ex.2/attack/ + +execute store result storage api: Argument.Damage float 1 run function api:mob/get_max_health +data modify storage api: Argument.AttackType set value "Physical" +data modify storage api: Argument.ElementType set value "None" +data modify storage api: Argument.FixedDamage set value 1b +execute unless data storage api: {DamageLibModified:true} as @p[tag=this] run function api:damage/modifier +execute if data storage api: {DamageLibModified:true} as @p[tag=this] run function api:damage/modifier_continuation +function api:damage/ diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.2/dis-equip/.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.2/dis-equip/.mcfunction new file mode 100644 index 0000000000..ebfbeb970b --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.2/dis-equip/.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/ex.2/dis-equip/ +# +# 神器の装備解除時の処理 +# +# @within function asset:artifact/alias/65534/dis-equip + +# 演出 + playsound minecraft:item.armor.equip_generic player @a ~ ~ ~ 1 0.8 diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.2/equip/.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.2/equip/.mcfunction new file mode 100644 index 0000000000..56e3eb79ef --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.2/equip/.mcfunction @@ -0,0 +1,14 @@ +#> asset:artifact/ex.2/equip/ +# +# 神器の装備した時の処理 +# +# @within function asset:artifact/alias/65534/equip + +# VFX + playsound ogg:block.smithing_table.smithing_table2 player @a ~ ~ ~ 0.5 1.6 + playsound minecraft:item.armor.equip_iron player @a ~ ~ ~ 0.5 1 + playsound ogg:random.levelup player @a ~ ~ ~ 0.6 2 + particle dust 0.278 0.733 1 1 ~ ~1 ~ 0.2 0.2 0.2 0 20 + particle crit ~ ~1 ~ 0 0 0 0.5 10 + particle dust 100000000 1 1 1 ~ ~1.5 ~ 0.5 1 0.5 0 150 + playsound minecraft:block.beacon.activate player @a ~ ~ ~ 1 2 diff --git a/TheSkyBlessing/data/asset/functions/artifact/ex.2/register.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/ex.2/register.mcfunction new file mode 100644 index 0000000000..3e24140935 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/ex.2/register.mcfunction @@ -0,0 +1,32 @@ +#> asset:artifact/ex.2/register +# +# 神器の作成部 ここでID等を定義する +# +# @within +# tag/function asset:artifact/register +# function asset:artifact/alias/65534/register + +data modify storage asset:artifact Extends append value 65535 +function asset:artifact/extends +# data modify storage asset:artifact ExtendsSafe set value true +# data modify storage asset:artifact IsAbstract set value false + +data modify storage asset:artifact ID set value 65534 +# data modify storage asset:artifact Item set value +data modify storage asset:artifact Name set value '{"text":"","extra":[{"text":"イーカロス","color":"dark_red"}]}' +data modify storage asset:artifact Lore set value ['{"text":"ある地に潜む研究者の末裔が作り出した、"}','{"text":"対天使兵器の最高傑作。"}','{"text":"攻撃した敵の傷口をさらに開き、致命傷に至らせる。"}','{"text":"「いかなる犠牲によっても、","color":"gray","italic":true}','{"text":"かの翼人らを討ち滅ぼさなければならぬのだ。」","color":"gray","italic":true}'] +# data modify storage asset:artifact CostText set value '{"text":""}' +# data modify storage asset:artifact RemainingCount set value +data modify storage asset:artifact Triggers set value [] +data modify storage asset:artifact Triggers append value {Slot:"hotbar",Trigger:"attack",AttackInfo:{Damage:["???"],AttackType:[Physical],ElementType:[None],BypassResist:1b,IsrangeAttack:never},MPCost:100,LocalCooldown:0,DisableCooldownMessage:true,DisableMPMessage:true} +data modify storage asset:artifact Triggers append value {Slot:"hotbar",Trigger:"equip",MPCost:0,Secret:true} +data modify storage asset:artifact Modifiers set value [] +data modify storage asset:artifact Modifiers append value {Type:"attack/base",Amount:0.05d,Operation:"multiply_base",MaxStack:9} +data modify storage asset:artifact Modifiers append value {Type:"defense/base",Amount:0.05d,Operation:"multiply_base",MaxStack:9} +data modify storage asset:artifact Modifiers append value {Type:"max_health",Amount:0.025d,Operation:"multiply_base",MaxStack:9} +data modify storage asset:artifact Modifiers append value {Type:"max_mp",Amount:0.025d,Operation:"multiply_base",MaxStack:9} +data modify storage asset:artifact CanUsedGod set value "ALL" +# data modify storage asset:artifact CustomNBT set value {} +# data modify storage asset:artifact Field set value {} + +execute unless data storage asset:artifact {Give:1b} run function asset_manager:artifact/give/put_data_to_map diff --git a/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction deleted file mode 100644 index 1e15127ada..0000000000 --- a/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -#> asset:artifact/example/give/2.give -# -# 神器の作成部 ここでID等を定義する -# -# @user -# @private - -# 神器の説明や消費MPなどをここで設定する。 -# 最後にasset:artifact/common/giveを実行することで入手可能。 - -data modify storage asset:artifact ID set value 2147483647 -data modify storage asset:artifact Item set value "minecraft:raw_gold" -data modify storage asset:artifact Name set value '{"text":"雷のブローチ","color":"yellow"}' -data modify storage asset:artifact Lore set value ['{"text":"攻撃を与えたとき、対象に"}','{"text":"現在体力に依存した割合攻撃を追加与える"}','{"text":""}'] -# data modify storage asset:artifact CostText set value '{"text":""}' -data modify storage asset:artifact RemainingCount set value 50 -data modify storage asset:artifact Slot set value "hotbar" -data modify storage asset:artifact Trigger set value "onAttack" -# data modify storage asset:artifact Condition set value '{"text":""}' -# data modify storage asset:artifact AttackInfo set value {Damage:[0,0],AttackType:[Physical,Magic],ElementType:[Fire,Water,Thunder,None],BypassResist:1b,IsrangeAttack:never} -data modify storage asset:artifact MPCost set value 20 -# data modify storage asset:artifact MPRequire set value 100 -data modify storage asset:artifact LocalCooldown set value 40 -# data modify storage asset:artifact SpecialCooldown set value 5 -data modify storage asset:artifact CanUsedGod set value ["Flora","Nyaptov","Wi-ki"] -# data modify storage asset:artifact CustomNBT set value {Unbreakable:1b} - -function asset:artifact/common/give \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/1.trigger.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/example/trigger/1.trigger.mcfunction deleted file mode 100644 index 7455ff4e0e..0000000000 --- a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/1.trigger.mcfunction +++ /dev/null @@ -1,9 +0,0 @@ -#> asset:artifact/example/trigger/1.trigger -# -# 指定したイベントタイミングで実行されるfunction -# ここで自身の神器が判定をしてmain処理を呼び出す -# -# @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 \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/2.check_condition.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/example/trigger/2.check_condition.mcfunction deleted file mode 100644 index 7a394f7519..0000000000 --- a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/2.check_condition.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -#> asset:artifact/example/trigger/2.check_condition -# -# 神器の発動条件をチェックします -# -# @within function asset:artifact/example/trigger/1.trigger - -# 神器IDの設定 - data modify storage asset:artifact TargetID set value 2147483647 -# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く - function asset:artifact/common/check_condition/hotbar -# CanUsedタグをチェックして3.main.mcfunctionを実行する - execute if entity @s[tag=CanUsed] run function asset:artifact/example/trigger/3.main \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/3.main.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/example/trigger/3.main.mcfunction deleted file mode 100644 index 4c448a594c..0000000000 --- a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/3.main.mcfunction +++ /dev/null @@ -1,33 +0,0 @@ -#> asset:artifact/example/trigger/3.main -# -# 神器のメイン処理部 -# -# @within function asset:artifact/example/trigger/2.check_condition - -#> health -# @private - #declare score_holder $Health - #declare score_holder $Count - -# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う - function asset:artifact/common/use/hotbar - -# ここから先は神器側の効果の処理を書く -# VFX - execute at @e[type=#lib:living,type=!player,tag=Victim,distance=..70,limit=1] run particle dust 100000000 100000000 0 1 ~ ~1.5 ~ 0.05 1 0.05 0 150 - execute at @e[type=#lib:living,type=!player,tag=Victim,distance=..70,limit=1] run playsound entity.lightning_bolt.impact player @a -# 個数を取得 - execute store result score $Count Temporary if data storage asset:context Items.hotbar[{tag:{TSB:{ID:2147483647}}}] -# ダメージ - execute store result score $Health Temporary run data get entity @e[type=#lib:living,type=!player,tag=Victim,distance=..70,limit=1] AbsorptionAmount 100 - scoreboard players operation $Count Temporary *= $5 Const - scoreboard players operation $Count Temporary += $10 Const - scoreboard players operation $Health Temporary *= $Count Temporary - scoreboard players operation $Health Temporary /= $100 Const - execute store result storage lib: Argument.Damage float 0.01 run scoreboard players get $Health Temporary -# ダメージ/その他の設定 - data modify storage lib: Argument.AttackType set value "Magic" - data modify storage lib: Argument.ElementType set value "Thunder" - data modify storage lib: Argument.FixedDamage set value 1b - function lib:damage/modifier - execute as @e[type=#lib:living,type=!player,tag=Victim,distance=..70,limit=1] run function lib:damage/ \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/functions/artifact/extends.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/extends.mcfunction new file mode 100644 index 0000000000..03a0a6c54f --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/extends.mcfunction @@ -0,0 +1,27 @@ +#> asset:artifact/extends +# +# +# +# @within function asset:artifact/*/register + +# 継承情報を保存する + function asset_manager:artifact/give/put_id_to_map + +# 既存にasset:context idが存在する場合に備えて退避させる + function asset_manager:common/context/id/stash + +# 再帰時に使うデータをスタックに積む + data modify storage asset:artifact CopiedExtends append from storage asset:artifact Extends + data modify storage asset:artifact IsFirstExtend append value {_:{_:true}} +# Extends を削除する + data remove storage asset:artifact Extends + +# 継承先を一つ一つ辿っていく + function asset:artifact/extends/foreach + +# リセット + data remove storage asset:artifact IsFirstExtend[-1] + data remove storage asset:artifact CopiedExtends[-1] + data remove storage asset:artifact Extends +# 退避させたデータを戻す + function asset_manager:common/context/id/pop diff --git a/TheSkyBlessing/data/asset/functions/artifact/extends/foreach.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/extends/foreach.mcfunction new file mode 100644 index 0000000000..c99ffe4fd9 --- /dev/null +++ b/TheSkyBlessing/data/asset/functions/artifact/extends/foreach.mcfunction @@ -0,0 +1,31 @@ +#> asset:artifact/extends/foreach +# +# +# +# @within function +# asset:artifact/extends +# asset:artifact/extends/foreach + +# IDを取得 + data modify storage asset:context id set from storage asset:artifact CopiedExtends[-1][0] + +# 取得したIDを用いてマクロを実行する + function asset_manager:artifact/give/register.m with storage asset:context + +# データチェック + execute unless data storage asset:artifact ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"次のIDのArtifactは存在しません: "},{"storage":"asset:context","nbt":"id"}] + execute unless data storage asset:artifact {ExtendsSafe:true} run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"次のIDのArtifactを継承することは出来ません: "},{"storage":"asset:context","nbt":"id"}] + execute if data storage asset:artifact IsFirstExtend[-1]._{_:false} unless data storage asset:artifact {IsAbstract:true} run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"二つ目以降の Extends には抽象 Artifact のみ指定することができます。"},{"storage":"asset:context","nbt":"id"}] + execute if data storage asset:artifact IsFirstExtend[-1]._{_:false} unless data storage asset:artifact {IsAbstract:true} run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"原因: ID "},{"storage":"asset:context","nbt":"id"},{"text":" を継承する Artifact"}] + +# リセット + data remove storage asset:artifact ExtendsSafe + +# 先頭削除 (Extends が十分に小さいことがわかっているため先頭再帰する) + data remove storage asset:artifact CopiedExtends[-1][0] + +# 最初の継承じゃないことをマークする + data modify storage asset:artifact IsFirstExtend[-1]._._ set value false + +# 要素があれば再帰 + execute if data storage asset:artifact CopiedExtends[-1][0] run function asset:artifact/extends/foreach diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/attack.json b/TheSkyBlessing/data/asset/tags/functions/artifact/attack.json deleted file mode 100644 index bdd084cc78..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/attack.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "asset:artifact/example/trigger/1.trigger" - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/attack/explosion.json b/TheSkyBlessing/data/asset/tags/functions/artifact/attack/explosion.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/attack/explosion.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/attack/projectile.json b/TheSkyBlessing/data/asset/tags/functions/artifact/attack/projectile.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/attack/projectile.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/click.carrot_on_a_stick.json b/TheSkyBlessing/data/asset/tags/functions/artifact/click.carrot_on_a_stick.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/click.carrot_on_a_stick.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/drowning.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/drowning.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/drowning.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/explosion.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/explosion.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/explosion.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/fire.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/fire.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/fire.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/freezing.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/freezing.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/freezing.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/blocked.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/blocked.json deleted file mode 100644 index d8df97c7b4..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/blocked.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/explosion.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/explosion.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/explosion.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/melee.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/melee.json deleted file mode 100644 index d8df97c7b4..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/melee.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/projectile.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/projectile.json deleted file mode 100644 index d8df97c7b4..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/from_entity/projectile.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/lightning.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/lightning.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/lightning.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/melee.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/melee.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/melee.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/other.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/other.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/other.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/projectile.json b/TheSkyBlessing/data/asset/tags/functions/artifact/damage/projectile.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/damage/projectile.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/dis_equip.json b/TheSkyBlessing/data/asset/tags/functions/artifact/dis_equip.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/dis_equip.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/attack/melee.json b/TheSkyBlessing/data/asset/tags/functions/artifact/enroll_pool.json similarity index 100% rename from TheSkyBlessing/data/asset/tags/functions/artifact/attack/melee.json rename to TheSkyBlessing/data/asset/tags/functions/artifact/enroll_pool.json diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/equip.json b/TheSkyBlessing/data/asset/tags/functions/artifact/equip.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/equip.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/give.json b/TheSkyBlessing/data/asset/tags/functions/artifact/give.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/give.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/heal.json b/TheSkyBlessing/data/asset/tags/functions/artifact/heal.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/heal.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/killed.json b/TheSkyBlessing/data/asset/tags/functions/artifact/killed.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/killed.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/killed/explosion.json b/TheSkyBlessing/data/asset/tags/functions/artifact/killed/explosion.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/killed/explosion.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/killed/melee.json b/TheSkyBlessing/data/asset/tags/functions/artifact/killed/melee.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/killed/melee.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/killed/projectile.json b/TheSkyBlessing/data/asset/tags/functions/artifact/killed/projectile.json deleted file mode 100644 index d8df97c7b4..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/killed/projectile.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/receive_heal.json b/TheSkyBlessing/data/asset/tags/functions/artifact/receive_heal.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/receive_heal.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/register.json b/TheSkyBlessing/data/asset/tags/functions/artifact/register.json index 5c922d2bbf..b19b386e7b 100644 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/register.json +++ b/TheSkyBlessing/data/asset/tags/functions/artifact/register.json @@ -1,5 +1,6 @@ { "values": [ - + "asset:artifact/ex.1/register", + "asset:artifact/ex.2/register" ] } diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/.json deleted file mode 100644 index 66fe5a47c6..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/10s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/10s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/10s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/1s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/1s.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/1s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/2s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/2s.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/2s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/3s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/3s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/3s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/4s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/4s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/4s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/5s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/5s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/5s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/10s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/10s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/10s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/1s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/1s.json deleted file mode 100644 index 66fe5a47c6..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/1s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/2s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/2s.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/2s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/3s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/3s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/3s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/4s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/4s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/4s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/5s.json b/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/5s.json deleted file mode 100644 index 0d17807366..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/sneak/keep/5s.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} \ No newline at end of file diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/tick.json b/TheSkyBlessing/data/asset/tags/functions/artifact/tick.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/tick.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/use_item.json b/TheSkyBlessing/data/asset/tags/functions/artifact/use_item.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/use_item.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset/tags/functions/artifact/using_item.json b/TheSkyBlessing/data/asset/tags/functions/artifact/using_item.json deleted file mode 100644 index 5c922d2bbf..0000000000 --- a/TheSkyBlessing/data/asset/tags/functions/artifact/using_item.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - - ] -} diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/_index.d.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/_index.d.mcfunction index 3243085f40..49d8e22203 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/_index.d.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/_index.d.mcfunction @@ -3,12 +3,9 @@ #> storage # @within * +# api:artifact/core/** +# asset:artifact/** # asset_manager:artifact/** -# asset:artifact/*/register -# asset:artifact/*/give/2.give -# asset:artifact/*/trigger/2.check_condition -# asset:artifact/*/trigger/3.main -# asset:artifact/common/** # player_manager:actionbar/ #declare storage asset:artifact @@ -29,12 +26,11 @@ #declare tag TriggerFlag.Sneak #declare tag TriggerFlag.UsingItem - #> バニラの攻撃を扱う用 # @within function # asset_manager:artifact/check/ # asset_manager:artifact/triggers/attack/** -#declare tag ShouldVanillaAttack + #declare tag ShouldVanillaAttack #> check用の失敗フラグ # @within function @@ -59,8 +55,6 @@ #declare tag Victim #declare tag Healer #declare tag Receiver - #declare tag Equip - #declare tag DisEquip #> セレクターテンプレート # @within * asset:artifact/** @@ -72,8 +66,16 @@ #declare score_holder $Value #declare score_holder $NormalizedValue #declare score_holder $Max + #declare score_holder $MaxCD #> リセット用 -# @within function asset_manager:artifact/triggers/equipments/update_cooldown/* +# @within function asset_manager:artifact/triggers/equipments/update_cooldown/** #declare score_holder $Tick + #declare score_holder $Max #declare score_holder $LatestUsedTick + +#> スロットの数値化 +# @within function +# asset_manager:artifact/data/new/fetch_data/* +# asset_manager:artifact/triggers/* + #declare score_holder $SlotIndex diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/check/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/check/.mcfunction index ce76989595..2052571632 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/check/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/check/.mcfunction @@ -2,11 +2,7 @@ # # 実行可能かどうかのチェックを行う # -# @input -# as player -# storage asset:artifact TargetSlot : Slot -# @output tag @s CanUsed -# @within function asset:artifact/common/check_condition/* +# @within function asset_manager:artifact/triggers/ # 対象スロットのデータの取得 function asset_manager:artifact/data/current/get diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/.mcfunction index 49cd84d39a..1e0870ca4f 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/.mcfunction @@ -4,7 +4,7 @@ # # @within function asset_manager:artifact/tick/player -#! LocalCoolDown +#! LocalCooldown # 0. offhand # 1. feet # 2. legs @@ -22,12 +22,12 @@ # EntityStorage呼び出し function oh_my_dat:please -# 長いので一度コピーしましょう - data modify storage asset:artifact LCDs set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown +# データを取り出す + data modify storage asset:artifact LCDs set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown # 各スロットのCDをデクリメントする LCDs(normal) -> DecrementedLCDs(inverted) - function asset_manager:artifact/cooldown/mini_bar/foreach_decrement + function asset_manager:artifact/cooldown/decrement/ # 各スロットのCDを表示用に正規化 + DecrementedLCDs(inverted) -> ( LCDs(normal), NormalizedLCDs(normal) ) - function asset_manager:artifact/cooldown/mini_bar/normalize_and_revert_lcds + function asset_manager:artifact/cooldown/normalize/ # 各スロットのCD表示を構築 data modify storage asset:artifact MiniBars.Offhand set from storage asset:artifact NormalizedLCDs[0] data modify storage asset:artifact MiniBars.Feet set from storage asset:artifact NormalizedLCDs[1] @@ -43,13 +43,26 @@ data modify storage asset:artifact MiniBars.Hotbar6 set from storage asset:artifact NormalizedLCDs[11] data modify storage asset:artifact MiniBars.Hotbar7 set from storage asset:artifact NormalizedLCDs[12] data modify storage asset:artifact MiniBars.Hotbar8 set from storage asset:artifact NormalizedLCDs[13] - function asset_manager:artifact/cooldown/mini_bar/construct_message.m with storage asset:artifact MiniBars + function asset_manager:artifact/cooldown/mini_bar.m with storage asset:artifact MiniBars # プレイヤーの現在スロット function api:data_get/selected_item_slot +# 該当スロットからCooldownの情報を取得する + execute if data storage api: {SelectedItemSlot:0} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[05] + execute if data storage api: {SelectedItemSlot:1} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[06] + execute if data storage api: {SelectedItemSlot:2} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[07] + execute if data storage api: {SelectedItemSlot:3} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[08] + execute if data storage api: {SelectedItemSlot:4} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[09] + execute if data storage api: {SelectedItemSlot:5} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[10] + execute if data storage api: {SelectedItemSlot:6} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[11] + execute if data storage api: {SelectedItemSlot:7} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[12] + execute if data storage api: {SelectedItemSlot:8} run data modify storage asset:artifact MainBar.Value set from storage asset:artifact NormalizedLCDs[13] # メインハンドを設定する - function asset_manager:artifact/cooldown/main_bar/ +# (Cooldown = -14..0) なら色を変更しておく // 実際は0に矯正されている + data modify storage asset:artifact MainBar.Color set value "#00D3FF" + execute if data storage asset:artifact MainBar{Value:0} run data modify storage asset:artifact MainBar.Color set value "#74E72A" + function asset_manager:artifact/cooldown/main_bar.m with storage asset:artifact MainBar # 元に戻す - data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown set from storage asset:artifact LCDs + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown set from storage asset:artifact LCDs # リセット scoreboard players reset $Value Temporary scoreboard players reset $NormalizedValue Temporary diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/decrement/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/decrement/.mcfunction new file mode 100644 index 0000000000..9ca4b3157c --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/decrement/.mcfunction @@ -0,0 +1,15 @@ +#> asset_manager:artifact/cooldown/decrement/ +# +# +# +# @within function +# asset_manager:artifact/cooldown/ +# asset_manager:artifact/cooldown/decrement/ + +# 末尾に追加 + data modify storage asset:artifact DecrementedLCDs append value [] +# それぞれ減算処理を行う + execute if data storage asset:artifact LCDs[-1][0] run function asset_manager:artifact/cooldown/decrement/foreach +# リセット & ループ + data remove storage asset:artifact LCDs[-1] + execute if data storage asset:artifact LCDs[0] run function asset_manager:artifact/cooldown/decrement/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/decrement/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/decrement/foreach.mcfunction new file mode 100644 index 0000000000..9c431b50b7 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/decrement/foreach.mcfunction @@ -0,0 +1,15 @@ +#> asset_manager:artifact/cooldown/decrement/foreach +# +# +# +# @within function asset_manager:artifact/cooldown/decrement/* + +# デクリメント + data modify storage asset:artifact DecrementedLCDs[-1] append from storage asset:artifact LCDs[-1][-1] + execute store result score $Value Temporary run data get storage asset:artifact LCDs[-1][-1].Value + execute if score $Value Temporary matches -14.. run scoreboard players remove $Value Temporary 1 + execute store result storage asset:artifact DecrementedLCDs[-1][-1].Value int 1 run scoreboard players get $Value Temporary +# 末尾削除 + data remove storage asset:artifact LCDs[-1][-1] +# 要素があれば再帰 + execute if data storage asset:artifact LCDs[-1][0] run function asset_manager:artifact/cooldown/decrement/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar/construct_message.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar.m.mcfunction similarity index 67% rename from TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar/construct_message.m.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar.m.mcfunction index 3eee7899a5..ef4749cb01 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar/construct_message.m.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar.m.mcfunction @@ -1,7 +1,7 @@ -#> asset_manager:artifact/cooldown/main_bar/construct_message.m +#> asset_manager:artifact/cooldown/main_bar.m # # actionbarに表示するtext componentを構築 # -# @within function asset_manager:artifact/cooldown/main_bar/ +# @within function asset_manager:artifact/cooldown/ $data modify storage asset:artifact MainBarMessage set value ['{"text":"\\uC051","font":"space"}','{"text":"\\u$(Value)","font":"cooldown/main_bar","color":"$(Color)"}','{"text":"\\uC051","font":"space"}'] diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar/.mcfunction deleted file mode 100644 index 1a15b195df..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/main_bar/.mcfunction +++ /dev/null @@ -1,35 +0,0 @@ -#> asset_manager:artifact/cooldown/main_bar/ -# -# -# -# @within function asset_manager:artifact/cooldown/ - -# 該当スロットからCooldownの情報を取得する - execute if data storage api: {SelectedItemSlot:0} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[5] - execute if data storage api: {SelectedItemSlot:1} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[6] - execute if data storage api: {SelectedItemSlot:2} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[7] - execute if data storage api: {SelectedItemSlot:3} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[8] - execute if data storage api: {SelectedItemSlot:4} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[9] - execute if data storage api: {SelectedItemSlot:5} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[10] - execute if data storage api: {SelectedItemSlot:6} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[11] - execute if data storage api: {SelectedItemSlot:7} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[12] - execute if data storage api: {SelectedItemSlot:8} run data modify storage asset:artifact TargetLCD set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[13] -# 取得 - execute store result score $Value Temporary run data get storage asset:artifact TargetLCD.Value - execute store result score $Max Temporary run data get storage asset:artifact TargetLCD.Max -# valueが負数(!= -15)なら0にする - execute if score $Value Temporary matches -14..-1 run scoreboard players set $Value Temporary 0 -# 0~100の範囲にする - scoreboard players operation $Value Temporary *= $-100 Const - scoreboard players operation $Value Temporary /= $Max Temporary - scoreboard players operation $Value Temporary *= $-1 Const -# ゼロパディングの代わりに+1000してstorageに保存 - scoreboard players operation $NormalizedValue Temporary = $Value Temporary - scoreboard players add $NormalizedValue Temporary 1000 - execute store result storage asset:artifact MainBar.Value int 1 run scoreboard players get $NormalizedValue Temporary -# if (Maxが0では無い && Valueが負数で無い) ならば表示バーを構築する // ここで負数であるのは-15の場合のみ。 - execute unless score $Max Temporary matches 0 if score $Value Temporary matches 1.. run data modify storage asset:artifact MainBar.Color set value "#00D3FF" - execute unless score $Max Temporary matches 0 if score $Value Temporary matches 0 run data modify storage asset:artifact MainBar.Color set value "#74E72A" - execute unless score $Max Temporary matches 0 if score $Value Temporary matches 0.. run function asset_manager:artifact/cooldown/main_bar/construct_message.m with storage asset:artifact MainBar -# リセット - data remove storage asset:artifact TargetLCD diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/construct_message.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar.m.mcfunction similarity index 96% rename from TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/construct_message.m.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar.m.mcfunction index a05b79041e..04c702ffa2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/construct_message.m.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar.m.mcfunction @@ -1,4 +1,4 @@ -#> asset_manager:artifact/cooldown/mini_bar/construct_message.m +#> asset_manager:artifact/cooldown/mini_bar.m # # actionbarに表示するtext componentを構築 # diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/foreach_decrement.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/foreach_decrement.mcfunction deleted file mode 100644 index d0da43d4ae..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/foreach_decrement.mcfunction +++ /dev/null @@ -1,17 +0,0 @@ -#> asset_manager:artifact/cooldown/mini_bar/foreach_decrement -# -# -# -# @within function -# asset_manager:artifact/cooldown/ -# asset_manager:artifact/cooldown/mini_bar/foreach_decrement - -# デクリメント - data modify storage asset:artifact DecrementedLCDs append from storage asset:artifact LCDs[-1] - execute store result score $Value Temporary run data get storage asset:artifact LCDs[-1].Value - execute if score $Value Temporary matches -14.. run scoreboard players remove $Value Temporary 1 - execute store result storage asset:artifact DecrementedLCDs[-1].Value int 1 run scoreboard players get $Value Temporary -# 末尾削除 - data remove storage asset:artifact LCDs[-1] -# 要素があれば再帰 - execute if data storage asset:artifact LCDs[0] run function asset_manager:artifact/cooldown/mini_bar/foreach_decrement diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize/.mcfunction new file mode 100644 index 0000000000..d634cba08e --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize/.mcfunction @@ -0,0 +1,57 @@ +#> asset_manager:artifact/cooldown/normalize/ +# +# +# +# @within function +# asset_manager:artifact/cooldown/ +# asset_manager:artifact/cooldown/normalize/ + +#! MiniBar +# \u1000 16/16 +# \u1001 15/16 +# \u1002 14/16 +# \u1003 13/16 +# \u1004 12/16 +# \u1005 11/16 +# \u1006 10/16 +# \u1007 9/16 +# \u1008 8/16 +# \u1009 7/16 +# \u1010 6/16 +# \u1011 5/16 +# \u1012 4/16 +# \u1013 3/16 +# \u1014 2/16 +# \u1015 1/16 +# \u1016 0/16 +# \u9999 null + +# LCDsに枠を追加する + data modify storage asset:artifact LCDs append value [] +# 各スロットごとに必要な値を算出する + # prefill + scoreboard players set $NormalizedValue Temporary -15 + # 値がない場合 + # 神器ではないかトリガーのない神器なので、問答無用でバー消し + # execute unless data storage asset:artifact DecrementedLCDs[-1][0] run scoreboard players set $NormalizedValue Temporary -15 + # 値がある場合 + # CDが最大かつ、終了していないものの現在値を抽出 ($NormalizedValue) + # CDが0の神器もバーを表示させるべきではないので弾く + # ついでに配列の並び順も元に戻す + execute if data storage asset:artifact DecrementedLCDs[-1][0] run scoreboard players set $MaxCD Temporary 0 + execute if data storage asset:artifact DecrementedLCDs[-1][0] run function asset_manager:artifact/cooldown/normalize/foreach + # valueが負数(!= -15)なら0にする + execute if score $NormalizedValue Temporary matches -14..-1 run scoreboard players set $NormalizedValue Temporary 0 + # 0~16の範囲に切り上げで補正する + scoreboard players operation $NormalizedValue Temporary *= $-16 Const + scoreboard players operation $NormalizedValue Temporary /= $Max Temporary + scoreboard players operation $NormalizedValue Temporary *= $-1 Const + # ゼロパディングの代わりに+1000する + scoreboard players add $NormalizedValue Temporary 1000 + # NormalizedLCDsに追加 + data modify storage asset:artifact NormalizedLCDs append value 9999 + execute unless score $Value Temporary matches -15 store result storage asset:artifact NormalizedLCDs[-1] int 1 run scoreboard players get $NormalizedValue Temporary +# 要素を削除し、残っているなら再帰 + scoreboard players reset $MaxCD Temporary + data remove storage asset:artifact DecrementedLCDs[-1] + execute if data storage asset:artifact DecrementedLCDs[-1] run function asset_manager:artifact/cooldown/normalize/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize/foreach.mcfunction new file mode 100644 index 0000000000..47d5d3f713 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize/foreach.mcfunction @@ -0,0 +1,16 @@ +#> asset_manager:artifact/cooldown/normalize/foreach +# +# +# +# @within function asset_manager:artifact/cooldown/normalize/* + +# LCDsにそのまま戻す + data modify storage asset:artifact LCDs[-1] append from storage asset:artifact DecrementedLCDs[-1][-1] +# 取得 + execute store result score $Value Temporary run data get storage asset:artifact DecrementedLCDs[-1][-1].Value + execute store result score $Max Temporary run data get storage asset:artifact DecrementedLCDs[-1][-1].Max +# 条件を満たしているなら更新 + execute if score $Max Temporary > $MaxCD Temporary if score $Value Temporary matches 1.. run scoreboard players operation $NormalizedValue Temporary = $Value Temporary + execute if score $Max Temporary > $MaxCD Temporary if score $Value Temporary matches 1.. run scoreboard players operation $MaxCD Temporary > $Max Temporary +# 要素を削除し、残っているなら再帰 + data remove storage asset:artifact DecrementedLCDs[-1][-1] diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/normalize_and_revert_lcds.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize_and_revert_lcds.mcfunction similarity index 90% rename from TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/normalize_and_revert_lcds.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize_and_revert_lcds.mcfunction index d757330383..61ca9f773a 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/mini_bar/normalize_and_revert_lcds.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/cooldown/normalize_and_revert_lcds.mcfunction @@ -1,10 +1,10 @@ -#> asset_manager:artifact/cooldown/mini_bar/normalize_and_revert_lcds +#> asset_manager:artifact/cooldown/normalize_and_revert_lcds # # # # @within function # asset_manager:artifact/cooldown/ -# asset_manager:artifact/cooldown/mini_bar/normalize_and_revert_lcds +# asset_manager:artifact/cooldown/normalize_and_revert_lcds #! MiniBar # \u1000 16/16 @@ -50,4 +50,4 @@ # 末尾削除 data remove storage asset:artifact DecrementedLCDs[-1] # 要素があれば再帰 - execute if data storage asset:artifact DecrementedLCDs[0] run function asset_manager:artifact/cooldown/mini_bar/normalize_and_revert_lcds + execute if data storage asset:artifact DecrementedLCDs[0] run function asset_manager:artifact/cooldown/normalize_and_revert_lcds diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/lore_append.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/lore_append.mcfunction index 13f34465dc..9391637130 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/lore_append.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/lore_append.mcfunction @@ -8,9 +8,10 @@ # @within function # asset_manager:artifact/create/lore_append # asset_manager:artifact/create/set_lore +# asset_manager:artifact/create/set_equipment loot replace block 10000 0 10000 container.0 loot asset_manager:artifact/get_lore data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[0].tag.display.Lore[0] data remove storage asset:artifact Lore[0] -execute if data storage asset:artifact Lore[0] run function asset_manager:artifact/create/lore_append \ No newline at end of file +execute if data storage asset:artifact Lore[0] run function asset_manager:artifact/create/lore_append diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/modifier/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/modifier/.mcfunction new file mode 100644 index 0000000000..a092a9b848 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/modifier/.mcfunction @@ -0,0 +1,100 @@ +#> asset_manager:artifact/create/modifier/ +# +# 装備時効果の内容をLoreに追加 +# +# @within function +# asset_manager:artifact/create/set_lore +# asset_manager:artifact/create/modifier/ + +#> temp +# @private + #declare score_holder $AmountFrac + #declare score_holder $AmountFrac2 + #declare score_holder $AmountInt + #declare score_holder $CustomModifier + +# 変数を用意 + scoreboard players set $CustomModifier Temporary 0 + data modify storage asset:artifact Modifier set from storage asset:artifact CopiedModifiers[0] + data modify storage asset:artifact Line set value ['{"text":"","color":"green","italic":false}','""','" +"','{"translate":"%s","with":[{"storage":"asset:artifact","nbt":"Amount.Int"}]}','""'] + +# カスタムModifier + execute if data storage asset:artifact Modifier{Type:"attack/base"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"attack/base"} run data modify storage asset:artifact Line[1] set value '"攻撃"' + execute if data storage asset:artifact Modifier{Type:"attack/fire"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"attack/fire"} run data modify storage asset:artifact Line[1] set value '"火攻撃"' + execute if data storage asset:artifact Modifier{Type:"attack/magic"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"attack/magic"} run data modify storage asset:artifact Line[1] set value '"魔法攻撃"' + execute if data storage asset:artifact Modifier{Type:"attack/physical"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"attack/physical"} run data modify storage asset:artifact Line[1] set value '"物理攻撃"' + execute if data storage asset:artifact Modifier{Type:"attack/thunder"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"attack/thunder"} run data modify storage asset:artifact Line[1] set value '"雷攻撃"' + execute if data storage asset:artifact Modifier{Type:"attack/water"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"attack/water"} run data modify storage asset:artifact Line[1] set value '"水攻撃"' + execute if data storage asset:artifact Modifier{Type:"defense/base"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"defense/base"} run data modify storage asset:artifact Line[1] set value '"耐性"' + execute if data storage asset:artifact Modifier{Type:"defense/fire"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"defense/fire"} run data modify storage asset:artifact Line[1] set value '"火耐性"' + execute if data storage asset:artifact Modifier{Type:"defense/magic"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"defense/magic"} run data modify storage asset:artifact Line[1] set value '"魔法耐性"' + execute if data storage asset:artifact Modifier{Type:"defense/physical"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"defense/physical"} run data modify storage asset:artifact Line[1] set value '"物理耐性"' + execute if data storage asset:artifact Modifier{Type:"defense/thunder"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"defense/thunder"} run data modify storage asset:artifact Line[1] set value '"雷耐性"' + execute if data storage asset:artifact Modifier{Type:"defense/water"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"defense/water"} run data modify storage asset:artifact Line[1] set value '"水耐性"' + execute if data storage asset:artifact Modifier{Type:"heal"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"heal"} run data modify storage asset:artifact Line[1] set value '"回復量"' + execute if data storage asset:artifact Modifier{Type:"receive_heal"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"receive_heal"} run data modify storage asset:artifact Line[1] set value '"被回復量"' + execute if data storage asset:artifact Modifier{Type:"mp_regen"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"mp_regen"} run data modify storage asset:artifact Line[1] set value '"MP回復量"' + execute if data storage asset:artifact Modifier{Type:"max_health"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"max_health"} run data modify storage asset:artifact Line[1] set value '"最大体力"' + execute if data storage asset:artifact Modifier{Type:"max_mp"} run scoreboard players set $CustomModifier Temporary 1 + execute if data storage asset:artifact Modifier{Type:"max_mp"} run data modify storage asset:artifact Line[1] set value '"最大MP"' + execute if score $CustomModifier Temporary matches 0 run function asset_manager:artifact/create/modifier/generic.m with storage asset:artifact Modifier +# 数値チェック +# Operation == "add": +# $AmountInt = floor(abs(Amount)) +# $AmountFrac(e3) = abs(Amount) * e3 % e3 +# Operation != "add": +# $AmountInt(e2) = floor(abs(Amount) * e2) +# $AmountFrac(e5) = abs(Amount) * e5 % e3 + execute store result score $AmountFrac Temporary run data get storage asset:artifact Modifier.Amount 1000 + execute unless data storage asset:artifact Modifier{Operation:"add"} run data modify storage asset:artifact Line[4] set value '"%"' + execute unless data storage asset:artifact Modifier{Operation:"add"} run scoreboard players operation $AmountFrac Temporary *= $100 Const + execute unless score $AmountFrac Temporary matches 0.. run data modify storage asset:artifact Line[0] set value '{"text":"","color":"red","italic":false}' + execute unless score $AmountFrac Temporary matches 0.. run data modify storage asset:artifact Line[2] set value '" -"' + execute unless score $AmountFrac Temporary matches 0.. run scoreboard players operation $AmountFrac Temporary *= $-1 Const + scoreboard players operation $AmountInt Temporary = $AmountFrac Temporary + scoreboard players operation $AmountInt Temporary /= $1000 Const + scoreboard players operation $AmountFrac Temporary %= $1000 Const +# $AmountFrac % 10 == 0: +# $AmountFrac(e2|e4) = $AmountFrac(e3|e5) / e1 + scoreboard players operation $AmountFrac2 Temporary = $AmountFrac Temporary + scoreboard players operation $AmountFrac2 Temporary %= $10 Const + execute if score $AmountFrac2 Temporary matches 0 run scoreboard players operation $AmountFrac Temporary /= $10 Const + scoreboard players operation $AmountFrac2 Temporary = $AmountFrac Temporary + scoreboard players operation $AmountFrac2 Temporary %= $10 Const + execute if score $AmountFrac2 Temporary matches 0 run scoreboard players operation $AmountFrac Temporary /= $10 Const +# 文字列に代入 + execute store result storage asset:artifact Amount.Int int 1 run scoreboard players get $AmountInt Temporary + execute store result storage asset:artifact Amount.Frac int 1 run scoreboard players get $AmountFrac Temporary + execute if score $AmountFrac Temporary matches 1.. run data modify storage asset:artifact Line[3] set value '{"translate":"%s.%s","with":[{"storage":"asset:artifact","nbt":"Amount.Int"},{"storage":"asset:artifact","nbt":"Amount.Frac"}]}' +# Lore追加 + loot replace block 10000 0 10000 container.0 loot asset_manager:artifact/generate_lore/modifier + data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[].tag.display.Lore[] + +# リセット + scoreboard players reset $CustomModifier Temporary + scoreboard players reset $AmountInt Temporary + scoreboard players reset $AmountFrac Temporary + scoreboard players reset $AmountFrac2 Temporary + data modify block 10000 0 10000 Items set value [] + data remove storage asset:artifact Line + data remove storage asset:artifact Amount +# 残っていればループ + data remove storage asset:artifact Modifier + data remove storage asset:artifact CopiedModifiers[0] + execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/create/modifier/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/modifier/generic.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/modifier/generic.m.mcfunction new file mode 100644 index 0000000000..667c33782a --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/modifier/generic.m.mcfunction @@ -0,0 +1,6 @@ +#> asset_manager:artifact/create/modifier/generic.m +# @input args +# Type : string +# @within function asset_manager:artifact/create/modifier/ + +$data modify storage asset:artifact Line[1] set value '{"translate":"attribute.name.$(Type)"}' diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_attack_info.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_attack_info.mcfunction deleted file mode 100644 index 10bb8be9ad..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_attack_info.mcfunction +++ /dev/null @@ -1,61 +0,0 @@ -#> asset_manager:artifact/create/set_attack_info -# -# 攻撃に関する情報をLoreに追加します -# -# @within function asset_manager:artifact/create/set_lore - -#> private -# @private - #declare score_holder $IsList - - # 初期化 - data modify storage asset:artifact Line1 set value ['""','{"text":"???"}','[{"text":"範囲-"},{"text":"不明","color":"gray"}]','""'] - data modify storage asset:artifact Line2 set value ['{"text":"物理 ","color":"dark_gray"}','{"text":"魔法 ","color":"dark_gray"}','{"text":"火 ","color":"dark_gray"}','{"text":"水 ","color":"dark_gray"}','{"text":"雷 ","color":"dark_gray"}','{"text":"無 ","color":"dark_gray"}'] - - - # Line-1 - # 貫通/非貫通 軽減/非軽減を表示 //未設定-非表示 - execute if data storage asset:artifact {AttackInfo:{BypassResist:1b}} run data modify storage asset:artifact Line1[0] set value '{"text":"[防御無効] "}' - - # ダメージ量を表示 //未設定-??? - # Listかを確認 - execute if data storage asset:artifact AttackInfo.Damage[0] run scoreboard players set $IsList Temporary 1 - execute if data storage asset:artifact {AttackInfo:{Damage:[]}} run scoreboard players set $IsList Temporary 1 - # Literalのとき - execute unless score $IsList Temporary matches 1.. if data storage asset:artifact AttackInfo.Damage run data modify storage asset:artifact Line1[1] set value '[{"storage":"asset:artifact","nbt":"AttackInfo.Damage"}]' - # List(要素数1)のとき - execute if score $IsList Temporary matches 1.. if data storage asset:artifact AttackInfo.Damage[0] run data modify storage asset:artifact Line1[1] set value '[{"storage":"asset:artifact","nbt":"AttackInfo.Damage[0]"}]' - # List(要素数2)のとき - execute if score $IsList Temporary matches 1.. if data storage asset:artifact AttackInfo.Damage[1] run data modify storage asset:artifact Line1[1] set value '[{"storage":"asset:artifact","nbt":"AttackInfo.Damage[0]"},{"text":"-"},{"storage":"asset:artifact","nbt":"AttackInfo.Damage[1]"}]' - - # 単体/確率範囲/条件範囲/常時範囲 を表示 //未設定-不明 - execute if data storage asset:artifact {AttackInfo:{IsRangeAttack:never}} run data modify storage asset:artifact Line1[2] set value '[{"text":"単体"}]' - execute if data storage asset:artifact {AttackInfo:{IsRangeAttack:probability}} run data modify storage asset:artifact Line1[2] set value '[{"text":"範囲-"},{"text":"確率","color":"aqua"}]' - execute if data storage asset:artifact {AttackInfo:{IsRangeAttack:condition}} run data modify storage asset:artifact Line1[2] set value '[{"text":"範囲-"},{"text":"条件","color":"green"}]' - execute if data storage asset:artifact {AttackInfo:{IsRangeAttack:every}} run data modify storage asset:artifact Line1[2] set value '[{"text":"範囲-"},{"text":"常時","color":"gold"}]' - - # 攻撃範囲を表示 //未設定-非表示 - execute if data storage asset:artifact AttackInfo.AttackRange run data modify storage asset:artifact Line1[3] set value '[{"text":" 範囲:"},{"storage":"asset:artifact","nbt":"AttackInfo.AttackRange"},{"text":"m"}]' - - # Line-2 - # 物理/魔法を表示 //未設定-物理 - execute if data storage asset:artifact {AttackInfo:{AttackType:[Physical]}} run data modify storage asset:artifact Line2[0] set value '{"text":"物理 ","color":"dark_green"}' - execute if data storage asset:artifact {AttackInfo:{AttackType:[Magic]}} run data modify storage asset:artifact Line2[1] set value '{"text":"魔法 ","color":"dark_purple"}' - - execute unless data storage asset:artifact AttackInfo.AttackType[0] run data modify storage asset:artifact Line2[0] set value '{"text":"物理 ","color":"dark_green"}' - - # 属性を表示 //未設定-無 - execute if data storage asset:artifact {AttackInfo:{ElementType:[Fire]}} run data modify storage asset:artifact Line2[2] set value '{"text":"火 ","color":"red"}' - execute if data storage asset:artifact {AttackInfo:{ElementType:[Water]}} run data modify storage asset:artifact Line2[3] set value '{"text":"水 ","color":"aqua"}' - execute if data storage asset:artifact {AttackInfo:{ElementType:[Thunder]}} run data modify storage asset:artifact Line2[4] set value '{"text":"雷 ","color":"yellow"}' - execute if data storage asset:artifact {AttackInfo:{ElementType:[None]}} run data modify storage asset:artifact Line2[5] set value '{"text":"無 ","color":"white"}' - - execute unless data storage asset:artifact AttackInfo.ElementType[0] run data modify storage asset:artifact Line2[5] set value '{"text":"無 ","color":"white"}' - - # lootしてLoreに落とし込む - loot replace block 10000 0 10000 container.2 loot asset_manager:artifact/generate_lore/attack_info - - # リセット - data remove storage asset:artifact Line1 - data remove storage asset:artifact Line2 - scoreboard players reset $IsList Temporary \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_data.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_data.mcfunction index 84c49d4aea..6509196bfb 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_data.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_data.mcfunction @@ -10,18 +10,31 @@ # Name : TextComponent # Lore : TextComponent[] # RemainingCount? : int -# Slot : Slot -# Trigger : Trigger -# Condition? : TextComponent -# AttackInfo? : Component -# MPCost : int -# MPRequire : int -# CostText? : TextComponent -# LocalCooldown : int -# SpecialCooldown : int +# RemainingCountMax? : int +# Triggers : Component[] +# ├ Slot : Slot +# ├ Trigger : Trigger +# ├ Condition? : TextComponent +# ├ AttackInfo? : Component +# ├ MPCost : int +# ├ MPRequire? : int +# ├ CostText? : TextComponent +# ├ LocalCooldown? : int +# ├ SpecialCooldown? : int +# ├ DisableCooldownMessage? : boolean +# ├ DisableMPMessage? : boolean +# └ Secret? : boolean +# DisableBreakSound? : boolean # CanUsedGod : God[] +# EquipID? : int +# Modifiers : Component[] +# ├ Type : string +# ├ Amount : double +# ├ Operation : "add" | "multiply_base" | "multiply" +# ├ MaxStack : int +# └ StackReduction : double # CustomNBT : Item.tag -# @within function asset:artifact/common/give +# @within function asset_manager:artifact/give/ #> Private # @private @@ -46,17 +59,13 @@ data modify storage asset:artifact Item.tag.CustomModelData set from storage asset:artifact ID data modify storage asset:artifact Item.tag.TSB.rawName set from storage asset:artifact Name data modify storage asset:artifact Item.tag.TSB.ID set from storage asset:artifact ID - data modify storage asset:artifact Item.tag.TSB.Trigger set from storage asset:artifact Trigger - data modify storage asset:artifact Item.tag.TSB.MPCost set from storage asset:artifact MPCost - data modify storage asset:artifact Item.tag.TSB.MPRequire set from storage asset:artifact MPRequire + data modify storage asset:artifact Item.tag.TSB.Triggers set from storage asset:artifact Triggers + data modify storage asset:artifact Item.tag.TSB.DisableBreakSound set from storage asset:artifact DisableBreakSound data modify storage asset:artifact Item.tag.TSB.CanUsedGod set from storage asset:artifact CanUsedGod data modify storage asset:artifact Item.tag.TSB.RemainingCount set from storage asset:artifact RemainingCount - data modify storage asset:artifact Item.tag.TSB.RemainingCountMAX set from storage asset:artifact RemainingCount - data modify storage asset:artifact Item.tag.TSB.LocalCooldown set from storage asset:artifact LocalCooldown - data modify storage asset:artifact Item.tag.TSB.SpecialCooldown set from storage asset:artifact SpecialCooldown - data modify storage asset:artifact Item.tag.TSB.DisableCooldownMessage set from storage asset:artifact DisableCooldownMessage - data modify storage asset:artifact Item.tag.TSB.DisableMPMessage set from storage asset:artifact DisableMPMessage - data modify storage asset:artifact Item.tag.TSB.DisableBreakSound set from storage asset:artifact DisableBreakSound + data modify storage asset:artifact Item.tag.TSB.RemainingCountMax set from storage asset:artifact RemainingCountMax + data modify storage asset:artifact Item.tag.TSB.EquipID set from storage asset:artifact EquipID + data modify storage asset:artifact Item.tag.TSB.Modifiers set from storage asset:artifact Modifiers # 名前 # 残り回数が存在する場合 @@ -75,4 +84,4 @@ data modify block 10000 0 10000 Items[0] set from storage asset:artifact Item # リセット - data remove storage asset:artifact BaseItem \ No newline at end of file + data remove storage asset:artifact BaseItem diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_equipment.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_equipment.mcfunction new file mode 100644 index 0000000000..77dbbe319b --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_equipment.mcfunction @@ -0,0 +1,39 @@ +#> asset_manager:artifact/create/set_equipment +# +# 装備セットによる効果を設定する +# +# @within function asset_manager:artifact/create/set_lore + +# IDから効果を抜き取る + function asset_manager:common/context/id/stash + data modify storage asset:context id set from storage asset:artifact EquipID + function #asset:effect/register + function asset_manager:common/context/id/pop + +# 空行セパレータ + data modify storage asset:artifact Item.tag.display.Lore append value '""' +# 名前をLoreに組み込む + data modify storage asset:artifact EquipName set from storage asset:effect Name + loot replace block 10000 0 10000 container.0 loot asset_manager:artifact/generate_lore/equipment + data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[0].tag.display.Lore[0] +# 説明文をLoreに組み込む + data modify storage asset:artifact Lore set from storage asset:effect Description + execute if data storage asset:artifact Lore[0] run function asset_manager:artifact/create/lore_append + +# リセット + data remove storage asset:artifact EquipName + data remove storage asset:artifact Lore + data remove storage asset:effect ExtendsSafe + data remove storage asset:effect ID + data remove storage asset:effect Name + data remove storage asset:effect Description + data remove storage asset:effect Duration + data remove storage asset:effect Stack + data remove storage asset:effect DurationOperation + data remove storage asset:effect StackOperation + data remove storage asset:effect MaxDuration + data remove storage asset:effect MaxStack + data remove storage asset:effect IsBadEffect + data remove storage asset:effect ProcessOnDied + data remove storage asset:effect RequireClearLv + data remove storage asset:effect Field diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_god.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_god.mcfunction index 700241c293..ea4b8537d0 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_god.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_god.mcfunction @@ -18,6 +18,8 @@ execute if data storage asset:artifact {CanUsedGod:["Wi-ki"]} run data modify storage asset:artifact Temp.CanUsedGod[3] set from storage global GodIcon.Wi-ki execute if data storage asset:artifact {CanUsedGod:["Rumor"]} run data modify storage asset:artifact Temp.CanUsedGod[4] set from storage global GodIcon.Rumor # 生成 - loot replace block 10000 0 10000 container.8 loot asset_manager:artifact/generate_lore/god + loot replace block 10000 0 10000 container.0 loot asset_manager:artifact/generate_lore/god + data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[0].tag.display.Lore[] # リセット - data remove storage asset:artifact Temp \ No newline at end of file + data modify block 10000 0 10000 Items set value [] + data remove storage asset:artifact Temp diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore.mcfunction index 9f8c63a45a..94d419ff78 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore.mcfunction @@ -7,28 +7,17 @@ # 初期化 data modify block 10000 0 10000 Items set value [] # 通常説明文 - function asset_manager:artifact/create/lore_append -# 空行セパレータ - data modify storage asset:artifact Item.tag.display.Lore append value '""' -# 0 使用方法 - function asset_manager:artifact/create/set_trigger -# 1? 使用条件 - execute if data storage asset:artifact Condition run loot replace block 10000 0 10000 container.1 loot asset_manager:artifact/generate_lore/condition -# 2? 攻撃情報 - execute if data storage asset:artifact AttackInfo run function asset_manager:artifact/create/set_attack_info -# 3? 必要MP - execute if data storage asset:artifact MPRequire run loot replace block 10000 0 10000 container.3 loot asset_manager:artifact/generate_lore/mp_require -# 4 消費MP - loot replace block 10000 0 10000 container.4 loot asset_manager:artifact/generate_lore/mp_cost -# 5? 消費アイテム - execute if data storage asset:artifact CostText run loot replace block 10000 0 10000 container.5 loot asset_manager:artifact/generate_lore/cost_item -# 6? クールタイム - execute if data storage asset:artifact LocalCooldown run function asset_manager:artifact/create/set_cooltime -# 7? スペシャル☆クールタイム - execute if data storage asset:artifact SpecialCooldown run function asset_manager:artifact/create/set_special_cooltime -# 8 使える神 + execute if data storage asset:artifact Lore[0] run function asset_manager:artifact/create/lore_append +# 装備時効果 + data modify storage asset:artifact CopiedModifiers set from storage asset:artifact Modifiers + execute if data storage asset:artifact CopiedModifiers[0] if data storage asset:artifact Item.tag.display.Lore[0] run data modify storage asset:artifact Item.tag.display.Lore append value '""' + execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/create/modifier/ + data remove storage asset:artifact CopiedModifiers +# セット効果 + execute if data storage asset:artifact EquipID run function asset_manager:artifact/create/set_equipment +# スキル設定 + data modify storage asset:artifact CopiedTriggers set from storage asset:artifact Triggers + execute if data storage asset:artifact CopiedTriggers[0] run function asset_manager:artifact/create/trigger/ + data remove storage asset:artifact CopiedTriggers +# 使える神 function asset_manager:artifact/create/set_god -# Lore一括追加 - data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[].tag.display.Lore[] -# リセット - data modify block 10000 0 10000 Items set value [] \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_trigger.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_trigger.mcfunction deleted file mode 100644 index 76befaec0b..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_trigger.mcfunction +++ /dev/null @@ -1,63 +0,0 @@ -#> asset_manager:artifact/create/set_trigger -# -# 使用の条件を設定します -# -# @within function asset_manager:artifact/create/set_lore - -# 指定スロットがhotbarでかつ重複可能か - execute if data storage asset:artifact {Slot:"hotbar",EnableDuplication:true} run data modify storage asset:artifact Temp.EnableDuplication set value "[重複可能] " - -# スロット - execute if data storage asset:artifact {Slot:"auto"} run data modify storage asset:artifact Temp.Trigger.A set value "どちらかの手に所持" - execute if data storage asset:artifact {Slot:"mainhand"} run data modify storage asset:artifact Temp.Trigger.A set value "メインハンドに所持" - execute if data storage asset:artifact {Slot:"offhand"} run data modify storage asset:artifact Temp.Trigger.A set value "オフハンドに所持" - execute if data storage asset:artifact {Slot:"head"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" - execute if data storage asset:artifact {Slot:"chest"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" - execute if data storage asset:artifact {Slot:"legs"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" - execute if data storage asset:artifact {Slot:"feet"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" - execute if data storage asset:artifact {Slot:"inventory"} run data modify storage asset:artifact Temp.Trigger.A set value "インベントリ内に保持" - execute if data storage asset:artifact {Slot:"hotbar"} run data modify storage asset:artifact Temp.Trigger.A set value "ホットバーに保持" -# 接続詞 - data modify storage asset:artifact Temp.Trigger.AB set value "し" -# トリガー - execute if data storage asset:artifact {Trigger:"onClick"} run data modify storage asset:artifact Temp.Trigger.B set value "右クリック" - execute if data storage asset:artifact {Trigger:"shot"} run data modify storage asset:artifact Temp.Trigger.B set value "発射" - execute if data storage asset:artifact {Trigger:"itemUse"} run data modify storage asset:artifact Temp.Trigger.B set value "使用" - execute if data storage asset:artifact {Trigger:"passive"} run data modify storage asset:artifact Temp.Trigger.B set value "ている限り" - execute if data storage asset:artifact {Trigger:"onAttack"} run data modify storage asset:artifact Temp.Trigger.B set value "攻撃" - execute if data storage asset:artifact {Trigger:"onAttackByMelee"} run data modify storage asset:artifact Temp.Trigger.B set value "近接攻撃" - execute if data storage asset:artifact {Trigger:"onAttackByProjectile"} run data modify storage asset:artifact Temp.Trigger.B set value "遠距離攻撃" - execute if data storage asset:artifact {Trigger:"onDamage"} run data modify storage asset:artifact Temp.Trigger.B set value "被ダメージ" - execute if data storage asset:artifact {Trigger:"onDamageFromExplode"} run data modify storage asset:artifact Temp.Trigger.B set value "被爆発ダメージ" - execute if data storage asset:artifact {Trigger:"onDamageFromBurn"} run data modify storage asset:artifact Temp.Trigger.B set value "被延焼ダメージ" - execute if data storage asset:artifact {Trigger:"onDamageFromEntity"} run data modify storage asset:artifact Temp.Trigger.B set value "被攻撃ダメージ" - execute if data storage asset:artifact {Trigger:"onDamageFromMelee"} run data modify storage asset:artifact Temp.Trigger.B set value "被近接ダメージ" - execute if data storage asset:artifact {Trigger:"onDamageFromProjectile"} run data modify storage asset:artifact Temp.Trigger.B set value "被遠距離ダメージ" - execute if data storage asset:artifact {Trigger:"onKilled"} run data modify storage asset:artifact Temp.Trigger.B set value "撃破" - execute if data storage asset:artifact {Trigger:"onKilledByMelee"} run data modify storage asset:artifact Temp.Trigger.B set value "近接攻撃で撃破" - execute if data storage asset:artifact {Trigger:"onKilledByProjectile"} run data modify storage asset:artifact Temp.Trigger.B set value "遠距離攻撃で撃破" - execute if data storage asset:artifact {Trigger:"sneak"} run data modify storage asset:artifact Temp.Trigger.B set value "スニーク" - execute if data storage asset:artifact {Trigger:"sneak1s"} run data modify storage asset:artifact Temp.Trigger.B set value "1秒間スニーク" - execute if data storage asset:artifact {Trigger:"sneak2s"} run data modify storage asset:artifact Temp.Trigger.B set value "2秒間スニーク" - execute if data storage asset:artifact {Trigger:"sneak3s"} run data modify storage asset:artifact Temp.Trigger.B set value "3秒間スニーク" - execute if data storage asset:artifact {Trigger:"sneak4s"} run data modify storage asset:artifact Temp.Trigger.B set value "4秒間スニーク" - execute if data storage asset:artifact {Trigger:"sneak5s"} run data modify storage asset:artifact Temp.Trigger.B set value "5秒間スニーク" - execute if data storage asset:artifact {Trigger:"sneak10s"} run data modify storage asset:artifact Temp.Trigger.B set value "10秒間スニーク" - execute if data storage asset:artifact {Trigger:"keepSneak"} run data modify storage asset:artifact Temp.Trigger.B set value "0秒以上スニーク" - execute if data storage asset:artifact {Trigger:"keepSneak1s"} run data modify storage asset:artifact Temp.Trigger.B set value "1秒間以上スニーク" - execute if data storage asset:artifact {Trigger:"keepSneak2s"} run data modify storage asset:artifact Temp.Trigger.B set value "2秒間以上スニーク" - execute if data storage asset:artifact {Trigger:"keepSneak3s"} run data modify storage asset:artifact Temp.Trigger.B set value "3秒間以上スニーク" - execute if data storage asset:artifact {Trigger:"keepSneak4s"} run data modify storage asset:artifact Temp.Trigger.B set value "4秒間以上スニーク" - execute if data storage asset:artifact {Trigger:"keepSneak5s"} run data modify storage asset:artifact Temp.Trigger.B set value "5秒間以上スニーク" - execute if data storage asset:artifact {Trigger:"keepSneak10s"} run data modify storage asset:artifact Temp.Trigger.B set value "10秒間以上スニーク" - execute if data storage asset:artifact {Trigger:"equipping"} run data modify storage asset:artifact Temp.Trigger.AB set value "" - execute if data storage asset:artifact {Trigger:"equipping"} run data modify storage asset:artifact Temp.Trigger.B set value "" - execute if data storage asset:artifact {Trigger:"onHeal"} run data modify storage asset:artifact Temp.Trigger.B set value "回復を与える" - execute if data storage asset:artifact {Trigger:"onReceiveHeal"} run data modify storage asset:artifact Temp.Trigger.B set value "回復を受ける" -# 設定されてなかったらエラーメッセージ - execute unless data storage asset:artifact Temp.Trigger.A run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"登録されていないSlotが指定されています","color":"white"}] - execute unless data storage asset:artifact Temp.Trigger.B run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"登録されていないTriggerが指定されています","color":"white"}] -# 生成 - loot replace block 10000 0 10000 container.0 loot asset_manager:artifact/generate_lore/trigger -# リセット - data remove storage asset:artifact Temp diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/.mcfunction new file mode 100644 index 0000000000..688c0416c7 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/.mcfunction @@ -0,0 +1,24 @@ +#> asset_manager:artifact/create/trigger/ +# +# Trigger関連の情報をLoreに追加する +# +# @within function +# asset_manager:artifact/create/set_lore +# asset_manager:artifact/create/trigger/ + +#> Private +# @private + #declare score_holder $Secret + +# move + data modify storage asset:artifact Trigger set from storage asset:artifact CopiedTriggers[0] + execute store result score $Secret Temporary run data get storage asset:artifact Trigger.Secret + +# exec + execute unless score $Secret Temporary matches 1 run function asset_manager:artifact/create/trigger/entry + +# loop + scoreboard players reset $Secret Temporary + data remove storage asset:artifact Trigger + data remove storage asset:artifact CopiedTriggers[0] + execute if data storage asset:artifact CopiedTriggers[0] run function asset_manager:artifact/create/trigger/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/attack_info.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/attack_info.mcfunction new file mode 100644 index 0000000000..3ad17d5068 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/attack_info.mcfunction @@ -0,0 +1,61 @@ +#> asset_manager:artifact/create/trigger/attack_info +# +# 攻撃に関する情報をLoreに追加します +# +# @within function asset_manager:artifact/create/trigger/entry + +#> private +# @private + #declare score_holder $IsList + +# 初期化 + data modify storage asset:artifact Line1 set value ['""','{"text":"???"}','[{"text":"範囲-"},{"text":"不明","color":"gray"}]','""'] + data modify storage asset:artifact Line2 set value ['{"text":"物理 ","color":"dark_gray"}','{"text":"魔法 ","color":"dark_gray"}','{"text":"火 ","color":"dark_gray"}','{"text":"水 ","color":"dark_gray"}','{"text":"雷 ","color":"dark_gray"}','{"text":"無 ","color":"dark_gray"}'] + + +# Line-1 + # 貫通/非貫通 軽減/非軽減を表示 //未設定-非表示 + execute if data storage asset:artifact Trigger{AttackInfo:{BypassResist:1b}} run data modify storage asset:artifact Line1[0] set value '{"text":"[防御無効] "}' + + # ダメージ量を表示 //未設定-??? + # Listかを確認 + execute if data storage asset:artifact Trigger.AttackInfo.Damage[0] run scoreboard players set $IsList Temporary 1 + execute if data storage asset:artifact Trigger{AttackInfo:{Damage:[]}} run scoreboard players set $IsList Temporary 1 + # Literalのとき + execute unless score $IsList Temporary matches 1.. if data storage asset:artifact Trigger.AttackInfo.Damage run data modify storage asset:artifact Line1[1] set value '[{"storage":"asset:artifact","nbt":"Trigger.AttackInfo.Damage"}]' + # List(要素数1)のとき + execute if score $IsList Temporary matches 1.. if data storage asset:artifact Trigger.AttackInfo.Damage[0] run data modify storage asset:artifact Line1[1] set value '[{"storage":"asset:artifact","nbt":"Trigger.AttackInfo.Damage[0]"}]' + # List(要素数2)のとき + execute if score $IsList Temporary matches 1.. if data storage asset:artifact Trigger.AttackInfo.Damage[1] run data modify storage asset:artifact Line1[1] set value '[{"storage":"asset:artifact","nbt":"Trigger.AttackInfo.Damage[0]"},{"text":"-"},{"storage":"asset:artifact","nbt":"Trigger.AttackInfo.Damage[1]"}]' + + # 単体/確率範囲/条件範囲/常時範囲 を表示 //未設定-不明 + execute if data storage asset:artifact Trigger{AttackInfo:{IsRangeAttack:never}} run data modify storage asset:artifact Line1[2] set value '[{"text":"単体"}]' + execute if data storage asset:artifact Trigger{AttackInfo:{IsRangeAttack:probability}} run data modify storage asset:artifact Line1[2] set value '[{"text":"範囲-"},{"text":"確率","color":"aqua"}]' + execute if data storage asset:artifact Trigger{AttackInfo:{IsRangeAttack:condition}} run data modify storage asset:artifact Line1[2] set value '[{"text":"範囲-"},{"text":"条件","color":"green"}]' + execute if data storage asset:artifact Trigger{AttackInfo:{IsRangeAttack:every}} run data modify storage asset:artifact Line1[2] set value '[{"text":"範囲-"},{"text":"常時","color":"gold"}]' + + # 攻撃範囲を表示 //未設定-非表示 + execute if data storage asset:artifact Trigger.AttackInfo.AttackRange run data modify storage asset:artifact Line1[3] set value '[{"text":" 範囲:"},{"storage":"asset:artifact","nbt":"Trigger.AttackInfo.AttackRange"},{"text":"m"}]' + +# Line-2 + # 物理/魔法を表示 //未設定-物理 + execute if data storage asset:artifact Trigger{AttackInfo:{AttackType:[Physical]}} run data modify storage asset:artifact Line2[0] set value '{"text":"物理 ","color":"dark_green"}' + execute if data storage asset:artifact Trigger{AttackInfo:{AttackType:[Magic]}} run data modify storage asset:artifact Line2[1] set value '{"text":"魔法 ","color":"dark_purple"}' + + execute unless data storage asset:artifact Trigger.AttackInfo.AttackType[0] run data modify storage asset:artifact Line2[0] set value '{"text":"物理 ","color":"dark_green"}' + + # 属性を表示 //未設定-無 + execute if data storage asset:artifact Trigger{AttackInfo:{ElementType:[Fire]}} run data modify storage asset:artifact Line2[2] set value '{"text":"火 ","color":"red"}' + execute if data storage asset:artifact Trigger{AttackInfo:{ElementType:[Water]}} run data modify storage asset:artifact Line2[3] set value '{"text":"水 ","color":"aqua"}' + execute if data storage asset:artifact Trigger{AttackInfo:{ElementType:[Thunder]}} run data modify storage asset:artifact Line2[4] set value '{"text":"雷 ","color":"yellow"}' + execute if data storage asset:artifact Trigger{AttackInfo:{ElementType:[None]}} run data modify storage asset:artifact Line2[5] set value '{"text":"無 ","color":"white"}' + + execute unless data storage asset:artifact Trigger.AttackInfo.ElementType[0] run data modify storage asset:artifact Line2[5] set value '{"text":"無 ","color":"white"}' + +# lootしてLoreに落とし込む + loot replace block 10000 0 10000 container.2 loot asset_manager:artifact/generate_lore/attack_info + +# リセット + data remove storage asset:artifact Line1 + data remove storage asset:artifact Line2 + scoreboard players reset $IsList Temporary diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_cooltime.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/cooltime.mcfunction similarity index 88% rename from TheSkyBlessing/data/asset_manager/functions/artifact/create/set_cooltime.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/cooltime.mcfunction index 16f0b0e5bc..7924e8b209 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_cooltime.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/cooltime.mcfunction @@ -1,8 +1,8 @@ -#> asset_manager:artifact/create/set_cooltime +#> asset_manager:artifact/create/trigger/cooltime # # 普通のクールタイムを秒数に変換 クールタイムが1tickだったりすると正確な秒数が出ない # -# @within function asset_manager:artifact/create/set_lore +# @within function asset_manager:artifact/create/trigger/entry #> Temp # @private @@ -11,10 +11,10 @@ #declare score_holder $CooldownMinutes # 5? クールタイムを秒数に変換 - execute store result score $Cooldown Temporary run data get storage asset:artifact LocalCooldown + execute store result score $Cooldown Temporary run data get storage asset:artifact Trigger.LocalCooldown scoreboard players operation $Cooldown Temporary /= $20 Const # 5? クールタイムの小数第一位まで求める - execute store result score $CooldownDecimal Temporary run data get storage asset:artifact LocalCooldown + execute store result score $CooldownDecimal Temporary run data get storage asset:artifact Trigger.LocalCooldown scoreboard players operation $CooldownDecimal Temporary %= $20 Const scoreboard players operation $CooldownDecimal Temporary *= $5 Const # 5? 秒数を分に変換 @@ -39,4 +39,4 @@ scoreboard players reset @s Temporary data remove storage asset:artifact LocalCooldownSecond data remove storage asset:artifact LocalCooldownDecimal - data remove storage asset:artifact LocalCooldownMinutes \ No newline at end of file + data remove storage asset:artifact LocalCooldownMinutes diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/entry.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/entry.mcfunction new file mode 100644 index 0000000000..16da759131 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/entry.mcfunction @@ -0,0 +1,26 @@ +#> asset_manager:artifact/create/trigger/entry +# @within function asset_manager:artifact/create/trigger/ + +# 空行セパレータ + execute if data storage asset:artifact Item.tag.display.Lore[0] run data modify storage asset:artifact Item.tag.display.Lore append value '""' +# 0 使用方法 + function asset_manager:artifact/create/trigger/trigger +# 1? 使用条件 + execute if data storage asset:artifact Trigger.Condition run loot replace block 10000 0 10000 container.1 loot asset_manager:artifact/generate_lore/condition +# 2? 攻撃情報 + execute if data storage asset:artifact Trigger.AttackInfo run function asset_manager:artifact/create/trigger/attack_info +# 3? 必要MP + execute if data storage asset:artifact Trigger.MPRequire run loot replace block 10000 0 10000 container.3 loot asset_manager:artifact/generate_lore/mp_require +# 4 消費MP + loot replace block 10000 0 10000 container.4 loot asset_manager:artifact/generate_lore/mp_cost +# 5? 消費アイテム + execute if data storage asset:artifact Trigger.CostText run loot replace block 10000 0 10000 container.5 loot asset_manager:artifact/generate_lore/cost_item +# 6? クールタイム + execute if data storage asset:artifact Trigger.LocalCooldown run function asset_manager:artifact/create/trigger/cooltime +# 7? スペシャル☆クールタイム + execute if data storage asset:artifact Trigger.SpecialCooldown run function asset_manager:artifact/create/trigger/special_cooltime + +# Lore一括追加 + data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[].tag.display.Lore[] +# リセット + data modify block 10000 0 10000 Items set value [] diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_special_cooltime.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/special_cooltime.mcfunction similarity index 87% rename from TheSkyBlessing/data/asset_manager/functions/artifact/create/set_special_cooltime.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/special_cooltime.mcfunction index adaf89e9d2..65797c1563 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_special_cooltime.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/special_cooltime.mcfunction @@ -1,8 +1,8 @@ -#> asset_manager:artifact/create/set_special_cooltime +#> asset_manager:artifact/create/trigger/special_cooltime # # スペシャルクールタイムを秒数にする 1tickとかだと表示が変になる # -# @within function asset_manager:artifact/create/set_lore +# @within function asset_manager:artifact/create/trigger/entry #> Temp # @private @@ -11,10 +11,10 @@ #declare score_holder $CooldownMinutes # 5? スペシャル☆クールタイムを秒数に変換 - execute store result score $Cooldown Temporary run data get storage asset:artifact SpecialCooldown + execute store result score $Cooldown Temporary run data get storage asset:artifact Trigger.SpecialCooldown scoreboard players operation $Cooldown Temporary /= $20 Const # 5? スペシャル☆クールタイムの小数第一位まで求める - execute store result score $CooldownDecimal Temporary run data get storage asset:artifact SpecialCooldown + execute store result score $CooldownDecimal Temporary run data get storage asset:artifact Trigger.SpecialCooldown scoreboard players operation $CooldownDecimal Temporary %= $20 Const scoreboard players operation $CooldownDecimal Temporary *= $5 Const # 5? 秒数を分に変換 @@ -39,4 +39,4 @@ scoreboard players reset @s Temporary data remove storage asset:artifact SpecialCooldownSecond data remove storage asset:artifact SpecialCooldownDecimal - data remove storage asset:artifact SpecialCooldownMinutes \ No newline at end of file + data remove storage asset:artifact SpecialCooldownMinutes diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/trigger.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/trigger.mcfunction new file mode 100644 index 0000000000..920c649f1c --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/trigger/trigger.mcfunction @@ -0,0 +1,60 @@ +#> asset_manager:artifact/create/trigger/trigger +# +# 使用の条件を設定します +# +# @within function asset_manager:artifact/create/trigger/entry + +# スロット + execute if data storage asset:artifact Trigger{Slot:"auto"} run data modify storage asset:artifact Temp.Trigger.A set value "どちらかの手に所持" + execute if data storage asset:artifact Trigger{Slot:"mainhand"} run data modify storage asset:artifact Temp.Trigger.A set value "メインハンドに所持" + execute if data storage asset:artifact Trigger{Slot:"offhand"} run data modify storage asset:artifact Temp.Trigger.A set value "オフハンドに所持" + execute if data storage asset:artifact Trigger{Slot:"head"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" + execute if data storage asset:artifact Trigger{Slot:"chest"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" + execute if data storage asset:artifact Trigger{Slot:"legs"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" + execute if data storage asset:artifact Trigger{Slot:"feet"} run data modify storage asset:artifact Temp.Trigger.A set value "装備" + execute if data storage asset:artifact Trigger{Slot:"inventory"} run data modify storage asset:artifact Temp.Trigger.A set value "インベントリ内に保持" + execute if data storage asset:artifact Trigger{Slot:"hotbar"} run data modify storage asset:artifact Temp.Trigger.A set value "ホットバーに保持" +# 接続詞 + data modify storage asset:artifact Temp.Trigger.AB set value "し" +# トリガー + execute if data storage asset:artifact Trigger{Trigger:"click"} run data modify storage asset:artifact Temp.Trigger.B set value "右クリック" + execute if data storage asset:artifact Trigger{Trigger:"keep-click"} run data modify storage asset:artifact Temp.Trigger.B set value "右クリック" + execute if data storage asset:artifact Trigger{Trigger:"shot"} run data modify storage asset:artifact Temp.Trigger.B set value "発射" + execute if data storage asset:artifact Trigger{Trigger:"use"} run data modify storage asset:artifact Temp.Trigger.B set value "使用" + execute if data storage asset:artifact Trigger{Trigger:"tick"} run data modify storage asset:artifact Temp.Trigger.B set value "ている限り" + execute if data storage asset:artifact Trigger{Trigger:"attack"} run data modify storage asset:artifact Temp.Trigger.B set value "攻撃" + execute if data storage asset:artifact Trigger{Trigger:"attack-melee"} run data modify storage asset:artifact Temp.Trigger.B set value "近接攻撃" + execute if data storage asset:artifact Trigger{Trigger:"attack-projectile"} run data modify storage asset:artifact Temp.Trigger.B set value "遠距離攻撃" + execute if data storage asset:artifact Trigger{Trigger:"damage"} run data modify storage asset:artifact Temp.Trigger.B set value "被ダメージ" + execute if data storage asset:artifact Trigger{Trigger:"damage-explosion"} run data modify storage asset:artifact Temp.Trigger.B set value "被爆発ダメージ" + execute if data storage asset:artifact Trigger{Trigger:"damage-burn"} run data modify storage asset:artifact Temp.Trigger.B set value "被延焼ダメージ" + execute if data storage asset:artifact Trigger{Trigger:"damage-entity"} run data modify storage asset:artifact Temp.Trigger.B set value "被攻撃ダメージ" + execute if data storage asset:artifact Trigger{Trigger:"damage-melee"} run data modify storage asset:artifact Temp.Trigger.B set value "被近接ダメージ" + execute if data storage asset:artifact Trigger{Trigger:"damage-projectile"} run data modify storage asset:artifact Temp.Trigger.B set value "被遠距離ダメージ" + execute if data storage asset:artifact Trigger{Trigger:"kill"} run data modify storage asset:artifact Temp.Trigger.B set value "撃破" + execute if data storage asset:artifact Trigger{Trigger:"kill-melee"} run data modify storage asset:artifact Temp.Trigger.B set value "近接攻撃で撃破" + execute if data storage asset:artifact Trigger{Trigger:"kill-projectile"} run data modify storage asset:artifact Temp.Trigger.B set value "遠距離攻撃で撃破" + execute if data storage asset:artifact Trigger{Trigger:"sneak"} run data modify storage asset:artifact Temp.Trigger.B set value "スニーク" + execute if data storage asset:artifact Trigger{Trigger:"sneak-1s"} run data modify storage asset:artifact Temp.Trigger.B set value "1秒間スニーク" + execute if data storage asset:artifact Trigger{Trigger:"sneak-2s"} run data modify storage asset:artifact Temp.Trigger.B set value "2秒間スニーク" + execute if data storage asset:artifact Trigger{Trigger:"sneak-3s"} run data modify storage asset:artifact Temp.Trigger.B set value "3秒間スニーク" + execute if data storage asset:artifact Trigger{Trigger:"sneak-4s"} run data modify storage asset:artifact Temp.Trigger.B set value "4秒間スニーク" + execute if data storage asset:artifact Trigger{Trigger:"sneak-5s"} run data modify storage asset:artifact Temp.Trigger.B set value "5秒間スニーク" + execute if data storage asset:artifact Trigger{Trigger:"sneak-10s"} run data modify storage asset:artifact Temp.Trigger.B set value "10秒間スニーク" + execute if data storage asset:artifact Trigger{Trigger:"keep-sneak"} run data modify storage asset:artifact Temp.Trigger.B set value "0秒以上スニーク" + execute if data storage asset:artifact Trigger{Trigger:"keep-sneak-1s"} run data modify storage asset:artifact Temp.Trigger.B set value "1秒間以上スニーク" + execute if data storage asset:artifact Trigger{Trigger:"keep-sneak-2s"} run data modify storage asset:artifact Temp.Trigger.B set value "2秒間以上スニーク" + execute if data storage asset:artifact Trigger{Trigger:"keep-sneak-3s"} run data modify storage asset:artifact Temp.Trigger.B set value "3秒間以上スニーク" + execute if data storage asset:artifact Trigger{Trigger:"keep-sneak-4s"} run data modify storage asset:artifact Temp.Trigger.B set value "4秒間以上スニーク" + execute if data storage asset:artifact Trigger{Trigger:"keep-sneak-5s"} run data modify storage asset:artifact Temp.Trigger.B set value "5秒間以上スニーク" + execute if data storage asset:artifact Trigger{Trigger:"keep-sneak-10s"} run data modify storage asset:artifact Temp.Trigger.B set value "10秒間以上スニーク" + execute if data storage asset:artifact Trigger{Trigger:"equip"} run data modify storage asset:artifact Temp.Trigger.AB set value "" + execute if data storage asset:artifact Trigger{Trigger:"equip"} run data modify storage asset:artifact Temp.Trigger.B set value "" + execute if data storage asset:artifact Trigger{Trigger:"heal"} run data modify storage asset:artifact Temp.Trigger.B set value "回復" +# 設定されてなかったらエラーメッセージ + execute unless data storage asset:artifact Temp.Trigger.A run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"登録されていないSlotが指定されています","color":"white"}] + execute unless data storage asset:artifact Temp.Trigger.B run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"登録されていないTriggerが指定されています","color":"white"}] +# 生成 + loot replace block 10000 0 10000 container.0 loot asset_manager:artifact/generate_lore/trigger +# リセット + data remove storage asset:artifact Temp diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/init.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/init.mcfunction deleted file mode 100644 index 99f4eba439..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/init.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -#> asset_manager:artifact/data/current/equips/init -# -# -# -# @within function -# asset_manager:artifact/data/*/revert_from_current -# asset_manager:artifact/triggers/equipments/mask_slot/ - -# 初期化 - data modify storage asset:artifact Equipments set value [] -# 適用 - data modify storage asset:artifact Equipments append from storage asset:context id.mainhand - data modify storage asset:artifact Equipments append from storage asset:context id.offhand - data modify storage asset:artifact Equipments append from storage asset:context id.feet - data modify storage asset:artifact Equipments append from storage asset:context id.legs - data modify storage asset:artifact Equipments append from storage asset:context id.chest - data modify storage asset:artifact Equipments append from storage asset:context id.head - data modify storage asset:artifact Equipments append from storage asset:context id.hotbar[] \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/merge.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/merge.mcfunction deleted file mode 100644 index 1b45af961e..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/merge.mcfunction +++ /dev/null @@ -1,18 +0,0 @@ -#> asset_manager:artifact/data/current/equips/merge -# -# Equipments <- MaskEquips -# -# @within function -# asset_manager:artifact/data/*/revert_from_current -# asset_manager:artifact/data/current/equips/merge - -# そのまま扱えないので取得 - execute store result storage asset:artifact LatestMaskEquipID int 1 run data get storage asset:artifact MaskEquips[-1] -# 末尾要素に応じて追加するものを変える - execute if data storage asset:artifact {LatestMaskEquipID:-1} run data modify storage asset:artifact NewEquips append from storage asset:artifact Equipments[-1] - execute unless data storage asset:artifact {LatestMaskEquipID:-1} run data modify storage asset:artifact NewEquips append from storage asset:artifact MaskEquips[-1] -# 末尾削除 - data remove storage asset:artifact MaskEquips[-1] - data remove storage asset:artifact Equipments[-1] -# 要素がまだあるなら再帰 - execute if data storage asset:artifact MaskEquips[0] if data storage asset:artifact Equipments[0] run function asset_manager:artifact/data/current/equips/merge \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/replace.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/replace.mcfunction deleted file mode 100644 index c83b896838..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/equips/replace.mcfunction +++ /dev/null @@ -1,26 +0,0 @@ -#> asset_manager:artifact/data/current/equips/replace -# -# -# -# @within function -# asset_manager:artifact/data/*/revert_from_current -# asset_manager:artifact/triggers/equipments/mask_slot/ - -# 適用 - data modify storage asset:context id.hotbar[8] set from storage asset:artifact NewEquips[0] - data modify storage asset:context id.hotbar[7] set from storage asset:artifact NewEquips[1] - data modify storage asset:context id.hotbar[6] set from storage asset:artifact NewEquips[2] - data modify storage asset:context id.hotbar[5] set from storage asset:artifact NewEquips[3] - data modify storage asset:context id.hotbar[4] set from storage asset:artifact NewEquips[4] - data modify storage asset:context id.hotbar[3] set from storage asset:artifact NewEquips[5] - data modify storage asset:context id.hotbar[2] set from storage asset:artifact NewEquips[6] - data modify storage asset:context id.hotbar[1] set from storage asset:artifact NewEquips[7] - data modify storage asset:context id.hotbar[0] set from storage asset:artifact NewEquips[8] - data modify storage asset:context id.head set from storage asset:artifact NewEquips[9] - data modify storage asset:context id.chest set from storage asset:artifact NewEquips[10] - data modify storage asset:context id.legs set from storage asset:artifact NewEquips[11] - data modify storage asset:context id.feet set from storage asset:artifact NewEquips[12] - data modify storage asset:context id.offhand set from storage asset:artifact NewEquips[13] - data modify storage asset:context id.mainhand set from storage asset:artifact NewEquips[14] -# リセット - data remove storage asset:artifact NewEquips \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/filter.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/filter.mcfunction deleted file mode 100644 index 29b6e0c896..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/filter.mcfunction +++ /dev/null @@ -1,23 +0,0 @@ -#> asset_manager:artifact/data/current/filter -# -# -# -# @within function -# asset_manager:artifact/data/current/get -# asset_manager:artifact/data/current/filter - -#> Private -# @private -#declare score_holder $nonIDEquals - -# 比較 - data modify storage asset:artifact Temp set from storage asset:artifact TargetID - execute store success score $nonIDEquals Temporary run data modify storage asset:artifact Temp set from storage asset:artifact HotbarItems[-1].tag.TSB.ID -# 一致してたら追加 - execute if score $nonIDEquals Temporary matches 0 run data modify storage asset:artifact TargetItems append from storage asset:artifact HotbarItems[-1] -# リセット - scoreboard players reset $nonIDEquals Temporary - data remove storage asset:artifact Temp - data remove storage asset:artifact HotbarItems[-1] -# 要素が残ってたら再帰 - execute if data storage asset:artifact HotbarItems[0] run function asset_manager:artifact/data/current/filter \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/get.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/get.mcfunction deleted file mode 100644 index d5cada7ce9..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/get.mcfunction +++ /dev/null @@ -1,32 +0,0 @@ -#> asset_manager:artifact/data/current/get -# -# TargetSlotを元にプレイヤーのデータを取得する -# -# @input -# as player -# storage asset:artifact TargetSlot : Slot -# @output storage asset:artifact -# Item : [ItemData] -# TargetDefaultSlot : Slot -# @within function -# asset_manager:artifact/check/ -# asset_manager:artifact/use/ - -# autoで無い場合はそのままDefaultSlotに突っ込む - execute unless data storage asset:artifact {TargetSlot:"auto"} run data modify storage asset:artifact TargetDefaultSlot set from storage asset:artifact TargetSlot -# autoの場合の処理 - execute if data storage asset:artifact {TargetSlot:"auto"} run data modify storage asset:artifact TargetDefaultSlot set from storage asset:context Items.AutoSlot - execute if data storage asset:artifact {TargetSlot:"auto"} unless data storage asset:context Items.AutoSlot run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"autoはこのトリガーでは実行できません","color":"white"}] - execute if data storage asset:artifact {TargetSlot:"auto"} unless data storage asset:context Items.AutoSlot run data modify storage asset:artifact TargetDefaultSlot set value 'mainhand' - -# 取得 - execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage asset:artifact TargetItems append from storage asset:context Items.mainhand - execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} run data modify storage asset:artifact TargetItems append from storage asset:context Items.offhand - execute if data storage asset:artifact {TargetDefaultSlot:"feet"} run data modify storage asset:artifact TargetItems append from storage asset:context Items.feet - execute if data storage asset:artifact {TargetDefaultSlot:"legs"} run data modify storage asset:artifact TargetItems append from storage asset:context Items.legs - execute if data storage asset:artifact {TargetDefaultSlot:"chest"} run data modify storage asset:artifact TargetItems append from storage asset:context Items.chest - execute if data storage asset:artifact {TargetDefaultSlot:"head"} run data modify storage asset:artifact TargetItems append from storage asset:context Items.head - - execute if data storage asset:artifact {TargetDefaultSlot:"hotbar"} run data modify storage asset:artifact HotbarItems set from storage asset:context Items.hotbar - execute if data storage asset:artifact {TargetDefaultSlot:"hotbar"} run function asset_manager:artifact/data/current/filter - execute if data storage asset:artifact {TargetDefaultSlot:"hotbar"} run data remove storage asset:artifact HotbarItems \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/reset.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/reset.mcfunction deleted file mode 100644 index 18de7be53c..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/reset.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -#> asset_manager:artifact/data/current/reset -# -# currentデータをリセットします -# -# @within function -# asset_manager:artifact/data/*/*_current -# asset_manager:artifact/triggers/ - -# リセット - data remove storage asset:context Inventory - data remove storage asset:context SelectedItemSlot - data remove storage asset:context Items - data remove storage asset:context id \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/.mcfunction deleted file mode 100644 index 483c37d810..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/.mcfunction +++ /dev/null @@ -1,20 +0,0 @@ -#> asset_manager:artifact/data/current/update/ -# -# Itemを元にcurrentデータを更新する -# -# @input storage asset:artifact ProcessedItem : SlottedItem -# @within function -# asset_manager:artifact/use/item/update -# asset_manager:artifact/use/item/break - -# ターゲットスロットを設定する - execute if data storage asset:artifact {TargetDefaultSlot:"hotbar"} run data modify storage asset:artifact SpecificTargetSlot set from storage asset:artifact ProcessedItem.Slot - 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 ProcessedItem if data storage asset:artifact {TargetDefaultSlot:"hotbar"} run function asset_manager:artifact/data/current/update/when_modified/hotbar - execute if data storage asset:artifact ProcessedItem unless data storage asset:artifact {TargetDefaultSlot:"hotbar"} run function asset_manager:artifact/data/current/update/when_modified/non-hotbar -# 削除されたときの処理 - execute unless data storage asset:artifact ProcessedItem if data storage asset:artifact {TargetDefaultSlot:"hotbar"} run function asset_manager:artifact/data/current/update/when_removed/hotbar - execute unless data storage asset:artifact ProcessedItem unless data storage asset:artifact {TargetDefaultSlot:"hotbar"} run function asset_manager:artifact/data/current/update/when_removed/non-hotbar -# リセット - data remove storage asset:artifact ProcessedItem \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_modified/hotbar.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_modified/hotbar.mcfunction deleted file mode 100644 index bb2a721634..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_modified/hotbar.mcfunction +++ /dev/null @@ -1,20 +0,0 @@ -#> asset_manager:artifact/data/current/update/when_modified/hotbar -# -# -# -# @within function -# asset_manager:artifact/data/current/update/ -# asset_manager:artifact/data/current/update/when_modified/non-hotbar - -# 設定 - execute if data storage asset:artifact {SpecificTargetSlot:0b} run data modify storage asset:context Items.hotbar[{Slot:0b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:1b} run data modify storage asset:context Items.hotbar[{Slot:1b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:2b} run data modify storage asset:context Items.hotbar[{Slot:2b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:3b} run data modify storage asset:context Items.hotbar[{Slot:3b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:4b} run data modify storage asset:context Items.hotbar[{Slot:4b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:5b} run data modify storage asset:context Items.hotbar[{Slot:5b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:6b} run data modify storage asset:context Items.hotbar[{Slot:6b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:7b} run data modify storage asset:context Items.hotbar[{Slot:7b}] set from storage asset:artifact ProcessedItem - execute if data storage asset:artifact {SpecificTargetSlot:8b} run data modify storage asset:context Items.hotbar[{Slot:8b}] set from storage asset:artifact ProcessedItem -# リセット - data remove storage asset:artifact SpecificTargetSlot \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_modified/non-hotbar.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_modified/non-hotbar.mcfunction deleted file mode 100644 index 7a780fcb4c..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_modified/non-hotbar.mcfunction +++ /dev/null @@ -1,13 +0,0 @@ -#> asset_manager:artifact/data/current/update/when_modified/non-hotbar -# -# Itemが存在するときの更新処理 -# -# @within function asset_manager:artifact/data/current/update/ - -execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage asset:context Items.mainhand set from storage asset:artifact ProcessedItem -execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run function asset_manager:artifact/data/current/update/when_modified/hotbar -execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} run data modify storage asset:context Items.offhand set from storage asset:artifact ProcessedItem -execute if data storage asset:artifact {TargetDefaultSlot:"feet"} run data modify storage asset:context Items.feet set from storage asset:artifact ProcessedItem -execute if data storage asset:artifact {TargetDefaultSlot:"legs"} run data modify storage asset:context Items.legs set from storage asset:artifact ProcessedItem -execute if data storage asset:artifact {TargetDefaultSlot:"chest"} run data modify storage asset:context Items.chest set from storage asset:artifact ProcessedItem -execute if data storage asset:artifact {TargetDefaultSlot:"head"} run data modify storage asset:context Items.head set from storage asset:artifact ProcessedItem \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_removed/hotbar.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_removed/hotbar.mcfunction deleted file mode 100644 index a843167300..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_removed/hotbar.mcfunction +++ /dev/null @@ -1,45 +0,0 @@ -#> asset_manager:artifact/data/current/update/when_removed/hotbar -# -# -# -# @within function -# asset_manager:artifact/data/current/update/ -# asset_manager:artifact/data/current/update/when_removed/non-hotbar - -execute if data storage asset:artifact {SpecificTargetSlot:0b} run data modify storage asset:context Items.hotbar[0] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:0b} run data modify storage asset:context id.hotbar[0] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:0b} run data modify storage asset:context id.all.hotbar[0] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:1b} run data modify storage asset:context Items.hotbar[1] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:1b} run data modify storage asset:context id.hotbar[1] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:1b} run data modify storage asset:context id.all.hotbar[1] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:2b} run data modify storage asset:context Items.hotbar[2] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:2b} run data modify storage asset:context id.hotbar[2] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:2b} run data modify storage asset:context id.all.hotbar[2] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:3b} run data modify storage asset:context Items.hotbar[3] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:3b} run data modify storage asset:context id.hotbar[3] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:3b} run data modify storage asset:context id.all.hotbar[3] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:4b} run data modify storage asset:context Items.hotbar[4] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:4b} run data modify storage asset:context id.hotbar[4] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:4b} run data modify storage asset:context id.all.hotbar[4] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:5b} run data modify storage asset:context Items.hotbar[5] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:5b} run data modify storage asset:context id.hotbar[5] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:5b} run data modify storage asset:context id.all.hotbar[5] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:6b} run data modify storage asset:context Items.hotbar[6] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:6b} run data modify storage asset:context id.hotbar[6] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:6b} run data modify storage asset:context id.all.hotbar[6] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:7b} run data modify storage asset:context Items.hotbar[7] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:7b} run data modify storage asset:context id.hotbar[7] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:7b} run data modify storage asset:context id.all.hotbar[7] set value -2 - -execute if data storage asset:artifact {SpecificTargetSlot:8b} run data modify storage asset:context Items.hotbar[8] set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {SpecificTargetSlot:8b} run data modify storage asset:context id.hotbar[8] set value -2 -execute if data storage asset:artifact {SpecificTargetSlot:8b} run data modify storage asset:context id.all.hotbar[8] set value -2 - -data remove storage asset:artifact SpecificTargetSlot \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_removed/non-hotbar.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_removed/non-hotbar.mcfunction deleted file mode 100644 index f244f32b76..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/current/update/when_removed/non-hotbar.mcfunction +++ /dev/null @@ -1,33 +0,0 @@ -#> asset_manager:artifact/data/current/update/when_removed/non-hotbar -# -# Itemが削除されたときの更新処理 -# -# @within function asset_manager:artifact/data/current/update/ - -execute if data storage asset:artifact {TargetSlot:"auto"} run data modify storage asset:context id.auto set value -2 -execute if data storage asset:artifact {TargetSlot:"auto"} run data modify storage asset:context id.all.auto set value -2 - -execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage asset:context Items.mainhand set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage asset:context id.mainhand set value -2 -execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run data modify storage asset:context id.all.mainhand set value -2 -execute if data storage asset:artifact {TargetDefaultSlot:"mainhand"} run function asset_manager:artifact/data/current/update/when_removed/hotbar - -execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} run data modify storage asset:context Items.offhand set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} run data modify storage asset:context id.offhand set value -2 -execute if data storage asset:artifact {TargetDefaultSlot:"offhand"} run data modify storage asset:context id.all.offhand set value -2 - -execute if data storage asset:artifact {TargetDefaultSlot:"feet"} run data modify storage asset:context Items.feet set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {TargetDefaultSlot:"feet"} run data modify storage asset:context id.feet set value -2 -execute if data storage asset:artifact {TargetDefaultSlot:"feet"} run data modify storage asset:context id.all.feet set value -2 - -execute if data storage asset:artifact {TargetDefaultSlot:"legs"} run data modify storage asset:context Items.legs set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {TargetDefaultSlot:"legs"} run data modify storage asset:context id.legs set value -2 -execute if data storage asset:artifact {TargetDefaultSlot:"legs"} run data modify storage asset:context id.all.legs set value -2 - -execute if data storage asset:artifact {TargetDefaultSlot:"chest"} run data modify storage asset:context Items.chest set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {TargetDefaultSlot:"chest"} run data modify storage asset:context id.chest set value -2 -execute if data storage asset:artifact {TargetDefaultSlot:"chest"} run data modify storage asset:context id.all.chest set value -2 - -execute if data storage asset:artifact {TargetDefaultSlot:"head"} run data modify storage asset:context Items.head set value {tag:{TSB:{ID:-2,UUID:-2,LocalCooldown:0}}} -execute if data storage asset:artifact {TargetDefaultSlot:"head"} run data modify storage asset:context id.head set value -2 -execute if data storage asset:artifact {TargetDefaultSlot:"head"} run data modify storage asset:context id.all.head set value -2 \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/.mcfunction new file mode 100644 index 0000000000..b5a38b3e15 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/.mcfunction @@ -0,0 +1,27 @@ +#> asset_manager:artifact/data/new/fetch_data/ +# +# プレイヤーデータからromを呼び出す +# +# @within function asset_manager:artifact/triggers/ + +# セッションを開く + function lib:array/session/open +# データを用意する + data modify storage asset:artifact New.ItemData set value [] +# idを取得する + data modify storage lib: Array append from storage asset:artifact New.id.mainhand + data modify storage lib: Array append from storage asset:artifact New.id.offhand + data modify storage lib: Array append from storage asset:artifact New.id.feet + data modify storage lib: Array append from storage asset:artifact New.id.legs + data modify storage lib: Array append from storage asset:artifact New.id.chest + data modify storage lib: Array append from storage asset:artifact New.id.head + data modify storage lib: Array[] append from storage asset:artifact New.id.hotbar[] +# 反転 + function lib:array/reverse +# id毎にデータを取得する + scoreboard players set $SlotIndex Temporary 15 + function asset_manager:artifact/data/new/fetch_data/foreach +# リセット + scoreboard players reset $SlotIndex Temporary + function lib:array/session/close + data remove storage asset:artifact TargetSlot diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/fetch.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/fetch.mcfunction new file mode 100644 index 0000000000..3cd6d05a29 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/fetch.mcfunction @@ -0,0 +1,28 @@ +#> asset_manager:artifact/data/new/fetch_data/fetch +# +# +# +# @within function asset_manager:artifact/data/new/fetch_data/foreach + +# indexを更新する + scoreboard players remove $SlotIndex Temporary 1 +# IDをキーにする + data modify storage api: Argument.Address set from storage lib: Array[-1] +# romを呼び出す + function api:rom/please +# データを格納する +# 普通に取り出す + data modify storage asset:artifact New.ItemData append value {} + data modify storage asset:artifact New.ItemData[-1].ID set from storage lib: Array[-1] + data modify storage asset:artifact New.ItemData[-1].CanUsedGod set from storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.CanUsedGod + data modify storage asset:artifact New.ItemData[-1].Field set from storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Field +# トリガーはSlotが正しいものを切り取る + function asset_manager:artifact/triggers/index_to_slot + function asset_manager:artifact/data/new/fetch_data/trigger.m with storage asset:artifact +# 装備時効果関連は、equipトリガーがある場合だけ取る + execute if data storage asset:artifact New.ItemData[-1].Triggers[{Trigger:"equip"}] run data modify storage asset:artifact New.ItemData[-1].EquipID set from storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.EquipID + execute if data storage asset:artifact New.ItemData[-1].Triggers[{Trigger:"equip"}] run data modify storage asset:artifact New.ItemData[-1].Modifiers set from storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Modifiers + execute if data storage asset:artifact New.ItemData[-1].Triggers[{Trigger:"equip"}] run data modify storage asset:artifact New.ItemData[-1].Modifiers[].ID set from storage lib: Array[-1] + execute if data storage asset:artifact New.ItemData[-1].Triggers[{Trigger:"equip"}] run data modify storage asset:artifact New.ItemData[-1].Modifiers[].Slot set from storage asset:artifact TargetSlot + execute unless data storage asset:artifact New.ItemData[-1].Triggers[{Trigger:"equip"}] run data modify storage asset:artifact New.ItemData[-1].EquipID set value -2 + execute unless data storage asset:artifact New.ItemData[-1].Triggers[{Trigger:"equip"}] run data modify storage asset:artifact New.ItemData[-1].Modifiers set value [] diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/foreach.mcfunction new file mode 100644 index 0000000000..b99103c018 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/foreach.mcfunction @@ -0,0 +1,18 @@ +#> asset_manager:artifact/data/new/fetch_data/foreach +# +# +# +# @within function asset_manager:artifact/data/new/fetch_data/* + +#> private +# @private + #declare score_holder $ID + +# キーチェック + 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:[]} +# 要素を削除し、残っていたら再帰する + data remove storage lib: Array[-1] + execute if data storage lib: Array[0] run function asset_manager:artifact/data/new/fetch_data/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/trigger.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/trigger.m.mcfunction new file mode 100644 index 0000000000..df47c1e607 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/fetch_data/trigger.m.mcfunction @@ -0,0 +1,13 @@ +#> asset_manager:artifact/data/new/fetch_data/trigger.m +# +# +# +# @input args TargetSlot : string +# @within function asset_manager:artifact/data/new/fetch_data/fetch + +data modify storage asset:artifact New.ItemData[-1].Triggers append from storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Triggers[{Slot:"$(TargetSlot)"}] +execute if data storage asset:artifact {TargetSlot:"mainhand"} run data modify storage asset:artifact New.ItemData[-1].Triggers append from storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Triggers[{Slot:"auto"}] +execute if data storage asset:artifact {TargetSlot:"offhand"} run data modify storage asset:artifact New.ItemData[-1].Triggers append from storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Triggers[{Slot:"auto"}] +data modify storage asset:artifact New.ItemData[-1].Triggers[].ID set from storage lib: Array[-1] +data modify storage asset:artifact New.ItemData[-1].Triggers[].Slot set from storage asset:artifact TargetSlot +data modify storage asset:artifact New.ItemData[-1].Triggers[].DisableBreakSound set from storage asset:artifact DisableBreakSound diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/init.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/init.mcfunction index d4c042bceb..96422b2db6 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/init.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/init.mcfunction @@ -5,68 +5,68 @@ # @within asset_manager:artifact/triggers/ # 初期化 - data remove storage asset:context New + data remove storage asset:artifact New # Inventory function api:data_get/inventory - data modify storage asset:context New.Inventory set from storage api: Inventory + data modify storage asset:artifact New.Inventory set from storage api: Inventory # SelectedItemSlot function api:data_get/selected_item_slot - data modify storage asset:context New.SelectedItemSlot set from storage api: SelectedItemSlot + data modify storage asset:artifact New.SelectedItemSlot set from storage api: SelectedItemSlot # Items function api:data_get/selected_item - data modify storage asset:context New.Items.mainhand set from storage api: SelectedItem - data modify storage asset:context New.Items.offhand set from storage asset:context New.Inventory[{Slot:-106b}] - data modify storage asset:context New.Items.feet set from storage asset:context New.Inventory[{Slot:100b}] - data modify storage asset:context New.Items.legs set from storage asset:context New.Inventory[{Slot:101b}] - data modify storage asset:context New.Items.chest set from storage asset:context New.Inventory[{Slot:102b}] - data modify storage asset:context New.Items.head set from storage asset:context New.Inventory[{Slot:103b}] + data modify storage asset:artifact New.Items.mainhand set from storage api: SelectedItem + data modify storage asset:artifact New.Items.offhand set from storage asset:artifact New.Inventory[{Slot:-106b}] + data modify storage asset:artifact New.Items.feet set from storage asset:artifact New.Inventory[{Slot:100b}] + data modify storage asset:artifact New.Items.legs set from storage asset:artifact New.Inventory[{Slot:101b}] + data modify storage asset:artifact New.Items.chest set from storage asset:artifact New.Inventory[{Slot:102b}] + data modify storage asset:artifact New.Items.head set from storage asset:artifact New.Inventory[{Slot:103b}] - execute if data storage asset:context New.Inventory[{Slot:0b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:0b}] - execute unless data storage asset:context New.Inventory[{Slot:0b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:0b} - execute if data storage asset:context New.Inventory[{Slot:1b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:1b}] - execute unless data storage asset:context New.Inventory[{Slot:1b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:1b} - execute if data storage asset:context New.Inventory[{Slot:2b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:2b}] - execute unless data storage asset:context New.Inventory[{Slot:2b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:2b} - execute if data storage asset:context New.Inventory[{Slot:3b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:3b}] - execute unless data storage asset:context New.Inventory[{Slot:3b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:3b} - execute if data storage asset:context New.Inventory[{Slot:4b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:4b}] - execute unless data storage asset:context New.Inventory[{Slot:4b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:4b} - execute if data storage asset:context New.Inventory[{Slot:5b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:5b}] - execute unless data storage asset:context New.Inventory[{Slot:5b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:5b} - execute if data storage asset:context New.Inventory[{Slot:6b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:6b}] - execute unless data storage asset:context New.Inventory[{Slot:6b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:6b} - execute if data storage asset:context New.Inventory[{Slot:7b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:7b}] - execute unless data storage asset:context New.Inventory[{Slot:7b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:7b} - execute if data storage asset:context New.Inventory[{Slot:8b}] run data modify storage asset:context New.Items.hotbar append from storage asset:context New.Inventory[{Slot:8b}] - execute unless data storage asset:context New.Inventory[{Slot:8b}] run data modify storage asset:context New.Items.hotbar append value {id:"none",Slot:8b} + execute if data storage asset:artifact New.Inventory[{Slot:0b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:0b}] + execute unless data storage asset:artifact New.Inventory[{Slot:0b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:0b} + execute if data storage asset:artifact New.Inventory[{Slot:1b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:1b}] + execute unless data storage asset:artifact New.Inventory[{Slot:1b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:1b} + execute if data storage asset:artifact New.Inventory[{Slot:2b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:2b}] + execute unless data storage asset:artifact New.Inventory[{Slot:2b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:2b} + execute if data storage asset:artifact New.Inventory[{Slot:3b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:3b}] + execute unless data storage asset:artifact New.Inventory[{Slot:3b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:3b} + execute if data storage asset:artifact New.Inventory[{Slot:4b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:4b}] + execute unless data storage asset:artifact New.Inventory[{Slot:4b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:4b} + execute if data storage asset:artifact New.Inventory[{Slot:5b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:5b}] + execute unless data storage asset:artifact New.Inventory[{Slot:5b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:5b} + execute if data storage asset:artifact New.Inventory[{Slot:6b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:6b}] + execute unless data storage asset:artifact New.Inventory[{Slot:6b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:6b} + execute if data storage asset:artifact New.Inventory[{Slot:7b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:7b}] + execute unless data storage asset:artifact New.Inventory[{Slot:7b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:7b} + execute if data storage asset:artifact New.Inventory[{Slot:8b}] run data modify storage asset:artifact New.Items.hotbar append from storage asset:artifact New.Inventory[{Slot:8b}] + execute unless data storage asset:artifact New.Inventory[{Slot:8b}] run data modify storage asset:artifact New.Items.hotbar append value {id:"none",Slot:8b} # NullCheck - execute unless data storage asset:context New.Items.mainhand run data modify storage asset:context New.Items.mainhand set value {} - execute unless data storage asset:context New.Items.offhand run data modify storage asset:context New.Items.offhand set value {} - execute unless data storage asset:context New.Items.feet run data modify storage asset:context New.Items.feet set value {} - execute unless data storage asset:context New.Items.legs run data modify storage asset:context New.Items.legs set value {} - execute unless data storage asset:context New.Items.chest run data modify storage asset:context New.Items.chest set value {} - execute unless data storage asset:context New.Items.head run data modify storage asset:context New.Items.head set value {} + execute unless data storage asset:artifact New.Items.mainhand run data modify storage asset:artifact New.Items.mainhand set value {} + execute unless data storage asset:artifact New.Items.offhand run data modify storage asset:artifact New.Items.offhand set value {} + execute unless data storage asset:artifact New.Items.feet run data modify storage asset:artifact New.Items.feet set value {} + execute unless data storage asset:artifact New.Items.legs run data modify storage asset:artifact New.Items.legs set value {} + execute unless data storage asset:artifact New.Items.chest run data modify storage asset:artifact New.Items.chest set value {} + execute unless data storage asset:artifact New.Items.head run data modify storage asset:artifact New.Items.head set value {} # 非TSBアイテムのNullCheck - execute unless data storage asset:context New.Items.mainhand.tag.TSB.ID run data modify storage asset:context New.Items.mainhand.tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.offhand.tag.TSB.ID run data modify storage asset:context New.Items.offhand.tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.feet.tag.TSB.ID run data modify storage asset:context New.Items.feet.tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.legs.tag.TSB.ID run data modify storage asset:context New.Items.legs.tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.chest.tag.TSB.ID run data modify storage asset:context New.Items.chest.tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.head.tag.TSB.ID run data modify storage asset:context New.Items.head.tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[0].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[0].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[1].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[1].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[2].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[2].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[3].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[3].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[4].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[4].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[5].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[5].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[6].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[6].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[7].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[7].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} - execute unless data storage asset:context New.Items.hotbar[8].tag.TSB.ID run data modify storage asset:context New.Items.hotbar[8].tag.TSB set value {ID:-2,UUID:-2,LocalCooldown:0} + execute unless data storage asset:artifact New.Items.mainhand.tag.TSB.ID run data modify storage asset:artifact New.Items.mainhand.tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.offhand.tag.TSB.ID run data modify storage asset:artifact New.Items.offhand.tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.feet.tag.TSB.ID run data modify storage asset:artifact New.Items.feet.tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.legs.tag.TSB.ID run data modify storage asset:artifact New.Items.legs.tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.chest.tag.TSB.ID run data modify storage asset:artifact New.Items.chest.tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.head.tag.TSB.ID run data modify storage asset:artifact New.Items.head.tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[0].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[0].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[1].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[1].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[2].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[2].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[3].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[3].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[4].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[4].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[5].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[5].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[6].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[6].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[7].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[7].tag.TSB set value {ID:-2,UUID:-2} + execute unless data storage asset:artifact New.Items.hotbar[8].tag.TSB.ID run data modify storage asset:artifact New.Items.hotbar[8].tag.TSB set value {ID:-2,UUID:-2} # id - data modify storage asset:context New.id.mainhand set from storage asset:context New.Items.mainhand.tag.TSB.ID - data modify storage asset:context New.id.offhand set from storage asset:context New.Items.offhand.tag.TSB.ID - data modify storage asset:context New.id.feet set from storage asset:context New.Items.feet.tag.TSB.ID - data modify storage asset:context New.id.legs set from storage asset:context New.Items.legs.tag.TSB.ID - data modify storage asset:context New.id.chest set from storage asset:context New.Items.chest.tag.TSB.ID - data modify storage asset:context New.id.head set from storage asset:context New.Items.head.tag.TSB.ID - data modify storage asset:context New.id.hotbar append from storage asset:context New.Items.hotbar[].tag.TSB.ID \ No newline at end of file + data modify storage asset:artifact New.id.mainhand set from storage asset:artifact New.Items.mainhand.tag.TSB.ID + data modify storage asset:artifact New.id.offhand set from storage asset:artifact New.Items.offhand.tag.TSB.ID + data modify storage asset:artifact New.id.feet set from storage asset:artifact New.Items.feet.tag.TSB.ID + data modify storage asset:artifact New.id.legs set from storage asset:artifact New.Items.legs.tag.TSB.ID + data modify storage asset:artifact New.id.chest set from storage asset:artifact New.Items.chest.tag.TSB.ID + data modify storage asset:artifact New.id.head set from storage asset:artifact New.Items.head.tag.TSB.ID + data modify storage asset:artifact New.id.hotbar append from storage asset:artifact New.Items.hotbar[].tag.TSB.ID diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/revert_from_current.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/revert_from_current.mcfunction deleted file mode 100644 index 19da4fc943..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/revert_from_current.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -#> asset_manager:artifact/data/new/revert_from_current -# -# currentデータをNewに格納します -# -# @within function asset_manager:artifact/triggers/** - -# 元配列 - function asset_manager:artifact/data/current/equips/init - data modify storage asset:artifact MaskEquips set from storage asset:artifact Equipments - - data modify storage asset:context id set from storage asset:context New.id - function asset_manager:artifact/data/current/equips/init -# idのmerge (-1はトリガー的なトリガー処理による削除なので上書きしない) - function asset_manager:artifact/data/current/equips/merge -# idの更新 - function asset_manager:artifact/data/current/equips/replace -# 新しいデータを一つ上の階層に上げる - data modify storage asset:context New.id set from storage asset:context id - data modify storage asset:context New.Items set from storage asset:context Items - data modify storage asset:context New.Inventory set from storage asset:context Inventory - data modify storage asset:context New.SelectedItemSlot set from storage asset:context SelectedItemSlot -# リセット - data remove storage asset:artifact MaskEquips - data remove storage asset:artifact Equipments - function asset_manager:artifact/data/current/reset \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/set_to_current.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/set_to_current.mcfunction deleted file mode 100644 index 1f54963e75..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/set_to_current.mcfunction +++ /dev/null @@ -1,26 +0,0 @@ -#> asset_manager:artifact/data/new/set_to_current -# -# Newをcurrentデータにsetします -# -# @within function asset_manager:artifact/triggers/** - -# リセット - function asset_manager:artifact/data/current/reset -# 新しいデータを一つ上の階層に上げる - data modify storage asset:context id set from storage asset:context New.id - data modify storage asset:context Items set from storage asset:context New.Items - data modify storage asset:context Inventory set from storage asset:context New.Inventory - data modify storage asset:context SelectedItemSlot set from storage asset:context New.SelectedItemSlot -# autoの処理 - # 初期化 - data modify storage asset:context id.auto set value -1 - # idのputとAutoSlotの設定 - data modify storage asset:context Items.AutoSlot set from storage asset:artifact Argument.AutoSlot - execute if data storage asset:artifact Argument{AutoSlot:"mainhand"} run data modify storage asset:context id.auto set from storage asset:context id.mainhand - execute if data storage asset:artifact Argument{AutoSlot:"offhand"} run data modify storage asset:context id.auto set from storage asset:context id.offhand - execute if data storage asset:artifact Argument{AutoSlot:"feet"} run data modify storage asset:context id.auto set from storage asset:context id.feet - execute if data storage asset:artifact Argument{AutoSlot:"legs"} run data modify storage asset:context id.auto set from storage asset:context id.legs - execute if data storage asset:artifact Argument{AutoSlot:"chest"} run data modify storage asset:context id.auto set from storage asset:context id.chest - execute if data storage asset:artifact Argument{AutoSlot:"head"} run data modify storage asset:context id.auto set from storage asset:context id.head - # リセット - data remove storage asset:artifact Argument.AutoSlot \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/stash_to_entity_storage.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/stash_to_entity_storage.mcfunction index f0357da6e6..1ddd64cf22 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/stash_to_entity_storage.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/data/new/stash_to_entity_storage.mcfunction @@ -7,7 +7,8 @@ # EntityStorage呼び出し function oh_my_dat:please # 突っ込む - data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Inventory set from storage asset:context New.Inventory - data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.SelectedItemSlot set from storage asset:context New.SelectedItemSlot - data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Items set from storage asset:context New.Items - data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.id set from storage asset:context New.id \ No newline at end of file + # data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Inventory set from storage asset:artifact New.Inventory + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.SelectedItemSlot set from storage asset:artifact New.SelectedItemSlot + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Items set from storage asset:artifact New.Items + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.id set from storage asset:artifact New.id + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.ItemData set from storage asset:artifact New.ItemData diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/init.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/init.mcfunction index f6b2dba4ca..383a58e6ae 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/init.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/init.mcfunction @@ -5,13 +5,14 @@ # @within function asset_manager:artifact/triggers/ # 初期化 - data remove storage asset:context Old + data remove storage asset:artifact Old # EntityStorage呼び出し function oh_my_dat:please # 突っ込む - data modify storage asset:context Old.Inventory set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Inventory - data modify storage asset:context Old.SelectedItemSlot set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.SelectedItemSlot - data modify storage asset:context Old.Items set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Items - data modify storage asset:context Old.id set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.id + # data modify storage asset:artifact Old.Inventory set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Inventory + data modify storage asset:artifact Old.SelectedItemSlot set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.SelectedItemSlot + data modify storage asset:artifact Old.Items set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.Items + data modify storage asset:artifact Old.id set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.id + data modify storage asset:artifact Old.ItemData set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash.ItemData # EntityStorageから削除 - data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash \ No newline at end of file + data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ContextStash diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/revert_from_current.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/revert_from_current.mcfunction deleted file mode 100644 index db2d1bc03a..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/revert_from_current.mcfunction +++ /dev/null @@ -1,25 +0,0 @@ -#> asset_manager:artifact/data/old/revert_from_current -# -# currentデータをOldに格納します -# -# @within function asset_manager:artifact/triggers/** - -# 元配列 - function asset_manager:artifact/data/current/equips/init - data modify storage asset:artifact MaskEquips set from storage asset:artifact Equipments - - data modify storage asset:context id set from storage asset:context Old.id - function asset_manager:artifact/data/current/equips/init -# idのmerge (-1はトリガー的なトリガー処理による削除なので上書きしない) - function asset_manager:artifact/data/current/equips/merge -# idの更新 - function asset_manager:artifact/data/current/equips/replace -# 新しいデータを一つ上の階層に上げる - data modify storage asset:context Old.id set from storage asset:context id - data modify storage asset:context Old.Items set from storage asset:context Items - data modify storage asset:context Old.Inventory set from storage asset:context Inventory - data modify storage asset:context Old.SelectedItemSlot set from storage asset:context SelectedItemSlot -# リセット - data remove storage asset:artifact MaskEquips - data remove storage asset:artifact Equipments - function asset_manager:artifact/data/current/reset \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/set_to_current.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/set_to_current.mcfunction deleted file mode 100644 index b1a59dbd8c..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/data/old/set_to_current.mcfunction +++ /dev/null @@ -1,26 +0,0 @@ -#> asset_manager:artifact/data/old/set_to_current -# -# Oldをcurrentデータにsetします -# -# @within function asset_manager:artifact/triggers/** - -# リセット - function asset_manager:artifact/data/current/reset -# 新しいデータを一つ上の階層に上げる - data modify storage asset:context id set from storage asset:context Old.id - data modify storage asset:context Items set from storage asset:context Old.Items - data modify storage asset:context Inventory set from storage asset:context Old.Inventory - data modify storage asset:context SelectedItemSlot set from storage asset:context Old.SelectedItemSlot -# autoの処理 - # 初期化 - data modify storage asset:context id.auto set value -1 - # idのputとAutoSlotの設定 - data modify storage asset:context Items.AutoSlot set from storage asset:artifact Argument.AutoSlot - execute if data storage asset:artifact Argument{AutoSlot:"mainhand"} run data modify storage asset:context id.auto set from storage asset:context id.mainhand - execute if data storage asset:artifact Argument{AutoSlot:"offhand"} run data modify storage asset:context id.auto set from storage asset:context id.offhand - execute if data storage asset:artifact Argument{AutoSlot:"feet"} run data modify storage asset:context id.auto set from storage asset:context id.feet - execute if data storage asset:artifact Argument{AutoSlot:"legs"} run data modify storage asset:context id.auto set from storage asset:context id.legs - execute if data storage asset:artifact Argument{AutoSlot:"chest"} run data modify storage asset:context id.auto set from storage asset:context id.chest - execute if data storage asset:artifact Argument{AutoSlot:"head"} run data modify storage asset:context id.auto set from storage asset:context id.head - # リセット - data remove storage asset:artifact Argument.AutoSlot \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/give/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/.mcfunction index 610e090388..1bd46bf5cd 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/give/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/.mcfunction @@ -1,56 +1,91 @@ #> asset_manager:artifact/give/ # +# 神器を入手します # -# -# @within function api:artifact/*/from_rarity +# @input storage asset:artifact +# ID : int +# Item : ItemID +# Name : TextComponent +# Lore : TextComponent[] +# RemainingCount? : int +# RemainingCountMax? : int +# Triggers : Component[] +# ├ Slot : Slot +# ├ Trigger : Trigger +# ├ Condition? : TextComponent +# ├ AttackInfo? : Component +# ├ MPCost : int +# ├ MPRequire? : int +# ├ CostText? : TextComponent +# ├ LocalCooldown? : int +# ├ SpecialCooldown? : int +# ├ DisableCooldownMessage? : boolean +# ├ DisableMPMessage? : boolean +# └ Secret? : boolean +# DisableBreakSound? : boolean +# CanUsedGod : God[] +# EquipID? : int +# Modifiers : Component[] +# ├ Type : string +# ├ Amount : double +# ├ Operation : "add" | "multiply_base" | "multiply" +# ├ MaxStack? : int +# └ StackReduction? : double +# Field? : Component +# CustomNBT? : Component +# @output item 神器 +# @within function api:artifact/core/from_id -#> For calc +#> Inv # @private - #declare score_holder $CandidateLength - #declare score_holder $Argument.Index - #declare score_holder $Pulls + #declare score_holder $InvSize + +# storage検証 + execute unless data storage asset:artifact ID run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" ID","color":"red"}] + execute unless data storage asset:artifact Item run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Item","color":"red"}] + execute unless data storage asset:artifact Name run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Name","color":"red"}] + execute unless data storage asset:artifact Lore run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Lore","color":"red"}] + # execute unless data storage asset:artifact RemainingCount run + execute unless data storage asset:artifact RemainingCountMax if data storage asset:artifact RemainingCount run data modify storage asset:artifact RemainingCountMax set from storage asset:artifact RemainingCount + execute unless data storage asset:artifact Triggers[0] run data modify storage asset:artifact Triggers set value [] + execute if data storage asset:artifact Triggers[0] run data modify storage asset:artifact CopiedTriggers set from storage asset:artifact Triggers + execute if data storage asset:artifact Triggers[0] run function asset_manager:artifact/give/validate/trigger + execute if data storage asset:artifact Triggers[0] run data remove storage asset:artifact CopiedTriggers + # execute unless data storage asset:artifact DisableBreakSound run + execute unless data storage asset:artifact CanUsedGod run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" CanUsedGod","color":"red"}] + execute unless data storage asset:artifact EquipID run data modify storage asset:artifact EquipID set value -1 + execute unless data storage asset:artifact Modifiers[0] run data modify storage asset:artifact Modifiers set value [] + execute if data storage asset:artifact Modifiers[0] run data modify storage asset:artifact CopiedModifiers set from storage asset:artifact Modifiers + execute if data storage asset:artifact Modifiers[0] run function asset_manager:artifact/give/validate/modifier + execute if data storage asset:artifact Modifiers[0] run data remove storage asset:artifact CopiedModifiers + # execute unless data storage asset:artifact Field run + # execute unless data storage asset:artifact CustomNBT run +# 各データ設定 + function asset_manager:artifact/create/set_data +# 神器排出 + execute unless data storage asset:context Type run data modify storage asset:context Type set value "give" + # execute if data storage asset:context {Type:"box"} // 何もする必要がない + execute if data storage asset:context {Type:"drop"} run loot spawn ~ ~ ~ mine 10000 0 10000 debug_stick + execute if data storage asset:context {Type:"drop",Important:true} as @e[type=item,nbt={Item:{tag:{TSB:{}}}},distance=..0.3] run function asset_manager:artifact/give/protect + execute if data storage asset:context {Type:"give"} run function api:inventory/get_size + execute if data storage asset:context {Type:"give"} if score $InvSize Lib matches ..35 run loot give @s mine 10000 0 10000 debug_stick + execute if data storage asset:context {Type:"give"} if score $InvSize Lib matches 36.. run loot spawn ~ ~ ~ mine 10000 0 10000 debug_stick + execute if data storage asset:context {Type:"give"} if score $InvSize Lib matches 36.. as @e[type=item,nbt={Item:{tag:{TSB:{}}}},distance=..0.3] run function asset_manager:artifact/give/protect + execute if data storage asset:context {Type:"replace"} run function asset_manager:artifact/give/replace -# セッション開ける - function lib:array/session/open -# 該当レアリティのデータを取得 - execute if data storage api: Argument{Rarity:1} run data modify storage lib: Array set from storage asset:artifact RarityRegistry[1] - execute if data storage api: Argument{Rarity:2} run data modify storage lib: Array set from storage asset:artifact RarityRegistry[2] - execute if data storage api: Argument{Rarity:3} run data modify storage lib: Array set from storage asset:artifact RarityRegistry[3] - execute if data storage api: Argument{Rarity:4} run data modify storage lib: Array set from storage asset:artifact RarityRegistry[4] -# データサイズを取得 - execute store result score $CandidateLength Temporary if data storage lib: Array[] -# 対象Indexを決定 - execute if data storage api: Argument{Rarity:1} run data modify storage lib: Args.key set value "artifact_lv-1" - execute if data storage api: Argument{Rarity:2} run data modify storage lib: Args.key set value "artifact_lv-2" - execute if data storage api: Argument{Rarity:3} run data modify storage lib: Args.key set value "artifact_lv-3" - execute if data storage api: Argument{Rarity:4} run data modify storage lib: Args.key set value "artifact_lv-4" - execute store result storage lib: Args.max int 1 run scoreboard players get $CandidateLength Temporary - execute store result storage lib: Args.scarcity_history_size int 0.35 run scoreboard players get $CandidateLength Temporary - execute store result score $Argument.Index Lib run function lib:random/with_biased/manual.m with storage lib: Args -# 候補データを操作して対象Indexを-1に持ってくる - function lib:array/move -# 一旦リセット - data modify storage asset:artifact Picks set from storage lib: Array[-1] - function lib:array/session/close -# 候補データの再設定 - function lib:array/session/open - data modify storage lib: Array set from storage asset:artifact Picks -# プル数を乱数により設定 -# $Pulls = floor( $CandidateLength * 0.30~0.70(e2) ) / e2 - execute store result score $CandidateLength Temporary if data storage lib: Array[] - scoreboard players remove $CandidateLength Temporary 1 - execute store result score $Pulls Temporary run function lib:random/ - scoreboard players operation $Pulls Temporary %= $41 Const - scoreboard players add $Pulls Temporary 30 - scoreboard players operation $Pulls Temporary *= $CandidateLength Temporary - scoreboard players operation $Pulls Temporary /= $100 Const -# シャッフルして取り出す - scoreboard players add $CandidateLength Temporary 1 - data modify storage asset:artifact Type set from storage asset:context Type - function asset_manager:artifact/give/candidates # リセット - function lib:array/session/close - scoreboard players reset $CandidateLength Temporary - scoreboard players reset $Pulls Temporary - data remove storage lib: Args - data remove storage asset:artifact Type + scoreboard players reset $InvSize Lib + data remove storage asset:context Type + data remove storage asset:artifact ID + data remove storage asset:artifact Item + data remove storage asset:artifact Name + data remove storage asset:artifact Lore + data remove storage asset:artifact RemainingCount + data remove storage asset:artifact RemainingCountMax + data remove storage asset:artifact Triggers + data remove storage asset:artifact DisableBreakSound + data remove storage asset:artifact CanUsedGod + data remove storage asset:artifact EquipID + data remove storage asset:artifact Modifiers + data remove storage asset:artifact Field + data remove storage asset:artifact CustomNBT diff --git a/TheSkyBlessing/data/asset/functions/artifact/common/protect.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/protect.mcfunction similarity index 65% rename from TheSkyBlessing/data/asset/functions/artifact/common/protect.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/give/protect.mcfunction index 9169da8e5a..d5ce8eb6ae 100644 --- a/TheSkyBlessing/data/asset/functions/artifact/common/protect.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/protect.mcfunction @@ -1,12 +1,9 @@ -#> asset:artifact/common/protect -# -# -# -# @within function asset:artifact/common/give +#> asset_manager:artifact/give/protect +# @within function asset_manager:artifact/give/ data modify entity @s Glowing set value true data modify entity @s NoGravity set value true data modify entity @s Age set value -32768 data modify entity @s Invulnerable set value true data modify entity @s Motion set value [0d,0d,0d] -data modify entity @s Fire set value 2s \ No newline at end of file +data modify entity @s Fire set value 2s diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/give/put_data_to_map.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/put_data_to_map.mcfunction new file mode 100644 index 0000000000..63a5f405ba --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/put_data_to_map.mcfunction @@ -0,0 +1,23 @@ +#> asset_manager:artifact/give/put_data_to_map +# +# +# +# @within function asset:artifact/*/register + +# ID をキーにする + data modify storage api: Argument.Address set from storage asset:context id + +# キーからROMを呼び出す + function api:rom/please + +# データを保存する + data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Triggers + data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Triggers set from storage asset:artifact Triggers + data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.DisableBreakSound + data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.DisableBreakSound set from storage asset:artifact DisableBreakSound + data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.EquipID + data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.EquipID set from storage asset:artifact EquipID + data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Modifiers + data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Modifiers set from storage asset:artifact Modifiers + data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.CanUsedGod + data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.CanUsedGod set from storage asset:artifact CanUsedGod diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/give/put_id_to_map.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/put_id_to_map.mcfunction new file mode 100644 index 0000000000..8a4724eec8 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/put_id_to_map.mcfunction @@ -0,0 +1,15 @@ +#> asset_manager:artifact/give/put_id_to_map +# +# +# +# @within function asset:artifact/extends + +# ID をキーにする + data modify storage api: Argument.Address set from storage asset:context id + +# キーからROMを呼び出す + function api:rom/please + +# データを保存する + data remove storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Extends + data modify storage rom: _[-4][-4][-4][-4][-4][-4][-4][-4].Artifact.Extends set from storage asset:artifact Extends diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/give/register.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/register.m.mcfunction new file mode 100644 index 0000000000..df0a10d28d --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/register.m.mcfunction @@ -0,0 +1,9 @@ +#> asset_manager:artifact/give/register.m +# +# +# +# @within function +# api:artifact/core/from_id +# asset:artifact/extends/foreach + +$function asset:artifact/alias/$(id)/register diff --git a/TheSkyBlessing/data/asset/functions/artifact/common/replace.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/replace.mcfunction similarity index 77% rename from TheSkyBlessing/data/asset/functions/artifact/common/replace.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/give/replace.mcfunction index f660d769ab..1c4f78815b 100644 --- a/TheSkyBlessing/data/asset/functions/artifact/common/replace.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/replace.mcfunction @@ -1,11 +1,8 @@ -#> asset:artifact/common/replace +#> asset_manager:artifact/give/replace # # 直接特定Slotに神器を配置します # -# @within function asset:artifact/common/give - -# storageチェック - execute unless data storage asset:context Slot run data modify storage asset:context Slot set value "mainhand" +# @within function asset_manager:artifact/give/ # slot指定replace execute if data storage asset:context {Slot:"mainhand"} run item replace entity @s weapon.mainhand from block 10000 0 10000 container.0 @@ -16,4 +13,4 @@ execute if data storage asset:context {Slot:"head"} run item replace entity @s armor.head from block 10000 0 10000 container.0 # リセット - data remove storage asset:context Slot \ No newline at end of file + data remove storage asset:context Slot diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/give/validate/modifier.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/validate/modifier.mcfunction new file mode 100644 index 0000000000..8212a094c3 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/validate/modifier.mcfunction @@ -0,0 +1,15 @@ +#> asset_manager:artifact/give/validate/modifier +# @within function +# asset_manager:artifact/give/ +# asset_manager:artifact/give/validate/modifier + +# validate + execute unless data storage asset:artifact CopiedModifiers[-1].Type run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Type","color":"red"}] + execute unless data storage asset:artifact CopiedModifiers[-1].Amount run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Amount","color":"red"}] + execute unless data storage asset:artifact CopiedModifiers[-1].Operation run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Operation","color":"red"}] + # execute unless data storage asset:artifact CopiedModifiers[-1].MaxStack + # execute unless data storage asset:artifact CopiedModifiers[-1].StackReduction + +# loop + data remove storage asset:artifact CopiedModifiers[-1] + execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/give/validate/modifier diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/give/validate/trigger.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/give/validate/trigger.mcfunction new file mode 100644 index 0000000000..dc2a173682 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/give/validate/trigger.mcfunction @@ -0,0 +1,21 @@ +#> asset_manager:artifact/give/validate/trigger +# @within function +# asset_manager:artifact/give/ +# asset_manager:artifact/give/validate/trigger + +# validate + execute unless data storage asset:artifact CopiedTriggers[-1].Slot run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Slot","color":"red"}] + execute unless data storage asset:artifact CopiedTriggers[-1].Trigger run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" Trigger","color":"red"}] + # execute unless data storage asset:artifact CopiedTriggers[-1].Condition run + # execute unless data storage asset:artifact CopiedTriggers[-1].AttackInfo run + execute unless data storage asset:artifact CopiedTriggers[-1].MPCost run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" MPCost","color":"red"}] + # execute unless data storage asset:artifact CopiedTriggers[-1].MPRequire run + # execute unless data storage asset:artifact CopiedTriggers[-1].CostText run + # execute unless data storage asset:artifact CopiedTriggers[-1].LocalCooldown run + # execute unless data storage asset:artifact CopiedTriggers[-1].SpecialCooldown run + # execute unless data storage asset:artifact CopiedTriggers[-1].DisableCooldownMessage run + # execute unless data storage asset:artifact CopiedTriggers[-1].DisableMPMessage run + +# loop + data remove storage asset:artifact CopiedTriggers[-1] + execute if data storage asset:artifact CopiedTriggers[0] run function asset_manager:artifact/give/validate/trigger diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/load.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/load.mcfunction index b0530474d6..272bb799e6 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/load.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/load.mcfunction @@ -5,6 +5,7 @@ # @within function core:load # 定義データを吹き飛ばす - data modify storage asset:artifact RarityRegistry set value [["UNUSED"], [], [], [], []] + data modify storage asset:artifact ShardPool set value [["UNUSED"], [], [], [], []] # 読み込み - function #asset:artifact/register \ No newline at end of file + function #asset:artifact/enroll_pool + function #asset:artifact/register diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction index da10b52c8f..4d03e21eeb 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction @@ -7,32 +7,31 @@ # IDの代入 function asset_manager:artifact/data/old/init function asset_manager:artifact/data/new/init -# 装備の変更チェック - execute if data storage asset:context Old run function asset_manager:artifact/triggers/equipments/compare -# 変更時の更新処理 - execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_cooldown/ +# 装備のデータ取り出し + function asset_manager:artifact/data/new/fetch_data/ # イベント情報を取得 data modify storage asset:artifact ArtifactEvents set from storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].ArtifactEvents set value {} -# 各トリガーに処理受け渡し & AutoSlotのリセット - function asset_manager:artifact/triggers/tick - execute if entity @s[tag=TriggerFlag.ClickCarrot] run function asset_manager:artifact/triggers/click.carrot - execute if entity @s[tag=TriggerFlag.UseItem] run function asset_manager:artifact/triggers/use_item/ - execute if entity @s[tag=TriggerFlag.Sneak] run function asset_manager:artifact/triggers/sneak/ - execute if entity @s[tag=TriggerFlag.UsingItem] run function asset_manager:artifact/triggers/using_item - execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/dis_equip - execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equip - execute if data storage asset:artifact ArtifactEvents.Attack[0] run function asset_manager:artifact/triggers/attack/ - execute if data storage asset:artifact ArtifactEvents.Damage[0] run function asset_manager:artifact/triggers/damage/ - execute if data storage asset:artifact ArtifactEvents.Killed[0] run function asset_manager:artifact/triggers/killed/ - execute if data storage asset:artifact ArtifactEvents.Heal[0] run function asset_manager:artifact/triggers/heal/ - execute if data storage asset:artifact ArtifactEvents.ReceiveHeal[0] run function asset_manager:artifact/triggers/receive_heal/ +# 装備の変更チェック + execute if data storage asset:artifact Old run function asset_manager:artifact/triggers/equipments/compare +# 変更時の更新処理 + execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_cooldown/ + execute if data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_attribute/ +# 改宗時の更新処理 + execute if entity @s[tag=Believe.Changed] unless data storage asset:artifact {EquipmentChanges:[{_:{_:false}}]} run function asset_manager:artifact/triggers/equipments/update_attribute/ +# 各神器にトリガー受けわたし + scoreboard players set $SlotIndex Temporary 15 + data modify storage asset:artifact CopiedItemData set from storage asset:artifact New.ItemData + function asset_manager:artifact/triggers/foreach # EntityStorageにデータ突っ込む function asset_manager:artifact/data/new/stash_to_entity_storage # リセット + 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 tag @s remove TriggerFlag.Sneak diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/.mcfunction index 9c42690388..e69de29bb2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/.mcfunction @@ -1,12 +0,0 @@ -#> asset_manager:artifact/triggers/attack/ -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# イベントを順に発火する - function asset_manager:artifact/triggers/attack/foreach -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/add_tag_each_victim.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/add_tag_each_victim.mcfunction deleted file mode 100644 index b82da55379..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/add_tag_each_victim.mcfunction +++ /dev/null @@ -1,20 +0,0 @@ -#> asset_manager:artifact/triggers/attack/add_tag_each_victim -# -# -# -# @within function -# asset_manager:artifact/triggers/attack/foreach -# asset_manager:artifact/triggers/attack/add_tag_each_victim - -#> Private -# @private -#declare score_holder $AttackTarget - -execute store result score $AttackTarget Temporary run data get storage asset:artifact AttackTargets[-1] -data remove storage asset:artifact AttackTargets[-1] - -execute as @e[type=#lib:living,type=!player,distance=..150] if score @s MobUUID = $AttackTarget Temporary run tag @s add Victim - -scoreboard players reset $AttackTarget Temporary - -execute if data storage asset:artifact AttackTargets[0] run function asset_manager:artifact/triggers/attack/add_tag_each_victim diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/foreach.mcfunction deleted file mode 100644 index 16660e01f2..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/foreach.mcfunction +++ /dev/null @@ -1,33 +0,0 @@ -#> asset_manager:artifact/triggers/attack/foreach -# -# -# -# @within function asset_manager:artifact/triggers/attack/* - -# イベントデータ取得 - data modify storage asset:context Attack set from storage asset:artifact ArtifactEvents.Attack[-1] - data remove storage asset:artifact ArtifactEvents.Attack[-1] -# 攻撃先を取得し、Victim を付与する (null の可能性もある) - data modify storage asset:artifact AttackTargets set from storage asset:context Attack.To - execute if data storage asset:artifact AttackTargets[0] run function asset_manager:artifact/triggers/attack/add_tag_each_victim -# 最大ダメージの計算 - function lib:array/session/open - data modify storage lib: Array set from storage asset:context Attack.Amounts - function lib:array/math/max - data modify storage asset:context Attack.Amount set from storage lib: MaxResult - function lib:array/session/close -# 神器側に受け渡し - function #asset:artifact/attack - execute if data storage asset:context Attack{Type:"vanilla_melee" } run tag @s add ShouldVanillaAttack - execute if data storage asset:context Attack{Type:"vanilla_melee" } run function #asset:artifact/attack/melee - execute if data storage asset:context Attack{Type:"vanilla_melee" } if entity @s[tag=ShouldVanillaAttack] as @e[type=#lib:living,type=!player,tag=Victim,distance=..8] at @s run function asset_manager:artifact/triggers/attack/vanilla/ - execute if data storage asset:context Attack{Type:"vanilla_projectile"} run function #asset:artifact/attack/projectile - execute if data storage asset:context Attack{Type:"vanilla_projectile"} as @e[type=#lib:living,type=!player,tag=Victim,distance=..150] at @s run function asset_manager:artifact/triggers/attack/vanilla/ - execute if data storage asset:context Attack{Type:"vanilla_explosion" } run function #asset:artifact/attack/explosion -# リセット - data remove storage asset:context Attack - data remove storage asset:artifact AttackTargets - tag @s remove ShouldVanillaAttack - tag @e[type=#lib:living,type=!player,tag=Victim] remove Victim -# イベントがまだあれば再帰する - execute if data storage asset:artifact ArtifactEvents.Attack[0] run function asset_manager:artifact/triggers/attack/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/vanilla/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/vanilla/.mcfunction deleted file mode 100644 index 86a81be5dd..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/vanilla/.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -#> asset_manager:artifact/triggers/attack/vanilla/ -# -# 神器に関係しない通常攻撃のダメージ処理 -# -# @within function asset_manager:artifact/triggers/attack/foreach - -#> Private -# @within asset_manager:artifact/triggers/attack/vanilla/* - #declare score_holder $Damage - -#> Private -# @private - #declare score_holder $Fluctuation - -# Damage - execute store result score $Damage Temporary run data get storage asset:context Attack.Amount -100 -# 減算 - scoreboard players operation @s MobHealth += $Damage Temporary -# ダメージ表示 - scoreboard players operation $Fluctuation Lib = $Damage Temporary - execute unless score $Fluctuation Lib matches 0 run function lib:status_log/show_health -# 代入 / kill - execute if score @s MobHealth matches ..0 run tag @s add Death - execute if score @s MobHealth matches ..0 run function asset_manager:artifact/triggers/attack/vanilla/push_kill_and_death_event - -# リセット - scoreboard players reset $Damage Temporary - tag @s remove ShouldVanillaAttack diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/vanilla/push_kill_and_death_event.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/vanilla/push_kill_and_death_event.mcfunction deleted file mode 100644 index 57c455506d..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/attack/vanilla/push_kill_and_death_event.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -#> asset_manager:artifact/triggers/attack/vanilla/push_kill_and_death_event -# -# -# -# @within function asset_manager:artifact/triggers/attack/vanilla/ - -# プレイヤーにイベントを追加する - 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 -# 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 - data remove storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].MobEvents.Death[-1].To - 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 @p[tag=this] UserID diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/click.carrot.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/click.carrot.mcfunction deleted file mode 100644 index 3f89409728..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/click.carrot.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -#> asset_manager:artifact/triggers/click.carrot -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - execute if predicate asset_manager:is_use_mainhand/carrot_on_a_stick run data modify storage asset:artifact Argument.AutoSlot set value "mainhand" - execute unless predicate asset_manager:is_use_mainhand/carrot_on_a_stick run data modify storage asset:artifact Argument.AutoSlot set value "offhand" - function asset_manager:artifact/data/new/set_to_current -# 神器側に受け渡し - function #asset:artifact/click.carrot_on_a_stick -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/click/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/click/.mcfunction new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/damage/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/damage/.mcfunction index 78cd400a9f..e69de29bb2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/damage/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/damage/.mcfunction @@ -1,12 +0,0 @@ -#> asset_manager:artifact/triggers/damage/ -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# 神器側に受け渡し - function asset_manager:artifact/triggers/damage/foreach -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/damage/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/damage/foreach.mcfunction deleted file mode 100644 index ed68f01f66..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/damage/foreach.mcfunction +++ /dev/null @@ -1,36 +0,0 @@ -#> asset_manager:artifact/triggers/damage/foreach -# -# -# -# @within function asset_manager:artifact/triggers/damage/* - -#> Private -# @private -#declare score_holder $AttackedFrom - -# イベントデータ取得 - data modify storage asset:context Damage set from storage asset:artifact ArtifactEvents.Damage[-1] - data remove storage asset:artifact ArtifactEvents.Damage[-1] -# 攻撃元を取得し、Attacker を付与する (null の可能性もある) - execute if data storage asset:context Damage.From store result score $AttackedFrom Temporary run data get storage asset:context Damage.From - execute if data storage asset:context Damage.From as @e[type=#lib:living,type=!player,distance=..150] if score @s MobUUID = $AttackedFrom Temporary run tag @s add Attacker - scoreboard players reset $AttackedFrom Temporary -# 神器側に受け渡し - function #asset:artifact/damage - execute if data storage asset:context Damage{Type:"vanilla_melee" } run function #asset:artifact/damage/melee - execute if data storage asset:context Damage{Type:"vanilla_drowning" } run function #asset:artifact/damage/drowning - execute if data storage asset:context Damage{Type:"vanilla_projectile"} run function #asset:artifact/damage/projectile - execute if data storage asset:context Damage{Type:"vanilla_explosion" } run function #asset:artifact/damage/explosion - execute if data storage asset:context Damage{Type:"vanilla_fire" } run function #asset:artifact/damage/fire - execute if data storage asset:context Damage{Type:"vanilla_freezing" } run function #asset:artifact/damage/freezing - execute if data storage asset:context Damage{Type:"vanilla_lightning" } run function #asset:artifact/damage/lightning - execute if data storage asset:context Damage{Type:"vanilla_other" } run function #asset:artifact/damage/other - execute if data storage asset:context Damage.From run function #asset:artifact/damage/from_entity/ - execute if data storage asset:context Damage.From if data storage asset:context Damage{Type:"vanilla_melee" } run function #asset:artifact/damage/from_entity/melee - execute if data storage asset:context Damage.From if data storage asset:context Damage{Type:"vanilla_projectile"} run function #asset:artifact/damage/from_entity/projectile - execute if data storage asset:context Damage.From if data storage asset:context Damage{Type:"vanilla_explosion" } run function #asset:artifact/damage/from_entity/explosion -# リセット - data remove storage asset:context Damage - tag @e[type=#lib:living,type=!player,tag=Attacker] remove Attacker -# イベントがまだあれば再帰する - execute if data storage asset:artifact ArtifactEvents.Damage[0] run function asset_manager:artifact/triggers/damage/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/dis-equip/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/dis-equip/.mcfunction new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/dis_equip.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/dis_equip.mcfunction deleted file mode 100644 index 76887a07b6..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/dis_equip.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -#> asset_manager:artifact/triggers/dis_equip -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/old/set_to_current -# 全スロットを参照できるidを作る - data modify storage asset:context id.all set from storage asset:context id -# 変更のなかったスロットをマスクする - function asset_manager:artifact/triggers/equipments/mask_slot/ -# 神器側に受け渡し - function #asset:artifact/dis_equip -# イベント発火後に実行するやつ - function asset_manager:artifact/data/old/revert_from_current \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equip.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equip.mcfunction deleted file mode 100644 index cd0a124596..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equip.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -#> asset_manager:artifact/triggers/equip -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# 全スロットを参照できるidを作る - data modify storage asset:context id.all set from storage asset:context id -# 変更のなかったスロットをマスクする - function asset_manager:artifact/triggers/equipments/mask_slot/ -# 神器側に受け渡し - function #asset:artifact/equip -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equip/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equip/.mcfunction new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/compare.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/compare.mcfunction index 9e549b8c5e..efac5f1f33 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/compare.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/compare.mcfunction @@ -4,34 +4,27 @@ # # @within function asset_manager:artifact/triggers/ -#> private use -# @private - #declare score_holder $Temp - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current # セッション開く function lib:array/session/open # データ設定 - data modify storage lib: ArrayA append from storage asset:context New.Items.mainhand.tag.TSB.UUID - data modify storage lib: ArrayA append from storage asset:context New.Items.offhand.tag.TSB.UUID - data modify storage lib: ArrayA append from storage asset:context New.Items.feet.tag.TSB.UUID - data modify storage lib: ArrayA append from storage asset:context New.Items.legs.tag.TSB.UUID - data modify storage lib: ArrayA append from storage asset:context New.Items.chest.tag.TSB.UUID - data modify storage lib: ArrayA append from storage asset:context New.Items.head.tag.TSB.UUID - data modify storage lib: ArrayA append from storage asset:context New.Items.hotbar[].tag.TSB.UUID + data modify storage lib: ArrayA append from storage asset:artifact New.Items.mainhand.tag.TSB.UUID + data modify storage lib: ArrayA append from storage asset:artifact New.Items.offhand.tag.TSB.UUID + data modify storage lib: ArrayA append from storage asset:artifact New.Items.feet.tag.TSB.UUID + data modify storage lib: ArrayA append from storage asset:artifact New.Items.legs.tag.TSB.UUID + data modify storage lib: ArrayA append from storage asset:artifact New.Items.chest.tag.TSB.UUID + data modify storage lib: ArrayA append from storage asset:artifact New.Items.head.tag.TSB.UUID + data modify storage lib: ArrayA append from storage asset:artifact New.Items.hotbar[].tag.TSB.UUID - data modify storage lib: ArrayB append from storage asset:context Old.Items.mainhand.tag.TSB.UUID - data modify storage lib: ArrayB append from storage asset:context Old.Items.offhand.tag.TSB.UUID - data modify storage lib: ArrayB append from storage asset:context Old.Items.feet.tag.TSB.UUID - data modify storage lib: ArrayB append from storage asset:context Old.Items.legs.tag.TSB.UUID - data modify storage lib: ArrayB append from storage asset:context Old.Items.chest.tag.TSB.UUID - data modify storage lib: ArrayB append from storage asset:context Old.Items.head.tag.TSB.UUID - data modify storage lib: ArrayB append from storage asset:context Old.Items.hotbar[].tag.TSB.UUID + data modify storage lib: ArrayB append from storage asset:artifact Old.Items.mainhand.tag.TSB.UUID + data modify storage lib: ArrayB append from storage asset:artifact Old.Items.offhand.tag.TSB.UUID + data modify storage lib: ArrayB append from storage asset:artifact Old.Items.feet.tag.TSB.UUID + data modify storage lib: ArrayB append from storage asset:artifact Old.Items.legs.tag.TSB.UUID + data modify storage lib: ArrayB append from storage asset:artifact Old.Items.chest.tag.TSB.UUID + data modify storage lib: ArrayB append from storage asset:artifact Old.Items.head.tag.TSB.UUID + data modify storage lib: ArrayB append from storage asset:artifact Old.Items.hotbar[].tag.TSB.UUID # 比較 function lib:array/compare # 比較結果を保存する data modify storage asset:artifact EquipmentChanges set from storage lib: CompareResult # リセット function lib:array/session/close - scoreboard players reset $Temp Temporary \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/mask_slot/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/mask_slot/.mcfunction deleted file mode 100644 index 3372445c40..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/mask_slot/.mcfunction +++ /dev/null @@ -1,16 +0,0 @@ -#> asset_manager:artifact/triggers/equipments/mask_slot/ -# -# -# -# @within function asset_manager:artifact/triggers/*equip - -# 元配列 - function asset_manager:artifact/data/current/equips/init - data modify storage asset:artifact CopiedEquipChanges set from storage asset:artifact EquipmentChanges -# マスク処理 - function asset_manager:artifact/triggers/equipments/mask_slot/masking_foreach -# 適用する(結果が反転しているので注意) - function asset_manager:artifact/data/current/equips/replace -# リセット - data remove storage asset:artifact CopiedEquipChanges - data remove storage asset:artifact Equipments \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/mask_slot/masking_foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/mask_slot/masking_foreach.mcfunction deleted file mode 100644 index 965f531250..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/mask_slot/masking_foreach.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -#> asset_manager:artifact/triggers/equipments/mask_slot/masking_foreach -# -# -# -# @within function asset_manager:artifact/triggers/equipments/mask_slot/* - -# 末尾要素に応じて追加するものを変える - execute if data storage asset:artifact CopiedEquipChanges[-1]._{_: true} run data modify storage asset:artifact NewEquips append value -1 - execute if data storage asset:artifact CopiedEquipChanges[-1]._{_:false} run data modify storage asset:artifact NewEquips append from storage asset:artifact Equipments[-1] -# 末尾削除 - data remove storage asset:artifact CopiedEquipChanges[-1] - data remove storage asset:artifact Equipments[-1] -# 要素がまだあるなら再帰 - execute if data storage asset:artifact CopiedEquipChanges[0] if data storage asset:artifact Equipments[0] run function asset_manager:artifact/triggers/equipments/mask_slot/masking_foreach \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/.mcfunction new file mode 100644 index 0000000000..daae5cf28e --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/.mcfunction @@ -0,0 +1,25 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/ +# +# +# +# @within function asset_manager:artifact/triggers/ + +# 装備が変更されている箇所を抽出 + data modify storage asset:artifact CopiedChanges set from storage asset:artifact EquipmentChanges + data modify storage asset:artifact CopiedOldItemData set from storage asset:artifact Old.ItemData + data modify storage asset:artifact CopiedNewItemData set from storage asset:artifact New.ItemData + function asset_manager:artifact/triggers/equipments/update_attribute/extract_changes +# 古いModifierを削除 + data modify storage asset:artifact CopiedModifiers set from storage asset:artifact MaskedOldItemData[].Modifiers + function asset_manager:artifact/triggers/equipments/update_attribute/remove/ +# 新しいModifierを付与 + data modify storage asset:artifact CopiedModifiers set from storage asset:artifact MaskedNewItemData[].Modifiers + function asset_manager:artifact/triggers/equipments/update_attribute/add/ +# セット装備効果の更新 + function asset_manager:artifact/triggers/equipments/update_attribute/attire/ + +# リセット + data remove storage asset:artifact CopiedChanges + data remove storage asset:artifact CopiedOldItemData + data remove storage asset:artifact CopiedNewItemData + data remove storage asset:artifact CopiedModifiers diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/_index.d.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/_index.d.mcfunction new file mode 100644 index 0000000000..bce4442a00 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/_index.d.mcfunction @@ -0,0 +1,11 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/_index.d +# @private + +#> custom modifier +# @within function asset_manager:artifact/triggers/equipments/update_attribute/** + #declare score_holder $CustomModifier + +#> dec to hex +# @within function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/** + #declare score_holder $F + #declare score_holder $FFFF diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/.mcfunction new file mode 100644 index 0000000000..4a5982744d --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/.mcfunction @@ -0,0 +1,30 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/add/ +# @within function +# asset_manager:artifact/triggers/equipments/update_attribute/ +# asset_manager:artifact/triggers/equipments/update_attribute/add/ + +# データを取得 + data modify storage asset:artifact Modifier set from storage asset:artifact CopiedModifiers[-1] + +# データを整える + execute if data storage asset:artifact Modifier{Slot:"hotbar"} run function asset_manager:artifact/triggers/equipments/update_attribute/add/calc_effective + data modify storage asset:artifact Modifier.UUID set value [I;1,1,-1,-1] + data modify storage asset:artifact Modifier.UUID[2] set from storage asset:artifact Modifier.ID + function asset_manager:artifact/triggers/equipments/update_attribute/get_slot_id + +# apiに移す + data modify storage api: Argument.UUID set from storage asset:artifact Modifier.UUID + data modify storage api: Argument.Amount set from storage asset:artifact Modifier.Amount + data modify storage api: Argument.Operation set from storage asset:artifact Modifier.Operation +# カスタムModifierで処理 + scoreboard players set $CustomModifier Temporary 0 + function asset_manager:artifact/triggers/equipments/update_attribute/add/custom.m with storage asset:artifact Modifier +# バニラModifierで処理 + execute unless score $CustomModifier Temporary matches 1 run function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/ + execute unless score $CustomModifier Temporary matches 1 run function asset_manager:artifact/triggers/equipments/update_attribute/add/generic.m with storage asset:artifact Modifier + +# リセット&ループ + scoreboard players reset $CustomModifier Temporary + data remove storage asset:artifact Modifier + data remove storage asset:artifact CopiedModifiers[-1] + execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/triggers/equipments/update_attribute/add/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/calc_effective.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/calc_effective.mcfunction new file mode 100644 index 0000000000..a7d99c3e15 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/calc_effective.mcfunction @@ -0,0 +1,28 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/add/calc_effective +# @within function asset_manager:artifact/triggers/equipments/update_attribute/add/ + +#> Private +# @private + #declare score_holder $Stack + #declare score_holder $Amount + #declare score_holder $MaxStack + #declare score_holder $StackReduction + +# 変数を取得 + execute store result score $Stack Temporary run data get storage asset:artifact Modifier.Stack + execute store result score $Amount Temporary run data get storage asset:artifact Modifier.Amount 1000 + execute store result score $MaxStack Temporary run data get storage asset:artifact Modifier.MaxStack + execute store result score $StackReduction Temporary run data get storage asset:artifact Modifier.StackReduction 1000 + execute if score $MaxStack Temporary matches 0 run scoreboard players set $MaxStack Temporary 9 +# 計算 + scoreboard players operation $Stack Temporary < $MaxStack Temporary + scoreboard players operation $Amount Temporary *= $Stack Temporary + execute unless score $StackReduction Temporary matches 0 run scoreboard players remove $Stack Temporary 1 + execute unless score $StackReduction Temporary matches 0 run scoreboard players operation $StackReduction Temporary *= $Stack Temporary + execute unless score $StackReduction Temporary matches 0 run scoreboard players operation $Amount Temporary -= $StackReduction Temporary + execute store result storage asset:artifact Modifier.Amount double 0.001 run scoreboard players get $Amount Temporary +# リセット + scoreboard players reset $Stack Temporary + scoreboard players reset $Amount Temporary + scoreboard players reset $MaxStack Temporary + scoreboard players reset $StackReduction Temporary diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/custom.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/custom.m.mcfunction new file mode 100644 index 0000000000..93a99de7b9 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/custom.m.mcfunction @@ -0,0 +1,8 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/add/custom.m +# @input args +# Type : string +# @within function asset_manager:artifact/triggers/equipments/update_attribute/add/ + +$function api:modifier/$(Type)/add +$execute store success score $CustomModifier Temporary run schedule function api:modifier/$(Type)/add 2147483647t +$schedule clear api:modifier/$(Type)/add diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/generic.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/generic.m.mcfunction new file mode 100644 index 0000000000..319c54c3ce --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/add/generic.m.mcfunction @@ -0,0 +1,11 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/add/generic.m +# @input args +# Type : attribute.name +# ID : int +# ArtifactID : hexadecimal +# SlotID : int +# Amount : double +# Operation : string +# @within function asset_manager:artifact/triggers/equipments/update_attribute/add/ + +$attribute @s $(Type) modifier add 1-0-1-0-$(ArtifactID)0000000$(SlotID) "$(ID).$(Type)" $(Amount) $(Operation) diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/.mcfunction new file mode 100644 index 0000000000..b673772f65 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/.mcfunction @@ -0,0 +1,17 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/attire/ +# +# +# +# @within function asset_manager:artifact/triggers/equipments/update_attribute/ + +# 2つの配列を重複を起こさないように結合する + data modify storage asset:artifact Attire.List set value [] + data modify storage asset:artifact Attire.Target set from storage asset:artifact MaskedOldItemData[].EquipID + function asset_manager:artifact/triggers/equipments/update_attribute/attire/concat + data modify storage asset:artifact Attire.Target set from storage asset:artifact MaskedNewItemData[].EquipID + function asset_manager:artifact/triggers/equipments/update_attribute/attire/concat +# 各要素ごとに当てはまる部位数を確認して反映する + function asset_manager:artifact/triggers/equipments/update_attribute/attire/foreach +# リセット + data remove storage asset:artifact Attire + data remove storage asset:artifact CopiedNewEquipIDs diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/concat.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/concat.mcfunction new file mode 100644 index 0000000000..ef98991f0e --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/concat.mcfunction @@ -0,0 +1,14 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/attire/concat +# +# +# +# @within function asset_manager:artifact/triggers/equipments/update_attribute/attire/* + +# idを一つ取り出す + data modify storage asset:artifact Attire.Value set from storage asset:artifact Attire.Target[-1] +# upsertする + function asset_manager:artifact/triggers/equipments/update_attribute/attire/upsert.m with storage asset:artifact Attire +# 要素を削除して、残っているならば再帰 + data remove storage asset:artifact Attire.Value + data remove storage asset:artifact Attire.Target[-1] + execute if data storage asset:artifact Attire.Target[0] run function asset_manager:artifact/triggers/equipments/update_attribute/attire/concat diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/foreach.mcfunction new file mode 100644 index 0000000000..e545c248a0 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/foreach.mcfunction @@ -0,0 +1,22 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/attire/foreach +# +# +# +# @within function asset_manager:artifact/triggers/equipments/update_attribute/attire/* + +#> private +# @private + #declare score_holder $SetID + +# idを取得する + execute store result score $SetID Temporary run data get storage asset:artifact Attire.List[-1] + +# エフェクトを付与する / 削除する + execute if score $SetID Temporary matches 1.. run data modify storage api: Argument.ID set from storage asset:artifact Attire.List[-1] + execute if score $SetID Temporary matches 1.. run function asset_manager:artifact/triggers/equipments/update_attribute/attire/parts_count.m with storage api: Argument + execute if score $SetID Temporary matches 1.. unless data storage api: Argument{Stack:0} run function api:entity/mob/effect/give + execute if score $SetID Temporary matches 1.. if data storage api: Argument{Stack:0} run function api:entity/mob/effect/remove/from_id + +# 要素を削除して、残っているならば再帰 + scoreboard players reset $SetID Temporary + data remove storage asset:artifact Attire.List[-1] diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/parts_count.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/parts_count.m.mcfunction new file mode 100644 index 0000000000..d30935e036 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/parts_count.m.mcfunction @@ -0,0 +1,5 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/attire/parts_count.m +# @input args ID : int +# @within function asset_manager:artifact/triggers/equipments/update_attribute/attire/equip_set + +$execute store result storage api: Argument.Stack int 1 if data storage asset:artifact MaskedNewItemData[{EquipID:$(ID)}] diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/upsert.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/upsert.m.mcfunction new file mode 100644 index 0000000000..43f5a0ac5e --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/attire/upsert.m.mcfunction @@ -0,0 +1,13 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/attire/upsert.m +# +# +# +# @within function asset_manager:artifact/triggers/equipments/update_attribute/attire/concat + +#> private +# @private + #declare score_holder $ExistsID + +$execute store result score $ExistsID Temporary if data storage asset:artifact Attire.List[$(Value)] +execute unless score $ExistsID Temporary matches 1.. run data modify storage asset:artifact Attire.List append from storage asset:artifact Attire.Value +scoreboard players reset $ExistsID Temporary diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/.mcfunction new file mode 100644 index 0000000000..fdd8fd8551 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/.mcfunction @@ -0,0 +1,34 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/ +# @within function asset_manager:artifact/triggers/equipments/update_attribute/*/ + +# 取得 + execute store result score $FFFF Temporary run data get storage asset:artifact Modifier.ID +# 4096の位 + scoreboard players operation $F Temporary = $FFFF Temporary + scoreboard players operation $F Temporary %= $16 Const + function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/digit + data modify storage asset:artifact Hexadecimal.Fourth set from storage asset:artifact Hexadecimal.Return + scoreboard players operation $FFFF Temporary /= $16 Const +# 256の位 + scoreboard players operation $F Temporary = $FFFF Temporary + scoreboard players operation $F Temporary %= $16 Const + function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/digit + data modify storage asset:artifact Hexadecimal.Third set from storage asset:artifact Hexadecimal.Return + scoreboard players operation $FFFF Temporary /= $16 Const +# 16の位 + scoreboard players operation $F Temporary = $FFFF Temporary + scoreboard players operation $F Temporary %= $16 Const + function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/digit + data modify storage asset:artifact Hexadecimal.Second set from storage asset:artifact Hexadecimal.Return + scoreboard players operation $FFFF Temporary /= $16 Const +# 1の位 + scoreboard players operation $F Temporary = $FFFF Temporary + scoreboard players operation $F Temporary %= $16 Const + function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/digit + data modify storage asset:artifact Hexadecimal.First set from storage asset:artifact Hexadecimal.Return +# 結合 + function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/concat.m with storage asset:artifact Hexadecimal +# リセット + scoreboard players reset $F Temporary + scoreboard players reset $FFFF Temporary + data remove storage asset:artifact Hexadecimal diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/concat.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/concat.m.mcfunction new file mode 100644 index 0000000000..1398077aef --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/concat.m.mcfunction @@ -0,0 +1,9 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/concat.m +# @input args +# First : string +# Second : string +# Third : string +# Fourth : string +# @within function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/ + +$data modify storage asset:artifact Modifier.ArtifactID set value "$(First)$(Second)$(Third)$(Fourth)" diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/digit.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/digit.mcfunction new file mode 100644 index 0000000000..8275d437e1 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/dec_to_hex/digit.mcfunction @@ -0,0 +1,19 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/digit +# @within function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/ + +execute if score $F Temporary matches 0 run data modify storage asset:artifact Hexadecimal.Return set value "0" +execute if score $F Temporary matches 1 run data modify storage asset:artifact Hexadecimal.Return set value "1" +execute if score $F Temporary matches 2 run data modify storage asset:artifact Hexadecimal.Return set value "2" +execute if score $F Temporary matches 3 run data modify storage asset:artifact Hexadecimal.Return set value "3" +execute if score $F Temporary matches 4 run data modify storage asset:artifact Hexadecimal.Return set value "4" +execute if score $F Temporary matches 5 run data modify storage asset:artifact Hexadecimal.Return set value "5" +execute if score $F Temporary matches 6 run data modify storage asset:artifact Hexadecimal.Return set value "6" +execute if score $F Temporary matches 7 run data modify storage asset:artifact Hexadecimal.Return set value "7" +execute if score $F Temporary matches 8 run data modify storage asset:artifact Hexadecimal.Return set value "8" +execute if score $F Temporary matches 9 run data modify storage asset:artifact Hexadecimal.Return set value "9" +execute if score $F Temporary matches 10 run data modify storage asset:artifact Hexadecimal.Return set value "a" +execute if score $F Temporary matches 11 run data modify storage asset:artifact Hexadecimal.Return set value "b" +execute if score $F Temporary matches 12 run data modify storage asset:artifact Hexadecimal.Return set value "c" +execute if score $F Temporary matches 13 run data modify storage asset:artifact Hexadecimal.Return set value "d" +execute if score $F Temporary matches 14 run data modify storage asset:artifact Hexadecimal.Return set value "e" +execute if score $F Temporary matches 15 run data modify storage asset:artifact Hexadecimal.Return set value "f" diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/extract_changes.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/extract_changes.mcfunction new file mode 100644 index 0000000000..3d114cae33 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/extract_changes.mcfunction @@ -0,0 +1,26 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/extract_changes +# +# +# +# @within function asset_manager:artifact/triggers/equipments/update_attribute/* + +# 配列をマスクする +# EquipIDは必要なのでlib:array/maskは使わない + data modify storage asset:artifact Mask set from storage asset:artifact CopiedChanges[-1]._._ + data modify storage asset:artifact MaskedOldItemData append from storage asset:artifact CopiedOldItemData[-1] + data modify storage asset:artifact MaskedNewItemData append from storage asset:artifact CopiedNewItemData[-1] + execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedOldItemData.ID set value -1 + execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedOldItemData.Triggers set value [] + # execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedOldItemData.EquipID set value -1 + execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedOldItemData.Modifiers set value [] + execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedNewItemData.ID set value -1 + execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedNewItemData.Triggers set value [] + # execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedNewItemData.EquipID set value -1 + execute if data storage asset:artifact {Mask:true} run data modify storage asset:artifact MaskedNewItemData.Modifiers set value [] + +# 要素を削除して、残っているならば再帰 + data remove storage asset:artifact Mask + data remove storage asset:artifact CopiedChanges[-1] + data remove storage asset:artifact CopiedOldItemData[-1] + data remove storage asset:artifact CopiedNewItemData[-1] + execute if data storage asset:artifact CopiedChanges[0] run function asset_manager:artifact/triggers/equipments/update_attribute/extract_changes diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/get_slot_id.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/get_slot_id.mcfunction new file mode 100644 index 0000000000..26bf8b55ab --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/get_slot_id.mcfunction @@ -0,0 +1,12 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/get_slot_id +# @within function asset_manager:artifact/triggers/equipments/update_attribute/*/ + +execute if data storage asset:artifact Modifier{Slot:"mainhand"} run data modify storage asset:artifact Modifier.SlotID set value 1 +execute if data storage asset:artifact Modifier{Slot:"offhand"} run data modify storage asset:artifact Modifier.SlotID set value 2 +execute if data storage asset:artifact Modifier{Slot:"feet"} run data modify storage asset:artifact Modifier.SlotID set value 3 +execute if data storage asset:artifact Modifier{Slot:"legs"} run data modify storage asset:artifact Modifier.SlotID set value 4 +execute if data storage asset:artifact Modifier{Slot:"chest"} run data modify storage asset:artifact Modifier.SlotID set value 5 +execute if data storage asset:artifact Modifier{Slot:"head"} run data modify storage asset:artifact Modifier.SlotID set value 6 +execute if data storage asset:artifact Modifier{Slot:"hotbar"} run data modify storage asset:artifact Modifier.SlotID set value 7 + +data modify storage asset:artifact Modifier.UUID[3] set from storage asset:artifact Modifier.SlotID diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/.mcfunction new file mode 100644 index 0000000000..69a9cea437 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/.mcfunction @@ -0,0 +1,30 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/remove/ +# +# +# +# @within function +# asset_manager:artifact/triggers/equipments/update_attribute/ +# asset_manager:artifact/triggers/equipments/update_attribute/remove/ + +# データを取得 + data modify storage asset:artifact Modifier set from storage asset:artifact CopiedModifiers[-1] + +# データを整える + data modify storage asset:artifact Modifier.UUID set value [I;1,1,-1,-1] + data modify storage asset:artifact Modifier.UUID[2] set from storage asset:artifact Modifier.ID + function asset_manager:artifact/triggers/equipments/update_attribute/get_slot_id + +# apiに移す + data modify storage api: Argument.UUID set from storage asset:artifact Modifier.UUID +# カスタムModifierで処理 + scoreboard players set $CustomModifier Temporary 0 + function asset_manager:artifact/triggers/equipments/update_attribute/remove/custom.m with storage asset:artifact Modifier +# バニラでModifierで処理 + execute unless score $CustomModifier Temporary matches 1 run function asset_manager:artifact/triggers/equipments/update_attribute/dec_to_hex/ + execute unless score $CustomModifier Temporary matches 1 run function asset_manager:artifact/triggers/equipments/update_attribute/remove/generic.m with storage asset:artifact Modifier + +# リセット&ループ + scoreboard players reset $CustomModifier Temporary + data remove storage asset:artifact Modifier + data remove storage asset:artifact CopiedModifiers[-1] + execute if data storage asset:artifact CopiedModifiers[0] run function asset_manager:artifact/triggers/equipments/update_attribute/remove/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/custom.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/custom.m.mcfunction new file mode 100644 index 0000000000..45307d503a --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/custom.m.mcfunction @@ -0,0 +1,8 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/remove/custom.m +# @input args +# Type : string +# @within function asset_manager:artifact/triggers/equipments/update_attribute/remove/ + +$function api:modifier/$(Type)/remove +$execute store success score $CustomModifier Temporary run schedule function api:modifier/$(Type)/remove 2147483647t +$schedule clear api:modifier/$(Type)/remove diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/generic.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/generic.m.mcfunction new file mode 100644 index 0000000000..ebd23f8539 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_attribute/remove/generic.m.mcfunction @@ -0,0 +1,8 @@ +#> asset_manager:artifact/triggers/equipments/update_attribute/remove/generic.m +# @input args +# Type : attribute.name +# ArtifactID : hexadecimal +# SlotID : int +# @within function asset_manager:artifact/triggers/equipments/update_attribute/remove/ + +$attribute @s $(Type) modifier remove 1-0-1-0-$(ArtifactID)0000000$(SlotID) diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/.mcfunction index 73936b5de4..af47e27813 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/.mcfunction @@ -8,29 +8,23 @@ function oh_my_dat:please # セッション開く function lib:array/session/open -# 配列として取得 - data modify storage asset:artifact ItemData append from storage asset:context New.Items.offhand.tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.feet.tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.legs.tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.chest.tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.head.tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[0].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[1].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[2].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[3].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[4].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[5].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[6].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[7].tag.TSB - data modify storage asset:artifact ItemData append from storage asset:context New.Items.hotbar[8].tag.TSB +# 今何時? + execute store result score $Tick Temporary run time query gametime +# 配列をコピー + data modify storage asset:artifact CopiedItemData set from storage asset:artifact New.ItemData + data remove storage asset:artifact CopiedItemData[0] # それぞれについて更新 - function asset_manager:artifact/triggers/equipments/update_cooldown/foreach + data modify storage asset:artifact LocalCooldown set value [] + function asset_manager:artifact/triggers/equipments/update_cooldown/foreach/ # 反転 + data modify storage lib: Array set from storage asset:artifact LocalCooldown function lib:array/reverse # 設定 - data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown set from storage lib: Array + data modify storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown set from storage lib: Array # リセット function lib:array/session/close - data remove storage asset:artifact ItemData + data remove storage asset:artifact CopiedItemData + data remove storage asset:artifact LocalCooldown scoreboard players reset $Tick Temporary - scoreboard players reset $LatestUsedTick Temporary \ No newline at end of file + scoreboard players reset $Max Temporary + scoreboard players reset $LatestUsedTick Temporary diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach/.mcfunction new file mode 100644 index 0000000000..a90ef37f9b --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach/.mcfunction @@ -0,0 +1,19 @@ +#> asset_manager:artifact/triggers/equipments/update_cooldown/foreach/ +# +# +# +# @within function asset_manager:artifact/triggers/equipments/update_cooldown/** + +# データ取得 + data modify storage asset:artifact CopiedTriggers set from storage asset:artifact CopiedItemData[-1].Triggers +# それぞれについて更新 + data modify storage lib: Array set value [] + execute if data storage asset:artifact CopiedTriggers[0] run function lib:array/reverse +# 反転して記録しておく + execute if data storage lib: Array[0] run function lib:array/reverse + data modify storage asset:artifact LocalCooldown append from storage lib: Array +# リセット + data remove storage asset:artifact CopiedItemData[-1] + data remove storage asset:artifact CopiedTriggers +# 要素があれば再帰 + execute if data storage asset:artifact CopiedItemData[0] run function asset_manager:artifact/triggers/equipments/update_cooldown/foreach/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach/get_cooldown.mcfunction similarity index 58% rename from TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach/get_cooldown.mcfunction index 94654eaf46..e4c2ece3b2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/equipments/update_cooldown/foreach/get_cooldown.mcfunction @@ -1,17 +1,12 @@ -#> asset_manager:artifact/triggers/equipments/update_cooldown/foreach +#> asset_manager:artifact/triggers/equipments/update_cooldown/foreach/get_cooldown # # # -# @within function asset_manager:artifact/triggers/equipments/update_cooldown/* +# @within function asset_manager:artifact/triggers/equipments/update_cooldown/foreach/* -#> Private -# @private - #declare score_holder $Max - -# データ取得 - execute store result score $Tick Temporary run time query gametime - execute store result score $Max Temporary run data get storage asset:artifact ItemData[-1].LocalCooldown - execute store result score $LatestUsedTick Temporary run data get storage asset:artifact ItemData[-1].LatestUseTick +# データを取得 + execute store result score $Max Temporary run data get storage asset:artifact CopiedTriggers[-1].LocalCooldown + execute store result score $LatestUsedTick Temporary run data get storage asset:artifact CopiedTriggers[-1].LatestUseTick # 使用してからの時間を取得 scoreboard players operation $Tick Temporary -= $LatestUsedTick Temporary scoreboard players operation $Max Temporary -= $Tick Temporary @@ -19,8 +14,7 @@ # 設定 data modify storage lib: Array append value {} execute store result storage lib: Array[-1].Value int 1 run scoreboard players get $Max Temporary - execute store result storage lib: Array[-1].Max int 1 run data get storage asset:artifact ItemData[-1].LocalCooldown -# 末尾削除 - data remove storage asset:artifact ItemData[-1] -# 要素があれば再帰 - execute if data storage asset:artifact ItemData[0] run function asset_manager:artifact/triggers/equipments/update_cooldown/foreach \ No newline at end of file + execute store result storage lib: Array[-1].Max int 1 run data get storage asset:artifact CopiedTriggers[-1].LocalCooldown +# リセット & ループ + data remove storage asset:artifact CopiedTriggers[-1] + execute if data storage asset:artifact CopiedTriggers[0] run function asset_manager:artifact/triggers/equipments/update_cooldown/foreach/get_cooldown diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/exec.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/exec.mcfunction new file mode 100644 index 0000000000..0871261307 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/exec.mcfunction @@ -0,0 +1,17 @@ +#> asset_manager:artifact/triggers/exec +# +# +# +# @within function asset_manager:artifact/triggers/foreach + +# トリガーを持っていれば処理を実行する + function asset_manager:artifact/triggers/tick/ + execute if entity @s[tag=TriggerFlag.ClickCarrot] run function asset_manager:artifact/triggers/click/ + execute if entity @s[tag=TriggerFlag.UseItem] run function asset_manager:artifact/triggers/use_item/ + execute if entity @s[tag=TriggerFlag.Sneak] run function asset_manager:artifact/triggers/sneak/ + execute if entity @s[tag=TriggerFlag.UsingItem] run function asset_manager:artifact/triggers/keep_click/ + execute if data storage asset:artifact ArtifactEvents.Attack[0] run function asset_manager:artifact/triggers/attack/ + execute if data storage asset:artifact ArtifactEvents.Damage[0] run function asset_manager:artifact/triggers/damage/ + execute if data storage asset:artifact ArtifactEvents.Killed[0] run function asset_manager:artifact/triggers/killed/ + execute if data storage asset:artifact ArtifactEvents.Heal[0] run function asset_manager:artifact/triggers/heal/ + execute if data storage asset:artifact ArtifactEvents.ReceiveHeal[0] run function asset_manager:artifact/triggers/receive_heal/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/foreach.mcfunction new file mode 100644 index 0000000000..5d92383c5d --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/foreach.mcfunction @@ -0,0 +1,26 @@ +#> asset_manager:artifact/triggers/foreach +# +# +# +# @within function +# asset_manager:artifact/triggers/ +# asset_manager:artifact/triggers/foreach + +#> private +# @private + #declare score_holder $ID + +# データを取得 + data modify storage asset:artifact MetaData set from storage asset:artifact CopiedItemData[-1] + data modify storage asset:context this set from storage asset:artifact MetaData.Field +# スロットを取得 + scoreboard players remove $SlotIndex Temporary 1 + function asset_manager:artifact/triggers/index_to_slot +# IDが存在するなら実際の処理へ + execute store result score $ID Temporary run data get storage asset:artifact MetaData.ID + execute if score $ID Temporary matches 1..65535 run function asset_manager:artifact/triggers/exec +# 要素を削除し、残っているならば再帰 + scoreboard players reset $ID Temporary + data remove storage asset:artifact MetaData + data remove storage asset:artifact CopiedItemData[-1] + execute if data storage asset:artifact CopiedItemData[0] run function asset_manager:artifact/triggers/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/.mcfunction index d6841fac8e..e69de29bb2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/.mcfunction @@ -1,12 +0,0 @@ -#> asset_manager:artifact/triggers/heal/ -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# 神器側に受け渡し - function asset_manager:artifact/triggers/heal/foreach -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/add_tag_each_receiver.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/add_tag_each_receiver.mcfunction deleted file mode 100644 index 08afe8b545..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/add_tag_each_receiver.mcfunction +++ /dev/null @@ -1,19 +0,0 @@ -#> 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 diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/foreach.mcfunction deleted file mode 100644 index 3cf761db93..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/heal/foreach.mcfunction +++ /dev/null @@ -1,26 +0,0 @@ -#> asset_manager:artifact/triggers/heal/foreach -# -# -# -# @within function asset_manager:artifact/triggers/heal/* - -# イベントデータ取得 - data modify storage asset:context Heal set from storage asset:artifact ArtifactEvents.Heal[-1] - data remove storage asset:artifact ArtifactEvents.Heal[-1] -# ヒール先を取得し、Receiver を付与する (null の可能性もある) - data modify storage asset:artifact HealTargets set from storage asset:context Heal.To - execute if data storage asset:artifact HealTargets[0] run 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:artifact/heal -# リセット - data remove storage asset:context Heal - data remove storage asset:artifact HealTargets - tag @a[tag=Receiver] remove Receiver -# イベントがまだあれば再帰する - execute if data storage asset:artifact ArtifactEvents.Heal[0] run function asset_manager:artifact/triggers/heal/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/index_to_slot.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/index_to_slot.mcfunction new file mode 100644 index 0000000000..59ee794718 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/index_to_slot.mcfunction @@ -0,0 +1,15 @@ +#> asset_manager:artifact/triggers/index_to_slot +# +# +# +# @within function +# asset_manager:artifact/data/new/fetch_data/fetch +# asset_manager:artifact/triggers/foreach + +execute if score $SlotIndex Temporary matches 0 run data modify storage asset:artifact TargetSlot set value "mainhand" +execute if score $SlotIndex Temporary matches 1 run data modify storage asset:artifact TargetSlot set value "offhand" +execute if score $SlotIndex Temporary matches 2 run data modify storage asset:artifact TargetSlot set value "feet" +execute if score $SlotIndex Temporary matches 3 run data modify storage asset:artifact TargetSlot set value "legs" +execute if score $SlotIndex Temporary matches 4 run data modify storage asset:artifact TargetSlot set value "chest" +execute if score $SlotIndex Temporary matches 5 run data modify storage asset:artifact TargetSlot set value "head" +execute if score $SlotIndex Temporary matches 6.. run data modify storage asset:artifact TargetSlot set value "hotbar" diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/keep_click/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/keep_click/.mcfunction new file mode 100644 index 0000000000..e69de29bb2 diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/killed/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/killed/.mcfunction index 70392828c9..e69de29bb2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/killed/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/killed/.mcfunction @@ -1,12 +0,0 @@ -#> asset_manager:artifact/triggers/killed/ -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# 神器側に受け渡し - function asset_manager:artifact/triggers/killed/foreach -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/killed/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/killed/foreach.mcfunction deleted file mode 100644 index de626aee18..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/killed/foreach.mcfunction +++ /dev/null @@ -1,27 +0,0 @@ -#> asset_manager:artifact/triggers/killed/foreach -# -# -# -# @within function asset_manager:artifact/triggers/killed/* - -#> Private -# @private -#declare score_holder $KillTarget - -# イベントデータ取得 - data modify storage asset:context Killed set from storage asset:artifact ArtifactEvents.Killed[-1] - data remove storage asset:artifact ArtifactEvents.Killed[-1] -# 攻撃先を取得し、Victim を付与する (null の可能性もある) - execute if data storage asset:context Killed.To store result score $KillTarget Temporary run data get storage asset:context Killed.To - execute if data storage asset:context Killed.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 -# 神器側に受け渡し - function #asset:artifact/killed - execute if data storage asset:context Killed{Type:"vanilla_melee" } run function #asset:artifact/killed/melee - execute if data storage asset:context Killed{Type:"vanilla_projectile"} run function #asset:artifact/killed/projectile - execute if data storage asset:context Killed{Type:"vanilla_explosion" } run function #asset:artifact/killed/explosion -# リセット - data remove storage asset:context Killed - tag @e[type=#lib:living,type=!player,tag=Victim] remove Victim -# イベントがまだあれば再帰する - execute if data storage asset:artifact ArtifactEvents.Killed[0] run function asset_manager:artifact/triggers/killed/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/.mcfunction index 257083925d..e69de29bb2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/.mcfunction @@ -1,12 +0,0 @@ -#> asset_manager:artifact/triggers/receive_heal/ -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# 神器側に受け渡し - function asset_manager:artifact/triggers/receive_heal/foreach -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/foreach.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/foreach.mcfunction deleted file mode 100644 index 2a7a1f6aaf..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/receive_heal/foreach.mcfunction +++ /dev/null @@ -1,24 +0,0 @@ -#> 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 ArtifactEvents.ReceiveHeal[-1] - data remove storage asset:artifact ArtifactEvents.ReceiveHeal[-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:artifact/receive_heal -# リセット - data remove storage asset:context ReceiveHeal - tag @a[tag=Healer] remove Healer -# イベントがまだあれば再帰する - execute if data storage asset:artifact ArtifactEvents.ReceiveHeal[0] run function asset_manager:artifact/triggers/receive_heal/foreach diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/.mcfunction index b29503db0c..e69de29bb2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/.mcfunction @@ -1,72 +0,0 @@ -#> asset_manager:artifact/triggers/sneak/ -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# スロット毎のチェック - function asset_manager:artifact/triggers/sneak/reset_when_change_item -# asset:contextにスニーク時間を設定する - function asset_manager:artifact/triggers/sneak/set_context -# 神器側に受け渡し - # keepトリガー類 - function #asset:artifact/sneak/keep/ - - execute if score @s Sneak matches 20.. run scoreboard players set $SneakThreshold Temporary 20 - execute if score @s Sneak matches 20.. run function asset_manager:artifact/triggers/sneak/reset_threshold_less - execute if score @s Sneak matches 20.. run function #asset:artifact/sneak/keep/1s - - execute if score @s Sneak matches 40.. run scoreboard players set $SneakThreshold Temporary 40 - execute if score @s Sneak matches 40.. run function asset_manager:artifact/triggers/sneak/reset_threshold_less - execute if score @s Sneak matches 40.. run function #asset:artifact/sneak/keep/2s - - execute if score @s Sneak matches 60.. run scoreboard players set $SneakThreshold Temporary 60 - execute if score @s Sneak matches 60.. run function asset_manager:artifact/triggers/sneak/reset_threshold_less - execute if score @s Sneak matches 60.. run function #asset:artifact/sneak/keep/3s - - execute if score @s Sneak matches 80.. run scoreboard players set $SneakThreshold Temporary 80 - execute if score @s Sneak matches 80.. run function asset_manager:artifact/triggers/sneak/reset_threshold_less - execute if score @s Sneak matches 80.. run function #asset:artifact/sneak/keep/4s - - execute if score @s Sneak matches 100.. run scoreboard players set $SneakThreshold Temporary 100 - execute if score @s Sneak matches 100.. run function asset_manager:artifact/triggers/sneak/reset_threshold_less - execute if score @s Sneak matches 100.. run function #asset:artifact/sneak/keep/5s - - execute if score @s Sneak matches 200.. run scoreboard players set $SneakThreshold Temporary 200 - execute if score @s Sneak matches 200.. run function asset_manager:artifact/triggers/sneak/reset_threshold_less - execute if score @s Sneak matches 200.. run function #asset:artifact/sneak/keep/10s - - # 単発トリガー類 - scoreboard players set $SneakThreshold Temporary 1 - function asset_manager:artifact/triggers/sneak/reset_value_not-equal - function #asset:artifact/sneak/ - - execute if score @s Sneak matches 20.. run scoreboard players set $SneakThreshold Temporary 20 - execute if score @s Sneak matches 20.. run function asset_manager:artifact/triggers/sneak/reset_value_not-equal - execute if score @s Sneak matches 20.. run function #asset:artifact/sneak/1s - - execute if score @s Sneak matches 40.. run scoreboard players set $SneakThreshold Temporary 40 - execute if score @s Sneak matches 40.. run function asset_manager:artifact/triggers/sneak/reset_value_not-equal - execute if score @s Sneak matches 40.. run function #asset:artifact/sneak/2s - - execute if score @s Sneak matches 60.. run scoreboard players set $SneakThreshold Temporary 60 - execute if score @s Sneak matches 60.. run function asset_manager:artifact/triggers/sneak/reset_value_not-equal - execute if score @s Sneak matches 60.. run function #asset:artifact/sneak/3s - - execute if score @s Sneak matches 80.. run scoreboard players set $SneakThreshold Temporary 80 - execute if score @s Sneak matches 80.. run function asset_manager:artifact/triggers/sneak/reset_value_not-equal - execute if score @s Sneak matches 80.. run function #asset:artifact/sneak/4s - - execute if score @s Sneak matches 100.. run scoreboard players set $SneakThreshold Temporary 100 - execute if score @s Sneak matches 100.. run function asset_manager:artifact/triggers/sneak/reset_value_not-equal - execute if score @s Sneak matches 100.. run function #asset:artifact/sneak/5s - - execute if score @s Sneak matches 200.. run scoreboard players set $SneakThreshold Temporary 200 - execute if score @s Sneak matches 200.. run function asset_manager:artifact/triggers/sneak/reset_value_not-equal - execute if score @s Sneak matches 200.. run function #asset:artifact/sneak/10s -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current -# リセット - data remove storage asset:context SneakTime \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset.mcfunction deleted file mode 100644 index 6358fc72a5..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset.mcfunction +++ /dev/null @@ -1,21 +0,0 @@ -#> asset_manager:artifact/triggers/sneak/reset -# -# スニークトリガー用スコアボードをすべてリセットします -# -# @within function core:tick/player/post - -scoreboard players reset @s Sneak.Mainhand -scoreboard players reset @s Sneak.Offhand -scoreboard players reset @s Sneak.Head -scoreboard players reset @s Sneak.Chest -scoreboard players reset @s Sneak.Legs -scoreboard players reset @s Sneak.Feet -scoreboard players reset @s Sneak.Hotbar0 -scoreboard players reset @s Sneak.Hotbar1 -scoreboard players reset @s Sneak.Hotbar2 -scoreboard players reset @s Sneak.Hotbar3 -scoreboard players reset @s Sneak.Hotbar4 -scoreboard players reset @s Sneak.Hotbar5 -scoreboard players reset @s Sneak.Hotbar6 -scoreboard players reset @s Sneak.Hotbar7 -scoreboard players reset @s Sneak.Hotbar8 \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_threshold_less.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_threshold_less.mcfunction deleted file mode 100644 index 844edeca6f..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_threshold_less.mcfunction +++ /dev/null @@ -1,24 +0,0 @@ -#> asset_manager:artifact/triggers/sneak/reset_threshold_less -# -# 各slotについて$SneakThreshold未満の値の場合、その値を-1に設定します -# -# @within function asset_manager:artifact/triggers/sneak/ - -# 処理 - execute unless score @s Sneak.Mainhand >= $SneakThreshold Temporary run data modify storage asset:context id.mainhand set value -1 - execute unless score @s Sneak.Offhand >= $SneakThreshold Temporary run data modify storage asset:context id.offhand set value -1 - execute unless score @s Sneak.Head >= $SneakThreshold Temporary run data modify storage asset:context id.head set value -1 - execute unless score @s Sneak.Chest >= $SneakThreshold Temporary run data modify storage asset:context id.chest set value -1 - execute unless score @s Sneak.Legs >= $SneakThreshold Temporary run data modify storage asset:context id.legs set value -1 - execute unless score @s Sneak.Feet >= $SneakThreshold Temporary run data modify storage asset:context id.feet set value -1 - execute unless score @s Sneak.Hotbar0 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[0] set value -1 - execute unless score @s Sneak.Hotbar1 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[1] set value -1 - execute unless score @s Sneak.Hotbar2 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[2] set value -1 - execute unless score @s Sneak.Hotbar3 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[3] set value -1 - execute unless score @s Sneak.Hotbar4 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[4] set value -1 - execute unless score @s Sneak.Hotbar5 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[5] set value -1 - execute unless score @s Sneak.Hotbar6 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[6] set value -1 - execute unless score @s Sneak.Hotbar7 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[7] set value -1 - execute unless score @s Sneak.Hotbar8 >= $SneakThreshold Temporary run data modify storage asset:context id.hotbar[8] set value -1 -# リセット - scoreboard players reset $SneakThreshold \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_value_not-equal.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_value_not-equal.mcfunction deleted file mode 100644 index b3cb110980..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_value_not-equal.mcfunction +++ /dev/null @@ -1,26 +0,0 @@ -#> asset_manager:artifact/triggers/sneak/reset_value_not-equal -# -# 各slotについて$SneakThresholdと同値ではない場合、その値を-1に設定します -# -# @within function asset_manager:artifact/triggers/sneak/ - -# 初期化 - data modify storage asset:context id set from storage asset:context New.id -# 処理 - execute unless score @s Sneak.Mainhand = $SneakThreshold Temporary run data modify storage asset:context id.mainhand set value -1 - execute unless score @s Sneak.Offhand = $SneakThreshold Temporary run data modify storage asset:context id.offhand set value -1 - execute unless score @s Sneak.Head = $SneakThreshold Temporary run data modify storage asset:context id.head set value -1 - execute unless score @s Sneak.Chest = $SneakThreshold Temporary run data modify storage asset:context id.chest set value -1 - execute unless score @s Sneak.Legs = $SneakThreshold Temporary run data modify storage asset:context id.legs set value -1 - execute unless score @s Sneak.Feet = $SneakThreshold Temporary run data modify storage asset:context id.feet set value -1 - execute unless score @s Sneak.Hotbar0 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[0] set value -1 - execute unless score @s Sneak.Hotbar1 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[1] set value -1 - execute unless score @s Sneak.Hotbar2 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[2] set value -1 - execute unless score @s Sneak.Hotbar3 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[3] set value -1 - execute unless score @s Sneak.Hotbar4 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[4] set value -1 - execute unless score @s Sneak.Hotbar5 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[5] set value -1 - execute unless score @s Sneak.Hotbar6 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[6] set value -1 - execute unless score @s Sneak.Hotbar7 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[7] set value -1 - execute unless score @s Sneak.Hotbar8 = $SneakThreshold Temporary run data modify storage asset:context id.hotbar[8] set value -1 -# リセット - scoreboard players reset $SneakThreshold \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_when_change_item.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_when_change_item.mcfunction deleted file mode 100644 index e545d361ed..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/reset_when_change_item.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -#> asset_manager:artifact/triggers/sneak/reset_when_change_item -# -# 各slotについて前のアイテムデータと一致していない場合、その値のスコアボードを1に設定します -# -# Q. なんで0やnullじゃなくて1なの? A. このfunctionが実行されるのはSneak時なので0|null+1の値 = 1になる -# -# @within function asset_manager:artifact/triggers/sneak/ - -#> private use -# @private - #declare score_holder $Temp - -# 変更のあったスロットのデータをリセットする - execute if data storage asset:artifact EquipmentChanges[00]._{_:false} run scoreboard players set @s Sneak.Mainhand 1 - execute if data storage asset:artifact EquipmentChanges[01]._{_:false} run scoreboard players set @s Sneak.Offhand 1 - execute if data storage asset:artifact EquipmentChanges[02]._{_:false} run scoreboard players set @s Sneak.Head 1 - execute if data storage asset:artifact EquipmentChanges[03]._{_:false} run scoreboard players set @s Sneak.Chest 1 - execute if data storage asset:artifact EquipmentChanges[04]._{_:false} run scoreboard players set @s Sneak.Legs 1 - execute if data storage asset:artifact EquipmentChanges[05]._{_:false} run scoreboard players set @s Sneak.Feet 1 - execute if data storage asset:artifact EquipmentChanges[06]._{_:false} run scoreboard players set @s Sneak.Hotbar0 1 - execute if data storage asset:artifact EquipmentChanges[07]._{_:false} run scoreboard players set @s Sneak.Hotbar1 1 - execute if data storage asset:artifact EquipmentChanges[08]._{_:false} run scoreboard players set @s Sneak.Hotbar2 1 - execute if data storage asset:artifact EquipmentChanges[09]._{_:false} run scoreboard players set @s Sneak.Hotbar3 1 - execute if data storage asset:artifact EquipmentChanges[10]._{_:false} run scoreboard players set @s Sneak.Hotbar4 1 - execute if data storage asset:artifact EquipmentChanges[11]._{_:false} run scoreboard players set @s Sneak.Hotbar5 1 - execute if data storage asset:artifact EquipmentChanges[12]._{_:false} run scoreboard players set @s Sneak.Hotbar6 1 - execute if data storage asset:artifact EquipmentChanges[13]._{_:false} run scoreboard players set @s Sneak.Hotbar7 1 - execute if data storage asset:artifact EquipmentChanges[14]._{_:false} run scoreboard players set @s Sneak.Hotbar8 1 \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/set_context.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/set_context.mcfunction deleted file mode 100644 index 95d07d15e1..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/sneak/set_context.mcfunction +++ /dev/null @@ -1,21 +0,0 @@ -#> asset_manager:artifact/triggers/sneak/set_context -# -# asset:contextにスニークした時間のデータを設定します -# -# @within function asset_manager:artifact/triggers/sneak/ - -execute store result storage asset:context SneakTime.mainhand int 1 run scoreboard players get @s Sneak.Mainhand -execute store result storage asset:context SneakTime.offhand int 1 run scoreboard players get @s Sneak.Offhand -execute store result storage asset:context SneakTime.head int 1 run scoreboard players get @s Sneak.Head -execute store result storage asset:context SneakTime.chest int 1 run scoreboard players get @s Sneak.Chest -execute store result storage asset:context SneakTime.legs int 1 run scoreboard players get @s Sneak.Legs -execute store result storage asset:context SneakTime.feet int 1 run scoreboard players get @s Sneak.Feet -execute store result storage asset:context SneakTime.hotbar[0] int 1 run scoreboard players get @s Sneak.Hotbar0 -execute store result storage asset:context SneakTime.hotbar[1] int 1 run scoreboard players get @s Sneak.Hotbar1 -execute store result storage asset:context SneakTime.hotbar[2] int 1 run scoreboard players get @s Sneak.Hotbar2 -execute store result storage asset:context SneakTime.hotbar[3] int 1 run scoreboard players get @s Sneak.Hotbar3 -execute store result storage asset:context SneakTime.hotbar[4] int 1 run scoreboard players get @s Sneak.Hotbar4 -execute store result storage asset:context SneakTime.hotbar[5] int 1 run scoreboard players get @s Sneak.Hotbar5 -execute store result storage asset:context SneakTime.hotbar[6] int 1 run scoreboard players get @s Sneak.Hotbar6 -execute store result storage asset:context SneakTime.hotbar[7] int 1 run scoreboard players get @s Sneak.Hotbar7 -execute store result storage asset:context SneakTime.hotbar[8] int 1 run scoreboard players get @s Sneak.Hotbar8 \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/tick.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/tick.mcfunction deleted file mode 100644 index 62066cda38..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/tick.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -#> asset_manager:artifact/triggers/tick -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# 神器側に受け渡し - function #asset:artifact/tick -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/tick/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/tick/.mcfunction new file mode 100644 index 0000000000..b788196c56 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/tick/.mcfunction @@ -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"}] diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/.mcfunction index 1ed7370b70..e69de29bb2 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/.mcfunction @@ -1,31 +0,0 @@ -#> asset_manager:artifact/triggers/use_item/ -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -#> consumable判定用アマスタ -# @private -#declare tag CheckConsumableStand - -# 食べたスロットを特定する - # 下ごしらえ - data modify storage api: SelectedItemSlot set from storage asset:context Old.SelectedItemSlot - data modify storage api: Inventory set from storage asset:context New.Inventory - function api:inventory/refer_selected_item_slot/get_item - execute unless data storage api: Item.tag.TSB run data modify storage api: Item.tag.TSB set value {ID:-2,LocalCooldown:0,UUID:-2} - # アイテムの変更で特定を試みる - function asset_manager:artifact/triggers/use_item/check_change - # アイテムを入れ替えたかで特定を試みる - execute unless data storage asset:artifact Argument.AutoSlot run function asset_manager:artifact/triggers/use_item/check_hand_swap - # アイテムを投げたかで特定を試みる - execute unless data storage asset:artifact Argument.AutoSlot run function asset_manager:artifact/triggers/use_item/check_item_drop - # アイテムが食べれるかで特定を試みる - execute unless data storage asset:artifact Argument.AutoSlot run summon armor_stand 0.0 0.0 0.0 {Marker:1b,Invisible:1b,Tags:["CheckConsumableStand"]} - execute unless data storage asset:artifact Argument.AutoSlot as @e[type=armor_stand,tag=CheckConsumableStand,distance=..0.001,x=0.0,y=0.0,z=0.0,limit=1] run function asset_manager:artifact/triggers/use_item/check_has_consumable -# イベント発火前に実行するやつ - function asset_manager:artifact/data/old/set_to_current -# 神器側に受け渡し - function #asset:artifact/use_item -# イベント発火後に実行するやつ - function asset_manager:artifact/data/old/revert_from_current \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_change.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_change.mcfunction deleted file mode 100644 index e63d2836f7..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_change.mcfunction +++ /dev/null @@ -1,27 +0,0 @@ -#> asset_manager:artifact/triggers/use_item/check_change -# -# -# -# @within function asset_manager:artifact/triggers/use_item/ - -#> private -# @private - #declare score_holder $notEqualM - #declare score_holder $notEqualO - -# メインハンドの比較 - data modify storage asset:artifact Temp set from storage asset:context Old.Items.mainhand - execute store success score $notEqualM Temporary run data modify storage asset:artifact Temp set from storage api: Item -# オフハンドの比較 - data modify storage asset:artifact Temp set from storage asset:context Old.Items.offhand - execute store success score $notEqualO Temporary run data modify storage asset:artifact Temp set from storage asset:context New.Items.offhand - -# 比較結果から設定 - execute if score $notEqualM Temporary matches 0 if score $notEqualO Temporary matches 0 run data modify storage asset:artifact Argument.AutoSlot set value 'none' - execute if score $notEqualM Temporary matches 1 if score $notEqualO Temporary matches 0 run data modify storage asset:artifact Argument.AutoSlot set value 'mainhand' - execute if score $notEqualM Temporary matches 0 if score $notEqualO Temporary matches 1 run data modify storage asset:artifact Argument.AutoSlot set value 'offhand' - -# リセット - scoreboard players reset $notEqualM Temporary - scoreboard players reset $notEqualO Temporary - data remove storage asset:artifact Temp \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_hand_swap.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_hand_swap.mcfunction deleted file mode 100644 index ca5322bd88..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_hand_swap.mcfunction +++ /dev/null @@ -1,29 +0,0 @@ -#> asset_manager:artifact/triggers/use_item/check_hand_swap -# -# -# -# @within function asset_manager:artifact/triggers/use_item/ - -#> p -# @private - #declare score_holder $notMainToOff - #declare score_holder $notOffToMain - -# メインハンド -> オフハンド - data modify storage asset:artifact Temp set from storage asset:context New.Items.offhand - data remove storage asset:artifact Temp.Slot - execute store success score $notMainToOff Temporary run data modify storage asset:artifact Temp set from storage asset:context Old.Items.mainhand -# オフハンド -> メインハンド - data modify storage asset:artifact Temp set from storage asset:context Old.Items.offhand - data remove storage asset:artifact Temp.Slot - execute store success score $notOffToMain Temporary run data modify storage asset:artifact Temp set from storage api: Item - -# 比較結果から設定 - execute if score $notMainToOff Temporary matches 0 if score $notOffToMain Temporary matches 0 run data modify storage asset:artifact Argument.AutoSlot set value 'none' - execute if score $notMainToOff Temporary matches 0 if score $notOffToMain Temporary matches 1 run data modify storage asset:artifact Argument.AutoSlot set value 'offhand' - execute if score $notMainToOff Temporary matches 1 if score $notOffToMain Temporary matches 0 run data modify storage asset:artifact Argument.AutoSlot set value 'mainhand' - -# リセット - scoreboard players reset $notMainToOff Temporary - scoreboard players reset $notOffToMain Temporary - data remove storage asset:artifact Temp \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_has_consumable.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_has_consumable.mcfunction deleted file mode 100644 index 27ed3af157..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_has_consumable.mcfunction +++ /dev/null @@ -1,20 +0,0 @@ -#> asset_manager:artifact/triggers/use_item/check_has_consumable -# -# -# -# @within function asset_manager:artifact/triggers/use_item/ - -# 下ごしらえ - data modify storage asset:artifact Temp set value [{},{}] - data modify storage asset:artifact Temp[0] set from storage asset:context Old.Items.mainhand - data modify storage asset:artifact Temp[1] set from storage asset:context Old.Items.offhand - data modify entity @s HandItems set from storage asset:artifact Temp - -# チェック - execute unless predicate asset_manager:has_consumable_item/mainhand unless predicate asset_manager:has_consumable_item/offhand run data modify storage asset:artifact Argument.AutoSlot set value 'none' - execute if predicate asset_manager:has_consumable_item/mainhand unless predicate asset_manager:has_consumable_item/offhand run data modify storage asset:artifact Argument.AutoSlot set value 'mainhand' - execute unless predicate asset_manager:has_consumable_item/mainhand if predicate asset_manager:has_consumable_item/offhand run data modify storage asset:artifact Argument.AutoSlot set value 'offhand' - -# リセット - kill @s - data remove storage asset:artifact Temp \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_item_drop.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_item_drop.mcfunction deleted file mode 100644 index d58f4a5fdb..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/use_item/check_item_drop.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -#> asset_manager:artifact/triggers/use_item/check_item_drop -# -# -# -# @within function asset_manager:artifact/triggers/use_item/ - -# タグがついてるならオフハンドです(maybe) - execute if entity @s[tag=StrictCheckMainhand] run data modify storage asset:artifact Argument.AutoSlot set value 'offhand' - -# リセット - tag @s remove StrictCheckMainhand \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/using_item.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/using_item.mcfunction deleted file mode 100644 index 79129c0f76..0000000000 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/using_item.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -#> asset_manager:artifact/triggers/using_item -# -# 各神器処理へデータ受け渡し -# -# @within function asset_manager:artifact/triggers/ - -# イベント発火前に実行するやつ - function asset_manager:artifact/data/new/set_to_current -# 神器側に受け渡し - function #asset:artifact/using_item -# イベント発火後に実行するやつ - function asset_manager:artifact/data/new/revert_from_current \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/break.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/break.mcfunction index a9085eb327..7ba578181a 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/break.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/break.mcfunction @@ -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 @@ -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/ \ No newline at end of file + function asset_manager:artifact/data/current/update/ diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update.mcfunction index fd2458558c..716ad004f7 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update.mcfunction @@ -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 @@ -41,4 +41,4 @@ function asset_manager:artifact/data/current/update/ # リセット data remove storage asset:artifact Name - data remove storage asset:artifact CopiedSlot \ No newline at end of file + data remove storage asset:artifact CopiedSlot diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/hotbar.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/hotbar.mcfunction index 1afee42b59..8c7f94ba90 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/hotbar.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/hotbar.mcfunction @@ -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 \ No newline at end of file + data remove storage asset:artifact SpecificTargetSlot diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/non-hotbar.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/non-hotbar.mcfunction index 9a7f2946d2..cf72217abb 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/non-hotbar.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/use/item/update_local_cooldown/non-hotbar.mcfunction @@ -4,10 +4,9 @@ # # @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 -execute if data storage asset:artifact {TargetDefaultSlot:"legs"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[2].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[2].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown -execute if data storage asset:artifact {TargetDefaultSlot:"chest"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[3].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[3].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown -execute if data storage asset:artifact {TargetDefaultSlot:"head"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[4].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCoolDown[4].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown \ No newline at end of file +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 +execute if data storage asset:artifact {TargetDefaultSlot:"legs"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[2].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[2].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown +execute if data storage asset:artifact {TargetDefaultSlot:"chest"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[3].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[3].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown +execute if data storage asset:artifact {TargetDefaultSlot:"head"} store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[4].Value int 1 store result storage oh_my_dat: _[-4][-4][-4][-4][-4][-4][-4][-4].LocalCooldown[4].Max int 1 run data get storage asset:artifact TargetItems[-1].tag.TSB.LocalCooldown diff --git a/TheSkyBlessing/data/asset_manager/functions/common/context/id/pop.mcfunction b/TheSkyBlessing/data/asset_manager/functions/common/context/id/pop.mcfunction index 369e05167e..2a8938de21 100644 --- a/TheSkyBlessing/data/asset_manager/functions/common/context/id/pop.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/common/context/id/pop.mcfunction @@ -3,24 +3,19 @@ # # # @within function -# api:mob/summon -# api:mob/core/summon # asset:*/extends # asset:*/super.* # api:artifact/*/from_id +# asset_manager:artifact/create/set_equipment # api:entity/mob/effect/core/give -# asset_manager:mob/triggers/death/manual # asset_manager:effect/events/*/call_super_method -# asset_manager:mob/triggers/*/call_super_method -# asset_manager:artifact/give/candidates -# api:spawner/subtract_hp -# asset_manager:object/summon/ +# api:mob/core/summon +# asset:mob/call.m +# asset_manager:mob/triggers/*/call_super_methods/ # api:object/core/summon -# asset_manager:object/*/call_super_methods/ # asset:object/call.m -# asset_manager:mob/triggers/*/call_super_methods/ -# asset_manager:mob/*/call_super_methods/ -# asset:mob/call.m +# asset_manager:object/*/call_super_methods/ +# api:spawner/subtract_hp # idを掃除 data remove storage asset:context id diff --git a/TheSkyBlessing/data/asset_manager/functions/common/context/id/stash.mcfunction b/TheSkyBlessing/data/asset_manager/functions/common/context/id/stash.mcfunction index c4c1636e0c..947f31097b 100644 --- a/TheSkyBlessing/data/asset_manager/functions/common/context/id/stash.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/common/context/id/stash.mcfunction @@ -3,23 +3,19 @@ # # # @within function -# api:mob/summon -# api:mob/core/summon # asset:*/extends # asset:*/super.* # api:artifact/*/from_id +# asset_manager:artifact/create/set_equipment # api:entity/mob/effect/core/give -# asset_manager:mob/triggers/death/manual # asset_manager:effect/events/*/call_super_method -# asset_manager:artifact/give/candidates -# api:spawner/subtract_hp -# asset_manager:object/summon/ +# api:mob/core/summon +# asset:mob/call.m +# asset_manager:mob/triggers/*/call_super_methods/ # api:object/core/summon -# asset_manager:object/*/call_super_methods/ # asset:object/call.m -# asset_manager:mob/triggers/*/call_super_methods/ -# asset_manager:mob/*/call_super_methods/ -# asset:mob/call.m +# asset_manager:object/*/call_super_methods/ +# api:spawner/subtract_hp # スタックに新しい空間を追加する data modify storage asset:context IDStashStack append value {} diff --git a/TheSkyBlessing/data/asset_manager/functions/common/context/this/pop.mcfunction b/TheSkyBlessing/data/asset_manager/functions/common/context/this/pop.mcfunction index 7b0155f604..91f529a2df 100644 --- a/TheSkyBlessing/data/asset_manager/functions/common/context/this/pop.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/common/context/this/pop.mcfunction @@ -3,23 +3,9 @@ # 保持していたthisを戻す # # @within function -# api:mob/summon +# api:artifact/core/from_id # api:mob/core/summon -# asset:*/extends -# asset:*/super.* -# api:artifact/*/from_id -# api:entity/mob/effect/core/give -# asset_manager:mob/triggers/death/manual -# asset_manager:effect/events/*/call_super_method -# asset_manager:mob/triggers/*/call_super_method -# asset_manager:artifact/give -# api:spawner/subtract_hp -# asset_manager:object/summon/ # api:object/core/summon -# asset_manager:object/*/call_super_method -# asset:object/call.m -# asset_manager:mob/*/call_super_method -# asset:mob/call.m # thisを掃除 data remove storage asset:context this diff --git a/TheSkyBlessing/data/asset_manager/functions/common/context/this/stash.mcfunction b/TheSkyBlessing/data/asset_manager/functions/common/context/this/stash.mcfunction index 4214586529..dbe59137ae 100644 --- a/TheSkyBlessing/data/asset_manager/functions/common/context/this/stash.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/common/context/this/stash.mcfunction @@ -3,23 +3,9 @@ # thisを一旦保持しておく # # @within function -# api:mob/summon +# api:artifact/core/from_id # api:mob/core/summon -# asset:*/extends -# asset:*/super.* -# api:artifact/*/from_id -# api:entity/mob/effect/core/give -# asset_manager:mob/triggers/death/manual -# asset_manager:effect/events/*/call_super_method -# asset_manager:mob/triggers/*/call_super_method -# asset_manager:artifact/give -# api:spawner/subtract_hp -# asset_manager:object/summon/ # api:object/core/summon -# asset_manager:object/*/call_super_method -# asset:object/call.m -# asset_manager:mob/*/call_super_method -# asset:mob/call.m # スタックに新しい空間を追加する data modify storage asset:context ThisStashStack append value {} diff --git a/TheSkyBlessing/data/asset_manager/functions/common/reset_all_context.mcfunction b/TheSkyBlessing/data/asset_manager/functions/common/reset_all_context.mcfunction index 16111a894a..e7a5282a8d 100644 --- a/TheSkyBlessing/data/asset_manager/functions/common/reset_all_context.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/common/reset_all_context.mcfunction @@ -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 \ No newline at end of file diff --git a/TheSkyBlessing/data/asset_manager/functions/effect/_index.d.mcfunction b/TheSkyBlessing/data/asset_manager/functions/effect/_index.d.mcfunction index 7d60f76c2b..e264d7a7a7 100644 --- a/TheSkyBlessing/data/asset_manager/functions/effect/_index.d.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/effect/_index.d.mcfunction @@ -9,6 +9,7 @@ # asset:effect/*/register # asset:effect/*/ # asset_manager:effect/** +# asset_manager:artifact/create/set_equipment #declare storage asset:effect #> Tags diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/condition.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/condition.json index 95616588a9..6061576ca8 100644 --- a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/condition.json +++ b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/condition.json @@ -23,7 +23,7 @@ }, { "storage": "asset:artifact", - "nbt": "Condition", + "nbt": "Trigger.Condition", "interpret": true } ] @@ -34,4 +34,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/cost_item.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/cost_item.json index b5f7ba0a90..13d565df6d 100644 --- a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/cost_item.json +++ b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/cost_item.json @@ -23,7 +23,7 @@ }, { "storage": "asset:artifact", - "nbt": "CostText", + "nbt": "Trigger.CostText", "interpret": true } ] @@ -34,4 +34,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/equipment.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/equipment.json new file mode 100644 index 0000000000..6d4456d9a2 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/equipment.json @@ -0,0 +1,37 @@ +{ + "type": "generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "debug_stick", + "functions": [ + { + "function": "set_lore", + "entity": "this", + "lore": [ + [ + { + "text": "", + "color": "white", + "italic": false + }, + { + "text": "セット装備: " + }, + { + "storage": "asset:artifact", + "nbt": "EquipName", + "interpret": true + } + ] + ] + } + ] + } + ] + } + ] +} diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/modifier.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/modifier.json new file mode 100644 index 0000000000..ce555824e6 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/modifier.json @@ -0,0 +1,30 @@ +{ + "type": "generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "debug_stick", + "functions": [ + { + "function": "set_lore", + "entity": "this", + "lore": [ + [ + { + "storage": "asset:artifact", + "nbt": "Line[]", + "separator": "", + "interpret": true + } + ] + ] + } + ] + } + ] + } + ] +} diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_cost.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_cost.json index 9657e5805c..6523ecc077 100644 --- a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_cost.json +++ b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_cost.json @@ -23,7 +23,7 @@ }, { "storage": "asset:artifact", - "nbt": "MPCost" + "nbt": "Trigger.MPCost" } ] ] @@ -33,4 +33,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_require.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_require.json index 2874d9f887..0b657e5629 100644 --- a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_require.json +++ b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/mp_require.json @@ -23,7 +23,7 @@ }, { "storage": "asset:artifact", - "nbt": "MPRequire" + "nbt": "Trigger.MPRequire" } ] ] @@ -33,4 +33,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/TheSkyBlessing/data/player_manager/functions/god/_index.d.mcfunction b/TheSkyBlessing/data/player_manager/functions/god/_index.d.mcfunction index d1f7908e5c..0b602a7dec 100644 --- a/TheSkyBlessing/data/player_manager/functions/god/_index.d.mcfunction +++ b/TheSkyBlessing/data/player_manager/functions/god/_index.d.mcfunction @@ -17,3 +17,10 @@ #> storage for process # @within function player_manager:god/mercy/** #declare storage player_manager:god + +#> Tag for Equipment Update +# @within function +# player_manager:god/*/believe +# player_manager:god/none/set_tag +# asset_manager:artifact/triggers/ + #declare tag Believe.Changed diff --git a/TheSkyBlessing/data/player_manager/functions/god/flora/believe.mcfunction b/TheSkyBlessing/data/player_manager/functions/god/flora/believe.mcfunction index 8fb693119b..97c285d6c0 100644 --- a/TheSkyBlessing/data/player_manager/functions/god/flora/believe.mcfunction +++ b/TheSkyBlessing/data/player_manager/functions/god/flora/believe.mcfunction @@ -22,4 +22,7 @@ data modify storage api: Argument.UUID set value [2, 1, 1, 10] data modify storage api: Argument.Amount set value -0.2 data modify storage api: Argument.Operation set value "multiply_base" - function api:modifier/defense/fire/add \ No newline at end of file + function api:modifier/defense/fire/add + +# 全装備を再チェック + tag @s add Believe.Changed diff --git a/TheSkyBlessing/data/player_manager/functions/god/none/set_tag.mcfunction b/TheSkyBlessing/data/player_manager/functions/god/none/set_tag.mcfunction index f02c670ee4..090eb3a1a2 100644 --- a/TheSkyBlessing/data/player_manager/functions/god/none/set_tag.mcfunction +++ b/TheSkyBlessing/data/player_manager/functions/god/none/set_tag.mcfunction @@ -4,4 +4,5 @@ # # @within function core:handler/first_join -tag @s add Believe.None \ No newline at end of file +tag @s add Believe.None +tag @s add Believe.Changed diff --git a/TheSkyBlessing/data/player_manager/functions/god/nyaptov/believe.mcfunction b/TheSkyBlessing/data/player_manager/functions/god/nyaptov/believe.mcfunction index 988c0c5911..e28c0725b2 100644 --- a/TheSkyBlessing/data/player_manager/functions/god/nyaptov/believe.mcfunction +++ b/TheSkyBlessing/data/player_manager/functions/god/nyaptov/believe.mcfunction @@ -22,4 +22,7 @@ data modify storage api: Argument.UUID set value [2, 1, 1, 11] data modify storage api: Argument.Amount set value -0.15 data modify storage api: Argument.Operation set value "multiply_base" - function api:modifier/defense/water/add \ No newline at end of file + function api:modifier/defense/water/add + +# 全装備を再チェック + tag @s add Believe.Changed diff --git a/TheSkyBlessing/data/player_manager/functions/god/rumor/believe.mcfunction b/TheSkyBlessing/data/player_manager/functions/god/rumor/believe.mcfunction index 0ff462ceae..da46450bb8 100644 --- a/TheSkyBlessing/data/player_manager/functions/god/rumor/believe.mcfunction +++ b/TheSkyBlessing/data/player_manager/functions/god/rumor/believe.mcfunction @@ -27,4 +27,7 @@ data modify storage api: Argument.UUID set value [2, 1, 1, 12] data modify storage api: Argument.Amount set value -0.1 data modify storage api: Argument.Operation set value "multiply_base" - function api:modifier/defense/base/add \ No newline at end of file + function api:modifier/defense/base/add + +# 全装備を再チェック + tag @s add Believe.Changed diff --git a/TheSkyBlessing/data/player_manager/functions/god/urban/believe.mcfunction b/TheSkyBlessing/data/player_manager/functions/god/urban/believe.mcfunction index 115cedee3e..6334341acc 100644 --- a/TheSkyBlessing/data/player_manager/functions/god/urban/believe.mcfunction +++ b/TheSkyBlessing/data/player_manager/functions/god/urban/believe.mcfunction @@ -24,4 +24,7 @@ data modify storage api: Argument.Operation set value "multiply_base" function api:modifier/attack/magic/add # ノックバック軽減+30% - attribute @s generic.knockback_resistance modifier add 1-0-2-0-d "Urban believe bonus" 0.3 multiply_base \ No newline at end of file + attribute @s generic.knockback_resistance modifier add 1-0-2-0-d "Urban believe bonus" 0.3 multiply_base + +# 全装備を再チェック + tag @s add Believe.Changed diff --git a/TheSkyBlessing/data/player_manager/functions/god/wi-ki/believe.mcfunction b/TheSkyBlessing/data/player_manager/functions/god/wi-ki/believe.mcfunction index 26412b16e4..ee5bb0b649 100644 --- a/TheSkyBlessing/data/player_manager/functions/god/wi-ki/believe.mcfunction +++ b/TheSkyBlessing/data/player_manager/functions/god/wi-ki/believe.mcfunction @@ -22,4 +22,7 @@ data modify storage api: Argument.UUID set value [2, 1, 1, 14] data modify storage api: Argument.Amount set value -0.3 data modify storage api: Argument.Operation set value "multiply_base" - function api:modifier/defense/fire/add \ No newline at end of file + function api:modifier/defense/fire/add + +# 全装備を再チェック + tag @s add Believe.Changed