Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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/1465.versatile_plasma/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1465
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:ender_eye"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text": "ヴァースティル・プラズマ", "color": "#D4FFBA"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text": "チャージ段階に応じて異なる方法で攻撃する。"}', '{"text": "チャージを2層重ねると25、3層重ねると追加で35のMPを消費する。"}']
# 消費アイテム ({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 [30, 300]
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Physical]
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.ElementType set value [Thunder]
# 攻撃に関する情報 -防御無視 (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
# MP必要量 (int) (オプション)
# data modify storage asset:artifact MPRequire set value
# MP回復量 (int)
data modify storage asset:artifact MPHealWhenHit set value 5
# 神器のクールダウン (int) (オプション)
data modify storage asset:artifact LocalCooldown set value 100
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
data modify storage asset:artifact TypeCooldown.Type set value "longRange"
data modify storage asset:artifact TypeCooldown.Duration set value 50
# グローバルクールダウン (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", "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/1465.versatile_plasma/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

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

# チャージ段階のEffect取得
data modify storage api: Argument.ID set value 374
function api:entity/mob/effect/get/from_id
# チャージ中ならば強制的にチャージ続行
execute if data storage api: Return.Effect run return run function asset:artifact/1465.versatile_plasma/trigger/charge

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

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

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

# チャージ用Effectを付与
data modify storage api: Argument.ID set value 374
function api:entity/mob/effect/give
function api:entity/mob/effect/reset

# 演出
playsound block.iron_door.open player @a ~ ~ ~ 2 0.5
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:artifact/1465.versatile_plasma/trigger/charge
#
#
#
# @within function asset:artifact/1465.versatile_plasma/trigger/2.check_condition

# チャージ用Effectを付与
data modify storage api: Argument.ID set value 374
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/374.charge_plasma/_/end
#
# Effectの効果の終了時に実行されるfunction
#
# @within tag/function asset:effect/end

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

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

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

# スタック数に応じてそれぞれの攻撃処理を実行
execute if data storage asset:context {Stack:1} run function asset:effect/374.charge_plasma/end/attack/1/
execute if data storage asset:context {Stack:2} anchored eyes positioned ^ ^-0.25 ^ run function asset:effect/374.charge_plasma/end/attack/2
execute if data storage asset:context {Stack:3} run function asset:effect/374.charge_plasma/end/attack/3/
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#> asset:effect/374.charge_plasma/end/attack/1
#
# 攻撃(ため1段階):スパーク
#
# @within function asset:effect/374.charge_plasma/end/**

#> Private
# @within function asset:effect/374.charge_plasma/end/attack/**
#declare score_holder $rec

# 36回実行
scoreboard players set $rec Temporary 36

# 向いている方向に確定で一個だす
data modify storage api: Argument.ID set value 1168
data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
execute anchored eyes positioned ^ ^ ^2.5 run function api:object/summon

# 本体
execute anchored eyes run function asset:effect/374.charge_plasma/end/attack/1/rec

# リセット
scoreboard players reset $rec
data remove storage asset:temp Args
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:effect/374.charge_plasma/end/attack/1/m
#
# Object 1168を召喚
#
# @within function asset:effect/374.charge_plasma/end/attack/1/rec

data modify storage api: Argument.ID set value 1168
data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
$execute positioned ^$(OffsetX) ^$(OffsetY) ^$(OffsetZ) run function api:object/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:effect/374.charge_plasma/end/attack/1/rec
#
# 再帰処理
#
# @within function asset:effect/374.charge_plasma/end/attack/1/**

# rec減算
scoreboard players remove $rec Temporary 1

# ランダムなoffsetを設定
execute store result storage asset:temp Args.OffsetX float 0.1 run random value -20..20
execute store result storage asset:temp Args.OffsetY float 0.1 run random value -5..5
execute store result storage asset:temp Args.OffsetZ float 0.1 run random value 5..35

# マクロでObject召喚
function asset:effect/374.charge_plasma/end/attack/1/m with storage asset:temp Args

# 再帰
execute if score $rec Temporary matches 1.. run function asset:effect/374.charge_plasma/end/attack/1/rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#> asset:effect/374.charge_plasma/end/attack/2
#
# プラズマ攻撃2: 拡散レーザー
#
# @within function asset:effect/374.charge_plasma/end/**

# 3発撃つ
data modify storage api: Argument.ID set value 1169
data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
execute rotated ~-30 ~ run function api:object/summon

data modify storage api: Argument.ID set value 1169
data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
execute rotated ~ ~ run function api:object/summon

data modify storage api: Argument.ID set value 1169
data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
execute rotated ~30 ~ run function api:object/summon

# 演出
playsound block.respawn_anchor.deplete player @a ~ ~ ~ 2 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:effect/374.charge_plasma/end/attack/3/
#
# 攻撃3: 貫通レーザー
#
# @within function asset:effect/374.charge_plasma/end/**

#> Private
# @within function asset:effect/374.charge_plasma/end/attack/3/**
#declare tag Hit
#declare tag HitTarget

# 再帰処理
execute anchored eyes run function asset:effect/374.charge_plasma/end/attack/3/rec
tag @s remove Hit
tag @e[tag=HitTarget,distance=..20] remove HitTarget

# 演出
playsound ogg:block.vault.open_shutter master @a ~ ~ ~ 2 2
playsound ogg:block.vault.break master @a ~ ~ ~ 1 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#> asset:effect/374.charge_plasma/end/attack/3/damage
#
#
#
# @within function asset:effect/374.charge_plasma/end/attack/3/rec


# ヒット済みタグ
execute positioned ~-0.5 ~-0.5 ~-0.5 run tag @e[type=#lib:living_without_player,tag=!Uninterferable,dx=0,limit=1] add HitTarget

# ダメージ
data modify storage api: Argument.Damage set value 300
data modify storage api: Argument.AttackType set value "Physical"
data modify storage api: Argument.ElementType set value "Thunder"
data modify storage api: Argument.AdditionalMPHeal set value 5
function api:damage/modifier
execute positioned ~-0.5 ~-0.5 ~-0.5 as @e[type=#lib:living_without_player,tag=!Uninterferable,dx=0,limit=1] run function api:damage/
function api:damage/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:effect/374.charge_plasma/end/attack/3/rec
#
#
#
# @within function asset:effect/374.charge_plasma/end/attack/3/**

# 着弾検知
execute unless block ^ ^ ^0.5 #lib:no_collision/ run tag @s add Hit

# 命中
execute positioned ~-0.5 ~-0.5 ~-0.5 if entity @e[type=#lib:living_without_player,tag=!HitTarget,tag=!Uninterferable,dx=0,limit=1] run function asset:effect/374.charge_plasma/end/attack/3/damage

# 演出
particle dust 0.8 1.0 0.5 1.0 ~ ~ ~ 0.0 0.0 0.0 1 1
particle dust 0.5 1.0 0.5 1.5 ~ ~ ~ 0.0 0.0 0.0 1 1
particle dust 0.8 0.8 0.3 0.5 ~ ~ ~ 0.0 0.0 0.0 1 1

# 再起
execute positioned ^ ^ ^0.5 if entity @s[tag=!Hit,distance=..20] run function asset:effect/374.charge_plasma/end/attack/3/rec
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#> asset:effect/374.charge_plasma/re-given/
#
# Effectが上書きされた時の処理
#
# @within function asset:effect/374.charge_plasma/_/re-given

#> Private
# @private
#declare score_holder $Charge
#declare score_holder $MP

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

# MPを取得
function api:mp/get_current
execute store result score $MP Temporary run data get storage api: Return.CurrentMP

# Field.Chargeを+1
execute store result storage asset:context this.Charge int 1 run scoreboard players add $Charge Temporary 1

# 時間に応じてバフをスタック
execute if data storage asset:context {Stack:1} if score $Charge Temporary matches 25.. if score $MP Temporary matches 25.. run function asset:effect/374.charge_plasma/re-given/charge/2
execute if data storage asset:context {Stack:2} if score $Charge Temporary matches 50.. if score $MP Temporary matches 35.. run function asset:effect/374.charge_plasma/re-given/charge/3

# リセット
scoreboard players reset $Charge
scoreboard players reset $MP
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:effect/374.charge_plasma/re-given/charge/2
#
#
#
# @within function asset:effect/374.charge_plasma/re-given/

# スタック数を増やす
data modify storage asset:context Stack set value 2

# MP消費
data modify storage api: Argument.Fluctuation set value -25
data modify storage api: Argument.DisableLog set value 1b
function api:mp/fluctuation

# 演出
playsound block.piston.extend player @a ~ ~ ~ 2 2
particle dust 0.8 1.0 0.5 2.0 ~ ~ ~ 0.5 1.0 0.5 1 8
particle dust 0.5 1.0 0.5 2.5 ~ ~ ~ 0.5 1.0 0.5 1 8
particle dust 0.8 0.8 0.3 1.5 ~ ~ ~ 0.5 1.0 0.5 1 8
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:effect/374.charge_plasma/re-given/charge/3
#
#
#
# @within function asset:effect/374.charge_plasma/re-given/

# スタック数を増やす
data modify storage asset:context Stack set value 3

# MP消費
data modify storage api: Argument.Fluctuation set value -35
data modify storage api: Argument.DisableLog set value 1b
function api:mp/fluctuation

# 演出
playsound block.piston.extend player @a ~ ~ ~ 2 2
playsound block.trial_spawner.detect_player player @a ~ ~ ~ 2 0.5
particle dust 0.8 1.0 0.5 2.0 ~ ~ ~ 0.5 1.0 0.5 1 8
particle dust 0.5 1.0 0.5 2.5 ~ ~ ~ 0.5 1.0 0.5 1 8
particle dust 0.8 0.8 0.3 1.5 ~ ~ ~ 0.5 1.0 0.5 1 8
Loading
Loading