Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ [神器1070] 血を喰らう恐怖を作成 #94

Merged
merged 7 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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/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/0920.dal_i_thalion/trigger/1.trigger",
"asset:artifact/0801.red_secret_stone/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/0900.pure_water_bracelet/give/1.trigger",
"asset:artifact/0772.dolphin_amulet/give/1.trigger",
"asset:artifact/0702.bright_lamp/give/1.trigger",
Expand Down
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/end.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/0219.blood_eater/_/end"
]
}
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/given.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/0219.blood_eater/_/given"
]
}
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/register.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/0219.blood_eater/_/register"
]
}
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/remove.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/0219.blood_eater/_/remove"
]
}
2 changes: 1 addition & 1 deletion Asset/data/asset/tags/functions/effect/tick.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"values": [

"asset:effect/0219.blood_eater/_/tick"
]
}
Loading