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

【Mob420】アストロブレイズ実装 #508

Merged
merged 3 commits into from
Jan 6, 2025
Merged
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
28 changes: 28 additions & 0 deletions Asset/data/asset/functions/mob/0420.astro_blaze/attack/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#> asset:mob/0420.astro_blaze/attack/
#
# Mobの攻撃時の処理
#
# @within function asset:mob/alias/420/attack

# バニラの攻撃じゃなかったら return
execute unless data storage asset:context Attack{IsVanilla:true} run return fail

# 演出
execute as @p[tag=Victim] at @s run particle dust 0.975 0.25 0.2 1 ~ ~ ~ 0.5 1 0.5 0 30

# ダメージ
# 引数の設定
# 与えるダメージ
data modify storage lib: Argument.Damage set value 40.0f
# 第一属性
data modify storage lib: Argument.AttackType set value "Magic"
# 第二属性
data modify storage lib: Argument.ElementType set value "Fire"
# デスログ
data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによって丸焦げにされてしまった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
# 補正functionを実行
function lib:damage/modifier
# ダメージを与える
execute as @p[tag=Victim] at @s run function lib:damage/
# リセット
function lib:damage/reset
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#> asset:mob/0420.astro_blaze/register
#
# Mobのデータを指定
#
# @within function asset:mob/alias/420/register

# 他のモブに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:mob ExtendsSafe set value
# 継承されることを前提とした、抽象的なモブであるかどうか(boolean)
data modify storage asset:mob IsAbstract set value false
# ID (int)
data modify storage asset:mob ID set value 420
# Type (string) Wikiを参照
data modify storage asset:mob Type set value "Enemy"
# 干渉可能か否か (boolean)
data modify storage asset:mob Interferable set value true
# 名前 (TextComponentString) (オプション)
data modify storage asset:mob Name set value '[{"text":"アストロブレイズ","color":"white"}]'
# Mobの説明文 (TextComponentString[]) (オプション)
# data modify storage asset:mob Lore set value
# 武器
# メインハンド (Compound(Item)) (オプション)
# data modify storage asset:mob Weapon.Mainhand set value
# オフハンド (Compound(Item)) (オプション)
# data modify storage asset:mob Weapon.Offhand set value
# 武器ドロップ率 ([float, float]) (オプション)
# data modify storage asset:mob WeaponDropChances set value
# 防具
# 頭 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Head set value
# 胴 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Chest set value
# 脚 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Legs set value
# 足 (Compound(Item)) (オプション)
# data modify storage asset:mob Armor.Feet set value
# 防具ドロップ率 ([float, float]) (オプション)
# data modify storage asset:mob ArmorDropChances set value
# 体力 (double) (オプション)
data modify storage asset:mob Health set value 3200
# 攻撃力 (double) (オプション)
# data modify storage asset:mob AttackDamage set value
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
# data modify storage asset:mob Defense set value
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
# data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
data modify storage asset:mob Speed set value 0.25
# 索敵範囲 (double) (オプション)
data modify storage asset:mob FollowRange set value 64
# ノックバック耐性 (double) (オプション)
data modify storage asset:mob KnockBackResist set value 1
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
# 物理倍率 (float) (オプション)
data modify storage asset:mob Resist.Physical set value 1.2
# 魔法倍率 (float) (オプション)
data modify storage asset:mob Resist.Magic set value 1.2
# 火倍率 (float) (オプション)
data modify storage asset:mob Resist.Fire set value 0.6
# 水倍率 (float) (オプション)
data modify storage asset:mob Resist.Water set value 0.6
# 雷倍率 (float) (オプション)
data modify storage asset:mob Resist.Thunder set value 0.6
# フィールド
# data modify storage asset:mob Field.myValue set value
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/0420.astro_blaze/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:mob/alias/420/summon

# 元となるEntityを召喚する
summon blaze ~ ~ ~ {Tags:["MobInit","AlwaysSlowFall"],Passengers:[{id:"minecraft:block_display",Tags:["AllowProcessingCommonTag","AutoKillWhenDieVehicle"],teleport_duration:1,brightness:{sky:15,block:15},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.375f,-0.6f,-0.375f],scale:[0.75f,0.6f,0.75f]},block_state:{Name:"minecraft:glass"}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:mob/0420.astro_blaze/summon/debug
#
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
#
# @user
# @private

# 召喚
data modify storage api: Argument.ID set value 420
function api:mob/summon
41 changes: 41 additions & 0 deletions Asset/data/asset/functions/mob/0420.astro_blaze/tick/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#> asset:mob/0420.astro_blaze/tick/
#
# Mobのtick時の処理
#
# @within asset:mob/alias/420/tick

# スコア上昇
scoreboard players add @s General.Mob.Tick 1

# 移動
execute if score @s General.Mob.Tick matches 40 run function asset:mob/0420.astro_blaze/tick/jump

# 発射合図
execute if score @s General.Mob.Tick matches 100 run function asset:mob/0420.astro_blaze/tick/pre_bullet
execute if score @s General.Mob.Tick matches 120 run function asset:mob/0420.astro_blaze/tick/pre_bullet
execute if score @s General.Mob.Tick matches 140 run function asset:mob/0420.astro_blaze/tick/pre_bullet

# 発射
execute if score @s General.Mob.Tick matches 161 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 162 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 163 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 164 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 165 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 166 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 167 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 168 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 169 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 170 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 171 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 172 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 173 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 174 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 175 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 176 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 177 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 178 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 179 run function asset:mob/0420.astro_blaze/tick/fire
execute if score @s General.Mob.Tick matches 180 run function asset:mob/0420.astro_blaze/tick/fire

# 一定以上ならスコアをリセットする
execute if score @s General.Mob.Tick matches 200 run scoreboard players set @s General.Mob.Tick 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#> asset:mob/0420.astro_blaze/tick/fire
#
# 発射!!!
#
# @within function asset:mob/0420.astro_blaze/tick/

#> Tags
# @private
#declare tag BO.Marker

# Markerを召喚
execute positioned ~ ~1 ~ run summon marker ~ ~ ~ {Tags:["BO.Marker"]}

# 前方拡散設定
data modify storage lib: Argument.Distance set value 8.0
data modify storage lib: Argument.Spread set value 1.5

# 前方拡散を実行する
execute as @e[type=marker,tag=BO.Marker,distance=..3] at @s facing entity @a[tag=!PlayerShouldInvulnerable,distance=..100,sort=random,limit=1] eyes rotated ~ ~2.5 run function lib:forward_spreader/circle

# 発射
execute positioned ~ ~1 ~ facing entity @e[type=marker,tag=BO.Marker,distance=..15,limit=1] feet run function asset:mob/0420.astro_blaze/tick/summon

# マーカーを戻してあげる
kill @e[type=marker,tag=BO.Marker,distance=..15,limit=1]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:mob/0420.astro_blaze/tick/jump
#
# プレイヤーの方向に移動
#
# @within function asset:mob/0420.astro_blaze/tick/

# 演出
playsound item.trident.return hostile @a ~ ~ ~ 1.0 1.75
playsound block.soul_sand.place hostile @a ~ ~ ~ 1.0 0.8

# 突進する
data modify storage lib: Argument.VectorMagnitude set value 1.5
execute facing entity @p[tag=!PlayerShouldInvulnerable,distance=..64,sort=nearest] eyes run function lib:motion/

# リセット
data remove storage lib: Argument
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/0420.astro_blaze/tick/pre_bullet
#
# 発射合図の演出
#
# @within function asset:mob/0420.astro_blaze/tick/

playsound entity.evoker.prepare_summon hostile @a[distance=..32] ~ ~ ~ 1.5 1.8
particle minecraft:witch ~ ~ ~ 0.5 0 0.5 0.5 30 force @a[distance=..64]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#> asset:mob/0420.astro_blaze/tick/summon
#
# 弾幕召喚
#
# @within function asset:mob/0420.astro_blaze/tick/fire

# オーバーライドを設定
execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @s MobUUID

# 召喚
data modify storage api: Argument.ID set value 2171
function api:object/summon
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/mob/alias/420/attack.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/alias/420/attack
#
# Mobの攻撃時の処理のエイリアス
#
# @within asset_manager:mob/triggers/attack/attack.m

# 本来の処理を呼び出す
function asset:mob/0420.astro_blaze/attack/
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/mob/alias/420/register.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/alias/420/register
#
# Mobのデータ指定処理のエイリアス
#
# @within asset_manager:mob/triggers/summon/register.m

# 元の登録処理を呼び出す
function asset:mob/0420.astro_blaze/register
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/mob/alias/420/summon.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/alias/420/summon
#
# Mob召喚処理のエイリアス
#
# @within asset_manager:mob/triggers/summon/summon.m

# 本来の処理を呼び出す
function asset:mob/0420.astro_blaze/summon/
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/mob/alias/420/tick.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/alias/420/tick
#
# Tick時処理のエイリアス
#
# @within asset_manager:mob/triggers/tick/tick.m

# 元のTick処理を呼び出す
function asset:mob/0420.astro_blaze/tick/
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#> asset:object/2171.astro_blaze_bullet/hit_entity/
#
# 継承先などから実行される処理
#
# @within asset:object/alias/2171/hit_entity

# 引数の設定
# 与えるダメージ
data modify storage api: Argument.Damage set value 30.0f
# 第一属性
data modify storage api: Argument.AttackType set value "Physical"
# 第二属性
data modify storage api: Argument.ElementType set value "Fire"
# デスログ
data modify storage api: Argument.DeathMessage append value '[{"translate": "%1$sの身体は%2$sの弾幕に貫かれてしまった","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"api:","interpret":true}]}]'
# 補正functionを実行
data modify storage api: Argument.MobUUID set from storage asset:context this.MobUUID
function api:damage/modifier_manual
# ダメージを与える
execute positioned ~-0.5 ~-0.5 ~-0.5 as @p[tag=!PlayerShouldInvulnerable,dx=0] run function api:damage/
# リセット
function api:damage/reset

# 消失
function asset:object/call.m {method:kill}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#> asset:object/2171.astro_blaze_bullet/init/
#
# Objectのinit時の処理
#
# @within asset:object/alias/2171/init

# 向きを決定
tp @s ~ ~ ~ ~ ~

# 発射音
playsound entity.blaze.shoot hostile @a[distance=..32] ~ ~ ~ 1 1 0
playsound entity.blaze.shoot hostile @a[distance=..32] ~ ~ ~ 1 0.95 0
playsound block.respawn_anchor.deplete hostile @a[distance=..32] ~ ~ ~ 1 2 0

# 継承元の処理
function asset:object/super.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#> asset:object/2171.astro_blaze_bullet/register
#
# Objectのデータを指定
#
# @within function asset:object/alias/2171/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 2171
# フィールド(オプション)
data modify storage asset:object Field set value {Speed:2,Range:64,MovePerStep:0.3}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:object/2171.astro_blaze_bullet/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:object/alias/2171/summon

# 元となるEntityを召喚する
summon item_display ~ ~ ~ {Tags:["ObjectInit"],billboard:"center",teleport_duration:1,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.5f,0.5f,0.5f]},item:{id:"leather_horse_armor",Count:1b,tag:{display:{color:15767073},CustomModelData:20370}}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:object/2171.astro_blaze_bullet/summon/debug
#
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
#
# @user
# @private

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

# パーティクル
particle flame ~ ~ ~ 0.2 0.2 0.2 0.05 1 force @a[distance=..32]
particle minecraft:dust 1 0.560 0.150 1 ~ ~ ~ 0.2 0.2 0.2 0 1 force @a[distance=..32]

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

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

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

# 元の登録処理を呼び出す
function asset:object/2171.astro_blaze_bullet/register
Loading
Loading