Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 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,9 @@
#> asset:artifact/1311.yearning_rose/damage_from_entity/0.load
#
# 神器に利用するスコアボード等の初期化処理
#
# @within tag/function asset:artifact/load

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

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

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

# バニラ攻撃の場合はCanUsedを削除
execute if data storage asset:context Damage{IsVanilla:1b} run tag @s remove CanUsed

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

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

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

# 演出
execute as @e[type=#lib:living_without_player,tag=Attacker,distance=..64,limit=1] at @s run function asset:artifact/1311.yearning_rose/damage_from_entity/vfx

# カウンター
function asset:artifact/1311.yearning_rose/damage_from_entity/damage

# 回復
function asset:artifact/1311.yearning_rose/damage_from_entity/heal
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#> asset:artifact/1311.yearning_rose/damage_from_entity/damage
#
#
#
# @within function asset:artifact/1311.yearning_rose/damage_from_entity/3.main

#> Private
# @private
#declare score_holder $Damage
#declare score_holder $DamageMax

# カウンターダメージ(e1)
execute store result score $Damage Temporary run data get storage asset:context Damage.Amount 300

# ダメージ上限(e1)
scoreboard players set $DamageMax Temporary 20000

# ダメージ
execute store result storage api: Argument.Damage float 0.1 run scoreboard players operation $Damage Temporary < $DamageMax Temporary
data modify storage api: Argument.AttackType set value "Physical"
data modify storage api: Argument.ElementType set value "None"
function api:damage/modifier
execute as @e[type=#lib:living_without_player,tag=Attacker,distance=..64,limit=1] run function api:damage/
function api:damage/reset

# リセット
scoreboard players reset $Damage Temporary
scoreboard players reset $DamageMax Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#> asset:artifact/1311.yearning_rose/damage_from_entity/heal
#
#
#
# @within function asset:artifact/1311.yearning_rose/damage_from_entity/3.main

#> Private
# @private
#declare score_holder $Heal
#declare score_holder $HealMax

# 被ダメ比例回復量(e1)
execute store result score $Heal Temporary run data get storage asset:context Damage.Amount 3

# 回復上限(e1)
scoreboard players set $HealMax Temporary 200

# 回復
execute store result storage api: Argument.Heal float 0.1 run scoreboard players operation $Heal Temporary < $HealMax Temporary
data modify storage api: Argument.Metadata set value "10F.Heal"
function api:heal/modifier
function api:heal/
function api:heal/reset

# リセット
scoreboard players reset $Heal Temporary
scoreboard players reset $HealMax Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#> asset:artifact/1311.yearning_rose/damage_from_entity/vfx
#
#
#
# @within function asset:artifact/1311.yearning_rose/damage_from_entity/3.main

# particle
particle block redstone_block ~ ~1.2 ~ 0.4 0.4 0.4 0 30 normal @a

# playsound
playsound entity.player.hurt_sweet_berry_bush player @a ~ ~ ~ 0.5 0.7
playsound entity.player.hurt_sweet_berry_bush player @a ~ ~ ~ 0.5 0.6
playsound minecraft:entity.spider.step player @a ~ ~ ~ 0.5 1

# 演出用Object召喚
# 使用者の方を向いて召喚する
data modify storage api: Argument.ID set value 1152
execute store result storage api: Argument.FieldOverride.TargetMobUUID int 1 run scoreboard players get @s MobUUID
execute facing entity @p[tag=this] feet run function api:object/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1311.yearning_rose/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1311
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"渇望する薔薇","color":"dark_red"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"translate":"-%1$s被ダメージ量の30倍のダメージを攻撃者に与える(最大2000)","with":[{"text":"\\u0002","font":"space"}]}','{"translate":"-%1$s被ダメージ量の%2$s分体力を回復する(最大20)","with":[{"text":"\\u0002","font":"space"},{"text":"30%"}]}','{"translate":"-%1$sこの回復効果で累計50回復するたび","with":[{"text":"\\u0002","font":"space"}]}','{"translate":"%1$s%2$sと%3$sを15秒間得る","with":[{"text":"\\u0008","font":"space"},{"text":"攻撃+10%","color":"green"},{"text":"与回復量+10%","color":"green"}]}','{"text":"血を吸い深紅に咲いた薔薇の一輪","color":"gray"}','{"text":"尽きぬ渇きのまま、更なる血を求め根を伸ばす","color":"gray"}']
# 消費アイテム ({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 "offhand"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onDamageFromEntity"
# 効果が重複可能か否か (boolean) (オプション)
# data modify storage asset:artifact EnableDuplication set value
# 神器の発動条件 (TextComponentString) (オプション)
data modify storage asset:artifact Condition set value '{"text":"属性攻撃で被ダメージ","color":"white"}'
# 神器の最大発動回数 (int) (オプション)
data modify storage asset:artifact PartsMax set value 1
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.Damage set value [0,2000]
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Physical]
# 攻撃に関する情報 -攻撃属性 (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 "never"
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
# data modify storage asset:artifact AttackInfo.AttackRange set value
# MP消費量 (int)
data modify storage asset:artifact MPCost set value 40
# MP必要量 (int) (オプション)
# data modify storage asset:artifact MPRequire set value
# MP回復量 (int)
# data modify storage asset:artifact MPHealWhenHit set value
# 神器のクールダウン (int) (オプション)
data modify storage asset:artifact LocalCooldown set value 200
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
# data modify storage asset:artifact TypeCooldown.Type set value
# data modify storage asset:artifact TypeCooldown.Duration set value
# 第二種別クールダウン ({Type: string, Duration: int}) (オプション)
# data modify storage asset:artifact SecondaryTypeCooldown.Type set value
# data modify storage asset:artifact SecondaryTypeCooldown.Duration set value
# グローバルクールダウン (int) (オプション)
# data modify storage asset:artifact SpecialCooldown set value
# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
data modify storage asset:artifact DisableCooldownMessage set value true
# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション)
data modify storage asset:artifact DisableMPMessage set value true
# 破壊時の音を鳴らさないかどうか (boolean) (オプション)
# data modify storage asset:artifact DisableBreakSound set value
# 扱える神 (string[]) Wikiを参照
data modify storage asset:artifact CanUsedGod set value ["Flora", "Urban", "Nyaptov", "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,7 @@
#> asset:artifact/1311.yearning_rose/receive_heal/1.trigger
#
#
#
# @within tag/function asset:artifact/**

execute if data storage asset:context id{offhand:1311} run function asset:artifact/1311.yearning_rose/receive_heal/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#> asset:artifact/1311.yearning_rose/receive_heal/2.check_condition
#
#
#
# @within function asset:artifact/1311.yearning_rose/receive_heal/1.trigger

#> Private
# @private
#declare score_holder $Heal

# Metadataがなければ失敗
execute unless data storage asset:context ReceiveHeal{Metadata:"10F.Heal"} run return fail

# 回復量を取得
execute store result score $Heal Temporary run data get storage asset:context ReceiveHeal.Amount 10
execute run scoreboard players operation @s 10F.HealSum += $Heal Temporary

# 回復量の合計が一定以上なら発動
execute if score @s 10F.HealSum matches 400.. run function asset:artifact/1311.yearning_rose/receive_heal/3.main

# リセット
scoreboard players reset $Heal Temporary
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#> asset:artifact/1311.yearning_rose/receive_heal/3.main
#
#
#
# @within function asset:artifact/1311.yearning_rose/receive_heal/2.check_condition

# 演出
execute rotated ~ 0 positioned ~ ~0.25 ~ run function asset:artifact/1311.yearning_rose/receive_heal/vfx/1
execute rotated ~ 0 positioned ~ ~0.2 ~ run function asset:artifact/1311.yearning_rose/receive_heal/vfx/2
playsound entity.player.hurt_sweet_berry_bush player @a ~ ~ ~ 0.5 0.7
playsound entity.player.hurt_sweet_berry_bush player @a ~ ~ ~ 0.5 0.6
playsound minecraft:entity.spider.step player @a
playsound ogg:random.levelup player @a ~ ~ ~ 0.6 1.7
#playsound ogg:random.levelup player @a ~ ~ ~ 0.6 1.6

# 調整班用数値設定箇所
# 効果時間は長めがいいな~とか
# 効果時間
data modify storage api: Argument.Duration set value 300
# 攻撃補正
data modify storage api: Argument.FieldOverride.AttackModifier set value 0.1
# 与回復補正
data modify storage api: Argument.FieldOverride.HealModifier set value 0.1

# バフ
data modify storage api: Argument.ID set value 340
function api:entity/mob/effect/give
function api:entity/mob/effect/reset

# リセット
scoreboard players reset @s 10F.HealSum
Loading