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/1306.will_o_wisp/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1306
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:carrot_on_a_stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"鬼火","color":"aqua"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"前方の敵1体にダメージを与え、鬼火を5秒間付与する","color":"white"}','{"translate":"鬼火のダメージは自身の最大体力の%s分アップする","with":[{"text":"20%","color":"white"}]}']
# 消費アイテム ({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 "mainhand"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onClick"
# 神器の発動条件 (TextComponentString) (オプション)
# data modify storage asset:artifact Condition set value
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.Damage set value "100+50x5"
# 攻撃に関する情報 -攻撃タイプ (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 "never"
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackRange set value 6
# MP消費量 (int)
# data modify storage asset:artifact MPCost set value
# MP必要量 (int) (オプション)
# data modify storage asset:artifact MPRequire set value
# MP回復量 (int)
data modify storage asset:artifact MPHealWhenHit set value 5
# 神器のクールダウン (int) (オプション)
# data modify storage asset:artifact LocalCooldown set value
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
data modify storage asset:artifact TypeCooldown.Type set value "shortRange"
data modify storage asset:artifact TypeCooldown.Duration set value 60
# グローバルクールダウン (int) (オプション)
# data modify storage asset:artifact SpecialCooldown set value
# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
# data modify storage asset:artifact DisableCooldownMessage set value
# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション)
# data modify storage asset:artifact DisableMPMessage set value
# 破壊時の音を鳴らさないかどうか (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/1306.will_o_wisp/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

data modify storage asset:artifact RarityRegistry[3] append value [1306]
data modify storage asset:artifact RarityRegistryWithColor.Red[3] append value [1306]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1306.will_o_wisp/trigger/1.trigger
#
# 指定したイベントタイミングで実行されるfunction
#
# @within tag/function asset:artifact/**

# storage asset:idのmainhandに装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する
execute if data storage asset:context id{mainhand:1306} run function asset:artifact/1306.will_o_wisp/trigger/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:artifact/1306.will_o_wisp/trigger/2.check_condition
#
# 神器の発動条件をチェックします
#
# @within function asset:artifact/1306.will_o_wisp/trigger/1.trigger

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

# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed] run function asset:artifact/1306.will_o_wisp/trigger/3.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#> asset:artifact/1306.will_o_wisp/trigger/3.main
#
# 神器のメイン処理部
#
# @within function asset:artifact/1306.will_o_wisp/trigger/2.check_condition

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

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

# ターゲット選定
# 何段階かターゲット選択処理をする

# 前方の敵1体をターゲットとする
execute anchored eyes positioned ^ ^ ^ run function asset:artifact/1306.will_o_wisp/trigger/target/line_of_sight

# ターゲットがいなければ、前方の近くの敵をターゲットとする
execute unless entity @e[type=#lib:living_without_player,tag=10A.Target,distance=..10] run function asset:artifact/1306.will_o_wisp/trigger/target/forward/

# ここまでしてターゲットがいなければ前方で演出
execute unless entity @e[type=#lib:living_without_player,tag=10A.Target,distance=..10] anchored eyes positioned ^ ^-0.5 ^4.5 rotated ~ 0 run function asset:artifact/1306.will_o_wisp/trigger/vfx

# ターゲットにダメージやエフェクト等
execute as @e[type=#lib:living_without_player,tag=10A.Target,distance=..10] at @s run function asset:artifact/1306.will_o_wisp/trigger/damage_and_effect

# リセット
data remove storage asset:temp Success
scoreboard players reset $10A.Recursive Temporary
tag @e[type=#lib:living_without_player,tag=10A.Target,distance=..10,limit=1] remove 10A.Target
tag @e[type=#lib:living_without_player,tag=10A.TempTarget,distance=..10] remove 10A.TempTarget
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1306.will_o_wisp/trigger/_index.d
# @private

#> tag
# @within function asset:artifact/1306.will_o_wisp/trigger/**
#declare tag 10A.Target
#declare tag 10A.TempTarget
#declare score_holder $10A.Recursive
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#> asset:artifact/1306.will_o_wisp/trigger/damage_and_effect
#
# ターゲットにすること諸々
#
# @within function asset:artifact/1306.will_o_wisp/trigger/3.main

#> Private
# @private
#declare score_holder $10A.Damage

# ターゲットの位置で演出
execute positioned ~ ~0.5 ~ rotated ~ 0 run function asset:artifact/1306.will_o_wisp/trigger/vfx

# ダメージ
data modify storage api: Argument.Damage set value 100f
data modify storage api: Argument.AttackType set value "Physical"
data modify storage api: Argument.ElementType set value "Water"
execute as @p[tag=this] run function api:damage/modifier
function api:damage/
function api:damage/reset

# エフェクトのダメージ計算
execute as @p[tag=this] run function api:modifier/max_health/get
execute store result score $10A.Damage Temporary run data get storage api: Return.MaxHealth 0.2
scoreboard players add $10A.Damage Temporary 50

# エフェクト付与
data modify storage api: Argument.ID set value 339
data modify storage api: Argument.Duration set value 100
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @p[tag=this] UserID
execute store result storage api: Argument.FieldOverride.Damage int 1 run scoreboard players get $10A.Damage Temporary
data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
function api:entity/mob/effect/give
function api:entity/mob/effect/reset

# リセット
scoreboard players reset $10A.Damage Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset:artifact/1306.will_o_wisp/trigger/target/forward/
#
#
#
# @within function asset:artifact/1306.will_o_wisp/trigger/3.main

# 自身の前方でかつ、最も近くの、壁を通してない敵を探す

# 前方の敵にTempTargetをつける
# まぁある程度適当なので横にも当たる
execute positioned ^ ^ ^1 run tag @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,distance=..5] add 10A.TempTarget
execute positioned ^ ^ ^-10 run tag @e[type=#lib:living_without_player,tag=10A.TempTarget,distance=..10] remove 10A.TempTarget

# 近い順に再帰で壁を貫通していないかチェックする
execute as @e[type=#lib:living_without_player,tag=10A.TempTarget,distance=..10,sort=nearest] facing entity @s eyes run function asset:artifact/1306.will_o_wisp/trigger/target/forward/check_through
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:artifact/1306.will_o_wisp/trigger/target/forward/check_through
#
#
#
# @within function
# asset:artifact/1306.will_o_wisp/trigger/target/forward/
# asset:artifact/1306.will_o_wisp/trigger/target/forward/check_through

# 成功済みならreturn
execute if data storage asset:temp {Success:true} run return fail

# 自身が近くにいたらreturn
execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @s[dx=0] run return run function asset:artifact/1306.will_o_wisp/trigger/target/forward/success

# 壁を再帰
execute positioned ^ ^ ^0.5 if block ~ ~ ~ #lib:no_collision/ run function asset:artifact/1306.will_o_wisp/trigger/target/forward/check_through
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:artifact/1306.will_o_wisp/trigger/target/forward/success
#
#
#
# @within function asset:artifact/1306.will_o_wisp/trigger/target/forward/check_through

# 自身にtagを付与
tag @s add 10A.Target

# 成功済み判定用storageを設定
data modify storage asset:temp Success set value true
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:artifact/1306.will_o_wisp/trigger/target/line_of_sight
#
#
#
# @within function
# asset:artifact/1306.will_o_wisp/trigger/3.main
# asset:artifact/1306.will_o_wisp/trigger/target/line_of_sight

# 視線先に敵がいるかを再帰で検知する

# 敵がいたらtag付けてreturn
execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @e[type=#lib:living_without_player,tag=!Uninterferable,dx=0,limit=1] run return run tag @e[type=#lib:living_without_player,tag=!Uninterferable,dx=0,sort=random,limit=1] add 10A.Target

# 再帰暴走防止スコア
scoreboard players add $10A.Recursive Temporary 1
execute if score $10A.Recursive Temporary matches 12.. run return fail

# 再帰
execute positioned ^ ^ ^0.5 if block ~ ~ ~ #lib:no_collision/ run function asset:artifact/1306.will_o_wisp/trigger/target/line_of_sight
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#> asset:artifact/1306.will_o_wisp/trigger/vfx
#
#
#
# @within function
# asset:artifact/1306.will_o_wisp/trigger/3.main
# asset:artifact/1306.will_o_wisp/trigger/damage_and_effect

# playsound
playsound entity.blaze.shoot player @a ~ ~ ~ 0.5 0.8
playsound minecraft:block.fire.ambient player @a ~ ~ ~ 1 0.7

particle soul_fire_flame ^4 ^ ^0 ^-40000000 ^ ^0 0.000000005 0
particle soul_fire_flame ^3.9507 ^ ^0.6257 ^-39507000 ^ ^-6257000 0.000000005 0
particle soul_fire_flame ^3.8042 ^ ^1.236 ^-38042000 ^ ^-12360000 0.000000005 0
particle soul_fire_flame ^3.564 ^ ^1.8159 ^-35640000 ^ ^-18159000 0.000000005 0
particle soul_fire_flame ^3.236 ^ ^2.3511 ^-32360000. ^ ^-23511000. 0.000000005 0
particle soul_fire_flame ^2.8284 ^ ^2.8284 ^-28284000. ^ ^-28284000. 0.000000005 0
particle soul_fire_flame ^2.3511 ^ ^3.236 ^-23511000. ^ ^-32360000. 0.000000005 0
particle soul_fire_flame ^1.8159 ^ ^3.564 ^-18159000 ^ ^-35640000 0.000000005 0
particle soul_fire_flame ^1.236 ^ ^3.8042 ^-12360000 ^ ^-38042000 0.000000005 0
particle soul_fire_flame ^0.6257 ^ ^3.9507 ^-6257000 ^ ^-39507000 0.000000005 0
particle soul_fire_flame ^0 ^ ^4 ^0 ^ ^-40000000 0.000000005 0
particle soul_fire_flame ^-0.6257 ^ ^3.9507 ^6257000 ^ ^-39507000 0.000000005 0
particle soul_fire_flame ^-1.236 ^ ^3.8042 ^12360000 ^ ^-38042000 0.000000005 0
particle soul_fire_flame ^-1.8159 ^ ^3.564 ^18159000 ^ ^-35640000 0.000000005 0
particle soul_fire_flame ^-2.3511 ^ ^3.236 ^23511000. ^ ^-32360000. 0.000000005 0
particle soul_fire_flame ^-2.8284 ^ ^2.8284 ^28284000. ^ ^-28284000. 0.000000005 0
particle soul_fire_flame ^-3.236 ^ ^2.3511 ^32360000. ^ ^-23511000. 0.000000005 0
particle soul_fire_flame ^-3.564 ^ ^1.8159 ^35640000 ^ ^-18159000 0.000000005 0
particle soul_fire_flame ^-3.8042 ^ ^1.236 ^38042000 ^ ^-12360000 0.000000005 0
particle soul_fire_flame ^-3.9507 ^ ^0.6257 ^39507000 ^ ^-6257000 0.000000005 0
particle soul_fire_flame ^-4 ^ ^0 ^40000000 ^ ^0 0.000000005 0
particle soul_fire_flame ^-3.9507 ^ ^-0.6257 ^39507000 ^ ^6257000 0.000000005 0
particle soul_fire_flame ^-3.8042 ^ ^-1.236 ^38042000 ^ ^12360000 0.000000005 0
particle soul_fire_flame ^-3.564 ^ ^-1.8159 ^35640000 ^ ^18159000 0.000000005 0
particle soul_fire_flame ^-3.236 ^ ^-2.3511 ^32360000. ^ ^23511000. 0.000000005 0
particle soul_fire_flame ^-2.8284 ^ ^-2.8284 ^28284000. ^ ^28284000. 0.000000005 0
particle soul_fire_flame ^-2.3511 ^ ^-3.236 ^23511000. ^ ^32360000. 0.000000005 0
particle soul_fire_flame ^-1.8159 ^ ^-3.564 ^18159000 ^ ^35640000 0.000000005 0
particle soul_fire_flame ^-1.236 ^ ^-3.8042 ^12360000 ^ ^38042000 0.000000005 0
particle soul_fire_flame ^-0.6257 ^ ^-3.9507 ^6257000 ^ ^39507000 0.000000005 0
particle soul_fire_flame ^0 ^ ^-4 ^0 ^ ^40000000 0.000000005 0
particle soul_fire_flame ^0.6257 ^ ^-3.9507 ^-6257000 ^ ^39507000 0.000000005 0
particle soul_fire_flame ^1.236 ^ ^-3.8042 ^-12360000 ^ ^38042000 0.000000005 0
particle soul_fire_flame ^1.8159 ^ ^-3.564 ^-18159000 ^ ^35640000 0.000000005 0
particle soul_fire_flame ^2.3511 ^ ^-3.236 ^-23511000. ^ ^32360000. 0.000000005 0
particle soul_fire_flame ^2.8284 ^ ^-2.8284 ^-28284000. ^ ^28284000. 0.000000005 0
particle soul_fire_flame ^3.236 ^ ^-2.3511 ^-32360000. ^ ^23511000. 0.000000005 0
particle soul_fire_flame ^3.564 ^ ^-1.8159 ^-35640000 ^ ^18159000 0.000000005 0
particle soul_fire_flame ^3.8042 ^ ^-1.236 ^-38042000 ^ ^12360000 0.000000005 0
particle soul_fire_flame ^3.9507 ^ ^-0.6257 ^-39507000 ^ ^6257000 0.000000005 0

particle soul_fire_flame ^2.5 ^ ^0 ^-25000000 ^ ^0 0.0000000045 0
particle soul_fire_flame ^2.4148 ^ ^0.647 ^-24148000 ^ ^-6470000 0.0000000045 0
particle soul_fire_flame ^2.165 ^ ^1.25 ^-21650000 ^ ^-12500000 0.0000000045 0
particle soul_fire_flame ^1.7677 ^ ^1.7677 ^-17677000 ^ ^-17677000 0.0000000045 0
particle soul_fire_flame ^1.25 ^ ^2.165 ^-12500000 ^ ^-21650000 0.0000000045 0
particle soul_fire_flame ^0.647 ^ ^2.4148 ^-6470000 ^ ^-24148000 0.0000000045 0
particle soul_fire_flame ^0 ^ ^2.5 ^0 ^ ^-25000000 0.0000000045 0
particle soul_fire_flame ^-0.647 ^ ^2.4148 ^6470000 ^ ^-24148000 0.0000000045 0
particle soul_fire_flame ^-1.25 ^ ^2.165 ^12500000 ^ ^-21650000 0.0000000045 0
particle soul_fire_flame ^-1.7677 ^ ^1.7677 ^17677000 ^ ^-17677000 0.0000000045 0
particle soul_fire_flame ^-2.165 ^ ^1.25 ^21650000 ^ ^-12500000 0.0000000045 0
particle soul_fire_flame ^-2.4148 ^ ^0.647 ^24148000 ^ ^-6470000 0.0000000045 0
particle soul_fire_flame ^-2.5 ^ ^0 ^25000000 ^ ^0 0.0000000045 0
particle soul_fire_flame ^-2.4148 ^ ^-0.647 ^24148000 ^ ^6470000 0.0000000045 0
particle soul_fire_flame ^-2.165 ^ ^-1.25 ^21650000 ^ ^12500000 0.0000000045 0
particle soul_fire_flame ^-1.7677 ^ ^-1.7677 ^17677000 ^ ^17677000 0.0000000045 0
particle soul_fire_flame ^-1.25 ^ ^-2.165 ^12500000 ^ ^21650000 0.0000000045 0
particle soul_fire_flame ^-0.647 ^ ^-2.4148 ^6470000 ^ ^24148000 0.0000000045 0
particle soul_fire_flame ^0 ^ ^-2.5 ^0 ^ ^25000000 0.0000000045 0
particle soul_fire_flame ^0.647 ^ ^-2.4148 ^-6470000 ^ ^24148000 0.0000000045 0
particle soul_fire_flame ^1.25 ^ ^-2.165 ^-12500000 ^ ^21650000 0.0000000045 0
particle soul_fire_flame ^1.7677 ^ ^-1.7677 ^-17677000 ^ ^17677000 0.0000000045 0
particle soul_fire_flame ^2.165 ^ ^-1.25 ^-21650000 ^ ^12500000 0.0000000045 0
particle soul_fire_flame ^2.4148 ^ ^-0.647 ^-24148000 ^ ^6470000 0.0000000045 0

particle soul_fire_flame ^1.5 ^ ^0 ^-15000000 ^ ^0 0.000000004 0
particle soul_fire_flame ^1.3858 ^ ^0.574 ^-13858000 ^ ^-5740000 0.000000004 0
particle soul_fire_flame ^1.0606 ^ ^1.0606 ^-10606000 ^ ^-10606000 0.000000004 0
particle soul_fire_flame ^0.574 ^ ^1.3858 ^-5740000 ^ ^-13858000 0.000000004 0
particle soul_fire_flame ^0 ^ ^1.5 ^0 ^ ^-15000000 0.000000004 0
particle soul_fire_flame ^-0.574 ^ ^1.3858 ^5740000 ^ ^-13858000 0.000000004 0
particle soul_fire_flame ^-1.0606 ^ ^1.0606 ^10606000 ^ ^-10606000 0.000000004 0
particle soul_fire_flame ^-1.3858 ^ ^0.574 ^13858000 ^ ^-5740000 0.000000004 0
particle soul_fire_flame ^-1.5 ^ ^0 ^15000000 ^ ^0 0.000000004 0
particle soul_fire_flame ^-1.3858 ^ ^-0.574 ^13858000 ^ ^5740000 0.000000004 0
particle soul_fire_flame ^-1.0606 ^ ^-1.0606 ^10606000 ^ ^10606000 0.000000004 0
particle soul_fire_flame ^-0.574 ^ ^-1.3858 ^5740000 ^ ^13858000 0.000000004 0
particle soul_fire_flame ^0 ^ ^-1.5 ^0 ^ ^15000000 0.000000004 0
particle soul_fire_flame ^0.574 ^ ^-1.3858 ^-5740000 ^ ^13858000 0.000000004 0
particle soul_fire_flame ^1.0606 ^ ^-1.0606 ^-10606000 ^ ^10606000 0.000000004 0
particle soul_fire_flame ^1.3858 ^ ^-0.574 ^-13858000 ^ ^5740000 0.000000004 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0339.will_o_wisp/_/register
#
#
#
# @within tag/function asset:effect/register

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

execute if data storage asset:context {id:339} run function asset:effect/0339.will_o_wisp/tick/
Loading