Skip to content
Open
Show file tree
Hide file tree
Changes from all 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/1574.sword_for_knight/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1574
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:carrot_on_a_stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"騎士のための剣","color":"aqua"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['{"text":"使用後2秒の間に受けたダメージを80%カットする。"}','{"text":"もちろんこれで殴ったっていい。"}','{"text":"剣も使いこなしてこそ騎士である。","color":"dark_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 "mainhand"
# 神器のトリガー (string) Wikiを参照
data modify storage asset:artifact Trigger set value "onAttackByMelee"
# 効果が重複可能か否か (boolean) (オプション)
# data modify storage asset:artifact EnableDuplication set value
# 神器の発動条件 (TextComponentString) (オプション)
# data modify storage asset:artifact Condition set value
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.Damage set value [700,900]
# 攻撃に関する情報 -攻撃タイプ (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 1b
# 攻撃に関する情報 -範囲攻撃 (string) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.IsRangeAttack set value 'never'
# 攻撃に関する情報 -攻撃範囲 (literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackRange set value 7
# MP消費量 (int)
data modify storage asset:artifact MPCost set value 30
# 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 40
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
data modify storage asset:artifact TypeCooldown.Type set value "shortRange"
data modify storage asset:artifact TypeCooldown.Duration set value 40
# 第二種別クールダウン ({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 40
Comment on lines +59 to +60

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コレはGCDではないかな~~~

# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
data modify storage asset:artifact DisableCooldownMessage set value 1b
# MP不足による使用不可のメッセージを非表示にするか否か (boolean) (オプション)
# data modify storage asset:artifact DisableMPMessage set value
# 破壊時の音を鳴らさないかどうか (boolean) (オプション)
# data modify storage asset:artifact DisableBreakSound set value
# 扱える神 (string[]) Wikiを参照
data modify storage asset:artifact CanUsedGod set value ["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,8 @@
#> asset:artifact/1574.sword_for_knight/onclick/0.load
#
# 神器に利用するスコアボード等の初期化処理
#
# @within tag/function asset:artifact/load

#> 定義類はここに
# @public
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#> asset:artifact/1574.sword_for_knight/onclick/1.trigger
#
# @within tag/function asset:artifact/click.carrot_on_a_stick

execute if data storage asset:context id{mainhand:1574} run function asset:artifact/1574.sword_for_knight/onclick/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1574.sword_for_knight/onclick/2.check_condition
#
# @within function asset:artifact/1574.sword_for_knight/onclick/1.trigger

# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/mainhand
# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed] run function asset:artifact/1574.sword_for_knight/onclick/3.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:artifact/1574.sword_for_knight/onclick/3.main
#
# 神器のメイン処理部
#
# @within function asset:artifact/1574.sword_for_knight/onclick/2.check_condition

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

# ここから先は神器側の効果の処理を書く
#演出
playsound minecraft:block.bell.use player @s ~ ~ ~ 1 2
# 防御
tag @s add 1574used
data modify storage api: Argument.ID set value 1175
execute positioned ~ ~ ~ run function api:object/summon
Comment on lines +14 to +16

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tagの使い方が健全ではなさそうなので、後々色々説明したい
あとpositioned ~ ~ ~は特に座標をずらさない場合は不要かな

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#> asset:artifact/1574.sword_for_knight/onclick/_index.d
# @private

#> tag
# @within function asset:artifact/1574.sword_for_knight/onclick/**
#declare tag 1574used

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

命名規則に沿うと、1574.Used、かな

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:artifact/1574.sword_for_knight/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

data modify storage asset:artifact RarityRegistry[4] append value [1574]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1574.sword_for_knight/trigger/1.trigger
#
# 指定したイベントタイミングで実行されるfunction
#
# @within tag/function asset:artifact/**

# storage asset:idのmainhandに装備している神器のIDが入っているので比較し、~/2.check_condition.mcfunctionを実行する
execute if data storage asset:context id{mainhand:1574} run function asset:artifact/1574.sword_for_knight/trigger/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:artifact/1574.sword_for_knight/trigger/2.check_condition
#
# 神器の発動条件をチェックします
#
# @within function asset:artifact/1574.sword_for_knight/trigger/1.trigger
# 神器の基本的な条件の確認を行うfunction、成功している場合CanUsedタグが付く
function asset:artifact/common/check_condition/mainhand
# 他にアイテム等確認する場合はここに書く

# CanUsedタグをチェックして3.main.mcfunctionを実行する
execute if entity @s[tag=CanUsed] run function asset:artifact/1574.sword_for_knight/trigger/3.main

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

何も演出ないけど仕様?
仮に意図していたとしても、演出なしは流石に避けてほしいかな~

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#> asset:artifact/1574.sword_for_knight/trigger/3.main
#
# 神器のメイン処理部
#
# @within function asset:artifact/1574.sword_for_knight/trigger/2.check_condition

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

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

# ダメージ代入
execute store result storage api: Argument.Damage float 1 run random value 700..900
# 属性
data modify storage api: Argument.AttackType set value "Physical"
data modify storage api: Argument.ElementType set value "None"
data modify storage api: Argument.FixedDamage set value 1b
data modify storage asset:artifact AttackInfo.BypassResist set value 1b
function api:damage/modifier
# ダメージを与える
execute as @e[type=#lib:living_without_player,tag=Victim,distance=..7] run function api:damage/

# リセット
function api:damage/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#> asset:object/1175.timer_of_sword_for_knight/_index.d
# @private

#> tag
# @within function asset:object/1175.timer_of_sword_for_knight/**
#declare tag 1574used
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#> asset:object/1175.timer_of_sword_for_knight/init/
#
# Objectのinit時の処理
#
# @within asset:object/alias/1175/init
#寿命
scoreboard players set @s 1175.Timer 40
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:object/1175.timer_of_sword_for_knight/load
#
# Objectに利用するスコアボード等の初期化処理
#
# @within tag/function asset:object/load

#> 定義類はここに
# @within function asset:object/1175.timer_of_sword_for_knight/**
scoreboard objectives add 1175.Timer dummy
Comment on lines +7 to +9

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General.Object.Tickを使えば良さそうな気がする

Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:object/1175.timer_of_sword_for_knight/register
#
# Objectのデータを指定
#
# @within function asset:object/alias/1175/register

# 継承(オプション)
# data modify storage asset:object Extends append value
# function asset:object/extends
# 他のObjectに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:object ExtendsSafe set value
# 継承されることを前提とした、抽象的なObjectであるかどうか(boolean)
data modify storage asset:object IsAbstract set value false
# Tickするかどうか(boolean) (オプション)
data modify storage asset:object IsTicking set value true

# ID (int)
data modify storage asset:object ID set value 1175
# フィールド(オプション)
# data modify storage asset:object Field.myValue set value
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1175.timer_of_sword_for_knight/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:object/alias/1175/summon

# 元となるEntityを召喚する
summon item_display ~ ~ ~ {Tags:["ObjectInit"]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/1175.timer_of_sword_for_knight/summon/debug
#
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
#
# @user
# @private

# 召喚
data modify storage api: Argument.ID set value 1175
function api:object/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:object/1175.timer_of_sword_for_knight/tick/
#
# Objectのtick時の処理
#
# @within asset:object/alias/1175/tick

# 寿命カウント
scoreboard players remove @s 1175.Timer 1
execute as @s at @e[type=player,tag=1574used,distance=..0.25] run tp @s ~ ~ ~
#演出
execute if score @s 1175.Timer matches 15 run playsound minecraft:block.bell.resonate player @e[type=player,tag=1574used,distance=..0.25] ~ ~ ~ 1 2
# 消滅処理
execute if score @s 1175.Timer matches 0 run tag @e[type=player,tag=1574used,distance=..0.25] remove 1574used
kill @s[scores={1175.Timer=..0}]
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/object/alias/1175/init.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1175/init
#
# Init処理のエイリアス
#
# @within asset_manager:object/init/init.m

# 元のInit処理を呼び出す
function asset:object/1175.timer_of_sword_for_knight/init/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1175/register
#
# Objectのデータ指定処理のエイリアス
#
# @within asset_manager:object/summon/register.m

# 元の登録処理を呼び出す
function asset:object/1175.timer_of_sword_for_knight/register
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1175/summon
#
# Object召喚処理のエイリアス
#
# @within asset_manager:object/summon/summon.m

# 元の召喚処理を呼び出す
function asset:object/1175.timer_of_sword_for_knight/summon/
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/object/alias/1175/tick.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1175/tick
#
# Tick時処理のエイリアス
#
# @within asset_manager:object/tick/tick.m

# 元のTick処理を呼び出す
function asset:object/1175.timer_of_sword_for_knight/tick/
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/attack/melee.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1574.sword_for_knight/trigger/1.trigger",
"asset:artifact/1269.apocalypse/trigger/1.trigger",
"asset:artifact/1209.sinful_scythe/trigger/1.trigger",
"asset:artifact/1282.ice_axe/trigger/1.trigger",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1574.sword_for_knight/onclick/1.trigger",
"asset:artifact/1332.bebebeam/trigger/1.trigger",
"asset:artifact/1306.will_o_wisp/trigger/1.trigger",
"asset:artifact/1144.cradle_of_azure_moon/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/1574.sword_for_knight/give/1.trigger",
"asset:artifact/1562.tsukimi_dango/give/1.trigger",
"asset:artifact/1430.shield_of_fate/give/1.trigger",
"asset:artifact/1453.frost_flake_bow/give/1.trigger",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/load.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1574.sword_for_knight/onclick/0.load",
"asset:artifact/1453.frost_flake_bow/trigger/0.load",
"asset:artifact/1332.bebebeam/trigger/0.load",
"asset:artifact/1252.fox_candle/trigger/0.load",
Expand Down
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/artifact/register.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:artifact/1574.sword_for_knight/register",
"asset:artifact/1562.tsukimi_dango/register",
"asset:artifact/1453.frost_flake_bow/register",
"asset:artifact/1430.shield_of_fate/register",
Expand Down
3 changes: 2 additions & 1 deletion Asset/data/asset/tags/functions/object/load.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:object/1175.timer_of_sword_for_knight/load",
"asset:object/1061.azure_jelly/load",
"asset:object/2251.wall_laser_clock/load",
"asset:object/2212.eclael_upper_shot/load",
Expand Down Expand Up @@ -58,4 +59,4 @@
"asset:object/1059.book_of_hero/load",
"asset:object/2031.giant_pumpkin/load"
]
}
}
Loading