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/1556.bubble_spreader/give/1.trigger
#
# 神器の取得処理の呼び出し時に実行されるfunction
#
# @within tag/function asset:artifact/give

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

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

# 神器のID (int) スプレッドシートの値を入れる
data modify storage asset:artifact ID set value 1556
# 神器のベースアイテム
data modify storage asset:artifact Item set value "minecraft:carrot_on_a_stick"
# 神器の名前 (TextComponentString)
data modify storage asset:artifact Name set value '{"text":"バウンシーバブルスプレッダー","color":"#1290FF"}'
# 神器の説明文 (TextComponentString[])
data modify storage asset:artifact Lore set value ['[{"text":"正面に5つの水泡を生成する","color":"white"}]','[{"text":"水泡は低速だが高い追尾性能を持つ","color":"white"}]','[{"text":"また、水泡は生成後しばらくの間、壁を反射する","color":"white"}]']
# 消費アイテム ({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 "onClick"
# 神器の発動条件 (TextComponentString) (オプション)
# data modify storage asset:artifact Condition set value
# 攻撃に関する情報 -Damage量 (literal[]/literal) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.Damage set value [150x5]
# 攻撃に関する情報 -攻撃タイプ (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.AttackType set value [Magic]
# 攻撃に関する情報 -攻撃属性 (string[]) Wikiを参照 (オプション)
data modify storage asset:artifact AttackInfo.ElementType set value [Water]
# 攻撃に関する情報 -防御無視 (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
# MP必要量 (int) (オプション)
# data modify storage asset:artifact MPRequire set value
# MP回復量 (int)
data modify storage asset:artifact MPHealWhenHit set value 10
# 神器のクールダウン (int) (オプション)
data modify storage asset:artifact LocalCooldown set value 85
# 種別クールダウン ({Type: string, Duration: int}) (オプション)
data modify storage asset:artifact TypeCooldown.Type set value "longRange"
data modify storage asset:artifact TypeCooldown.Duration set value 55
# グローバルクールダウン (int) (オプション)
# data modify storage asset:artifact SpecialCooldown set value
# クールダウンによる使用不可のメッセージを非表示にするか否か (boolean) (オプション)
# data modify storage asset:artifact DisableCooldownMessage set value
# 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 ["Flora","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/1556.bubble_spreader/register
#
# 神器プールへの登録処理
#
# @within tag/function asset:artifact/register

data modify storage asset:artifact RarityRegistry[4] append value [1556]
data modify storage asset:artifact RarityRegistryWithColor.Red[4] append value [1556]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:artifact/1556.bubble_spreader/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:1556} run function asset:artifact/1556.bubble_spreader/trigger/2.check_condition
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:artifact/1556.bubble_spreader/trigger/2.check_condition
#
# 神器の発動条件をチェックします
#
# @within function asset:artifact/1556.bubble_spreader/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/1556.bubble_spreader/trigger/3.main
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#> asset:artifact/1556.bubble_spreader/trigger/3.main
#
# 神器のメイン処理部
#
# @within function asset:artifact/1556.bubble_spreader/trigger/2.check_condition

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

# 演出
playsound block.conduit.activate player @a ~ ~ ~ 0.7 1.5 0

# 弾を5回召喚する
execute anchored eyes positioned ^ ^-0.35 ^0.3 rotated ~ ~-5 run function asset:artifact/1556.bubble_spreader/trigger/summon_object
execute anchored eyes positioned ^ ^-0.35 ^0.3 rotated ~ ~-5 run function asset:artifact/1556.bubble_spreader/trigger/summon_object
execute anchored eyes positioned ^ ^-0.35 ^0.3 rotated ~ ~-5 run function asset:artifact/1556.bubble_spreader/trigger/summon_object
execute anchored eyes positioned ^ ^-0.35 ^0.3 rotated ~ ~-5 run function asset:artifact/1556.bubble_spreader/trigger/summon_object
execute anchored eyes positioned ^ ^-0.35 ^0.3 rotated ~ ~-5 run function asset:artifact/1556.bubble_spreader/trigger/summon_object
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#> asset:artifact/1556.bubble_spreader/trigger/summon_object
#
#
#
# @within function asset:artifact/1556.bubble_spreader/trigger/3.main

#> Private
# @private
#declare tag SpreadMarker

# 前方拡散
summon marker ~ ~ ~ {Tags:["SpreadMarker"]}
data modify storage lib: Argument.Distance set value 2.5
data modify storage lib: Argument.Spread set value 3.0
execute as @e[type=marker,tag=SpreadMarker,distance=..0.01,limit=1] run function lib:forward_spreader/circle

# 弾を召喚
data modify storage api: Argument.ID set value 1165
data modify storage api: Argument.FieldOverride.Damage set value 150f
data modify storage api: Argument.FieldOverride.AdditionalMPHeal set from storage api: PersistentArgument.AdditionalMPHeal
execute store result storage api: Argument.FieldOverride.UserID int 1 run scoreboard players get @s UserID
execute facing entity @e[type=marker,tag=SpreadMarker,distance=..10,limit=1] feet run function api:object/summon

# リセット
kill @e[type=marker,tag=SpreadMarker,distance=..10]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:object/1165.bubble_spreader/detect_hit_block/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1165/detect_hit_block

# 判定(片方は反射用)
execute unless block ^ ^ ^0.5 #lib:no_collision/ run data modify storage asset:context IsHitBlock set value true
execute if score @s General.Object.Tick matches ..15 unless block ^ ^ ^1.0 #lib:no_collision/ run data modify storage asset:context IsHitBlock set value true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/1165.bubble_spreader/detect_hit_entity/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1165/detect_hit_entity

# ヒット検知
execute if score @s General.Object.Tick matches 16.. positioned ~-0.5 ~-0.5 ~-0.5 if entity @e[type=#lib:living_without_player,tag=!Uninterferable,dx=0] run data modify storage asset:context IsHitEntity set value true
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:object/1165.bubble_spreader/hit_block/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1165/hit_block

# General.Object.Tickによって挙動を変える
# ..15 反射
execute if score @s General.Object.Tick matches ..15 run function asset:object/1165.bubble_spreader/hit_block/reflect
# 16.. 消滅
execute if score @s General.Object.Tick matches 16.. run function asset:object/call.m {method:kill}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:object/1165.bubble_spreader/hit_block/reflect
#
# 継承先などから実行される処理
#
# @within asset:object/1165.bubble_spreader/hit_block/

# 実行者を反射軌道で0.1m前進
# 反射距離を何ブロック先が埋まってるかで調整する
execute unless block ^ ^ ^1.0 #lib:no_collision/ run scoreboard players set $Speed Lib 10
execute unless block ^ ^ ^0.5 #lib:no_collision/ run scoreboard players set $Speed Lib 5
function lib:reflection_bullet/
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:object/1165.bubble_spreader/init/
#
# Objectのinit時の処理
#
# @within asset:object/alias/1165/init

# -5..2の範囲でtickを変える
execute store result score @s General.Object.Tick run random value -5..2

# super.init
function asset:object/super.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#> asset:object/1165.bubble_spreader/kill/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1165/kill

#> Private
# @private
#declare score_holder $UserID

# 弾ける無数の泡
particle minecraft:bubble_pop ~ ~ ~ 0.8 0.8 0.8 0.1 90 normal @a
# 泡を包み込む水色のオーラ
particle minecraft:dust_color_transition 0.18 0.45 0.78 1.5 1.0 1.0 1.0 ~ ~ ~ 0.5 0.5 0.5 0 3 normal @a
# ポコポコと弾ける泡の音
playsound minecraft:block.bubble_column.bubble_pop neutral @a ~ ~ ~ 0.5 1.5 0
playsound minecraft:block.bubble_column.bubble_pop neutral @a ~ ~ ~ 0.5 2.0 0
# 弾けた時の水しぶきの音
playsound minecraft:entity.player.splash neutral @a ~ ~ ~ 0.4 2.0 0

# ダメージ
data modify storage api: Argument.Damage set from storage asset:context this.Damage
data modify storage api: Argument.AttackType set value "Magic"
data modify storage api: Argument.ElementType set value "Water"
data modify storage api: Argument.AdditionalMPHeal set from storage asset:context this.AdditionalMPHeal
execute store result score $UserID Temporary run data get storage asset:context this.UserID
execute as @a if score @s UserID = $UserID Temporary run function api:damage/modifier
execute positioned ~-0.5 ~-0.5 ~-0.5 as @e[type=#lib:living_without_player,tag=!Uninterferable,dx=0,limit=1] run function api:damage/
function api:damage/reset

# リセット
scoreboard players reset $UserID Temporary

# 消滅
kill @s
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:object/1165.bubble_spreader/recursive/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/1165/recursive

# 何らかの理由で埋まってたらキルメソッド
execute unless block ~ ~ ~ #lib:no_collision/ unless block ^ ^ ^-0.5 #lib:no_collision/ run return run function asset:object/call.m {method:kill}
# 演出
particle minecraft:dust_color_transition 0.18 0.25 0.58 1 1.0 1.0 1.0 ~ ~ ~ 0 0 0 0 1
particle minecraft:crit ~ ~ ~ 0 0 0 0 1
#particle minecraft:bubble_pop ~ ~ ~ 0.1 0.1 0.1 0 1
#particle minecraft:dust_color_transition 0.18 0.45 0.78 1 1.0 1.0 1.0 ^ ^ ^0.25 0 0 0 0 1
#particle minecraft:bubble_pop ^ ^ ^0.25 0.1 0.1 0.1 0 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#> asset:object/1165.bubble_spreader/register
#
# Objectのデータを指定
#
# @within function asset:object/alias/1165/register

# 継承(オプション)
data modify storage asset:object Extends append value 1
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

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

# 元となるEntityを召喚する
execute as 0-0-0-0-0 in minecraft:overworld positioned as @s run tp @s ~ ~ ~ ~ ~
data modify storage asset:temp Args.Rotation set from entity 0-0-0-0-0 Rotation
function asset:object/1165.bubble_spreader/summon/m with storage asset:temp Args
data remove storage asset:temp Args
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/1165.bubble_spreader/summon/debug
#
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
#
# @user
# @private

# 召喚
data modify storage api: Argument.ID set value 1165
function api:object/summon
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#> asset:object/1165.bubble_spreader/summon/m
#
# マクロで召喚する
#
# @input args:
# Rotation :
# @within function asset:object/1165.bubble_spreader/summon/
# 見た目は仮(泡のテクスチャ作ってもらう予定)
$summon item_display ~ ~ ~ {Tags:["ObjectInit"],Rotation:$(Rotation),item:{id:"minecraft:glass",Count:1b},transformation:{translation:[0f,0f,0f],scale:[0.5f,0.5f,0.5f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},teleport_duration:1}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#> asset:object/1165.bubble_spreader/tick/
#
# Objectのtick時の処理
#
# @within asset:object/alias/1165/tick

# Tick加算
scoreboard players add @s General.Object.Tick 1

# 16..の時、常時追尾
execute if score @s General.Object.Tick matches 16.. run tp @s ~ ~ ~ facing entity @e[type=#lib:living_without_player,tag=Enemy,tag=!Uninterferable,distance=..20,sort=nearest,limit=1] eyes

# super.tick
function asset:object/super.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1165/detect_hit_block
#
# メソッド処理のエイリアス
#
# @within asset_manager:object/call_method/run_method.m

# 元のメソッド処理を呼び出す
function asset:object/1165.bubble_spreader/detect_hit_block/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1165/detect_hit_entity
#
# メソッド処理のエイリアス
#
# @within asset_manager:object/call_method/run_method.m

# 元のメソッド処理を呼び出す
function asset:object/1165.bubble_spreader/detect_hit_entity/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1165/hit_block
#
# メソッド処理のエイリアス
#
# @within asset_manager:object/call_method/run_method.m

# 元のメソッド処理を呼び出す
function asset:object/1165.bubble_spreader/hit_block/
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/object/alias/1165/init.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1165/init
#
# Init処理のエイリアス
#
# @within asset_manager:object/init/init.m

# 元のInit処理を呼び出す
function asset:object/1165.bubble_spreader/init/
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/object/alias/1165/kill.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1165/kill
#
# メソッド処理のエイリアス
#
# @within asset_manager:object/call_method/run_method.m

# 元のメソッド処理を呼び出す
function asset:object/1165.bubble_spreader/kill/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/alias/1165recursive
#
# メソッド処理のエイリアス
#
# @within asset_manager:object/call_method/run_method.m

# 元のメソッド処理を呼び出す
function asset:object/1165.bubble_spreader/recursive/
Loading
Loading