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

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1391
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '[{"text":"青","color":"#7A7AFF"},{"text":"色","color":"#8484FF"},{"text":"の","color":"#8E8EFF"},{"text":"屈","color":"#9898FF"},{"text":"折","color":"#A2A2FF"},{"text":"","color":"#ACACFF"},{"text":"プ","color":"#B6B6FF"},{"text":"リ","color":"#C0C0FF"},{"text":"ズ","color":"#CACAFF"},{"text":"ム","color":"#D4D4FF"}]'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"攻撃対象N体に与ダメージ量の10%分の水属性ダメージを与える"}','{"text":"このダメージは自身のステータス補正の影響を受けない"}']
# 消費アイテム ({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":"水属性以外で属性攻撃"}'
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.Damage set value [0,0]
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Physical,Magic]
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.ElementType set value [Water]
# 攻撃に関する情報 -防御無視 (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
# MP消費量 (int)
data modify storage asset:artifact MPCost set value 20
# 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 "ALL"
# カスタム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,7 @@
#> asset:artifact/1391.blue_refraction_prism/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

# data modify storage asset:artifact RarityRegistry[1] append value [1391]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1391.blue_refraction_prism/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:[1391]} run function asset:artifact/1391.blue_refraction_prism/trigger/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#> asset:artifact/1391.blue_refraction_prism/trigger/2.check_condition
#
# 神器の発動条件をチェックします
#
# @within function asset:artifact/1391.blue_refraction_prism/trigger/1.trigger

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

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

# バニラ攻撃ならreturn
execute if data storage asset:context Attack{IsVanilla:true} run tag @s remove CanUsed
execute if entity @s[tag=!CanUsed] run return fail

# DoTならreturn
execute if data storage asset:context Attack{IsDoT:true} run return fail
execute if entity @s[tag=!CanUsed] run return fail

# 水属性ならreturn
execute if data storage asset:context Attack{ElementType:"Water"} run return fail
execute if entity @s[tag=!CanUsed] run return fail

# Victimがいなければreturn
execute unless entity @e[type=#lib:living_without_player,tag=Victim,distance=..64] run return fail
execute if entity @s[tag=!CanUsed] run return fail

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

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

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

# SingleDamageSession open
function api:damage/single_damage_session/open

# 攻撃対象のうち近いN体に諸々を適用
execute as @e[type=#lib:living_without_player,tag=Victim,tag=!Uninterferable,distance=..64,sort=nearest,limit=3] at @s run function asset:artifact/1391.blue_refraction_prism/trigger/apply

# SingleDamageSession close
function api:damage/single_damage_session/close

# 自作パーティクル x4
# 各entityで実行すると負荷がやばいのでテキトーに分散させる
function asset:artifact/1391.blue_refraction_prism/trigger/vfx/
function asset:artifact/1391.blue_refraction_prism/trigger/vfx/
function asset:artifact/1391.blue_refraction_prism/trigger/vfx/
function asset:artifact/1391.blue_refraction_prism/trigger/vfx/

# リセット
data remove storage asset:temp Temp
tag @e[type=#lib:living_without_player,tag=Target,distance=..64] remove Target
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1391.blue_refraction_prism/trigger/_index.d
# @private

#> tag
# @within function asset:artifact/1391.blue_refraction_prism/trigger/**
#declare score_holder $TempID
#declare tag Target
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#> asset:artifact/1391.blue_refraction_prism/trigger/apply
#
#
#
# @within function asset:artifact/1391.blue_refraction_prism/trigger/3.main

# 自身にTagを付与しておく
tag @s add Target

# 演出
playsound block.amethyst_block.chime player @a ~ ~ ~ 1.5 1
playsound block.amethyst_block.chime player @a ~ ~ ~ 1.5 0.8

# 事前処理
data modify storage asset:temp Temp.To set from storage asset:context Attack.To
data modify storage asset:temp Temp.Amounts set from storage asset:context Attack.Amounts
function asset:artifact/1391.blue_refraction_prism/trigger/recursive
scoreboard players reset $TempID Temporary

# ダメージ
# 自身の補正は適用されない
execute store result storage api: Argument.Damage float 0.001 run data get storage asset:temp Temp.Damage 100
data modify storage api: Argument.AttackType set from storage asset:context Attack.AttackType
data modify storage api: Argument.ElementType set value "Water"
data modify storage api: Argument.BypassModifier set value true
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:artifact/1391.blue_refraction_prism/trigger/recursive
#
#
#
# @within function
# asset:artifact/1391.blue_refraction_prism/trigger/apply
# asset:artifact/1391.blue_refraction_prism/trigger/recursive

# 最後尾の要素を取得
execute store result score $TempID Temporary run data get storage asset:temp Temp.To[-1]

# 最後尾のIDが自身のUUIDと一致しているなら、ダメージをTempStorageに入れておく
execute if score @s MobUUID = $TempID Temporary run data modify storage asset:temp Temp.Damage set from storage asset:temp Temp.Amounts[-1]

# 一致していないなら最後尾の要素を削除
execute unless score @s MobUUID = $TempID Temporary run data remove storage asset:temp Temp.To[-1]
execute unless score @s MobUUID = $TempID Temporary run data remove storage asset:temp Temp.Amounts[-1]

# 要素がある && 一致してないなら再帰
execute if data storage asset:temp Temp.To[0] unless score @s MobUUID = $TempID Temporary run function asset:artifact/1391.blue_refraction_prism/trigger/recursive
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1391.blue_refraction_prism/trigger/vfx/
#
#
#
# @within function asset:artifact/1391.blue_refraction_prism/trigger/3.main

# Targetのうちランダムな1体の箇所で演出
execute as @e[type=#lib:living_without_player,tag=Target,distance=..64,sort=random,limit=1] at @s anchored eyes rotated ~ 0 positioned ^ ^-0.5 ^ run function asset:artifact/1391.blue_refraction_prism/trigger/vfx/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:artifact/1391.blue_refraction_prism/trigger/vfx/summon
#
#
#
# @within function asset:artifact/1391.blue_refraction_prism/trigger/vfx/

data modify storage api: Argument.ID set value 1156
data modify storage api: Argument.FieldOverride.Font set value {Front:4,Back:5}
function api:object/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:object/1156.refraction_prism/init/
#
# Objectのinit時の処理
#
# @within asset:object/alias/1156/init

# Rotationをランダムにする
execute store result storage asset:temp Args.Yaw float 0.01 run random value 0..35999
execute store result storage asset:temp Args.Pitch float 0.01 run random value -6000..1500
function asset:object/1156.refraction_prism/init/set_rotation with storage asset:temp Args
data remove storage asset:temp Args

# Passengersも合わせる
execute at @s on passengers run tp @s ~ ~ ~ ~ ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:object/1156.refraction_prism/init/set_rotation
#
#
#
# @within function asset:object/1156.refraction_prism/init/

$tp @s ~ ~ ~ $(Yaw) $(Pitch)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset:object/1156.refraction_prism/register
#
# Objectのデータを指定
#
# @within function asset:object/alias/1156/register

# 継承(オプション)
# data modify storage asset:object Extends append value
# function asset:object/extends
# 他のObjectに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:object ExtendsSafe set value
# 継承されることを前提とした、抽象的なObjectであるかどうか(boolean)
data modify storage asset:object IsAbstract set value false
# Tickするかどうか(boolean) (オプション)
# data modify storage asset:object IsTicking set value

# ID (int)
data modify storage asset:object ID set value 1160
# フィールド(オプション)
data modify storage asset:object Field.Font.Front set value 0
data modify storage asset:object Field.Font.Back set value 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:object/1156.refraction_prism/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:object/alias/1156/summon

function asset:object/1156.refraction_prism/summon/m with storage asset:context this.Font
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:object/1156.refraction_prism/summon/m
#
#
#
# @within function asset:object/1156.refraction_prism/summon/

$summon text_display ~ ~ ~ {Tags:["ObjectInit"],teleport_duration:1,alignment:"center",brightness:{sky:15,block:15},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0.3826f,0.9238f],translation:[0f,0f,0f],scale:[0f,0f,0f]},text:'[{"text":"$(Front)","font":"object/1156"}]',background:16711680,Passengers:[{id:"text_display",Tags:[],teleport_duration:1,alignment:"center",brightness:{sky:15,block:15},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[-0.3826f,0.9238f,0f,0f],translation:[0f,0f,0f],scale:[0f,0f,0f]},text:'[{"text":"$(Back)","font":"object/1156"}]',background:16711680}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#> asset:object/1156.refraction_prism/tick/
#
# Objectのtick時の処理
#
# @within asset:object/alias/1156/tick

# Tick加算
scoreboard players add @s General.Object.Tick 1
execute unless score @s General.Object.Tick matches 3.. run return fail

# tp
execute if score @s General.Object.Tick matches 3..13 run tp @s ^ ^ ^0.12
execute if score @s General.Object.Tick matches 14..21 run tp @s ^ ^ ^0.09
execute if score @s General.Object.Tick matches 22..27 run tp @s ^ ^ ^0.05
execute if score @s General.Object.Tick matches 28.. run tp @s ^ ^ ^0.01

# transformation
execute if score @s General.Object.Tick matches 3 run function asset:object/1156.refraction_prism/tick/transformation/0/
execute if score @s General.Object.Tick matches 15 run function asset:object/1156.refraction_prism/tick/transformation/1/
execute if score @s General.Object.Tick matches 25 run function asset:object/1156.refraction_prism/tick/transformation/2/

# kill
execute if score @s General.Object.Tick matches 30.. run function asset:object/1156.refraction_prism/tick/kill
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1156.refraction_prism/tick/kill
#
#
#
# @within function asset:object/1156.refraction_prism/tick/

execute on passengers run kill @s
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1156.refraction_prism/tick/transformation/0/
#
#
#
# @within function asset:object/1156.refraction_prism/tick/

function asset:object/1156.refraction_prism/tick/transformation/0/apply
execute on passengers run function asset:object/1156.refraction_prism/tick/transformation/0/apply
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/1156.refraction_prism/tick/transformation/0/apply
#
#
#
# @within function asset:object/1156.refraction_prism/tick/transformation/0/

data modify entity @s interpolation_duration set value 12
data modify entity @s start_interpolation set value 0
data modify entity @s transformation.left_rotation set value {angle:1.57f,axis:[0f,-0.7071f,0.7071f]}
data modify entity @s transformation.scale set value [0.6f,0.6f,0f]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1156.refraction_prism/tick/transformation/1/
#
#
#
# @within function asset:object/1156.refraction_prism/tick/

function asset:object/1156.refraction_prism/tick/transformation/1/apply
execute on passengers run function asset:object/1156.refraction_prism/tick/transformation/1/apply
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/1156.refraction_prism/tick/transformation/1/apply
#
#
#
# @within function asset:object/1156.refraction_prism/tick/transformation/1/

data modify entity @s interpolation_duration set value 10
data modify entity @s start_interpolation set value 0
data modify entity @s transformation.left_rotation set value {angle:3.14f,axis:[0f,-0.7071f,0.7071f]}
data modify entity @s transformation.scale set value [0.9f,0.9f,0f]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1156.refraction_prism/tick/transformation/2/
#
# 消滅する
#
# @within function asset:object/1156.refraction_prism/tick/

function asset:object/1156.refraction_prism/tick/transformation/2/apply
execute on passengers run function asset:object/1156.refraction_prism/tick/transformation/2/apply
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/1156.refraction_prism/tick/transformation/2/apply
#
#
#
# @within function asset:object/1156.refraction_prism/tick/transformation/2/

data modify entity @s interpolation_duration set value 5
data modify entity @s start_interpolation set value 0
data modify entity @s transformation.left_rotation set value {angle:-2.355f,axis:[0f,-0.7071f,0.7071f]}
data modify entity @s transformation.scale set value [0f,0f,0f]
Loading
Loading