Skip to content

Commit 3d804d6

Browse files
authored
✨ [Artifact 1252] 狐ノ蝋燭の作成 (#1981)
1 parent 6bb127e commit 3d804d6

30 files changed

Lines changed: 401 additions & 0 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#> asset:artifact/1252.fox_candle/give/1.trigger
2+
#
3+
# 神器の取得処理の呼び出し時に実行されるfunction
4+
#
5+
# @within tag/function asset:artifact/give
6+
7+
execute if data storage asset:context {id:1252} run function asset:artifact/1252.fox_candle/give/2.give
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#> asset:artifact/1252.fox_candle/give/2.give
2+
#
3+
# 神器の作成部 ここでID等を定義する
4+
#
5+
# @user
6+
# @within function asset:artifact/1252.fox_candle/give/1.trigger
7+
8+
# 神器の説明や消費MPなどをここで設定する。
9+
# 最後にasset:artifact/common/giveを実行することで入手可能。
10+
11+
# 神器のID (int) スプレッドシートの値を入れる
12+
data modify storage asset:artifact ID set value 1252
13+
# 神器のベースアイテム
14+
data modify storage asset:artifact Item set value "minecraft:stick"
15+
# 神器の名前 (TextComponentString)
16+
data modify storage asset:artifact Name set value '{"text":"狐ノ蝋燭","color":"#D9972F"}'
17+
# 神器の説明文 (TextComponentString[])
18+
data modify storage asset:artifact Lore set value ['{"text":"周囲のランダムな敵3体にダメージを与え、狐火を9秒間付与する","color":"white"}','{"text":"(狐火が付与されていない敵を優先)","color":"white"}','{"text":"妖しい炎の灯る3本の蝋燭","color":"gray"}','{"text":"憑かれた命を糧に静かに揺らめく","color":"gray"}']
19+
# 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション)
20+
# data modify storage asset:artifact ConsumeItem.Item set value '{"translate":"item.minecraft.stick"}'
21+
# data modify storage asset:artifact ConsumeItem.Count set value 1
22+
# data modify storage asset:artifact ConsumeItem.Extra set value
23+
# 使用回数 (int) (オプション)
24+
# data modify storage asset:artifact RemainingCount set value
25+
# 神器を発動できるスロット (string) Wikiを参照
26+
data modify storage asset:artifact Slot set value "offhand"
27+
# 神器のトリガー (string) Wikiを参照
28+
data modify storage asset:artifact Trigger set value "onDamage"
29+
# 効果が重複可能か否か (boolean) (オプション)
30+
# data modify storage asset:artifact EnableDuplication set value
31+
# 神器の発動条件 (TextComponentString) (オプション)
32+
data modify storage asset:artifact Condition set value '{"text":"累計で最大体力の9%分の被ダメージ"}'
33+
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
34+
data modify storage asset:artifact AttackInfo.Damage set value "300+60x9"
35+
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
36+
data modify storage asset:artifact AttackInfo.AttackType set value [Magic]
37+
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
38+
data modify storage asset:artifact AttackInfo.ElementType set value [Fire]
39+
# 攻撃に関する情報 -防御無視 (boolean) Wikiを参照 (オプション)
40+
# data modify storage asset:artifact AttackInfo.BypassResist set value
41+
# 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション)
42+
# data modify storage asset:artifact AttackInfo.IsRangeAttack set value
43+
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
44+
data modify storage asset:artifact AttackInfo.AttackRange set value 16
45+
# MP消費量 (int)
46+
data modify storage asset:artifact MPCost set value 50
47+
# MP必要量 (int) (オプション)
48+
# data modify storage asset:artifact MPRequire set value
49+
# MP回復量 (int)
50+
# data modify storage asset:artifact MPHealWhenHit set value
51+
# 神器のクールダウン (int) (オプション)
52+
data modify storage asset:artifact LocalCooldown set value 100
53+
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
54+
# data modify storage asset:artifact TypeCooldown.Type set value
55+
# data modify storage asset:artifact TypeCooldown.Duration set value
56+
# 第二種別クールダウン ({Type: string, Duration: int}) (オプション)
57+
# data modify storage asset:artifact SecondaryTypeCooldown.Type set value
58+
# data modify storage asset:artifact SecondaryTypeCooldown.Duration set value
59+
# グローバルクールダウン (int) (オプション)
60+
# data modify storage asset:artifact SpecialCooldown set value
61+
# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
62+
data modify storage asset:artifact DisableCooldownMessage set value true
63+
# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション)
64+
data modify storage asset:artifact DisableMPMessage set value true
65+
# 破壊時の音を鳴らさないかどうか (boolean) (オプション)
66+
# data modify storage asset:artifact DisableBreakSound set value
67+
# 扱える神 (string[]) Wikiを参照
68+
data modify storage asset:artifact CanUsedGod set value ["Urban", "Nyaptov", "Rumor"]
69+
# カスタムNBT (NBTCompound) 追加で指定したいNBT (オプション)
70+
# data modify storage asset:artifact CustomNBT set value {}
71+
72+
# 神器の入手用function
73+
function asset:artifact/common/give
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:artifact/1252.fox_candle/register
2+
#
3+
# 神器プールへの登録処理
4+
#
5+
# @within tag/function asset:artifact/register
6+
7+
data modify storage asset:artifact RarityRegistry[4] append value [1252]
8+
data modify storage asset:artifact RarityRegistryWithColor.Red[4] append value [1252]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#> asset:artifact/1252.fox_candle/trigger/0.load
2+
#
3+
# 神器に利用するスコアボード等の初期化処理
4+
#
5+
# @within tag/function asset:artifact/load
6+
7+
#> 定義類はここに
8+
# @within function asset:artifact/1252.fox_candle/trigger/**
9+
scoreboard objectives add YS.DamagePerSum dummy
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:artifact/1252.fox_candle/trigger/1.trigger
2+
#
3+
# 指定したイベントタイミングで実行されるfunction
4+
#
5+
# @within tag/function asset:artifact/**
6+
7+
# storage asset:idの%slot%に装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する
8+
execute if data storage asset:context id{offhand:1252} run function asset:artifact/1252.fox_candle/trigger/2.check_condition
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#> asset:artifact/1252.fox_candle/trigger/2.check_condition
2+
#
3+
# 神器の発動条件をチェックします
4+
#
5+
# @within function asset:artifact/1252.fox_candle/trigger/1.trigger
6+
7+
# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
8+
function asset:artifact/common/check_condition/offhand
9+
# 他にアイテム等確認する場合はここに書く
10+
11+
#> Private
12+
# @private
13+
#declare score_holder $Damage
14+
#declare score_holder $MaxHealth
15+
16+
# CanUsedじゃないならreturn
17+
execute if entity @s[tag=!CanUsed] run return fail
18+
19+
# 死んでるならreturn
20+
execute if entity @s[tag=Death] run tag @s remove CanUsed
21+
execute if entity @s[tag=!CanUsed] run return fail
22+
23+
# ダメージによる体力減少割合を取得
24+
execute store result score $MaxHealth Temporary run attribute @s generic.max_health get
25+
execute store result score $Damage Temporary run data get storage asset:context Damage.Amount 1000
26+
scoreboard players operation $Damage Temporary /= $MaxHealth Temporary
27+
28+
# スコアに加算
29+
scoreboard players operation @s YS.DamagePerSum += $Damage Temporary
30+
31+
# リセット
32+
scoreboard players reset $Damage Temporary
33+
scoreboard players reset $MaxHealth Temporary
34+
35+
# 効果範囲内に敵がいないならreturn
36+
execute unless entity @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,distance=..16,limit=1] run tag @s remove CanUsed
37+
execute if entity @s[tag=!CanUsed] run return fail
38+
39+
# スコアが一定以上でないならreturn
40+
execute unless score @s YS.DamagePerSum matches 90.. run tag @s remove CanUsed
41+
execute if entity @s[tag=!CanUsed] run return fail
42+
43+
# CanUsedタグをチェックして3.main.mcfunctionを実行する
44+
function asset:artifact/1252.fox_candle/trigger/3.main
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#> asset:artifact/1252.fox_candle/trigger/3.main
2+
#
3+
# 神器のメイン処理部
4+
#
5+
# @within function asset:artifact/1252.fox_candle/trigger/2.check_condition
6+
7+
# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う
8+
function asset:artifact/common/use/offhand
9+
10+
# ここから先は神器側の効果の処理を書く
11+
12+
# 最大ターゲット数
13+
data modify storage asset:temp Temp.Count set value 3
14+
15+
# この神器のDoTが付与されていない敵を優先的にターゲッティングする
16+
execute as @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,distance=..16,sort=random] run function asset:artifact/1252.fox_candle/trigger/target_select/no_debuff
17+
18+
# まだターゲッティングできるならなんでもいいからターゲットにする
19+
execute unless data storage asset:temp Temp{Count:0} run function asset:artifact/1252.fox_candle/trigger/target_select/m with storage asset:temp Temp
20+
21+
# ターゲットに対して諸々実行する
22+
function asset:artifact/1252.fox_candle/trigger/attack
23+
24+
# リセット
25+
data remove storage asset:temp Temp
26+
tag @e[type=#lib:living_without_player,tag=YS.Target,tag=!Uninterferable,distance=..16] remove YS.Target
27+
scoreboard players reset @s YS.DamagePerSum
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#> asset:artifact/1252.fox_candle/trigger/_index.d
2+
# @private
3+
4+
#> tag
5+
# @within function asset:artifact/1252.fox_candle/trigger/**
6+
#declare tag YS.Target
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#> asset:artifact/1252.fox_candle/trigger/attack
2+
#
3+
#
4+
#
5+
# @within function asset:artifact/1252.fox_candle/trigger/3.main
6+
7+
# 演出
8+
playsound entity.blaze.shoot player @a ~ ~ ~ 0.8 1.2 0
9+
playsound block.fire.ambient player @a ~ ~ ~ 1 1.2 0
10+
playsound block.enchantment_table.use player @a ~ ~ ~ 1 1.2
11+
execute at @e[type=#lib:living_without_player,tag=YS.Target,distance=..16] positioned ~ ~0.4 ~ run function asset:artifact/1252.fox_candle/trigger/vfx
12+
13+
# ダメージ
14+
data modify storage api: Argument.Damage set value 300d
15+
data modify storage api: Argument.AttackType set value "Magic"
16+
data modify storage api: Argument.ElementType set value "Fire"
17+
function api:damage/modifier
18+
execute as @e[type=#lib:living_without_player,tag=YS.Target,distance=..16] run function api:damage/
19+
function api:damage/reset
20+
21+
# 以下DoT
22+
# 効果時間
23+
data modify storage api: Argument.Duration set value 180
24+
# ダメージ
25+
data modify storage api: Argument.FieldOverride.Damage set value 50
26+
# ダメージ間隔
27+
data modify storage api: Argument.FieldOverride.Tick.Max set value 20
28+
29+
# 付与
30+
data modify storage api: Argument.ID set value 352
31+
execute store result storage api: Argument.FieldOverride.AppliedFrom int 1 run scoreboard players get @s UserID
32+
execute as @e[type=#lib:living_without_player,tag=YS.Target,distance=..16] run function api:entity/mob/effect/give
33+
function api:entity/mob/effect/reset
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:artifact/1252.fox_candle/trigger/target_select/m
2+
#
3+
# 直接Tagを付与する
4+
#
5+
# @within function asset:artifact/1252.fox_candle/trigger/3.main
6+
7+
#
8+
$tag @e[type=#lib:living_without_player,tag=Enemy,tag=!YS.Target,tag=!Uninterferable,distance=..16,sort=random,limit=$(Count)] add YS.Target

0 commit comments

Comments
 (0)