Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1324.mysterious_star/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1324
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '[{"text":"神","color":"#9e99fc"},{"text":"秘","color":"#9bb3fd"},{"text":"の","color":"#98cefe"},{"text":"星","color":"#96e9ff"}]'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"自身と周囲20mのプレイヤーの中で"}','{"text":"最も現在MPの多い1名のMPを2減少させ"}','{"text":"最も現在MPの少ない1名のMPを2回復する"}']
# 消費アイテム ({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 "passive"
# 効果が重複可能か否か (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 20
# 種別クールダウン ({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
# 破壊時の音を鳴らさないかどうか (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/1324.mysterious_star/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

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

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

#> Private
# @private
#declare score_holder $10S.PlayerCount

# tag=!PlayerShouldInvulnerableが二人以上範囲内にいなけれれば使用不可
execute if entity @s[tag=CanUsed] store result score $10S.PlayerCount Temporary if entity @a[tag=!PlayerShouldInvulnerable,distance=..20]
execute if entity @s[tag=CanUsed] unless score $10S.PlayerCount Temporary matches 2.. run scoreboard players reset $10S.PlayerCount Temporary
execute if entity @s[tag=CanUsed] unless score $10S.PlayerCount Temporary matches 2.. run tag @s remove CanUsed

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

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

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

# 最も現在MPの高い/低いプレイヤーを検索
function asset:artifact/1324.mysterious_star/trigger/find_target

# 演出
function asset:artifact/1324.mysterious_star/trigger/vfx/

# 最も現在MPの多いプレイヤーのMPを減少
data modify storage api: Argument.Fluctuation set value -2
data modify storage api: Argument.DisableLog set value true
execute as @p[tag=10S.HighestMPTarget] run function api:mp/fluctuation

# 最も現在MPの少ないプレイヤーのMPを回復
data modify storage api: Argument.Fluctuation set value 2
data modify storage api: Argument.DisableLog set value true
execute as @p[tag=10S.LowestMPTarget] run function api:mp/fluctuation

#say -------
#say @a[tag=10S.HighestMPTarget]
#say @a[tag=10S.LowestMPTarget]

# リセット
tag @a[tag=10S.HighestMP] remove 10S.HighestMP
tag @a[tag=10S.HighestMPTarget] remove 10S.HighestMPTarget
tag @a[tag=10S.LowestMP] remove 10S.LowestMP
tag @a[tag=10S.LowestMPTarget] remove 10S.LowestMPTarget
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:artifact/1324.mysterious_star/trigger/_index.d
# @private

#> tag
# @within function asset:artifact/1324.mysterious_star/trigger/**
#declare tag 10S.SearchTarget
#declare tag 10S.HighestMP
#declare tag 10S.HighestMPTarget
#declare tag 10S.LowestMP
#declare tag 10S.LowestMPTarget
#declare score_holder $10S.HighestMP
#declare score_holder $10S.LowestMP
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset:artifact/1324.mysterious_star/trigger/find_target
#
#
#
# @within function asset:artifact/1324.mysterious_star/trigger/3.main

# 範囲内の対象の現在MPを取得
# 検索対象:最も現在MPが高いプレイヤー1名, 最も現在MPの低いプレイヤー1名

# 検索対象にTagを付与
tag @a[tag=!PlayerShouldInvulnerable,distance=..20] add 10S.SearchTarget

# 各プレイヤーの現在MPをスコアへ代入
execute as @a[tag=10S.SearchTarget] store result score @s Temporary run function asset:artifact/1324.mysterious_star/trigger/get_mp

# $HighestMP, $LowestMPの初期化
scoreboard players set $10S.HighestMP Temporary 0
scoreboard players set $10S.LowestMP Temporary 2147483647

# 最も多い対象を探す
execute as @a[tag=10S.SearchTarget] run scoreboard players operation $10S.HighestMP Temporary > @s Temporary
execute as @a[tag=10S.SearchTarget] if score @s Temporary = $10S.HighestMP Temporary run tag @s add 10S.HighestMP
tag @r[tag=10S.HighestMP] add 10S.HighestMPTarget

# 最も少ない対象を探す
# 最も多い対象は検索から除外
execute as @a[tag=10S.SearchTarget,tag=!10S.HighestMP] run scoreboard players operation $10S.LowestMP Temporary < @s Temporary
execute as @a[tag=10S.SearchTarget,tag=!10S.HighestMP] if score @s Temporary = $10S.LowestMP Temporary run tag @s add 10S.LowestMP
tag @r[tag=10S.LowestMP] add 10S.LowestMPTarget

# リセット
scoreboard players reset @a[tag=10S.SearchTarget] Temporary
tag @a[tag=10S.SearchTarget] remove 10S.SearchTarget
scoreboard players reset $10S.HighestMP Temporary
scoreboard players reset $10S.LowestMP Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:artifact/1324.mysterious_star/trigger/get_mp
#
#
#
# @within function asset:artifact/1324.mysterious_star/trigger/find_target

# 現在体力を取得
function api:mp/get_current

# 現在体力の10倍を返り値として返す
return run data get storage api: Return.CurrentMP 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1324.mysterious_star/trigger/vfx/
#
#
#
# @within function asset:artifact/1324.mysterious_star/trigger/3.main

# MPが最も多いプレイヤーから低いプレイヤーへ線を伸ばす
execute as @p[tag=10S.HighestMPTarget] at @s facing entity @p[tag=10S.LowestMPTarget] feet positioned ~ ~0.2 ~ run function asset:artifact/1324.mysterious_star/trigger/vfx/recursive
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:artifact/1324.mysterious_star/trigger/vfx/recursive
#
#
#
# @within function
# asset:artifact/1324.mysterious_star/trigger/vfx/
# asset:artifact/1324.mysterious_star/trigger/vfx/recursive

# 演出
particle dust 0.384 0.373 0.953 0.75 ~ ~ ~ 0.25 0.25 0.25 1 0 normal
particle dust 0.384 0.373 0.953 0.75 ^ ^ ^0.5 0.25 0.25 0.25 1 0 normal

# LowestMPTargetが近くにいたら終了
execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @p[tag=10S.LowestMPTarget,dx=0] run return fail

# 再帰
execute if entity @s[distance=..40] positioned ^ ^ ^1 run function asset:artifact/1324.mysterious_star/trigger/vfx/recursive
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/give.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1324.mysterious_star/give/1.trigger",
"asset:artifact/1140.over_pulse_booster/give/1.trigger",
"asset:artifact/1139.over_pulse_legframe/give/1.trigger",
"asset:artifact/1138.over_pulse_bodyarmor/give/1.trigger",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/register.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1324.mysterious_star/register",
"asset:artifact/1137.over_pulse_headgear/register",
"asset:artifact/1228.fatalerror/register",
"asset:artifact/1273.maidchan_plush/register",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/tick.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1324.mysterious_star/trigger/1.trigger",
"asset:artifact/0237.schrodingers_cat/trigger/1.trigger",
"asset:artifact/1057.great_demon_head/tick/1.trigger",
"asset:artifact/1066.weight_stone/tick/1.trigger",
Expand Down