Skip to content

Commit

Permalink
✨ [神器1043] ガンマ・レイの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Dec 29, 2023
1 parent 4f3c6d9 commit a6420ff
Show file tree
Hide file tree
Showing 146 changed files with 13,394 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1043.gamma_ray/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1043
# 神器のベースアイテム
data modify storage asset:artifact Item set value "carrot_on_a_stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"ガンマ・レイ","bold":true,"color":"#ffffe0"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"スニークを解除した瞬間、まばゆい光線を放つ","color":"white","italic":false}','{"text":"溜めれば溜めるほどダメージがあがるだろう","color":"white","italic":false}','{"text":"「なんで みんな 最初に 必殺技を つかわないんだろう」","color":"gray","italic":false}']
# MP以外の消費物 (TextComponentString) (オプション)
# data modify storage asset:artifact CostText set value
# 使用回数 (int) (オプション)
# data modify storage asset:artifact RemainingCount set value
# 神器を発動できるスロット (string) Wikiを参照
data modify storage asset:artifact Slot set value "auto"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onClick"
# 神器の発動条件 (TextComponentString) (オプション)
data modify storage asset:artifact Condition set value '{"text":"スニークしている時"}'
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.Damage set value [200,3080]
# 攻撃に関する情報 -攻撃タイプ (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
# 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.IsRangeAttack set value "condition"
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackRange set value 24
# MP消費量 (int)
data modify storage asset:artifact MPCost set value 75
# MP必要量 (int) (オプション)
# data modify storage asset:artifact MPRequire set value
# 神器のクールダウン (int) (オプション)
data modify storage asset:artifact LocalCooldown set value 300
# グローバルクールダウン (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
# 扱える神 (string[]) Wikiを参照
data modify storage asset:artifact CanUsedGod set value ["Flora","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/1043.gamma_ray/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

data modify storage asset:artifact RarityRegistry[4] append value 1043
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:artifact/1043.gamma_ray/trigger/0.load
#
# 神器に利用するスコアボード等の初期化処理
#
# @within tag/function asset:artifact/load

#> 定義類はここに
# @within function asset:artifact/1043.gamma_ray/trigger/**
scoreboard objectives add SZ.CastTick dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1043.gamma_ray/trigger/1.trigger
#
# 指定したイベントタイミングで実行されるfunction
#
# @within tag/function asset:artifact/**

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

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/auto
# 他にアイテム等確認する場合はここに書く
execute if entity @s[tag=CanUsed,predicate=!lib:is_sneaking] run tellraw @s {"text":"スニーク時以外は発動できません。","color":"red"}
execute unless entity @s[predicate=lib:is_sneaking] run tag @s remove CanUsed
execute if entity @s[tag=SZ.Cast] run tag @s remove CanUsed
# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed] run function asset:artifact/1043.gamma_ray/trigger/3.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#> asset:artifact/1043.gamma_ray/trigger/3.main
#
# 神器のメイン処理部
#
# @within function asset:artifact/1043.gamma_ray/trigger/2.check_condition

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

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

# 発動時のタグとスコア
tag @s add SZ.Cast
scoreboard players set @s SZ.CastTick 0

# スケジュール設定
schedule function asset:artifact/1043.gamma_ray/trigger/4.schedule 1t
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:artifact/1043.gamma_ray/trigger/4.schedule
#
# 1Tick スケジュールによるスニーク検知
#
# @within function
# asset:artifact/1043.gamma_ray/trigger/3.main
# asset:artifact/1043.gamma_ray/trigger/5.casting
# asset:artifact/1043.gamma_ray/trigger/rejoin_process

execute as @a[tag=SZ.Cast] if predicate lib:is_sneaking at @s run function asset:artifact/1043.gamma_ray/trigger/5.casting

execute as @a[tag=SZ.Cast] unless predicate lib:is_sneaking at @s run function asset:artifact/1043.gamma_ray/trigger/6.cast
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:artifact/1043.gamma_ray/trigger/5.1.m
#
# マクロによるVFXの呼び出し
#
# @input args
# Num : VFXのFunction番号
# @within function asset:artifact/1043.gamma_ray/trigger/5.casting

# VFXを呼び出す
$function asset:artifact/1043.gamma_ray/trigger/vfx/fc_$(Num)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#> asset:artifact/1043.gamma_ray/trigger/5.casting
#
# 溜めモーション
#
# @within function asset:artifact/1043.gamma_ray/trigger/4.schedule


# ストレージを設定
execute store result storage asset:temp SZ.Num int 1 run scoreboard players get @s SZ.CastTick

# 演出マクロを呼び出す
execute anchored eyes positioned ^ ^ ^0.5 run function asset:artifact/1043.gamma_ray/trigger/5.1.m with storage asset:temp SZ

# スコアを増やす
scoreboard players add @s SZ.CastTick 1

# スケジュール設定
execute if score @s SZ.CastTick matches ..120 run schedule function asset:artifact/1043.gamma_ray/trigger/4.schedule 1t
execute if score @s SZ.CastTick matches 121 run scoreboard players remove @s SZ.CastTick 1
execute if score @s SZ.CastTick matches 120 run function asset:artifact/1043.gamma_ray/trigger/6.cast

# リセット
data remove storage asset:temp SZ
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#> asset:artifact/1043.gamma_ray/trigger/6.1.loop
#
# 着弾検知ループ
#
# @within function
# asset:artifact/1043.gamma_ray/trigger/6.cast
# asset:artifact/1043.gamma_ray/trigger/6.1.loop

# 着弾検知
execute positioned ~-0.5 ~-0.5 ~-0.5 run tag @e[tag=Enemy,tag=!Uninterferable,dx=0] add SZ.Landing

# 再帰
execute positioned ^ ^ ^0.5 if block ~ ~ ~ #lib:no_collision if entity @s[distance=..24] run function asset:artifact/1043.gamma_ray/trigger/6.1.loop
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#> asset:artifact/1043.gamma_ray/trigger/6.cast
#
# 発射
#
# @within function
# asset:artifact/1043.gamma_ray/trigger/4.schedule
# asset:artifact/1043.gamma_ray/trigger/5.casting

#> val
# @private
#declare score_holder $SZ.Damage

# 着弾検知
execute anchored eyes run function asset:artifact/1043.gamma_ray/trigger/6.1.loop

# ダメージ計算
# 溜め時間:N Tick 溜め時間が長いほど二次関数的にダメージが上がる
# N ^ 2 / 5 + 200
scoreboard players operation $SZ.Damage Temporary = @s SZ.CastTick
scoreboard players operation $SZ.Damage Temporary *= @s SZ.CastTick
scoreboard players operation $SZ.Damage Temporary /= $5 Const
execute store result storage lib: Argument.Damage float 1 run scoreboard players operation $SZ.Damage Temporary += $200 Const

# ダメージ
data modify storage lib: Argument.AttackType set value "Magic"
data modify storage lib: Argument.ElementType set value "None"
function lib:damage/modifier
execute as @e[tag=SZ.Landing,distance=..28] run function lib:damage/

# 演出
execute if score @s SZ.CastTick matches 0..20 anchored eyes run function asset:artifact/1043.gamma_ray/trigger/cast_vfx/1
execute if score @s SZ.CastTick matches 21..40 anchored eyes run function asset:artifact/1043.gamma_ray/trigger/cast_vfx/2
execute if score @s SZ.CastTick matches 41..60 anchored eyes run function asset:artifact/1043.gamma_ray/trigger/cast_vfx/3
execute if score @s SZ.CastTick matches 61..80 anchored eyes run function asset:artifact/1043.gamma_ray/trigger/cast_vfx/4
execute if score @s SZ.CastTick matches 81..100 anchored eyes run function asset:artifact/1043.gamma_ray/trigger/cast_vfx/5
execute if score @s SZ.CastTick matches 101.. anchored eyes run function asset:artifact/1043.gamma_ray/trigger/cast_vfx/6

# 音
playsound entity.lightning_bolt.thunder player @a[distance=..32] ~ ~ ~ 1 2
playsound block.respawn_anchor.deplete player @a[distance=..32] ~ ~ ~ 1 2
playsound block.amethyst_block.resonate player @a[distance=..32] ~ ~ ~ 1 2
execute if score @s SZ.CastTick matches 41.. anchored eyes run playsound block.end_portal.spawn player @a[distance=..32] ~ ~ ~ 0.25 2
execute if score @s SZ.CastTick matches 41.. anchored eyes run playsound item.trident.thunder player @a[distance=..32] ~ ~ ~ 1 2
execute if score @s SZ.CastTick matches 81.. anchored eyes run playsound entity.warden.sonic_boom player @a[distance=..32] ~ ~ ~ 1 2
execute if score @s SZ.CastTick matches 101.. anchored eyes run playsound entity.warden.sonic_boom player @a[distance=..32] ~ ~ ~ 1 1.99

# リセット
function lib:damage/reset
tag @s remove SZ.Cast
tag @e[tag=SZ.Landing,distance=..28] remove SZ.Landing
scoreboard players reset @s SZ.CastTick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1043.gamma_ray/trigger/_index.d
# @private

#> tag
# @within function asset:artifact/1043.gamma_ray/trigger/**
#declare tag SZ.Cast
#declare tag SZ.Landing
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#> asset:artifact/1043.gamma_ray/trigger/cast_vfx/1
#
# 発動演出(Rank1)
#
# @within function asset:artifact/1043.gamma_ray/trigger/6.cast

# Rank1--平面.001
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^24.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^4.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^8.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^12.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^16.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^20 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^21.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^22.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^23.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^1.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^2.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^3.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^5.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^6.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^7.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^9.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^10 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^11.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^13.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^14.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^15.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^17.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^18.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^19.0 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^23.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^3.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^7.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^11.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^15.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^19.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^20.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^21.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^22.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^0.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^1.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^2.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^4.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^5.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^6.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^8.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^9.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^10.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^12.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^13.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^14.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^16.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^17.5 0 0 0 0 1 force @a[distance=..32]
particle dust 100000000 100000000 1 0.5 ^0 ^0 ^18.5 0 0 0 0 1 force @a[distance=..32]
Loading

0 comments on commit a6420ff

Please sign in to comment.