Skip to content

Commit

Permalink
✨ [神器1070] 血を喰らう恐怖を作成 (#94)
Browse files Browse the repository at this point in the history
Co-authored-by: はいいろ <[email protected]>
  • Loading branch information
quikku and haiiro2gou authored May 2, 2024
1 parent fd13912 commit ed6fbc0
Show file tree
Hide file tree
Showing 24 changed files with 259 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1070.blood_eater/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1070
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"血を喰らう恐怖","color":"dark_red","bold":true,"italic":true}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"赤い騎士の象徴","color":"dark_red"}','{"text":"被ダメ時、5秒間攻撃力が25%増加する","color":"dark_red"}','{"text":"ただし発動時、追加でダメージを受ける","color":"dark_red"}']
# 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 "hotbar"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onDamage"
# 神器の発動条件 (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
# 神器のクールダウン (int) (オプション)
data modify storage asset:artifact LocalCooldown set value 100
# グローバルクールダウン (int) (オプション)
# data modify storage asset:artifact SpecialCooldown set value
# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
data modify storage asset:artifact DisableCooldownMessage set value false
# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション)
# data modify storage asset:artifact DisableMPMessage set value
# 扱える神 (string[]) Wikiを参照
data modify storage asset:artifact CanUsedGod set value ["Urban","Nyaptov","Wi-ki","Rumor"]
# カスタム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,8 @@
#> asset:artifact/1070.blood_eater/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:[1070]} run function asset:artifact/1070.blood_eater/trigger/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:artifact/1070.blood_eater/trigger/2.check_condition
#
# 神器の発動条件をチェックします
#
# @within function asset:artifact/1070.blood_eater/trigger/1.trigger

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

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

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

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

# particle
particle landing_lava ~ ~1 ~ 0.1 0.5 0.1 0 100
particle block redstone_block ~ ~1 ~ 0 0 0 1 20

# 音
playsound minecraft:entity.blaze.death player @a ~ ~ ~ 1 1
playsound minecraft:entity.breeze.death player @a ~ ~ ~ 1 1

# 自身に5の防御貫通ダメージを与える
# ダメージ量
data modify storage lib: Argument.Damage set value 5.0f
# 第一属性
data modify storage lib: Argument.AttackType set value "Physical"
# 補正をしない
data modify storage lib: Argument.FixedDamage set value true
# 死亡メッセージ
data modify storage lib: Argument.DeathMessage set value ['[{"translate": "%1$sは血を喰らう恐怖に殺された。","with":[{"selector":"@s"}]}]']
# ダメージ
function lib:damage/modifier
execute as @s[tag=!PlayerShouldInvulnerable] run function lib:damage/
# リセット
function lib:damage/reset

# エフェクトを付与
data modify storage api: Argument.ID set value 219
function api:entity/mob/effect/give
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:effect/0219.blood_eater/_/end
#
# Effectの効果の終了時に実行されるfunction
#
# @within tag/function asset:effect/end

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

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

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

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

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

# 補正削除
function asset:effect/0219.blood_eater/modifier/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0219.blood_eater/given/
#
# Effectが付与された時の処理
#
# @within function asset:effect/0219.blood_eater/_/given

# 補正付与
function asset:effect/0219.blood_eater/modifier/add
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#> asset:effect/0219.blood_eater/modifier/add
#
#
#
# @within function
# asset:effect/0219.blood_eater/given/

# 攻撃補正を付与
data modify storage api: Argument.UUID set value [I;1,3,219,0]
data modify storage api: Argument.Amount set value 0.25
data modify storage api: Argument.Operation set value "multiply"
function api:modifier/attack/base/add

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:effect/0219.blood_eater/modifier/remove
#
#
#
# @within function
# asset:effect/0219.blood_eater/remove/
# asset:effect/0219.blood_eater/end/

# 攻撃補正を削除
data modify storage api: Argument.UUID set value [I;1,3,219,0]
function api:modifier/attack/base/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset:effect/0219.blood_eater/register
#
# Effectのデータを指定
#
# @within function asset:effect/0219.blood_eater/_/register

# ExtendsSafe (boolean) (default = false)
data modify storage asset:effect ExtendsSafe set value true
# ID (int)
data modify storage asset:effect ID set value 219
# 名前 (TextComponentString)
data modify storage asset:effect Name set value '{"text":"血を喰らう恐怖","color":"dark_red"}'
# 説明文 (TextComponentString[])
data modify storage asset:effect Description set value ['{"text":"攻撃力が上昇する"}']
# 効果時間 (int) (default = API || error)
data modify storage asset:effect Duration set value 100
# スタック (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 remove
# 消すのに必要なレベル (int) (default = 1)
data modify storage asset:effect RequireClearLv set value 3

# フィールド
# data modify storage asset:effect Field.myValue set value
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:effect/0219.blood_eater/remove/
#
# Effectが削除された時の処理
#
# @within function asset:effect/0219.blood_eater/_/remove

# 補正削除
function asset:effect/0219.blood_eater/modifier/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:effect/0219.blood_eater/tick/
#
# Effectのtick処理
#
# @within function asset:effect/0219.blood_eater/_/tick

# 演出
execute if predicate lib:random_pass_per/10 run particle landing_lava ~ ~1 ~ 0.1 0.2 0.1 0 5
execute if predicate lib:random_pass_per/30 run particle dust 0.400 0.000 0.000 1.3 ~ ~1 ~ 1 1 1 1 1 normal
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/damage.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1070.blood_eater/trigger/1.trigger",
"asset:artifact/1051.blue_crystal_of_stardust/trigger/1.trigger",
"asset:artifact/0920.dal_i_thalion/trigger/1.trigger",
"asset:artifact/0247.heavenly_herb/trigger/1.trigger",
Expand Down
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/1070.blood_eater/give/1.trigger",
"asset:artifact/1081.wandering_piece_of_dream/give/1.trigger",
"asset:artifact/1080.allochromatic_empty/give/1.trigger",
"asset:artifact/1079.allochromatic/give/1.trigger",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/effect/end.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"asset:effect/0212.lunatic_moon/_/end",
"asset:effect/0213.reflecting_sky/_/end",
"asset:effect/0214.quick_charge/_/end",
"asset:effect/0219.blood_eater/_/end",
"asset:effect/0220.dream_of_burning_butterfly/_/end",
"asset:effect/0231.wandering_dream/_/end",
"asset:effect/0605.aurora_corrosion/_/end",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/effect/given.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"asset:effect/0212.lunatic_moon/_/given",
"asset:effect/0213.reflecting_sky/_/given",
"asset:effect/0214.quick_charge/_/given",
"asset:effect/0219.blood_eater/_/given",
"asset:effect/0220.dream_of_burning_butterfly/_/given",
"asset:effect/0231.wandering_dream/_/given",
"asset:effect/0608.sinking/_/given",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/effect/register.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"asset:effect/0212.lunatic_moon/_/register",
"asset:effect/0213.reflecting_sky/_/register",
"asset:effect/0214.quick_charge/_/register",
"asset:effect/0219.blood_eater/_/register",
"asset:effect/0220.dream_of_burning_butterfly/_/register",
"asset:effect/0228.rubeus_resonance/_/register",
"asset:effect/0229.sapphirus_resonance/_/register",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/effect/remove.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"asset:effect/0212.lunatic_moon/_/remove",
"asset:effect/0213.reflecting_sky/_/remove",
"asset:effect/0214.quick_charge/_/remove",
"asset:effect/0219.blood_eater/_/remove",
"asset:effect/0220.dream_of_burning_butterfly/_/remove",
"asset:effect/0231.wandering_dream/_/remove",
"asset:effect/0605.aurora_corrosion/_/remove",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/effect/tick.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"asset:effect/0212.lunatic_moon/_/tick",
"asset:effect/0213.reflecting_sky/_/tick",
"asset:effect/0214.quick_charge/_/tick",
"asset:effect/0219.blood_eater/_/tick",
"asset:effect/0220.dream_of_burning_butterfly/_/tick",
"asset:effect/0228.rubeus_resonance/_/tick",
"asset:effect/0229.sapphirus_resonance/_/tick",
Expand Down

0 comments on commit ed6fbc0

Please sign in to comment.