Skip to content

Commit

Permalink
神器2002-2003 火雷を作成
Browse files Browse the repository at this point in the history
  • Loading branch information
haiiro2gou committed Aug 18, 2022
1 parent 237157f commit ea1618e
Show file tree
Hide file tree
Showing 41 changed files with 600 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:sacred_treasure/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:sacred_treasure ID set value 2002
# 神器のベースアイテム
data modify storage asset:sacred_treasure Item set value "minecraft:carrot_on_a_stick"
# 神器の名前 (TextComponentString)
data modify storage asset:sacred_treasure Name set value '{"text":"火雷 -納刀-","color":"yellow","bold":false}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:sacred_treasure Lore set value ['{"text":"正面に凄まじい疾さで居合を放つ。","italic":false}','{"text":"\\"其れは総てを貫く雷。\\"","color":"gray","italic":false}']
# MP以外の消費物 (TextComponentString) (オプション)
# data modify storage asset:sacred_treasure CostText set value
# 使用回数 (int) (オプション)
data modify storage asset:sacred_treasure RemainingCount set value 1
# 神器を発動できるスロット (string) Wikiを参照
data modify storage asset:sacred_treasure Slot set value "mainhand"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:sacred_treasure Trigger set value "onClick"
# 神器の発動条件 (TextComponentString) (オプション)
data modify storage asset:sacred_treasure Condition set value '{"text":"スニーク中かつ前回の抜刀から15秒以上経過"}'
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
data modify storage asset:sacred_treasure AttackInfo.Damage set value [400,1200]
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:sacred_treasure AttackInfo.AttackType set value [Physical]
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
data modify storage asset:sacred_treasure AttackInfo.ElementType set value [Thunder,None]
# 攻撃に関する情報 -防御無視 (boolean) Wikiを参照 (オプション)
# data modify storage asset:sacred_treasure AttackInfo.BypassResist set value
# 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション)
data modify storage asset:sacred_treasure AttackInfo.IsRangeAttack set value every
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
# data modify storage asset:sacred_treasure AttackInfo.AttackRange set value
# MP消費量 (int)
data modify storage asset:sacred_treasure MPCost set value 60
# MP必要量 (int) (オプション)
# data modify storage asset:sacred_treasure MPRequire set value
# 神器のクールダウン (int) (オプション)
data modify storage asset:sacred_treasure LocalCooldown set value 300
# グローバルクールダウン (int) (オプション)
# data modify storage asset:sacred_treasure SpecialCooldown set value
# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
data modify storage asset:sacred_treasure DisableCooldownMessage set value true
# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション)
# data modify storage asset:sacred_treasure DisableMPMessage set value
# 扱える神 (string[]) Wikiを参照
data modify storage asset:sacred_treasure CanUsedGod set value ['Urban','Nyaptov']
# カスタムNBT (NBTCompound) 追加で指定したいNBT (オプション)
# data modify storage asset:sacred_treasure CustomNBT set value {}

# 神器の入手用function
function asset:sacred_treasure/common/give
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:sacred_treasure/register

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

#> 定義類はここに
# @within function
# asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/**
# asset:sacred_treasure/2003.blazing_thunder_drawn/trigger/**
scoreboard objectives add 1JM.ChargeTime dummy
scoreboard objectives add 1JM.CoolTime dummy
scoreboard objectives add 1JM.IaiTime dummy
scoreboard objectives add 1JM.UserID dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/1.trigger
#
# 指定したイベントタイミングで実行されるfunction
#
# @within tag/function asset:sacred_treasure/**

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

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:sacred_treasure/common/check_condition/mainhand
# 他にアイテム等確認する場合はここに書く

# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed,predicate=lib:is_sneaking] unless score @s 1JM.CoolTime matches 1.. run function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/3.main
execute if entity @s[tag=CanUsed,tag=!1JM.InCooldown,predicate=lib:is_sneaking] if score @s 1JM.CoolTime matches 1.. run tellraw @s [{"text":"手が痺れている...","color":"red"}]
execute if entity @s[tag=CanUsed,predicate=lib:is_sneaking] if score @s 1JM.CoolTime matches 1.. run tag @s add 1JM.InCooldown
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/3.main
#
# 神器のメイン処理部
#
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/2.check_condition

# 基本的な使用時の処理(MP消費や使用回数の処理など)を行う
function asset:sacred_treasure/common/use/mainhand
tag @s remove 1JM.InCooldown

# 居合抜き
scoreboard players set @s 1JM.IaiTime 3

# 抜刀する
data modify storage api: Argument.ID set value 2003
function api:sacred_treasure/give/from_id
scoreboard players set @s 1JM.ChargeTime 200
scoreboard players set @s 1JM.CoolTime 300
playsound block.beacon.activate player @a ~ ~ ~ 1 2

# ループ起動
function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/_index.d
# @private

#> tag
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/**
#declare tag 1JM.InCooldown
#declare tag 1JM.Owner
#declare tag 1JM.Rush
#declare tag 1JM.RushInit

#> score_holder
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/**
#declare score_holder $RandomDamage
#declare score_holder $801
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/
#
# 居合切りの処理
#
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop

# 移動処理
execute if score @s 1JM.IaiTime matches 3 run function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/1.summon
tag @s add 1JM.Owner
function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/3.teleport

# 演出
function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/3.1.particle

# 攻撃処理
# 1段目
# 与ダメージ
data modify storage lib: Argument.Damage set value 400.0f
# 属性
data modify storage lib: Argument.AttackType set value "Physical"
data modify storage lib: Argument.ElementType set value "None"
# ダメージ
function lib:damage/modifier
execute as @e[type=#lib:living,tag=Enemy,tag=!Uninterferable,distance=..2] positioned ^ ^ ^ run function lib:damage/
# 2段目
# 801を定義
scoreboard players set $801 Temporary 801
# 乱数を取得
execute store result score $RandomDamage Temporary run function lib:random/
scoreboard players operation $RandomDamage Temporary %= $801 Temporary
# 与ダメージ
scoreboard players add $RandomDamage Temporary 0
execute store result storage lib: Argument.Damage int 1 run scoreboard players get $RandomDamage Temporary
# 属性
data modify storage lib: Argument.AttackType set value "Physical"
data modify storage lib: Argument.ElementType set value "Thunder"
# ダメージ
function lib:damage/modifier_continuation
execute as @e[type=#lib:living,tag=Enemy,tag=!Uninterferable,distance=..5] positioned ^ ^ ^ run function lib:damage/

# リセット
tag @s remove 1JM.Owner
scoreboard players reset $801 Temporary
scoreboard players reset $RandomDamage Temporary
function lib:damage/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/1.summon
#
# 居合抜き用のマーカー召喚
#
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/

# 召喚
summon armor_stand ~ ~ ~ {Invisible:1b,Tags:["Friend","Projectile","1JM.Rush","1JM.RushInit"]}
scoreboard players operation @e[type=armor_stand,tag=1JM.RushInit] 1JM.UserID = @s UserID
tag @s add 1JM.Owner
execute as @e[type=armor_stand,tag=1JM.RushInit,sort=nearest,limit=1] at @s run function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/2.init
tag @s remove 1JM.Owner
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/2.init
#
# 居合抜きマーカーの初期化
#
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/1.summon

# プレイヤー向きにTP
execute at @p[tag=1JM.Owner] run tp @s ^ ^ ^-0.01 facing entity @p[tag=1JM.Owner] feet

# Motion付与
data modify storage lib: Argument.VectorMagnitude set value 9
execute as @s at @s facing entity @p[tag=1JM.Owner] feet run function lib:motion/
data remove storage lib: Argument

# リセット
tag @s remove 1JM.RushInit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/3.1.particle
#
# TP演出
#
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/

particle dust 1 1 0 1 ~ ~0.2 ~ 1 0.4 1 0 100
particle minecraft:large_smoke ~ ~ ~ 0 0 0 0.4 10
playsound entity.lightning_bolt.thunder player @a ~ ~ ~ 0.5 2 0
playsound entity.lightning_bolt.impact player @a ~ ~ ~ 0.5 0 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/3.teleport
#
# プレイヤーをマーカーにTPさせる
#
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/

execute as @e[tag=1JM.Rush] at @s if score @s 1JM.UserID = @p[tag=1JM.Owner] UserID run tp @p[tag=1JM.Owner] ~ ~ ~
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/4.kill
#
# 使い終わったマーカーの処理
#
# @within function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop

tag @s add 1JM.Owner
execute as @e[type=armor_stand,tag=1JM.Rush] if score @s 1JM.UserID = @p[tag=1JM.Owner] UserID run kill @s
tag @s remove 1JM.Owner
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/rejoin_process
#
# 使い方は必ずwikiを見ること
#
# @within tag/function asset:rejoin

# ループ
execute if entity @a[scores={1JM.IaiTime=1..}] run schedule function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop 1t replace
execute if entity @a[scores={1JM.ChargeTime=0..}] run schedule function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop 1t replace
execute if entity @a[scores={1JM.CoolTime=1..}] run schedule function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop 1t replace

tag @a remove 1JM.InCooldown
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#> asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop
#
# ループ処理
#
# @within function
# asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/3.main
# asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop
# asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/rejoin_process

# 居合抜き
execute as @a[scores={1JM.IaiTime=1..}] at @s run function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/
execute as @a[scores={1JM.IaiTime=1..}] at @s run scoreboard players remove @s 1JM.IaiTime 1
execute as @a[scores={1JM.IaiTime=..0}] at @s run function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/iai/4.kill
execute as @a[scores={1JM.IaiTime=..0}] at @s run scoreboard players reset @s 1JM.IaiTime

# 抜刀
execute as @a[scores={1JM.ChargeTime=1..}] at @s run scoreboard players remove @s 1JM.ChargeTime 1
execute as @a[scores={1JM.ChargeTime=1..}] at @s run particle dust 1 1 0 1 ~ ~0.4 ~ 0.7 0.7 0.7 0 7
execute as @a[scores={1JM.ChargeTime=..0}] at @s unless score @s 1JN.CoolTime matches 1.. run function asset:sacred_treasure/2003.blazing_thunder_drawn/trigger/3.main

# CT
execute as @a[scores={1JM.CoolTime=1..}] at @s run scoreboard players remove @s 1JM.CoolTime 1
execute as @a[scores={1JM.CoolTime=..0}] at @s run scoreboard players reset @s 1JM.CoolTime

# ループ
execute if entity @a[scores={1JM.IaiTime=1..}] run schedule function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop 1t replace
execute if entity @a[scores={1JM.ChargeTime=0..}] run schedule function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop 1t replace
execute if entity @a[scores={1JM.CoolTime=1..}] run schedule function asset:sacred_treasure/2002.blazing_thunder_sheathed/trigger/schedule_loop 1t replace
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:sacred_treasure/2003.blazing_thunder_drawn/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:sacred_treasure/give

execute if data storage asset:context {id:2003} run function asset:sacred_treasure/2003.blazing_thunder_drawn/give/2.give
Loading

0 comments on commit ea1618e

Please sign in to comment.