Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1252.fox_candle/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

execute if data storage asset:context {id:1252} run function asset:artifact/1252.fox_candle/give/2.give
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#> asset:artifact/1252.fox_candle/give/2.give
#
# 神器の作成部 ここでID等を定義する
#
# @user
# @within function asset:artifact/1252.fox_candle/give/1.trigger

# 神器の説明や消費MPなどをここで設定する。
# 最後にasset:artifact/common/giveを実行することで入手可能。

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1252
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"狐ノ蝋燭","color":"#D9972F"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"周囲のランダムな敵3体にダメージを与え、狐火を9秒間付与する","color":"white"}','{"text":"(狐火が付与されていない敵を優先)","color":"white"}','{"text":"妖しい炎の灯る3本の蝋燭","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 "offhand"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onDamage"
# 効果が重複可能か否か (boolean) (オプション)
# data modify storage asset:artifact EnableDuplication set value
# 神器の発動条件 (TextComponentString) (オプション)
data modify storage asset:artifact Condition set value '{"text":"累計で最大体力の9%分の被ダメージ"}'
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.Damage set value "300+60x9"
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Magic]
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.ElementType set value [Fire]
# 攻撃に関する情報 -防御無視 (boolean) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.BypassResist set value
# 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.IsRangeAttack set value
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackRange set value 16
# MP消費量 (int)
data modify storage asset:artifact MPCost set value 50
# 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 100
# 種別クールダウン ({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 ["Urban", "Nyaptov", "Rumor"]
# カスタムNBT (NBTCompound) 追加で指定したいNBT (オプション)
# data modify storage asset:artifact CustomNBT set value {}

# 神器の入手用function
function asset:artifact/common/give
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1252.fox_candle/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

data modify storage asset:artifact RarityRegistry[4] append value [1252]
data modify storage asset:artifact RarityRegistryWithColor.Red[4] append value [1252]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:artifact/1252.fox_candle/trigger/0.load
#
# 神器に利用するスコアボード等の初期化処理
#
# @within tag/function asset:artifact/load

#> 定義類はここに
# @within function asset:artifact/1252.fox_candle/trigger/**
scoreboard objectives add YS.DamagePerSum dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1252.fox_candle/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{offhand:1252} run function asset:artifact/1252.fox_candle/trigger/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#> asset:artifact/1252.fox_candle/trigger/2.check_condition
#
# 神器の発動条件をチェックします
#
# @within function asset:artifact/1252.fox_candle/trigger/1.trigger

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/offhand
# 他にアイテム等確認する場合はここに書く

#> Private
# @private
#declare score_holder $Damage
#declare score_holder $MaxHealth

# CanUsedじゃないならreturn
execute if entity @s[tag=!CanUsed] run return fail

# 死んでるならreturn
execute if entity @s[tag=Death] run tag @s remove CanUsed
execute if entity @s[tag=!CanUsed] run return fail

# ダメージによる体力減少割合を取得
function api:modifier/max_health/get
execute store result score $MaxHealth Temporary run data get storage api: Return.MaxHealth 1
execute store result score $Damage Temporary run data get storage asset:context Damage.Amount 1000
scoreboard players operation $Damage Temporary /= $MaxHealth Temporary

# スコアに加算
scoreboard players operation @s YS.DamagePerSum += $Damage Temporary

# リセット
scoreboard players reset $Damage Temporary
scoreboard players reset $MaxHealth Temporary

# 効果範囲内に敵がいないならreturn
execute unless entity @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,distance=..16,limit=1] run tag @s remove CanUsed
execute if entity @s[tag=!CanUsed] run return fail

# スコアが一定以上でないならreturn
execute unless score @s YS.DamagePerSum matches 90.. run tag @s remove CanUsed
execute if entity @s[tag=!CanUsed] run return fail

# CanUsedタグをチェックして3.main.mcfunctionを実行する
function asset:artifact/1252.fox_candle/trigger/3.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#> asset:artifact/1252.fox_candle/trigger/3.main
#
# 神器のメイン処理部
#
# @within function asset:artifact/1252.fox_candle/trigger/2.check_condition

# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う
function asset:artifact/common/use/offhand

# ここから先は神器側の効果の処理を書く

# 最大ターゲット数
data modify storage asset:temp Temp.Count set value 3

# この神器のDoTが付与されていない敵を優先的にターゲッティングする
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

# まだターゲッティングできるならなんでもいいからターゲットにする
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

# ターゲットに対して諸々実行する
function asset:artifact/1252.fox_candle/trigger/attack

# リセット
data remove storage asset:temp Temp
tag @e[type=#lib:living_without_player,tag=YS.Target,tag=!Uninterferable,distance=..16] remove YS.Target
scoreboard players reset @s YS.DamagePerSum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#> asset:artifact/1252.fox_candle/trigger/_index.d
# @private

#> tag
# @within function asset:artifact/1252.fox_candle/trigger/**
#declare tag YS.Target
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#> asset:artifact/1252.fox_candle/trigger/attack
#
#
#
# @within function asset:artifact/1252.fox_candle/trigger/3.main

# 演出
playsound entity.blaze.shoot player @a ~ ~ ~ 0.8 1.2 0
playsound block.fire.ambient player @a ~ ~ ~ 1 1.2 0
playsound block.enchantment_table.use player @a ~ ~ ~ 1 1.2
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

# ダメージ
data modify storage api: Argument.Damage set value 300d
data modify storage api: Argument.AttackType set value "Magic"
data modify storage api: Argument.ElementType set value "Fire"
function api:damage/modifier
execute as @e[type=#lib:living_without_player,tag=YS.Target,distance=..16] run function api:damage/
function api:damage/reset

# 以下DoT
# 効果時間
data modify storage api: Argument.Duration set value 180
# ダメージ
data modify storage api: Argument.FieldOverride.Damage set value 50
# ダメージ間隔
data modify storage api: Argument.FieldOverride.Tick.Max set value 20

# 付与
data modify storage api: Argument.ID set value 352
execute store result storage api: Argument.FieldOverride.AppliedFrom int 1 run scoreboard players get @s UserID
execute as @e[type=#lib:living_without_player,tag=YS.Target,distance=..16] run function api:entity/mob/effect/give
function api:entity/mob/effect/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1252.fox_candle/trigger/target_select/m
#
# 直接Tagを付与する
#
# @within function asset:artifact/1252.fox_candle/trigger/3.main

#
$tag @e[type=#lib:living_without_player,tag=Enemy,tag=!YS.Target,tag=!Uninterferable,distance=..16,sort=random,limit=$(Count)] add YS.Target
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:artifact/1252.fox_candle/trigger/target_select/no_debuff
#
# DoTが付与されてないやつをターゲットとする
#
# @within function asset:artifact/1252.fox_candle/trigger/3.main

# ターゲットがもう最大数まで見つかっているならreturn
execute if data storage asset:temp Temp{Count:0} run return fail

# 自身に狐火が付与されているか?
data modify storage api: Argument.ID set value 352
function api:entity/mob/effect/get/from_id

# 付与されていなければターゲットとする
execute unless data storage api: Return.Effect run tag @s add YS.Target
execute unless data storage api: Return.Effect store result storage asset:temp Temp.Count int 0.9999999999 run data get storage asset:temp Temp.Count
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:artifact/1252.fox_candle/trigger/vfx
#
# なんか蝋燭っぽい演出
#
# @within function asset:artifact/1252.fox_candle/trigger/attack

# 思考メモ
# yは0.1上に上げて、オレンジ、白、soul_fireの順でロウソクっぽくする
# オレンジは必須(オレンジ + 白で狐のしっぽの表現)

# オレンジ
particle dust 1 0.7 0 1.3 ~ ~0.5 ~ 0.02 0.3 0.02 0 15 normal @a
# 白
particle dust 1 0.965 0.878 1.3 ~ ~1.4 ~ 0.02 0.3 0.02 0 15 normal @a
# 炎
particle soul_fire_flame ~ ~2.2 ~ 0.02 0.04 0.02 0 5 normal @a

# playsound
playsound minecraft:entity.fox.bite player @a ~ ~ ~ 1 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0352.kitsunebi/_/given
#
# Effectが付与された時に実行されるfunction
#
# @within tag/function asset:effect/given

execute if data storage asset:context {id:352} run function asset:effect/0352.kitsunebi/given/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0352.kitsunebi/_/re-given
#
# Effectが上書きされた時に実行されるfunction
#
# @within tag/function asset:effect/re-given

execute if data storage asset:context {id:352} run function asset:effect/0352.kitsunebi/re-given/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0352.kitsunebi/_/register
#
#
#
# @within tag/function asset:effect/register

execute if data storage asset:context {id:352} run function asset:effect/0352.kitsunebi/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0352.kitsunebi/_/tick
#
# Effectが発動している間毎tick実行されるfunction
#
# @within tag/function asset:effect/tick

execute if data storage asset:context {id:352} run function asset:effect/0352.kitsunebi/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0352.kitsunebi/given/
#
# Effectが付与された時の処理
#
# @within function asset:effect/0352.kitsunebi/_/given

# 初期化
function asset:effect/0352.kitsunebi/init/
10 changes: 10 additions & 0 deletions Asset/data/asset/functions/effect/0352.kitsunebi/init/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:effect/0352.kitsunebi/init/
#
#
#
# @within function
# asset:effect/0352.kitsunebi/given/
# asset:effect/0352.kitsunebi/re-given/

# Tickを初期化
data modify storage asset:context this.Tick._ set from storage asset:context this.Tick.Max
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0352.kitsunebi/re-given/
#
# Effectが上書きされた時の処理
#
# @within function asset:effect/0352.kitsunebi/_/re-given

# 初期化
function asset:effect/0352.kitsunebi/init/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#> asset:effect/0352.kitsunebi/register
#
# Effectのデータを指定
#
# @within function asset:effect/0352.kitsunebi/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 352
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text":"狐火","color":"#D9972F"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value ['{"text":"継続的に魔法火属性ダメージを受ける"}']
# 効果時間 (int) (default = API || error)
# data modify storage asset:effect Duration set value
# スタック (int) (default = API || 1)
# data modify storage asset:effect Stack set value
# 効果時間の操作方法 (default = API || "replace")
# data modify storage asset:effect DurationOperation set value
# スタックの操作方法 (default = API || "replace")
data modify storage asset:effect StackOperation set value 1
# 最大効果時間 (int) (default = 2147483647)
# data modify storage asset:effect MaxDuration set value
# 最大スタック (int) (default = 2147483647)
# data modify storage asset:effect MaxStack set value
# 悪い効果か否か (boolean)
data modify storage asset:effect IsBadEffect set value true
# 死亡時のエフェクトの処理 (default = "remove")
# data modify storage asset:effect ProcessOnDied set value
# 消すのに必要なレベル (int) (default = 1)
data modify storage asset:effect RequireClearLv set value 3
# エフェクトをUIに表示するか (boolean) (default = true)
# data modify storage asset:effect Visible set value
# エフェクトのスタックををUIに表示するか (boolean) (default = true)
data modify storage asset:effect StackVisible set value false

# フィールド
data modify storage asset:effect Field.Tick._ set value 0
data modify storage asset:effect Field.Tick.Max set value 20
data modify storage asset:effect Field.Damage set value 1
data modify storage asset:effect Field.UserID set value -1
11 changes: 11 additions & 0 deletions Asset/data/asset/functions/effect/0352.kitsunebi/tick/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:effect/0352.kitsunebi/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0352.kitsunebi/_/tick

# デクリメント
execute store result storage asset:context this.Tick._ int 0.9999999999 run data get storage asset:context this.Tick._
# 1秒毎にダメージ
execute if data storage asset:context this.Tick{_:0} run function asset:effect/0352.kitsunebi/tick/deal_damage
execute if data storage asset:context this.Tick{_:0} run data modify storage asset:context this.Tick._ set from storage asset:context this.Tick.Max
Loading
Loading