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

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1590
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:ender_eye"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text": "炊飯器"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text": "最大4段階のチャージをし、段階に応じた数の米粒を発射する。"}', '{"text": "発射中は再発動ができない。"}', '{"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 "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 "5x10-40"
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Physical]
# 攻撃に関する情報 -攻撃属性 (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 "never"
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackRange set value "7.0"
# 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 1
# 神器のクールダウン (int) (オプション)
# data modify storage asset:artifact LocalCooldown set value
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
data modify storage asset:artifact TypeCooldown.Type set value "longRange"
data modify storage asset:artifact TypeCooldown.Duration set value 70
# グローバルクールダウン (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 ["Flora", "Nyaptov"]
# カスタム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/1590.rice_cooker/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

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

# Effect 392を確認
data modify storage api: Argument.ID set value 392
function api:entity/mob/effect/get/from_id
execute if data storage api: Return.Effect run return run function asset:artifact/1590.rice_cooker/trigger/charge
# 発射中なら発動不可
data modify storage api: Argument.ID set value 393
function api:entity/mob/effect/get/from_id
execute if data storage api: Return.Effect run return fail

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/mainhand

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

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

# ここから先は神器側の効果の処理を書く
data modify storage api: Argument.ID set value 392
#攻撃情報
data modify storage api: Argument.FieldOverride.Damage set value 5.0f
data modify storage api: Argument.FieldOverride.AttackType set value "Physical"
data modify storage api: Argument.FieldOverride.ElementType set value "Water"

function api:entity/mob/effect/give
function api:entity/mob/effect/reset

# 演出
particle poof ~ ~ ~ 0.1 0.5 0.1 0.5 25
playsound block.fire.extinguish player @a ~ ~ ~ 0.75 0.75
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:artifact/1590.rice_cooker/trigger/charge
#
#
#
# @within function asset:artifact/1590.rice_cooker/trigger/2.check_condition

# Effect 392を上書き付与
data modify storage api: Argument.ID set value 392
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,7 @@
#> asset:effect/0392.now_cooking/_/end
#
# Effectの効果の終了時に実行されるfunction
#
# @within tag/function asset:effect/end

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

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

execute if data storage asset:context {id:392} run function asset:effect/0392.now_cooking/register
16 changes: 16 additions & 0 deletions Asset/data/asset/functions/effect/0392.now_cooking/end/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:effect/0392.now_cooking/end/
#
# Effectの効果が切れた時の処理
#
# @within function asset:effect/0392.now_cooking/_/end

# スタック数×10発の弾丸召喚 = Effect 393を効果時間(弾数×2 = スタック数×20)tickで付与
data modify storage api: Argument.ID set value 393
execute store result storage api: Argument.Duration int 20 run data get storage asset:context Stack
#攻撃情報も引き継ぐ
data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage
data modify storage api: Argument.FieldOverride.AttackType set from storage asset:context this.AttackType
data modify storage api: Argument.FieldOverride.ElementType set from storage asset:context this.ElementType

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,29 @@
#> asset:effect/0392.now_cooking/re-given/
#
# Effectが上書きされた時の処理
#
# @within function asset:effect/0392.now_cooking/_/re-given

#> Private
# @private
#declare score_holder $Charge

# Field上書き
data modify storage asset:context this set from storage asset:context PreviousField

# チャージ時間取得&更新
execute store result score $Charge Temporary run data get storage asset:context this.Charge
execute store result storage asset:context this.Charge int 1 run scoreboard players add $Charge Temporary 1

# チャージ時間に応じてスタック更新&演出
execute if score $Charge Temporary matches 12 run data modify storage asset:context Stack set value 2
execute if score $Charge Temporary matches 12 run playsound block.note_block.chime player @a ~ ~ ~ 1 0.75

execute if score $Charge Temporary matches 24 run data modify storage asset:context Stack set value 3
execute if score $Charge Temporary matches 24 run playsound block.note_block.chime player @a ~ ~ ~ 1 1.0

execute if score $Charge Temporary matches 36 run data modify storage asset:context Stack set value 4
execute if score $Charge Temporary matches 36 run playsound block.note_block.chime player @a ~ ~ ~ 1 1.5

# リセット
scoreboard players reset $Charge Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#> asset:effect/0392.now_cooking/register
#
# Effectのデータを指定
#
# @within function asset:effect/0392.now_cooking/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 392
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text": "はじめちょろちょろ中ぱっぱ"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value ['{"text": "チャージ段階に応じて米粒の発射数が上昇する"}']
# 効果時間 (int) (default = API || error)
data modify storage asset:effect Duration set value 1
# スタック (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
# 最大効果時間 (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 false
# 死亡時のエフェクトの処理 (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

# フィールド
data modify storage asset:effect Field.Charge set value 0
data modify storage asset:effect Field.Damage set value 0
data modify storage asset:effect Field.AttackType set value ""
data modify storage asset:effect Field.ElementType set value ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0393.launching_rice/_/register
#
#
#
# @within tag/function asset:effect/register

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

execute if data storage asset:context {id:393} run function asset:effect/0393.launching_rice/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#> asset:effect/0393.launching_rice/register
#
# Effectのデータを指定
#
# @within function asset:effect/0393.launching_rice/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 393
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text": "赤子泣いても蓋とるな"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value []
# 効果時間 (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
# 最大効果時間 (int) (default = 2147483647)
data modify storage asset:effect MaxDuration set value 80
# 最大スタック (int) (default = 2147483647)
# data modify storage asset:effect MaxStack set value
# 悪い効果か否か (boolean)
data modify storage asset:effect IsBadEffect set value false
# 死亡時のエフェクトの処理 (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 false
# エフェクトのスタックををUIに表示するか (boolean) (default = true)
# data modify storage asset:effect StackVisible set value

# フィールド
data modify storage asset:effect Field.Interval set value 1
data modify storage asset:effect Field.Damage set value 0
data modify storage asset:effect Field.AttackType set value ""
data modify storage asset:effect Field.ElementType set value ""
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:effect/0393.launching_rice/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0393.launching_rice/_/tick

# 2tickごとに弾丸発射
execute store result storage asset:context this.Interval int 0.9999999999 run data get storage asset:context this.Interval
execute if data storage asset:context this{Interval:0} run function asset:effect/0393.launching_rice/tick/shoot
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:effect/0393.launching_rice/tick/damage
#
#
#
# @within function asset:effect/0393.launching_rice/tick/rec

# ダメージ
data modify storage api: Argument.Damage set from storage asset:context this.Damage
data modify storage api: Argument.AttackType set from storage asset:context this.AttackType
data modify storage api: Argument.ElementType set from storage asset:context this.ElementType
function api:damage/modifier
execute as @e[type=#lib:living_without_player,tag=0393.Target,distance=..2,limit=1] run function api:damage/
function api:damage/reset

# リセット
tag @e[type=#lib:living_without_player,tag=0393.Target,distance=..2,limit=1] remove 0393.Target
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#> asset:effect/0393.launching_rice/tick/rec
#
#
#
# @within function asset:effect/0393.launching_rice/tick/**

#> Private
# @within function asset:effect/0393.launching_rice/tick/**
#declare tag 0393.Hit
#declare tag 0393.Target

# 着弾検知
execute if entity @e[type=#lib:living_without_player,tag=!Uninterferable,distance=..2] run tag @s add 0393.Hit
execute as @e[type=#lib:living_without_player,tag=!Uninterferable,distance=..2] run tag @s add 0393.Target
execute unless block ^ ^ ^0.5 #lib:no_collision/ run tag @s add 0393.Hit

# ダメージ処理
execute if entity @e[type=#lib:living_without_player,tag=0393.Target,distance=..2,limit=1] run function asset:effect/0393.launching_rice/tick/damage

# 演出
particle dust 1 1 1 0.25 ~ ~ ~ 0.01 0.01 0.01 0 3

# 再帰
execute positioned ^ ^ ^0.5 if entity @s[tag=!0393.Hit,distance=..7] run function asset:effect/0393.launching_rice/tick/rec
Loading
Loading