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

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1421
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:ender_eye"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"トースター","color":"#d7a657"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"長押しすることで最大3段階のチャージを行う"}','[{"translate":"%1$sを離すことで","with":[{"keybind":"key.use"}]}]','{"text":"チャージ段階に応じたダメージと速度のパンを2枚射出する"}','{"text":"朝はやっぱりパンですよね!","color":"gray"}']
# 消費アイテム ({Item: TextComponent, Count: int, Extra?: TextComponent}) (オプション)
data modify storage asset:artifact ConsumeItem.Item set value '{"translate":"item.minecraft.bread"}'
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 "40-120x2"
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Physical]
# 攻撃に関する情報 -攻撃属性 (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 20
# 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
# 種別クールダウン ({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 ["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,7 @@
#> asset:artifact/1421.toaster/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

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

#> Private
# @private
#declare score_holder $Count

# チャージ用Effectがあれば強制的にチャージ続行
data modify storage api: Argument.ID set value 362
function api:entity/mob/effect/get/from_id
execute if data storage api: Return.Effect run return run function asset:artifact/1421.toaster/trigger/charge

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

# CanUsedでなければreturn
execute if entity @s[tag=!CanUsed] run return fail

# パンがn個以上か?
execute store result score $Count Temporary run clear @s bread 0
execute unless score $Count Temporary matches 1.. run tag @s remove CanUsed
scoreboard players reset $Count Temporary
execute if entity @s[tag=!CanUsed] run function lib:message/artifact/dont_have_require_items
execute if entity @s[tag=!CanUsed] run return fail

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

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

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

# パンを1個消費
clear @s bread 1

# 演出
playsound minecraft:block.note_block.chime player @a ~ ~ ~ 1 1.8

# チャージ用エフェクト
data modify storage api: Argument.ID set value 362
data modify storage api: Argument.FieldOverride.Range set value 40
data modify storage api: Argument.FieldOverride.Speed set value {Charge1:1,Charge2:2,Charge3:3}
data modify storage api: Argument.FieldOverride.Damage set value {Charge1:40,Charge2:70,Charge3:120}
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,10 @@
#> asset:artifact/1421.toaster/trigger/charge
#
#
#
# @within function asset:artifact/1421.toaster/trigger/2.check_condition

# チャージ
data modify storage api: Argument.ID set value 362
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/0362.baking/_/re-given
#
# Effectが上書きされた時に実行されるfunction
#
# @within tag/function asset:effect/re-given

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

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

execute if data storage asset:context {id:362} run function asset:effect/0362.baking/tick/
31 changes: 31 additions & 0 deletions Asset/data/asset/functions/effect/0362.baking/re-given/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#> asset:effect/0362.baking/re-given/
#
# Effectが上書きされた時の処理
#
# @within function asset:effect/0362.baking/_/re-given

#> Private
# @private
#declare score_holder $Charge

# 常時の音
playsound block.furnace.fire_crackle player @a ~ ~ ~ 1 0.8

# データ引き継ぎ
data modify storage asset:context this set from storage asset:context PreviousField

# チャージ段階取得
execute store result score $Charge Temporary run data get storage asset:context PreviousField.Charge

# Field.Chargeを+1
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 playsound minecraft:block.note_block.chime player @a ~ ~ ~ 1 1.9
execute if score $Charge Temporary matches 12 run data modify storage asset:context Stack set value 2

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

# リセット
scoreboard players reset $Charge Temporary
39 changes: 39 additions & 0 deletions Asset/data/asset/functions/effect/0362.baking/register.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#> asset:effect/0362.baking/register
#
# Effectのデータを指定
#
# @within function asset:effect/0362.baking/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 362
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text":"加熱中...","color":"#d7a657"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value ['{"text":"チャージ段階に応じてパンの射出速度とダメージが上昇する"}']
# 効果時間 (int) (default = API || error)
data modify storage asset:effect Duration set value 2
# スタック (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
12 changes: 12 additions & 0 deletions Asset/data/asset/functions/effect/0362.baking/tick/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:effect/0362.baking/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0362.baking/_/tick

# 発射直前の音
execute if data storage asset:context {Duration:1} run function asset:effect/0362.baking/tick/sound

# 残りDurationが1と0の時に発射
execute if data storage asset:context {Duration:1} anchored eyes positioned ^-0.35 ^-0.25 ^ run function asset:effect/0362.baking/tick/shoot
execute if data storage asset:context {Duration:0} anchored eyes positioned ^-0.35 ^-0.35 ^ run function asset:effect/0362.baking/tick/shoot
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset:effect/0362.baking/tick/shoot
#
#
#
# @within function asset:effect/0362.baking/tick/

# スタックに応じて弾速を調整
execute if data storage asset:context {Stack:1} run data modify storage api: Argument.FieldOverride.Speed set from storage asset:context this.Speed.Charge1
execute if data storage asset:context {Stack:2} run data modify storage api: Argument.FieldOverride.Speed set from storage asset:context this.Speed.Charge2
execute if data storage asset:context {Stack:3} run data modify storage api: Argument.FieldOverride.Speed set from storage asset:context this.Speed.Charge3

# ダメージ設定
execute if data storage asset:context {Stack:1} run data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage.Charge1
execute if data storage asset:context {Stack:2} run data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage.Charge2
execute if data storage asset:context {Stack:3} run data modify storage api: Argument.FieldOverride.Damage set from storage asset:context this.Damage.Charge3

# 召喚
data modify storage api: Argument.ID set value 1159
data modify storage api: Argument.FieldOverride.Range set from storage asset:context this.Range
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
function api:object/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0362.baking/tick/sound
#
# 音
#
# @within function asset:effect/0362.baking/tick/

playsound block.piston.contract player @a ~ ~ ~ 1 1.2
playsound block.fire.ambient player @a ~ ~ ~ 1 1.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1159.bread/detect_hit_entity/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1159/detect_hit_entity

#
execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @e[type=#lib:living_without_player,tag=Enemy,dx=0,limit=1] run data modify storage asset:context IsHitEntity set value true
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset:object/1159.bread/hit_entity/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1159/hit_entity

#> Private
# @private
#declare score_holder $UserID

# User特定
execute store result score $UserID Temporary run data get storage asset:context this.UserID

# ダメージ
data modify storage api: Argument.Damage set from storage asset:context this.Damage
data modify storage api: Argument.AttackType set value "Physical"
data modify storage api: Argument.ElementType set value "Fire"
execute as @a if score @s UserID = $UserID Temporary run function api:damage/modifier
execute positioned ~-0.5 ~-0.5 ~-0.5 as @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,dx=0,sort=random,limit=1] run function api:damage/
function api:damage/reset

# リセット
scoreboard players reset $UserID Temporary

# 消滅
function asset:object/call.m {method:"kill"}
12 changes: 12 additions & 0 deletions Asset/data/asset/functions/object/1159.bread/kill/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:object/1159.bread/kill/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1159/kill

# 演出
particle item stick{CustomModelData:20603} ~ ~ ~ 0 0 0 0.1 15 normal @a
playsound minecraft:block.fire.extinguish neutral @a ~ ~ ~ 1 2

# 消滅
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:object/1159.bread/recursive/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1159/recursive

# 演出
particle dust 1 0.886 0.522 0.3 ~ ~ ~ 0.05 0.05 0.05 0 1 normal @a
particle dust 1 0.886 0.522 0.3 ^ ^ ^-0.25 0.05 0.05 0.05 0 1 normal @a
23 changes: 23 additions & 0 deletions Asset/data/asset/functions/object/1159.bread/register.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#> asset:object/1159.bread/register
#
# Objectのデータを指定
#
# @within function asset:object/alias/1159/register

# 継承(オプション)
data modify storage asset:object Extends append value 1
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 1159
# フィールド(オプション)
data modify storage asset:object Field.Speed set value 1
data modify storage asset:object Field.Range set value 40
data modify storage asset:object Field.MovePerStep set value 0.5
data modify storage asset:object Field.Damage set value 1d
Loading
Loading