From 9793ffe84d0ceb9524cd984263db43cd0498ad26 Mon Sep 17 00:00:00 2001 From: Lapis-LJA <87566955+Lapis-LJA@users.noreply.github.com> Date: Tue, 13 Jan 2026 00:15:41 +0900 Subject: [PATCH 1/9] =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../give/1.trigger.mcfunction | 7 ++ .../1361.unicorn_horn/give/2.give.mcfunction | 73 +++++++++++++++++++ .../1361.unicorn_horn/register.mcfunction | 8 ++ .../trigger/1.trigger.mcfunction | 8 ++ .../trigger/2.check_condition.mcfunction | 46 ++++++++++++ .../2.check_condition/add_tag.m.mcfunction | 8 ++ .../search_max_damage_target.mcfunction | 28 +++++++ .../trigger/3.main.mcfunction | 37 ++++++++++ .../trigger/_index.d.mcfunction | 8 ++ .../1361.unicorn_horn/trigger/vfx.mcfunction | 11 +++ .../asset/tags/functions/artifact/attack.json | 3 +- .../asset/tags/functions/artifact/give.json | 3 +- .../tags/functions/artifact/register.json | 3 +- 13 files changed, 240 insertions(+), 3 deletions(-) create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/give/1.trigger.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/register.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/1.trigger.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/1.trigger.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/1.trigger.mcfunction new file mode 100644 index 00000000000..455df9db18b --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/1.trigger.mcfunction @@ -0,0 +1,7 @@ +#> asset:artifact/1361.unicorn_horn/give/1.trigger +# +# 神器の取得処理の呼び出し時に実行されるfunction +# +# @within tag/function asset:artifact/give + +execute if data storage asset:context {id:1361} run function asset:artifact/1361.unicorn_horn/give/2.give \ No newline at end of file diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction new file mode 100644 index 00000000000..e5a3fa1a118 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction @@ -0,0 +1,73 @@ +#> asset:artifact/1361.unicorn_horn/give/2.give +# +# 神器の作成部 ここでID等を定義する +# +# @user +# @within function asset:artifact/1361.unicorn_horn/give/1.trigger + +# 神器の説明や消費MPなどをここで設定する。 +# 最後にasset:artifact/common/giveを実行することで入手可能。 + +# 神器のID (int) スプレッドシートの値を入れる + data modify storage asset:artifact ID set value 1361 +# 神器のベースアイテム + data modify storage asset:artifact Item set value "minecraft:stick" +# 神器の名前 (TextComponentString) + data modify storage asset:artifact Name set value '{"text":"ユニコーンのツノ","color":"#d787ff"}' +# 神器の説明文 (TextComponentString[]) + data modify storage asset:artifact Lore set value ['{"text":"攻撃対象の中で最もダメージを与えた1体に","color":"white"}','{"text":"属性耐性を貫通するランダムな属性のダメージを与える","color":"white"}','{"text":"聖域に棲まう一角の幻獣のツノ","color":"gray"}','{"text":"満ちた神秘の魔力が、敵の守りを容易く貫く","color":"gray"}'] +# 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション) + # data modify storage asset:artifact ConsumeItem.Item set value '{"translate":"item.minecraft.stick"}' + # data modify storage asset:artifact ConsumeItem.Count set value 1 + # data modify storage asset:artifact ConsumeItem.Extra set value +# 使用回数 (int) (オプション) + # data modify storage asset:artifact RemainingCount set value +# 神器を発動できるスロット (string) Wikiを参照 + data modify storage asset:artifact Slot set value "hotbar" +# 神器のトリガー (string) Wikiを参照 + data modify storage asset:artifact Trigger set value "onAttack" +# 効果が重複可能か否か (boolean) (オプション) + # data modify storage asset:artifact EnableDuplication set value +# 神器の発動条件 (TextComponentString) (オプション) + data modify storage asset:artifact Condition set value '{"text":"1600以上のダメージを与える","color":"white"}' +# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション) + data modify storage asset:artifact AttackInfo.Damage set value [1000] +# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション) + data modify storage asset:artifact AttackInfo.AttackType set value [Magic] +# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション) + data modify storage asset:artifact AttackInfo.ElementType set value [Fire,Water,Thunder,None] +# 攻撃に関する情報 -防御無視 (boolean) Wikiを参照 (オプション) + data modify storage asset:artifact AttackInfo.BypassResist set value true +# 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション) + data modify storage asset:artifact AttackInfo.IsRangeAttack set value "never" +# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション) + # data modify storage asset:artifact AttackInfo.AttackRange set value +# MP消費量 (int) + data modify storage asset:artifact MPCost set value 25 +# MP必要量 (int) (オプション) + # data modify storage asset:artifact MPRequire set value +# MP回復量 (int) + # data modify storage asset:artifact MPHealWhenHit set value +# 神器のクールダウン (int) (オプション) + data modify storage asset:artifact LocalCooldown set value 160 +# 種別クールダウン ({Type: string, Duration: int}) (オプション) + # data modify storage asset:artifact TypeCooldown.Type set value + # data modify storage asset:artifact TypeCooldown.Duration set value +# 第二種別クールダウン ({Type: string, Duration: int}) (オプション) + # data modify storage asset:artifact SecondaryTypeCooldown.Type set value + # data modify storage asset:artifact SecondaryTypeCooldown.Duration set value +# グローバルクールダウン (int) (オプション) + # data modify storage asset:artifact SpecialCooldown set value +# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション) + data modify storage asset:artifact DisableCooldownMessage set value true +# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション) + data modify storage asset:artifact DisableMPMessage set value true +# 破壊時の音を鳴らさないかどうか (boolean) (オプション) + # data modify storage asset:artifact DisableBreakSound set value +# 扱える神 (string[]) Wikiを参照 + data modify storage asset:artifact CanUsedGod set value ["Flora", "Nyaptov", "Wi-ki", "Rumor"] +# カスタムNBT (NBTCompound) 追加で指定したいNBT (オプション) + # data modify storage asset:artifact CustomNBT set value {} + +# 神器の入手用function + function asset:artifact/common/give diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/register.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/register.mcfunction new file mode 100644 index 00000000000..d2718ac6e81 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/register.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/1361.unicorn_horn/register +# +# 神器プールへの登録処理 +# +# @within tag/function asset:artifact/register + +data modify storage asset:artifact RarityRegistry[4] append value [1361] +data modify storage asset:artifact RarityRegistryWithColor.Red[4] append value [1361] diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/1.trigger.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/1.trigger.mcfunction new file mode 100644 index 00000000000..b8252997c7e --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/1.trigger.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/1361.unicorn_horn/trigger/1.trigger +# +# 指定したイベントタイミングで実行されるfunction +# +# @within tag/function asset:artifact/** + +# storage asset:idの%slot%に装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する + execute if data storage asset:context id{hotbar:[1361]} run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition \ No newline at end of file diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction new file mode 100644 index 00000000000..08e60cbc87b --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction @@ -0,0 +1,46 @@ +#> asset:artifact/1361.unicorn_horn/trigger/2.check_condition +# +# 神器の発動条件をチェックします +# +# @within function asset:artifact/1361.unicorn_horn/trigger/1.trigger + +# ID指定する + data modify storage asset:artifact TargetID set value 1361 +# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く + function asset:artifact/common/check_condition/hotbar +# 他にアイテム等確認する場合はここに書く + +#> Private +# @private + +# 仕様書 +# 最大ダメージを取得し、攻撃対象の中で「ダメージ量が最大ダメージと一致する対象」をTempTargetとし +# TempTargetの中で最も近い対象を攻撃対象とする。 + +# 要求ダメージ設定(10倍) + execute if entity @s[tag=CanUsed] run scoreboard players set $RequireDamage Temporary 16000 + +# 最大ダメージが要求ダメージ以上か? + execute if entity @s[tag=CanUsed] store result score $MaxDamage Temporary run data get storage asset:context Attack.Amount 10 + execute if entity @s[tag=CanUsed] unless score $MaxDamage Temporary >= $RequireDamage Temporary run tag @s remove CanUsed + + # execute if entity @s[tag=CanUsed] run say 要求ダメージok + +# 最大ダメージを与えた対象を探す + execute if entity @s[tag=CanUsed] run data modify storage asset:temp _.To set from storage asset:context Attack.To + execute if entity @s[tag=CanUsed] run data modify storage asset:temp _.Amounts set from storage asset:context Attack.Amounts + execute if entity @s[tag=CanUsed] run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target + +# この段階でTempTargetがいなければCanUsedを削除 + execute if entity @s[tag=CanUsed] unless entity @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150] run tag @s remove CanUsed + + # execute if entity @s[tag=CanUsed] run say TempTarget ok + +# CanUsedタグをチェックして3.main.mcfunctionを実行する + execute if entity @s[tag=CanUsed] run function asset:artifact/1361.unicorn_horn/trigger/3.main + +# リセット + data remove storage asset:temp _ + scoreboard players reset $MaxDamage Temporary + scoreboard players reset $RequireDamage Temporary + tag @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150] remove TempTarget diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction new file mode 100644 index 00000000000..ff3b6f8333d --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m +# +# +# +# @within function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target + +# tagを付与 + $tag @e[type=#lib:living_without_player,tag=Enemy,tag=Victim,scores={MobUUID=$(TargetMobUUID)},distance=..150,sort=nearest,limit=1] add TempTarget diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction new file mode 100644 index 00000000000..c609bf391d1 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction @@ -0,0 +1,28 @@ +#> asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target +# +# 最もダメージを与えた対象を探す +# +# @within function +# asset:artifact/1361.unicorn_horn/trigger/2.check_condition +# asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target + +#> Private +# @private + #declare score_holder $Damage + +# 配列の最後尾のダメージ量をコピー + execute store result score $Damage Temporary run data get storage asset:temp _.Amounts[-1] 10 + +# 最大ダメージ量と同じならマクロでtagを付与 distanceで広範囲検索するよりは軽そうと思ったから + execute if score $Damage Temporary = $MaxDamage Temporary run data modify storage asset:temp _.TargetMobUUID set from storage asset:temp _.To[-1] + execute if score $Damage Temporary = $MaxDamage Temporary run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m with storage asset:temp _ + +# 最後尾の要素を削除 + data remove storage asset:temp _.To[-1] + data remove storage asset:temp _.Amounts[-1] + +# リセット + scoreboard players reset $Damage Temporary + +# 要素がまだあれば再帰 + execute if data storage asset:temp _.To[0] run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction new file mode 100644 index 00000000000..f941e486b74 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction @@ -0,0 +1,37 @@ +#> asset:artifact/1361.unicorn_horn/trigger/3.main +# +# 神器のメイン処理部 +# +# @within function asset:artifact/1361.unicorn_horn/trigger/2.check_condition + +# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う + function asset:artifact/common/use/hotbar + +# ここから先は神器側の効果の処理を書く + +#> Private +# @private + #declare score_holder $Random + +# check_conditionで判定したTempTargetの中で最も近い対象を攻撃対象とする + +# 演出 + execute as @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,tag=!Uninterferable,distance=..150,sort=nearest,limit=1] at @s anchored eyes positioned ^ ^ ^ run function asset:artifact/1361.unicorn_horn/trigger/vfx + +# 属性をランダムに指定する + execute store result score $Random Temporary run random value 0..3 + execute if score $Random Temporary matches 0 run data modify storage api: Argument.ElementType set value "None" + execute if score $Random Temporary matches 1 run data modify storage api: Argument.ElementType set value "Fire" + execute if score $Random Temporary matches 2 run data modify storage api: Argument.ElementType set value "Water" + execute if score $Random Temporary matches 3 run data modify storage api: Argument.ElementType set value "Thunder" + +# 敵の耐性のみを貫通するダメージ + data modify storage api: Argument.Damage set value 1000f + data modify storage api: Argument.AttackType set value "Magic" + function api:damage/modifier + data modify storage api: Argument.BypassModifier set value false + execute as @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,tag=!Uninterferable,distance=..150,sort=nearest,limit=1] run function api:damage/ + function api:damage/reset + +# リセット + scoreboard players reset $Random Temporary diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction new file mode 100644 index 00000000000..af8d185fb38 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction @@ -0,0 +1,8 @@ +#> asset:artifact/1361.unicorn_horn/trigger/_index.d +# @private + +#> tag +# @within function asset:artifact/1361.unicorn_horn/trigger/** + #declare tag TempTarget + #declare score_holder $MaxDamage + #declare score_holder $RequireDamage diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction new file mode 100644 index 00000000000..eb9e2a00d91 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction @@ -0,0 +1,11 @@ +#> asset:artifact/1361.unicorn_horn/trigger/vfx +# +# +# +# @within function asset:artifact/1361.unicorn_horn/trigger/3.main + +# 演出 + particle dust 1 0.4 1 0.6 ~ ~ ~ 0 2 0 0 160 normal @a + particle dragon_breath ~ ~ ~ 0 0 0 0.4 20 normal @a + playsound minecraft:entity.allay.ambient_without_item player @a ~ ~ ~ 0.8 1.8 + playsound minecraft:entity.arrow.hit_player player @a ~ ~ ~ 0.4 1.2 diff --git a/Asset/data/asset/tags/functions/artifact/attack.json b/Asset/data/asset/tags/functions/artifact/attack.json index 2758c71743e..96326b4a962 100644 --- a/Asset/data/asset/tags/functions/artifact/attack.json +++ b/Asset/data/asset/tags/functions/artifact/attack.json @@ -1,5 +1,6 @@ { "values": [ + "asset:artifact/1361.unicorn_horn/trigger/1.trigger", "asset:artifact/0897.lightning_broach/trigger/1.trigger", "asset:artifact/0554.catastrophe/attack/1.trigger", "asset:artifact/1110.lantern_of_firefly/trigger/1.trigger", @@ -8,4 +9,4 @@ "asset:artifact/0664.soul_fire_armor/attack/1.trigger", "asset:artifact/0724.oblivious_snow/attack/1.trigger" ] -} +} \ No newline at end of file diff --git a/Asset/data/asset/tags/functions/artifact/give.json b/Asset/data/asset/tags/functions/artifact/give.json index f3eb0088574..3d94f7f4180 100644 --- a/Asset/data/asset/tags/functions/artifact/give.json +++ b/Asset/data/asset/tags/functions/artifact/give.json @@ -1,5 +1,6 @@ { "values": [ + "asset:artifact/1361.unicorn_horn/give/1.trigger", "asset:artifact/1140.over_pulse_booster/give/1.trigger", "asset:artifact/1139.over_pulse_legframe/give/1.trigger", "asset:artifact/1138.over_pulse_bodyarmor/give/1.trigger", @@ -517,4 +518,4 @@ "asset:artifact/0735.collision_plate/give/1.trigger", "asset:artifact/0745.blade_of_whirlwind/give/1.trigger" ] -} +} \ No newline at end of file diff --git a/Asset/data/asset/tags/functions/artifact/register.json b/Asset/data/asset/tags/functions/artifact/register.json index deba1661508..e8ee56e038a 100644 --- a/Asset/data/asset/tags/functions/artifact/register.json +++ b/Asset/data/asset/tags/functions/artifact/register.json @@ -1,5 +1,6 @@ { "values": [ + "asset:artifact/1361.unicorn_horn/register", "asset:artifact/1137.over_pulse_headgear/register", "asset:artifact/1228.fatalerror/register", "asset:artifact/1273.maidchan_plush/register", @@ -295,4 +296,4 @@ "asset:artifact/1027.fire_of_rebirth/register", "asset:artifact/1111.rod_o_redeem/register" ] -} +} \ No newline at end of file From d6e2f4b93265f1b82f876337161b4468202faafa 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: Wed, 14 Jan 2026 03:16:14 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=E6=B6=88=E3=81=97=E5=BF=98=E3=82=8C?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1361.unicorn_horn/trigger/2.check_condition.mcfunction | 3 --- 1 file changed, 3 deletions(-) diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction index 08e60cbc87b..2693da0d811 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction @@ -10,9 +10,6 @@ function asset:artifact/common/check_condition/hotbar # 他にアイテム等確認する場合はここに書く -#> Private -# @private - # 仕様書 # 最大ダメージを取得し、攻撃対象の中で「ダメージ量が最大ダメージと一致する対象」をTempTargetとし # TempTargetの中で最も近い対象を攻撃対象とする。 From f881dedc079f6a50bcf2a9d6a0f8da188e00e56d 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: Wed, 14 Jan 2026 03:18:52 +0900 Subject: [PATCH 3/9] =?UTF-8?q?=E8=80=90=E6=80=A7=E3=82=92=E8=B2=AB?= =?UTF-8?q?=E9=80=9A=E3=81=A7=E3=81=8D=E3=81=A6=E3=81=84=E3=81=AA=E3=81=84?= =?UTF-8?q?=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../artifact/1361.unicorn_horn/trigger/3.main.mcfunction | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction index f941e486b74..c2a3e5e2057 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction @@ -29,7 +29,7 @@ data modify storage api: Argument.Damage set value 1000f data modify storage api: Argument.AttackType set value "Magic" function api:damage/modifier - data modify storage api: Argument.BypassModifier set value false + data modify storage api: Argument.BypassModifier set value true execute as @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,tag=!Uninterferable,distance=..150,sort=nearest,limit=1] run function api:damage/ function api:damage/reset From b03d1656292619442013ea22f319430a9a1e2d43 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, 22 Jan 2026 08:55:50 +0900 Subject: [PATCH 4/9] =?UTF-8?q?=E3=82=B3=E3=83=A1=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=92=E8=AA=BF=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../artifact/1361.unicorn_horn/trigger/3.main.mcfunction | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction index c2a3e5e2057..c7ec1b6a37d 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction @@ -25,7 +25,7 @@ execute if score $Random Temporary matches 2 run data modify storage api: Argument.ElementType set value "Water" execute if score $Random Temporary matches 3 run data modify storage api: Argument.ElementType set value "Thunder" -# 敵の耐性のみを貫通するダメージ +# 敵の属性耐性のみを無視するダメージ data modify storage api: Argument.Damage set value 1000f data modify storage api: Argument.AttackType set value "Magic" function api:damage/modifier From d2fa5928e7ae9c0eb12ec9732899acb302ae117d Mon Sep 17 00:00:00 2001 From: Lapis-LJA <87566955+Lapis-LJA@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:20:30 +0900 Subject: [PATCH 5/9] =?UTF-8?q?check=5Fcondition=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trigger/2.check_condition.mcfunction | 38 +++++++++---------- .../2.check_condition/reset.mcfunction | 12 ++++++ 2 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction index 2693da0d811..63aab348c1f 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction @@ -14,30 +14,30 @@ # 最大ダメージを取得し、攻撃対象の中で「ダメージ量が最大ダメージと一致する対象」をTempTargetとし # TempTargetの中で最も近い対象を攻撃対象とする。 -# 要求ダメージ設定(10倍) - execute if entity @s[tag=CanUsed] run scoreboard players set $RequireDamage Temporary 16000 +# CanUsedじゃなければreturn + execute if entity @s[tag=!CanUsed] run return fail -# 最大ダメージが要求ダメージ以上か? - execute if entity @s[tag=CanUsed] store result score $MaxDamage Temporary run data get storage asset:context Attack.Amount 10 - execute if entity @s[tag=CanUsed] unless score $MaxDamage Temporary >= $RequireDamage Temporary run tag @s remove CanUsed +# IsDoT:trueならreturn + execute if data storage asset:context Attack{IsDoT:true} run return run tag @s remove CanUsed - # execute if entity @s[tag=CanUsed] run say 要求ダメージok +# Victimがいなければreturn + execute unless entity @e[type=#lib:living_without_player,tag=Victim,distance=..150,limit=1] run return run tag @s remove CanUsed -# 最大ダメージを与えた対象を探す - execute if entity @s[tag=CanUsed] run data modify storage asset:temp _.To set from storage asset:context Attack.To - execute if entity @s[tag=CanUsed] run data modify storage asset:temp _.Amounts set from storage asset:context Attack.Amounts - execute if entity @s[tag=CanUsed] run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target +# 最大ダメージが要求ダメージ以上か? + scoreboard players set $RequireDamage Temporary 16000 + execute store result score $MaxDamage Temporary run data get storage asset:context Attack.Amount 10 + execute unless score $MaxDamage Temporary >= $RequireDamage Temporary run return run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset -# この段階でTempTargetがいなければCanUsedを削除 - execute if entity @s[tag=CanUsed] unless entity @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150] run tag @s remove CanUsed +# 最大ダメージを与えた対象を探す + data modify storage asset:temp _.To set from storage asset:context Attack.To + data modify storage asset:temp _.Amounts set from storage asset:context Attack.Amounts + function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target - # execute if entity @s[tag=CanUsed] run say TempTarget ok +# この段階でTempTargetがいなければreturn + execute unless entity @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150,limit=1] run return run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset -# CanUsedタグをチェックして3.main.mcfunctionを実行する - execute if entity @s[tag=CanUsed] run function asset:artifact/1361.unicorn_horn/trigger/3.main +# 3.main.mcfunctionを実行する + function asset:artifact/1361.unicorn_horn/trigger/3.main # リセット - data remove storage asset:temp _ - scoreboard players reset $MaxDamage Temporary - scoreboard players reset $RequireDamage Temporary - tag @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150] remove TempTarget + function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction new file mode 100644 index 00000000000..ee2c78f13f8 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction @@ -0,0 +1,12 @@ +#> asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset +# +# +# +# @within function asset:artifact/1361.unicorn_horn/trigger/2.check_condition + +# 諸々をまとめてリセット + tag @s remove CanUsed + data remove storage asset:temp _ + scoreboard players reset $MaxDamage Temporary + scoreboard players reset $RequireDamage Temporary + tag @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150] remove TempTarget From a150dd452e8bdaa11671d99f716c1fc45afa2d75 Mon Sep 17 00:00:00 2001 From: Lapis-LJA <87566955+Lapis-LJA@users.noreply.github.com> Date: Thu, 5 Feb 2026 06:27:25 +0900 Subject: [PATCH 6/9] =?UTF-8?q?=E8=A1=A8=E7=8F=BE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/artifact/1361.unicorn_horn/give/2.give.mcfunction | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction index e5a3fa1a118..84221df0341 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction @@ -15,7 +15,7 @@ # 神器の名前 (TextComponentString) data modify storage asset:artifact Name set value '{"text":"ユニコーンのツノ","color":"#d787ff"}' # 神器の説明文 (TextComponentString[]) - data modify storage asset:artifact Lore set value ['{"text":"攻撃対象の中で最もダメージを与えた1体に","color":"white"}','{"text":"属性耐性を貫通するランダムな属性のダメージを与える","color":"white"}','{"text":"聖域に棲まう一角の幻獣のツノ","color":"gray"}','{"text":"満ちた神秘の魔力が、敵の守りを容易く貫く","color":"gray"}'] + data modify storage asset:artifact Lore set value ['{"text":"攻撃対象の中で最もダメージを与えた1体に","color":"white"}','{"text":"属性耐性を無視するランダムな属性のダメージを与える","color":"white"}','{"text":"聖域に棲まう一角の幻獣のツノ","color":"gray"}','{"text":"満ちた神秘の魔力が、敵の守りを容易く貫く","color":"gray"}'] # 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション) # data modify storage asset:artifact ConsumeItem.Item set value '{"translate":"item.minecraft.stick"}' # data modify storage asset:artifact ConsumeItem.Count set value 1 From 055d9ed8b16b11fa831eec8718d94ad7f963e4fd Mon Sep 17 00:00:00 2001 From: Lapis-LJA <87566955+Lapis-LJA@users.noreply.github.com> Date: Fri, 6 Feb 2026 02:41:57 +0900 Subject: [PATCH 7/9] =?UTF-8?q?=E4=BB=95=E6=A7=98=E3=82=92=E5=A4=A7?= =?UTF-8?q?=E5=B9=85=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../1361.unicorn_horn/give/2.give.mcfunction | 2 +- .../trigger/2.check_condition.mcfunction | 29 ++++++++----------- .../2.check_condition/add_tag.m.mcfunction | 8 ----- .../2.check_condition/reset.mcfunction | 12 -------- .../search_max_damage_target.mcfunction | 28 ------------------ .../trigger/3.main.mcfunction | 9 ++++-- .../trigger/_index.d.mcfunction | 8 ----- 7 files changed, 20 insertions(+), 76 deletions(-) delete mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction delete mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction delete mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction delete mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction index 84221df0341..cf4b9d9de47 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/give/2.give.mcfunction @@ -15,7 +15,7 @@ # 神器の名前 (TextComponentString) data modify storage asset:artifact Name set value '{"text":"ユニコーンのツノ","color":"#d787ff"}' # 神器の説明文 (TextComponentString[]) - data modify storage asset:artifact Lore set value ['{"text":"攻撃対象の中で最もダメージを与えた1体に","color":"white"}','{"text":"属性耐性を無視するランダムな属性のダメージを与える","color":"white"}','{"text":"聖域に棲まう一角の幻獣のツノ","color":"gray"}','{"text":"満ちた神秘の魔力が、敵の守りを容易く貫く","color":"gray"}'] + data modify storage asset:artifact Lore set value ['{"text":"攻撃対象の中のランダムな1体に","color":"white"}','{"text":"属性耐性を無視するランダムな属性のダメージを与える","color":"white"}','{"text":"聖域に棲まう一角の幻獣のツノ","color":"gray"}','{"text":"満ちた神秘の魔力が、敵の守りを容易く貫く","color":"gray"}'] # 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション) # data modify storage asset:artifact ConsumeItem.Item set value '{"translate":"item.minecraft.stick"}' # data modify storage asset:artifact ConsumeItem.Count set value 1 diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction index 63aab348c1f..1312b115917 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition.mcfunction @@ -10,34 +10,29 @@ function asset:artifact/common/check_condition/hotbar # 他にアイテム等確認する場合はここに書く -# 仕様書 -# 最大ダメージを取得し、攻撃対象の中で「ダメージ量が最大ダメージと一致する対象」をTempTargetとし -# TempTargetの中で最も近い対象を攻撃対象とする。 +#> Private +# @private + #declare score_holder $MaxDamage + #declare score_holder $RequireDamage # CanUsedじゃなければreturn execute if entity @s[tag=!CanUsed] run return fail # IsDoT:trueならreturn - execute if data storage asset:context Attack{IsDoT:true} run return run tag @s remove CanUsed + execute if data storage asset:context Attack{IsDoT:true} run tag @s remove CanUsed + execute if entity @s[tag=!CanUsed] run return fail # Victimがいなければreturn - execute unless entity @e[type=#lib:living_without_player,tag=Victim,distance=..150,limit=1] run return run tag @s remove CanUsed + execute unless entity @e[type=#lib:living_without_player,tag=Victim,distance=..64,limit=1] run tag @s remove CanUsed + execute if entity @s[tag=!CanUsed] run return fail # 最大ダメージが要求ダメージ以上か? scoreboard players set $RequireDamage Temporary 16000 execute store result score $MaxDamage Temporary run data get storage asset:context Attack.Amount 10 - execute unless score $MaxDamage Temporary >= $RequireDamage Temporary run return run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset - -# 最大ダメージを与えた対象を探す - data modify storage asset:temp _.To set from storage asset:context Attack.To - data modify storage asset:temp _.Amounts set from storage asset:context Attack.Amounts - function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target - -# この段階でTempTargetがいなければreturn - execute unless entity @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150,limit=1] run return run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset + execute unless score $MaxDamage Temporary >= $RequireDamage Temporary run tag @s remove CanUsed + scoreboard players reset $RequireDamage Temporary + scoreboard players reset $MaxDamage Temporary + execute if entity @s[tag=!CanUsed] run return fail # 3.main.mcfunctionを実行する function asset:artifact/1361.unicorn_horn/trigger/3.main - -# リセット - function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction deleted file mode 100644 index ff3b6f8333d..00000000000 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> asset:artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m -# -# -# -# @within function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target - -# tagを付与 - $tag @e[type=#lib:living_without_player,tag=Enemy,tag=Victim,scores={MobUUID=$(TargetMobUUID)},distance=..150,sort=nearest,limit=1] add TempTarget diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction deleted file mode 100644 index ee2c78f13f8..00000000000 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/reset.mcfunction +++ /dev/null @@ -1,12 +0,0 @@ -#> asset:artifact/1361.unicorn_horn/trigger/2.check_condition/reset -# -# -# -# @within function asset:artifact/1361.unicorn_horn/trigger/2.check_condition - -# 諸々をまとめてリセット - tag @s remove CanUsed - data remove storage asset:temp _ - scoreboard players reset $MaxDamage Temporary - scoreboard players reset $RequireDamage Temporary - tag @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,distance=..150] remove TempTarget diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction deleted file mode 100644 index c609bf391d1..00000000000 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target.mcfunction +++ /dev/null @@ -1,28 +0,0 @@ -#> asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target -# -# 最もダメージを与えた対象を探す -# -# @within function -# asset:artifact/1361.unicorn_horn/trigger/2.check_condition -# asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target - -#> Private -# @private - #declare score_holder $Damage - -# 配列の最後尾のダメージ量をコピー - execute store result score $Damage Temporary run data get storage asset:temp _.Amounts[-1] 10 - -# 最大ダメージ量と同じならマクロでtagを付与 distanceで広範囲検索するよりは軽そうと思ったから - execute if score $Damage Temporary = $MaxDamage Temporary run data modify storage asset:temp _.TargetMobUUID set from storage asset:temp _.To[-1] - execute if score $Damage Temporary = $MaxDamage Temporary run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/add_tag.m with storage asset:temp _ - -# 最後尾の要素を削除 - data remove storage asset:temp _.To[-1] - data remove storage asset:temp _.Amounts[-1] - -# リセット - scoreboard players reset $Damage Temporary - -# 要素がまだあれば再帰 - execute if data storage asset:temp _.To[0] run function asset:artifact/1361.unicorn_horn/trigger/2.check_condition/search_max_damage_target diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction index c7ec1b6a37d..cba9294b025 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction @@ -11,12 +11,16 @@ #> Private # @private + #declare tag Target #declare score_holder $Random # check_conditionで判定したTempTargetの中で最も近い対象を攻撃対象とする +# Victimのうちランダムな対象1体を指定 + tag @e[type=#lib:living_without_player,tag=Victim,tag=!Uninterferable,distance=..64,sort=random,limit=1] add Target + # 演出 - execute as @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,tag=!Uninterferable,distance=..150,sort=nearest,limit=1] at @s anchored eyes positioned ^ ^ ^ run function asset:artifact/1361.unicorn_horn/trigger/vfx + execute as @e[type=#lib:living_without_player,tag=Target,distance=..64,sort=nearest,limit=1] at @s anchored eyes positioned ^ ^ ^ run function asset:artifact/1361.unicorn_horn/trigger/vfx # 属性をランダムに指定する execute store result score $Random Temporary run random value 0..3 @@ -30,8 +34,9 @@ data modify storage api: Argument.AttackType set value "Magic" function api:damage/modifier data modify storage api: Argument.BypassModifier set value true - execute as @e[type=#lib:living_without_player,tag=Victim,tag=TempTarget,tag=!Uninterferable,distance=..150,sort=nearest,limit=1] run function api:damage/ + execute as @e[type=#lib:living_without_player,tag=Target,distance=..64,sort=nearest,limit=1] run function api:damage/ function api:damage/reset # リセット scoreboard players reset $Random Temporary + tag @e[type=#lib:living_without_player,tag=Target,distance=..64,sort=nearest,limit=1] remove Target diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction deleted file mode 100644 index af8d185fb38..00000000000 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/_index.d.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -#> asset:artifact/1361.unicorn_horn/trigger/_index.d -# @private - -#> tag -# @within function asset:artifact/1361.unicorn_horn/trigger/** - #declare tag TempTarget - #declare score_holder $MaxDamage - #declare score_holder $RequireDamage From e0b8893e3aeffbc597bc7dc6cccee926f014c57c Mon Sep 17 00:00:00 2001 From: Lapis-LJA <87566955+Lapis-LJA@users.noreply.github.com> Date: Fri, 6 Feb 2026 02:46:21 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=E6=BC=94=E5=87=BA=E3=82=92=E8=AA=BF?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction index eb9e2a00d91..c5839c578f6 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction @@ -7,5 +7,5 @@ # 演出 particle dust 1 0.4 1 0.6 ~ ~ ~ 0 2 0 0 160 normal @a particle dragon_breath ~ ~ ~ 0 0 0 0.4 20 normal @a - playsound minecraft:entity.allay.ambient_without_item player @a ~ ~ ~ 0.8 1.8 + playsound minecraft:entity.allay.ambient_without_item player @a ~ ~ ~ 0.8 1.1 playsound minecraft:entity.arrow.hit_player player @a ~ ~ ~ 0.4 1.2 From ee6d5653311b24ef6872ad176f154534a29c486b Mon Sep 17 00:00:00 2001 From: Lapis-LJA <87566955+Lapis-LJA@users.noreply.github.com> Date: Wed, 11 Feb 2026 02:28:05 +0900 Subject: [PATCH 9/9] =?UTF-8?q?as=20@e=E3=82=92=E5=89=8A=E6=B8=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trigger/3.main.mcfunction | 31 ++----------------- .../trigger/as_target.mcfunction | 30 ++++++++++++++++++ .../1361.unicorn_horn/trigger/vfx.mcfunction | 2 +- 3 files changed, 33 insertions(+), 30 deletions(-) create mode 100644 Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/as_target.mcfunction diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction index cba9294b025..cb357eb5e29 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/3.main.mcfunction @@ -9,34 +9,7 @@ # ここから先は神器側の効果の処理を書く -#> Private -# @private - #declare tag Target - #declare score_holder $Random - # check_conditionで判定したTempTargetの中で最も近い対象を攻撃対象とする -# Victimのうちランダムな対象1体を指定 - tag @e[type=#lib:living_without_player,tag=Victim,tag=!Uninterferable,distance=..64,sort=random,limit=1] add Target - -# 演出 - execute as @e[type=#lib:living_without_player,tag=Target,distance=..64,sort=nearest,limit=1] at @s anchored eyes positioned ^ ^ ^ run function asset:artifact/1361.unicorn_horn/trigger/vfx - -# 属性をランダムに指定する - execute store result score $Random Temporary run random value 0..3 - execute if score $Random Temporary matches 0 run data modify storage api: Argument.ElementType set value "None" - execute if score $Random Temporary matches 1 run data modify storage api: Argument.ElementType set value "Fire" - execute if score $Random Temporary matches 2 run data modify storage api: Argument.ElementType set value "Water" - execute if score $Random Temporary matches 3 run data modify storage api: Argument.ElementType set value "Thunder" - -# 敵の属性耐性のみを無視するダメージ - data modify storage api: Argument.Damage set value 1000f - data modify storage api: Argument.AttackType set value "Magic" - function api:damage/modifier - data modify storage api: Argument.BypassModifier set value true - execute as @e[type=#lib:living_without_player,tag=Target,distance=..64,sort=nearest,limit=1] run function api:damage/ - function api:damage/reset - -# リセット - scoreboard players reset $Random Temporary - tag @e[type=#lib:living_without_player,tag=Target,distance=..64,sort=nearest,limit=1] remove Target +# Victimのうちランダムな対象1体を指定して実行 + execute as @e[type=#lib:living_without_player,tag=Victim,distance=..64,sort=random,limit=1] at @s run function asset:artifact/1361.unicorn_horn/trigger/as_target diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/as_target.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/as_target.mcfunction new file mode 100644 index 00000000000..099b8152e57 --- /dev/null +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/as_target.mcfunction @@ -0,0 +1,30 @@ +#> asset:artifact/1361.unicorn_horn/trigger/as_target +# +# +# +# @within function asset:artifact/1361.unicorn_horn/trigger/3.main + +#> Private +# @private + #declare score_holder $Random + +# 演出 + execute anchored eyes positioned ^ ^ ^ run function asset:artifact/1361.unicorn_horn/trigger/vfx + +# 属性をランダムに指定する + execute store result score $Random Temporary run random value 0..3 + execute if score $Random Temporary matches 0 run data modify storage api: Argument.ElementType set value "None" + execute if score $Random Temporary matches 1 run data modify storage api: Argument.ElementType set value "Fire" + execute if score $Random Temporary matches 2 run data modify storage api: Argument.ElementType set value "Water" + execute if score $Random Temporary matches 3 run data modify storage api: Argument.ElementType set value "Thunder" + +# 敵の属性耐性のみを無視するダメージ + data modify storage api: Argument.Damage set value 1000f + data modify storage api: Argument.AttackType set value "Magic" + execute as @p[tag=this] run function api:damage/modifier + data modify storage api: Argument.BypassModifier set value true + function api:damage/ + function api:damage/reset + +# リセット + scoreboard players reset $Random Temporary diff --git a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction index c5839c578f6..0ef7a7c80a8 100644 --- a/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction +++ b/Asset/data/asset/functions/artifact/1361.unicorn_horn/trigger/vfx.mcfunction @@ -2,7 +2,7 @@ # # # -# @within function asset:artifact/1361.unicorn_horn/trigger/3.main +# @within function asset:artifact/1361.unicorn_horn/trigger/as_target # 演出 particle dust 1 0.4 1 0.6 ~ ~ ~ 0 2 0 0 160 normal @a