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,8 @@
#> asset:artifact/1648.cursed_power_stone/trigger/_index.d
# @private

#> tag
# @within function asset:artifact/1648.cursed_power_stone/**
# @within function asset:effect/0427.power_of_curse/**
# @within function asset:effect/0428.curse_of_power/**
Comment thread
firgde marked this conversation as resolved.
Resolved
#declare tag A1648.Equipping
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1648.cursed_power_stone/dis_equip/1.trigger
#
# 装備を外した時に外した部位にのみのidが入った状態でトリガーされる
#
# @within tag/function asset:artifact/dis_equip

execute if data storage asset:context id{hotbar:[1648]} run function asset:artifact/1648.cursed_power_stone/dis_equip/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:artifact/1648.cursed_power_stone/dis_equip/2.check_condition
#
#
#
# @within function asset:artifact/1648.cursed_power_stone/dis_equip/1.trigger

#> private
# @private
#declare score_holder $A1648.Count

# まだホットバーに同神器があるかつ装備中タグがついているならキャンセル
execute store result score $A1648.Count Temporary if data storage asset:context New.Items.hotbar[{tag:{TSB:{ID:1648}}}]
execute if score $A1648.Count Temporary matches 0 if entity @s[tag=A1648.Equipping] run function asset:artifact/1648.cursed_power_stone/dis_equip/3.main

# リセット
scoreboard players reset $A1648.Count Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset:artifact/1648.cursed_power_stone/dis_equip/3.main
#
# 装備を外した時のメイン処理
#
# @within function asset:artifact/1648.cursed_power_stone/dis_equip/2.check_condition

# Fieldを取得しておく
data modify storage api: Argument.ID set value 427
function api:entity/mob/effect/get/from_id
Comment thread
firgde marked this conversation as resolved.
Resolved

# Effect427削除
data modify storage api: Argument.ID set value 427
function api:entity/mob/effect/remove/from_id
function api:entity/mob/effect/reset

# 戦闘中ならEffect428付与
data modify storage api: Argument.ID set value 428

# Fieldを引き継ぐ
data modify storage api: Argument.FieldOverride set from storage api: Return.Effect.Field

execute if predicate lib:in_battle run function api:entity/mob/effect/give
function api:entity/mob/effect/reset

# 装備中タグを削除
tag @s remove A1648.Equipping
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1648.cursed_power_stone/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1648
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text": "呪われし力の結晶", "color": "#a93aae"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"translate": "装備中、攻撃力が%s、MP回復量が%s上昇するが、", "with": [{"text": "10%", "color": "green"}, {"text": "20%", "color": "green"}]}', '{"text": "MPが0になるか、戦闘中に装備を解除すると"}', '{"translate": "15秒の間耐性とMP回復量が%s低下する。", "with": [{"text": "20%", "color": "red"}]}', '{"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 "hotbar"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "equipping"
# 効果が重複可能か否か (boolean) (オプション)
# data modify storage asset:artifact EnableDuplication set value
# 神器の発動条件 (TextComponentString) (オプション)
# data modify storage asset:artifact Condition set value
# 攻撃に関する情報 -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 [Fire,Water,Thunder,None]
# 攻撃に関する情報 -防御無視 (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 0
# 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
# 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
# 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", "Wi-ki", "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/1648.cursed_power_stone/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

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

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

# 信仰変更時に使えなくなっていたらリセット
execute if entity @s[tag=A1648.Equipping,tag=!CanUsed] run function asset:artifact/1648.cursed_power_stone/trigger/reset

# 他にアイテム等確認する場合はここに書く
# 既に装備しているならキャンセル
tag @s[tag=A1648.Equipping] remove CanUsed

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

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

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

#> private
# @private
#declare score_holder $A1648.MP
#declare tag A1648.HasDebuff

# MPが0以上ならEffect427、そうでないならEffect428を付与
#Effect428が付与されていたらEffect427は付与しない
data modify storage api: Argument.ID set value 428
function api:entity/mob/effect/get/from_id
execute if data storage api: Return.Effect run tag @s add A1648.HasDebuff

function api:mp/get_current
execute store result score $A1648.MP Temporary run data get storage api: Return.CurrentMP
data modify storage api: Argument.ID set value 427
execute if score $A1648.MP Temporary matches 0 run data modify storage api: Argument.ID set value 428

# modifierを設定
data modify storage api: Argument.FieldOverride.Buff.Attack set value 0.1d
data modify storage api: Argument.FieldOverride.Buff.MPHeal set value 0.2d

data modify storage api: Argument.FieldOverride.Debuff.Defense set value -0.2d
data modify storage api: Argument.FieldOverride.Debuff.MPHeal set value -0.2d

execute if entity @s[tag=!A1648.HasDebuff] run function api:entity/mob/effect/give
function api:entity/mob/effect/reset

# 装備中タグ
tag @s add A1648.Equipping

# 演出
playsound block.trial_spawner.spawn_mob player @a ~ ~ ~ 1.0 0.7
playsound ogg:ambient.nether.crimson_forest.shine3 player @a ~ ~ ~ 2.0 2.0
particle dust 0.7 0.2 0.7 0.7 ~ ~1 ~ 0.2 0.5 0.2 0 12
particle dust 0.8 0.4 0.8 0.7 ~ ~1 ~ 0.2 0.5 0.2 0 12

# リセット
scoreboard players reset $A1648.MP Temporary
tag @s remove A1648.HasDebuff
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#> asset:artifact/1648.cursed_power_stone/trigger/reset
#
#
#
# @within function asset:artifact/1648.cursed_power_stone/trigger/2.check_condition

# Effect427を削除
data modify storage api: Argument.ID set value 427
function api:entity/mob/effect/remove/from_id
function api:entity/mob/effect/reset

# 装備中タグを削除
tag @s remove A1648.Equipping
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0427.power_of_curse/_/given
#
# Effectが付与された時に実行されるfunction
#
# @within tag/function asset:effect/given

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

execute if data storage asset:context {id:427} run function asset:effect/0427.power_of_curse/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0427.power_of_curse/_/remove
#
# Effectが神器や牛乳によって削除された時に実行されるfunction
#
# @within tag/function asset:effect/remove

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

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

## modifier付与
# 攻撃
data modify storage api: Argument.UUID set value [I;1,3,427,0]
data modify storage api: Argument.Amount set from storage asset:context this.Buff.Attack
data modify storage api: Argument.Operation set value "multiply"
function api:modifier/attack/base/add

# MP回復量
data modify storage api: Argument.UUID set value [I;1,3,427,0]
data modify storage api: Argument.Amount set from storage asset:context this.Buff.MPHeal
data modify storage api: Argument.Operation set value "multiply"
function api:modifier/mp_heal/add
Comment thread
firgde marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#> asset:effect/0427.power_of_curse/register
#
# Effectのデータを指定
#
# @within function asset:effect/0427.power_of_curse/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 427
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text": "呪いの力", "color": "#a93aae"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value ['{"text": "与ダメージとMP回復量が上昇する"}']
# 効果時間 (int) (default = API || error)
data modify storage asset:effect Duration set value 2147483647
# スタック (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 "keep"
# 消すのに必要なレベル (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 set value {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:effect/0427.power_of_curse/remove/
#
# Effectが削除された時の処理
#
# @within function asset:effect/0427.power_of_curse/_/remove

## modifier削除
# 攻撃
data modify storage api: Argument.UUID set value [I;1,3,427,0]
function api:modifier/attack/base/remove

# MP回復量
data modify storage api: Argument.UUID set value [I;1,3,427,0]
function api:modifier/mp_heal/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:effect/0427.power_of_curse/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0427.power_of_curse/_/tick

#> private
# @private
#declare score_holder $E0427.MP

# MPが0ならEffect428を付与
function api:mp/get_current
execute store result score $E0427.MP Temporary run data get storage api: Return.CurrentMP
execute if score $E0427.MP Temporary matches 0 run function asset:effect/0427.power_of_curse/tick/remove

# リセット
scoreboard players reset $E0427.MP Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:effect/0427.power_of_curse/tick/remove
#
#
#
# @within function asset:effect/0427.power_of_curse/tick/

# 自身は削除
data modify storage api: Argument.ID set value 427
function api:entity/mob/effect/remove/from_id
function api:entity/mob/effect/reset

# Effect428を付与
data modify storage api: Argument.ID set value 428

# Fieldを引き継ぐ
data modify storage api: Argument.FieldOverride set from storage asset:context this

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