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/1584.pk_insight/damage_from_entity/1.trigger
#
#
#
# @within tag/function asset:artifact/damage/from_entity/

# storage asset:idのoffhandに装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する
execute if data storage asset:context id{offhand:1584} run function asset:artifact/1584.pk_insight/damage_from_entity/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:artifact/1584.pk_insight/damage_from_entity/2.check_condition
#
#
#
# @within function asset:artifact/1584.pk_insight/damage_from_entity/1.trigger

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/offhand
# 他にアイテム等確認する場合はここに書く
# Effect 386が付与されている状態が条件
data modify storage api: Argument.ID set value 386
function api:entity/mob/effect/get/from_id
function api:entity/mob/effect/reset
execute unless data storage api: Return.Effect{ID:386} run tag @s remove CanUsed

# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed] run function asset:artifact/1584.pk_insight/damage_from_entity/3.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#> asset:artifact/1584.pk_insight/damage_from_entity/3.1.success
#
#
#
# @within function asset:artifact/1584.pk_insight/damage_from_entity/3.main

# 攻撃者に割合ダメージ
#初期化
data modify storage api: Argument.Damage set value 0
#通常の敵には35%
execute as @e[type=#lib:living,tag=Attacker,tag=!Enemy.Boss,tag=!Uninterferable,distance=..20] store result storage api: Argument.Damage float 0.35 run function api:mob/get_max_health
#天使には割合ではなく固定で1000ダメージ
execute as @e[type=#lib:living,tag=Attacker,tag=Enemy.Boss,tag=!Uninterferable,distance=..20] run data modify storage api: Argument.Damage set value 1000

data modify storage api: Argument.AttackType set value "Magic"
data modify storage api: Argument.ElementType set value "None"
data modify storage api: Argument.FixedDamage set value 1b
function api:damage/modifier
execute if data storage api: Argument.Damage as @e[type=#lib:living,tag=Attacker,distance=..20] run function api:damage/
function api:damage/reset

# 演出
playsound entity.evoker.cast_spell player @a ~ ~ ~ 2.0 2.0
playsound entity.enderman.teleport player @a ~ ~ ~ 1.0 1.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#> asset:artifact/1584.pk_insight/damage_from_entity/3.main
#
#
#
# @within function asset:artifact/1584.pk_insight/damage_from_entity/2.check_condition

#> Private
# @private
#declare score_holder $Duration

# Effect 386の残り効果時間が9tick以内なら成功
data modify storage api: Argument.ID set value 386
function api:entity/mob/effect/get/from_id
execute store result score $Duration Temporary run data get storage api: Return.Effect.Duration
function api:entity/mob/effect/reset
execute if score $Duration Temporary matches ..9 run function asset:artifact/1584.pk_insight/damage_from_entity/3.1.success
# Effect剝奪
data modify storage api: Argument.ID set value 386
function api:entity/mob/effect/remove/from_id
function api:entity/mob/effect/reset

# リセット
scoreboard players reset $Duration Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1584.pk_insight/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1584
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:carrot_on_a_stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text": "予言者の見極め", "color": "#deceeb"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text": "使用後、耐性が", "extra": [{"text": "70%", "color": "red"}, {"text": "、移動速度が", "color": "white"}, {"text": "50%", "color": "red"}, {"text": "下がり、カウントダウンが始まる。", "color": "white"}]}', '{"text": "3カウント後、0.5秒の間耐性が", "extra": [{"text": "70%", "color": "green"}, {"text": "上昇する。", "color": "white"}]}','{"text": "耐性上昇中にダメージを受けたとき、攻撃者にダメージを与える。"}','{"text": "通常: 最大体力の35%分の割合ダメージ", "color": "gray"}', '{"text": "天使: 1000ダメージ", "color": "gray"}', '{"text": "この効果はオフハンドからこの神器を外した場合、不発になり、"}', '{"text": "10秒の間耐性が", "extra": [{"text": "30%", "color": "red"}, {"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 "offhand"
# 神器のトリガー (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 "???"
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Magic]
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.ElementType set value [None]
# 攻撃に関する情報 -防御無視 (boolean) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.BypassResist set value true
# 攻撃に関する情報 -範囲攻撃 (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 600
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
# data modify storage asset:artifact TypeCooldown.Type set value
# data modify storage asset:artifact TypeCooldown.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 ['Rumor', 'Nyaptov', "Wi-ki"]
# カスタム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/1584.pk_insight/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

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

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

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/offhand
# 他にアイテム等確認する場合はここに書く
# Effect 389があるなら失敗
data modify storage api: Argument.ID set value 389
function api:entity/mob/effect/get/from_id
execute if data storage api: Return.Effect run tag @s remove CanUsed

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

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

# ここから先は神器側の効果の処理を書く
# Effect 386を付与
data modify storage api: Argument.ID set value 386
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:artifact/1584.pk_insight/trigger/dis_equip/
#
# 装備を外した時に外した部位にのみのidが入った状態でトリガーされる
#
# @within tag/function asset:artifact/dis_equip

execute if data storage asset:context id{offhand:1584} run function asset:artifact/1584.pk_insight/trigger/dis_equip/main
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset:artifact/1584.pk_insight/trigger/dis_equip/main
#
# 装備を外した時のメイン処理
#
# @within function asset:artifact/1584.pk_insight/trigger/dis_equip/

# Effect 386剝奪
data modify storage api: Argument.ID set value 386
function api:entity/mob/effect/remove/from_id
function api:entity/mob/effect/reset

# Effect 389付与
data modify storage api: Argument.ID set value 389
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/0386.pk_insight/_/end
#
# Effectの効果の終了時に実行されるfunction
#
# @within tag/function asset:effect/end

execute if data storage asset:context {id:386} run function asset:effect/0386.pk_insight/end/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0386.pk_insight/_/given
#
# Effectが付与された時に実行されるfunction
#
# @within tag/function asset:effect/given

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

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

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

execute if data storage asset:context {id:386} run function asset:effect/0386.pk_insight/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0386.pk_insight/end/
#
# Effectの効果が切れた時の処理
#
# @within function asset:effect/0386.pk_insight/_/end

# バフ/デバフ解除
function asset:effect/0386.pk_insight/modifier/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0386.pk_insight/given/
#
# Effectが付与された時の処理
#
# @within function asset:effect/0386.pk_insight/_/given

# modifier付与
function asset:effect/0386.pk_insight/modifier/add
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:effect/0386.pk_insight/modifier/add
#
#
#
# @within function asset:effect/0386.pk_insight/**

# 耐性
data modify storage api: Argument.UUID set value [I;1,3,386,0]
data modify storage api: Argument.Amount set value -0.7d
data modify storage api: Argument.Operation set value "multiply_base"
function api:modifier/defense/base/add

# 移動速度
attribute @s generic.movement_speed modifier add 1-0-3-0-386 "386.pk_insight" -0.5 multiply_base
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:effect/0386.pk_insight/modifier/remove
#
#
#
# @within function asset:effect/0386.pk_insight/**

# 耐性
data modify storage api: Argument.UUID set value [I;1,3,386,0]
function api:modifier/defense/base/remove

# 移動速度
attribute @s generic.movement_speed modifier remove 1-0-3-0-386
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#> asset:effect/0386.pk_insight/register
#
# Effectのデータを指定
#
# @within function asset:effect/0386.pk_insight/_/register

# ExtendsSafe (boolean) (default = false)
# data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 386
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text": "予言者の見極め", "color": "#deceeb"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value ['{"text": "移動速度と耐性が極端に低下する"}', '{"text": "終了直前に、耐性が極端に上昇する"}']
# 効果時間 (int) (default = API || error)
data modify storage asset:effect Duration set value 39
# スタック (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
# エフェクトを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.Interval set value 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0386.pk_insight/remove/
#
# Effectが削除された時の処理
#
# @within function asset:effect/0386.pk_insight/_/remove

# バフ/デバフ解除
function asset:effect/0386.pk_insight/modifier/remove
21 changes: 21 additions & 0 deletions Asset/data/asset/functions/effect/0386.pk_insight/tick/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#> asset:effect/0386.pk_insight/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0386.pk_insight/_/tick

#> Private
#@private
#declare score_holder $Duration

# Interval減算
execute store result storage asset:context this.Interval int 0.9999999999 run data get storage asset:context this.Interval
# 10tickごとにカウントダウン
execute if data storage asset:context this{Interval:0} anchored eyes positioned ^ ^ ^ run function asset:effect/0386.pk_insight/tick/count

# 残り時間が5tick以内なら耐性デバフを消して大幅上昇
execute store result score $Duration Temporary run data get storage asset:context Duration
execute if score $Duration Temporary matches 9 run function asset:effect/0386.pk_insight/tick/guard

# リセット
scoreboard players reset $Duration Temporary
Loading
Loading