From 0d18205ab4c7500e166363429985f2b9c287202d Mon Sep 17 00:00:00 2001 From: ChenCMD Date: Thu, 14 Nov 2024 03:07:13 +0900 Subject: [PATCH 1/5] =?UTF-8?q?:construction:=20=E7=A5=9E=E5=99=A8?= =?UTF-8?q?=E3=81=AB=E3=83=92=E3=83=83=E3=83=88=E6=99=82=E5=9B=9E=E5=BE=A9?= =?UTF-8?q?MP=E3=82=92=E8=BF=BD=E5=8A=A0=E5=87=BA=E6=9D=A5=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/artifact/common/give.mcfunction | 2 +- .../artifact/example/give/2.give.mcfunction | 2 ++ .../artifact/create/set_data.mcfunction | 2 ++ .../artifact/create/set_lore/.mcfunction | 18 +++++----- .../{6.cooldown => 7.cooldown}/.mcfunction | 16 ++++----- .../make_duration.m.mcfunction | 6 ++-- .../{7.god.mcfunction => 8.god.mcfunction} | 4 +-- .../generate_lore/5.mp_heal_when_hit.json | 36 +++++++++++++++++++ .../{5.cost_item.json => 6.cost_item.json} | 0 .../{6.cooldown.json => 7.cooldown.json} | 0 ...duration.json => 7.cooldown_duration.json} | 0 11 files changed, 64 insertions(+), 22 deletions(-) rename TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/{6.cooldown => 7.cooldown}/.mcfunction (73%) rename TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/{6.cooldown => 7.cooldown}/make_duration.m.mcfunction (92%) rename TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/{7.god.mcfunction => 8.god.mcfunction} (94%) create mode 100644 TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/5.mp_heal_when_hit.json rename TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/{5.cost_item.json => 6.cost_item.json} (100%) rename TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/{6.cooldown.json => 7.cooldown.json} (100%) rename TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/{6.cooldown_duration.json => 7.cooldown_duration.json} (100%) diff --git a/TheSkyBlessing/data/asset/functions/artifact/common/give.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/common/give.mcfunction index 2a55eea8c1..bf46466d4e 100644 --- a/TheSkyBlessing/data/asset/functions/artifact/common/give.mcfunction +++ b/TheSkyBlessing/data/asset/functions/artifact/common/give.mcfunction @@ -37,7 +37,7 @@ 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 MPCost unless data storage asset:artifact MPHealWhenHit run tellraw @a [{"storage":"global","nbt":"Prefix.ERROR"},{"text":"引数が足りません"},{"text":" MPCost","color":"red"},{"text":" or","color":"white"},{"text":" MPHealWhenHit","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 diff --git a/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction index d560cddc75..99405c5a85 100644 --- a/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction +++ b/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction @@ -37,6 +37,8 @@ data modify storage asset:artifact AttackInfo.AttackRange set value "1.5" data modify storage asset:artifact MPCost set value 5 data modify storage asset:artifact MPRequire set value 10 +data modify storage asset:artifact MPHealWhenHit set value 15 + data modify storage asset:artifact LocalCooldown set value 80 data modify storage asset:artifact TypeCooldown.Type set value "shortRange" 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 08538217f9..1dc9893db0 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_data.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_data.mcfunction @@ -16,6 +16,7 @@ # AttackInfo? : Component # MPCost : int # MPRequire : int +# MPHealWhenHit : int # CostText? : TextComponent # LocalCooldown : int # SpecialCooldown : int @@ -49,6 +50,7 @@ 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.MPHealWhenHit set from storage asset:artifact MPHealWhenHit 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 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 242e9e7291..fe3610ffcc 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/.mcfunction @@ -18,14 +18,16 @@ execute if data storage asset:artifact AttackInfo run function asset_manager:artifact/create/set_lore/2.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/3.mp_require -# 4 消費MP - loot replace block 10000 0 10000 container.4 loot asset_manager:artifact/generate_lore/4.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/5.cost_item -# 6? クールダウン - function asset_manager:artifact/create/set_lore/6.cooldown/ -# 7 使える神 - function asset_manager:artifact/create/set_lore/7.god +# 4? 消費MP + execute if data storage asset:artifact MPCost run loot replace block 10000 0 10000 container.4 loot asset_manager:artifact/generate_lore/4.mp_cost +# 5? ヒット時MP回復 + execute if data storage asset:artifact MPHealWhenHit run loot replace block 10000 0 10000 container.5 loot asset_manager:artifact/generate_lore/5.mp_heal_when_hit +# 6? 消費アイテム + execute if data storage asset:artifact CostText run loot replace block 10000 0 10000 container.6 loot asset_manager:artifact/generate_lore/6.cost_item +# 7? クールダウン + function asset_manager:artifact/create/set_lore/7.cooldown/ +# 8 使える神 + function asset_manager:artifact/create/set_lore/8.god # Lore一括追加 data modify storage asset:artifact Item.tag.display.Lore append from block 10000 0 10000 Items[].tag.display.Lore[] # リセット diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/6.cooldown/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.cooldown/.mcfunction similarity index 73% rename from TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/6.cooldown/.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.cooldown/.mcfunction index 917c68b23a..64918e77d9 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/6.cooldown/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.cooldown/.mcfunction @@ -1,4 +1,4 @@ -#> asset_manager:artifact/create/set_lore/6.cooldown/ +#> asset_manager:artifact/create/set_lore/7.cooldown/ # # # @@ -8,13 +8,13 @@ # @within function asset_manager:artifact/create/set_lore/ # 各クールダウンの文章を生成する - execute if data storage asset:artifact LocalCooldown run function asset_manager:artifact/create/set_lore/6.cooldown/make_duration.m {CooldownPath:"storage asset:artifact LocalCooldown",IconPath:"storage global Icon.Cooldown.Local"} - execute if data storage asset:artifact TypeCooldown{Type:"shortRange"} run function asset_manager:artifact/create/set_lore/6.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.ShortRange"} - execute if data storage asset:artifact TypeCooldown{Type: "longRange"} run function asset_manager:artifact/create/set_lore/6.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.LongRange"} - execute if data storage asset:artifact TypeCooldown{Type: "summon"} run function asset_manager:artifact/create/set_lore/6.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.Summon"} - execute if data storage asset:artifact TypeCooldown{Type: "heal"} run function asset_manager:artifact/create/set_lore/6.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.Heal"} - execute if data storage asset:artifact SpecialCooldown run function asset_manager:artifact/create/set_lore/6.cooldown/make_duration.m {CooldownPath:"storage asset:artifact SpecialCooldown",IconPath:"storage global Icon.Cooldown.Global"} + execute if data storage asset:artifact LocalCooldown run function asset_manager:artifact/create/set_lore/7.cooldown/make_duration.m {CooldownPath:"storage asset:artifact LocalCooldown",IconPath:"storage global Icon.Cooldown.Local"} + execute if data storage asset:artifact TypeCooldown{Type:"shortRange"} run function asset_manager:artifact/create/set_lore/7.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.ShortRange"} + execute if data storage asset:artifact TypeCooldown{Type: "longRange"} run function asset_manager:artifact/create/set_lore/7.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.LongRange"} + execute if data storage asset:artifact TypeCooldown{Type: "summon"} run function asset_manager:artifact/create/set_lore/7.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.Summon"} + execute if data storage asset:artifact TypeCooldown{Type: "heal"} run function asset_manager:artifact/create/set_lore/7.cooldown/make_duration.m {CooldownPath:"storage asset:artifact TypeCooldown.Duration",IconPath:"storage global Icon.Cooldown.Type.Heal"} + execute if data storage asset:artifact SpecialCooldown run function asset_manager:artifact/create/set_lore/7.cooldown/make_duration.m {CooldownPath:"storage asset:artifact SpecialCooldown",IconPath:"storage global Icon.Cooldown.Global"} # lootする - execute if data storage asset:artifact Cooldown[0] run loot replace block 10000 0 10000 container.6 loot asset_manager:artifact/generate_lore/6.cooldown + execute if data storage asset:artifact Cooldown[0] run loot replace block 10000 0 10000 container.7 loot asset_manager:artifact/generate_lore/7.cooldown # リセット data remove storage asset:artifact Cooldown diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/6.cooldown/make_duration.m.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.cooldown/make_duration.m.mcfunction similarity index 92% rename from TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/6.cooldown/make_duration.m.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.cooldown/make_duration.m.mcfunction index b011e5837b..457cda9baf 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/6.cooldown/make_duration.m.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.cooldown/make_duration.m.mcfunction @@ -1,10 +1,10 @@ -#> asset_manager:artifact/create/set_lore/6.cooldown/make_duration.m +#> asset_manager:artifact/create/set_lore/7.cooldown/make_duration.m # # # @input args # CooldownPath: DataPath # IconPath: DataPath -# @within function asset_manager:artifact/create/set_lore/6.cooldown/ +# @within function asset_manager:artifact/create/set_lore/7.cooldown/ #> Temp # @private @@ -32,7 +32,7 @@ execute store result storage asset:artifact CooldownDecimal int 1 run scoreboard players get $CooldownDecimal Temporary execute store result storage asset:artifact CooldownMinutes int 1 run scoreboard players get $CooldownMinutes Temporary # Lore にする - loot replace block 10000 1 10000 container.0 loot asset_manager:artifact/generate_lore/6.cooldown_duration + loot replace block 10000 1 10000 container.0 loot asset_manager:artifact/generate_lore/7.cooldown_duration data modify storage asset:artifact Cooldown append from block 10000 1 10000 Items[0].tag.display.Lore[0] # リセット scoreboard players reset $Cooldown diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.god.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/8.god.mcfunction similarity index 94% rename from TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.god.mcfunction rename to TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/8.god.mcfunction index 1666d7db9b..fe345b9c36 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/7.god.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/create/set_lore/8.god.mcfunction @@ -1,4 +1,4 @@ -#> asset_manager:artifact/create/set_lore/7.god +#> asset_manager:artifact/create/set_lore/8.god # # 使用できる神を設定します # @@ -18,6 +18,6 @@ execute if data storage asset:artifact {CanUsedGod:["Wi-ki"]} run data modify storage asset:artifact Temp.CanUsedGod[3] set from storage global Icon.God.Wi-ki execute if data storage asset:artifact {CanUsedGod:["Rumor"]} run data modify storage asset:artifact Temp.CanUsedGod[4] set from storage global Icon.God.Rumor # 生成 - loot replace block 10000 0 10000 container.7 loot asset_manager:artifact/generate_lore/7.god + loot replace block 10000 0 10000 container.8 loot asset_manager:artifact/generate_lore/7.god # リセット data remove storage asset:artifact Temp diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/5.mp_heal_when_hit.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/5.mp_heal_when_hit.json new file mode 100644 index 0000000000..f6d34caf44 --- /dev/null +++ b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/5.mp_heal_when_hit.json @@ -0,0 +1,36 @@ +{ + "type": "generic", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "item", + "name": "debug_stick", + "functions": [ + { + "function": "set_lore", + "entity": "this", + "lore": [ + [ + { + "text": "", + "color": "white", + "italic": false + }, + { + "text": "ヒット時MP回復: " + }, + { + "storage": "asset:artifact", + "nbt": "MPHealWhenHit" + } + ] + ] + } + ] + } + ] + } + ] +} diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/5.cost_item.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/6.cost_item.json similarity index 100% rename from TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/5.cost_item.json rename to TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/6.cost_item.json diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/6.cooldown.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/7.cooldown.json similarity index 100% rename from TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/6.cooldown.json rename to TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/7.cooldown.json diff --git a/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/6.cooldown_duration.json b/TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/7.cooldown_duration.json similarity index 100% rename from TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/6.cooldown_duration.json rename to TheSkyBlessing/data/asset_manager/loot_tables/artifact/generate_lore/7.cooldown_duration.json From d6e73aa9a25830b8098b8ef6d044d7d670d960f4 Mon Sep 17 00:00:00 2001 From: ChenCMD Date: Thu, 14 Nov 2024 03:09:32 +0900 Subject: [PATCH 2/5] =?UTF-8?q?:technologist:=20DamageAPI=20=E5=AE=9F?= =?UTF-8?q?=E8=A1=8C=E6=99=82=E3=81=AB=20MP=20=E3=82=92=E5=9B=9E=E5=BE=A9?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TheSkyBlessing/data/api/functions/damage/.mcfunction | 1 + .../data/api/functions/damage/core/attack.mcfunction | 5 ++++- .../data/api/functions/damage/core/mp_heal.mcfunction | 9 +++++++++ .../data/api/functions/damage/core/reset.mcfunction | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 TheSkyBlessing/data/api/functions/damage/core/mp_heal.mcfunction diff --git a/TheSkyBlessing/data/api/functions/damage/.mcfunction b/TheSkyBlessing/data/api/functions/damage/.mcfunction index 6bddfcbd53..229a519070 100644 --- a/TheSkyBlessing/data/api/functions/damage/.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/.mcfunction @@ -21,6 +21,7 @@ # └ Argument.BypassDifficulty? : boolean # Argument.ReduceEnchantment? : id(minecraft:enchantment) | { id: id(minecraft:enchantment), modifier?: int } # Argument.DeathMessage? : TextComponent || TextComponent[] +# Argument.AdditionalMPHeal? : int # Argument.DisableLog? : boolean (default: false) # Argument.Metadata? : any # @api diff --git a/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction index 252401bad8..e5225cbc1b 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/attack.mcfunction @@ -12,4 +12,7 @@ function api:damage/core/health_subtract/ # リセット scoreboard players reset $Health Temporary - scoreboard players reset $Damage Temporary \ No newline at end of file + scoreboard players reset $Damage Temporary + +# MP 回復 + execute if data storage api: Argument.AdditionalMPHeal if entity @s[type=!player] as @a if score @s UserID = $LatestModifiedUser UserID run function api:damage/core/mp_heal diff --git a/TheSkyBlessing/data/api/functions/damage/core/mp_heal.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/mp_heal.mcfunction new file mode 100644 index 0000000000..50eb62bf69 --- /dev/null +++ b/TheSkyBlessing/data/api/functions/damage/core/mp_heal.mcfunction @@ -0,0 +1,9 @@ +#> api:damage/core/mp_heal +# +# +# +# @within function api:damage/core/attack + +data modify storage api: Argument.Fluctuation set from storage api: Argument.AdditionalMPHeal +data modify storage api: Argument.DisableLog set value true +function api:mp/fluctuation diff --git a/TheSkyBlessing/data/api/functions/damage/core/reset.mcfunction b/TheSkyBlessing/data/api/functions/damage/core/reset.mcfunction index e602295a86..d4e6d24b43 100644 --- a/TheSkyBlessing/data/api/functions/damage/core/reset.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/core/reset.mcfunction @@ -16,6 +16,7 @@ data remove storage api: Argument.BypassEnchantments data remove storage api: Argument.BypassResistance data remove storage api: Argument.DisableParticle data remove storage api: Argument.ReduceEnchantment +data remove storage api: Argument.AdditionalMPHeal data remove storage api: Argument.DisableLog data remove storage api: Argument.Metadata From 85504b47c44531f0c1aab31c5367dafaa1f2ba64 Mon Sep 17 00:00:00 2001 From: ChenCMD Date: Thu, 14 Nov 2024 03:10:21 +0900 Subject: [PATCH 3/5] =?UTF-8?q?:sparkles:=20=E7=A5=9E=E5=99=A8=E3=81=A7=20?= =?UTF-8?q?DamageAPI=20=E4=BD=BF=E7=94=A8=E6=99=82=E3=81=AB=20register=20?= =?UTF-8?q?=E3=81=A7=E8=A8=AD=E5=AE=9A=E3=81=97=E3=81=9F=E9=87=8F=20MP=20?= =?UTF-8?q?=E3=82=92=E5=9B=9E=E5=BE=A9=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TheSkyBlessing/data/api/functions/damage/.mcfunction | 3 ++- .../functions/artifact/triggers/.mcfunction | 1 + .../asset_manager/functions/artifact/use/.mcfunction | 10 +++++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/TheSkyBlessing/data/api/functions/damage/.mcfunction b/TheSkyBlessing/data/api/functions/damage/.mcfunction index 229a519070..ea7584147f 100644 --- a/TheSkyBlessing/data/api/functions/damage/.mcfunction +++ b/TheSkyBlessing/data/api/functions/damage/.mcfunction @@ -21,7 +21,7 @@ # └ Argument.BypassDifficulty? : boolean # Argument.ReduceEnchantment? : id(minecraft:enchantment) | { id: id(minecraft:enchantment), modifier?: int } # Argument.DeathMessage? : TextComponent || TextComponent[] -# Argument.AdditionalMPHeal? : int +# Argument.AdditionalMPHeal? : int (default: PersistentArgument.AdditionalMPHeal) # Argument.DisableLog? : boolean (default: false) # Argument.Metadata? : any # @api @@ -42,6 +42,7 @@ execute unless data storage api: Argument.BypassEnchantments run data modify storage api: Argument.BypassEnchantments set value false execute unless data storage api: Argument.BypassResistance run data modify storage api: Argument.BypassResistance set value false execute unless data storage api: Argument.BypassDifficulty run data modify storage api: Argument.BypassDifficulty set value false + execute unless data storage api: Argument.AdditionalMPHeal run data modify storage api: Argument.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal execute unless data storage api: Argument.DisableLog run data modify storage api: Argument.DisableLog set value false # Healthを持つ干渉可能なEntityかつ死んでいなければ実行 diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction index be9f5e512c..6516194cb0 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/triggers/.mcfunction @@ -31,6 +31,7 @@ # EntityStorageにデータ突っ込む function asset_manager:artifact/data/new/stash_to_entity_storage # リセット + data remove storage api: PersistentArgument.AdditionalMPHeal data remove storage asset:artifact EquipmentChanges data remove storage asset:artifact ArtifactEvents function asset_manager:artifact/data/current/reset diff --git a/TheSkyBlessing/data/asset_manager/functions/artifact/use/.mcfunction b/TheSkyBlessing/data/asset_manager/functions/artifact/use/.mcfunction index 12ccb11bfb..de2d8af0da 100644 --- a/TheSkyBlessing/data/asset_manager/functions/artifact/use/.mcfunction +++ b/TheSkyBlessing/data/asset_manager/functions/artifact/use/.mcfunction @@ -6,8 +6,16 @@ # 神器データの取得 function asset_manager:artifact/data/current/get +# 神器処理内で利用される DamageAPI 用に MP 回復量のデータを追加する +# DamageAPI で MP 回復をするのは設計上非常に正しくなく、 +# 本来は、DamageAPI 時に割り込みで呼び出された回数を記録し、 +# 神器処理終了後にまとめて MPHealWhenHit * Cnt を回復するのが正しいと思われる。 +# が、実装時点では神器の処理終了時に追加で処理を実行することが出来ないため、 +# すべてを諦めて DamageAPI で回復を行う。 + data remove storage api: PersistentArgument.AdditionalMPHeal + execute store result storage api: PersistentArgument.AdditionalMPHeal int 1 run data get storage asset:artifact TargetItems[0].tag.TSB.MPHealWhenHit # MP減少処理 - function asset_manager:artifact/use/remove_mp + execute if data storage asset:artifact TargetItems[0].tag.TSB.MPCost run function asset_manager:artifact/use/remove_mp # 種別クールダウン保存 execute if data storage asset:artifact TargetItems[0].tag.TSB.TypeCooldown run function asset_manager:artifact/use/update_type_cooldown.m with storage asset:artifact TargetItems[0].tag.TSB.TypeCooldown # 特殊クールダウン保存 From f090f7c4372b3f07f57876b9d1d055d59de505a9 Mon Sep 17 00:00:00 2001 From: ChenCMD Date: Thu, 14 Nov 2024 03:11:21 +0900 Subject: [PATCH 4/5] =?UTF-8?q?:technologist:=20=E5=8B=95=E4=BD=9C?= =?UTF-8?q?=E7=A2=BA=E8=AA=8D=E7=94=A8=E3=81=AB=20Example=20=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../asset/functions/artifact/example/give/2.give.mcfunction | 6 +++--- .../functions/artifact/example/trigger/3.main.mcfunction | 6 +++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction index 99405c5a85..56bbdc78bc 100644 --- a/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction +++ b/TheSkyBlessing/data/asset/functions/artifact/example/give/2.give.mcfunction @@ -34,10 +34,10 @@ data modify storage asset:artifact AttackInfo.BypassResist set value 1b data modify storage asset:artifact AttackInfo.IsRangeAttack set value "always" data modify storage asset:artifact AttackInfo.AttackRange set value "1.5" -data modify storage asset:artifact MPCost set value 5 -data modify storage asset:artifact MPRequire set value 10 +# data modify storage asset:artifact MPCost set value 5 +# data modify storage asset:artifact MPRequire set value 10 -data modify storage asset:artifact MPHealWhenHit set value 15 +data modify storage asset:artifact MPHealWhenHit set value 5 data modify storage asset:artifact LocalCooldown set value 80 diff --git a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/3.main.mcfunction b/TheSkyBlessing/data/asset/functions/artifact/example/trigger/3.main.mcfunction index 2a87e72fcd..7b9eca3036 100644 --- a/TheSkyBlessing/data/asset/functions/artifact/example/trigger/3.main.mcfunction +++ b/TheSkyBlessing/data/asset/functions/artifact/example/trigger/3.main.mcfunction @@ -13,4 +13,8 @@ function asset:artifact/common/use/mainhand # ここから先は神器側の効果の処理を書く - execute as @e[type=#lib:living,type=!player,tag=Victim,distance=..5] run data modify entity @s Motion[1] set value 2.5d + data modify storage api: Argument.Damage set value 1 + data modify storage api: Argument.AttackType set value "Physical" + function api:damage/modifier + execute as @e[type=#lib:living,type=!player,tag=Victim,distance=..6] run function api:damage/ + function api:damage/reset From 9821e44c740a3cdd2d9c1bffe2eed9cc880578b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=91=A0=E7=92=83?= <87566955+Lapis-LJA@users.noreply.github.com> Date: Thu, 14 Nov 2024 22:50:27 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=A9=B9=20$size=E3=82=92=E3=83=AA?= =?UTF-8?q?=E3=82=BB=E3=83=83=E3=83=88=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=20(#1630)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/lib/functions/random/with_biased/manual.m.mcfunction | 1 + 1 file changed, 1 insertion(+) diff --git a/TheSkyBlessing/data/lib/functions/random/with_biased/manual.m.mcfunction b/TheSkyBlessing/data/lib/functions/random/with_biased/manual.m.mcfunction index d3a2bd757a..e1aa4ce883 100644 --- a/TheSkyBlessing/data/lib/functions/random/with_biased/manual.m.mcfunction +++ b/TheSkyBlessing/data/lib/functions/random/with_biased/manual.m.mcfunction @@ -40,6 +40,7 @@ # 諸々リセット scoreboard players reset $max Temporary + scoreboard players reset $size Temporary data remove storage lib: isScarcityHistoryIncluded data remove storage lib: Random data remove storage lib: RecentHits