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

🍱 [Mob421-422] シミシミタレット実装 #509

Merged
merged 5 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#> asset:mob/0421.silver_turret/attack/
#
# Mobの攻撃時の処理
#
# @within function asset:mob/alias/421/attack

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

# 演出
playsound entity.blaze.hurt hostile @a ~ ~ ~ 1 0.65

# ダメージ
# 引数の設定
# 与えるダメージ
data modify storage lib: Argument.Damage set value 35.0f
# 第一属性
data modify storage lib: Argument.AttackType set value "Physical"
# 第二属性
data modify storage lib: Argument.ElementType set value "None"
# デスログ
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,9 @@
#> asset:mob/0421.silver_turret/load
#
# Mobに利用するスコアボード等の初期化処理
#
# @within tag/function asset:mob/load

#> 定義類はここに
# @within function asset:mob/0421.silver_turret/**
scoreboard objectives add BP.SummonCount dummy
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#> asset:mob/0421.silver_turret/register
#
# Mobのデータを指定
#
# @within function asset:mob/alias/421/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 421
# 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 3900
# 攻撃力 (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.2
# 索敵範囲 (double) (オプション)
data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
data modify storage asset:mob KnockBackResist set value 0.5
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
# 物理倍率 (float) (オプション)
data modify storage asset:mob Resist.Physical set value 0.8
# 魔法倍率 (float) (オプション)
data modify storage asset:mob Resist.Magic set value 1.4
# 火倍率 (float) (オプション)
data modify storage asset:mob Resist.Fire set value 0.8
# 水倍率 (float) (オプション)
data modify storage asset:mob Resist.Water set value 1
# 雷倍率 (float) (オプション)
data modify storage asset:mob Resist.Thunder set value 1
# フィールド
# 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/0421.silver_turret/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:mob/alias/421/summon

# 元となるEntityを召喚する
summon silverfish ~ ~ ~ {Tags:["MobInit","AntiBurn","AlwaysSlowFall"],Passengers:[{id:"minecraft:item_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:[0f,0.3f,0f],scale:[1f,1f,1f]},item:{id:"minecraft:stick",Count:1b,tag:{CustomModelData:20467}}}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#> asset:mob/0421.silver_turret/summon/debug
#
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
#
# @user
# @private

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

# タレットの位置調整
execute at @s on passengers run tp @s ^ ^ ^ ~ 0

# シミが一定以上ならreturn
execute if score @s BP.SummonCount matches 20.. run return fail

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

# プレイヤーが近くにいる場合シミシミバレット発射!
execute if score @s General.Mob.Tick matches 150.. if entity @a[tag=!PlayerShouldInvulnerable,distance=..16] run function asset:mob/0421.silver_turret/tick/fire
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#> asset:mob/0421.silver_turret/tick/fire
#
# 召喚
#
# @within function asset:mob/0421.silver_turret/tick/

# 召喚
data modify storage api: Argument.ID set value 422
execute positioned ^ ^0.75 ^1 run function api:mob/summon

# 演出
playsound item.trident.return hostile @a ~ ~ ~ 1.0 1.75
playsound block.soul_sand.place hostile @a ~ ~ ~ 1.0 0.8
execute positioned ^ ^0.75 ^1 run particle smoke ~ ~ ~ 0.25 0.25 0.25 0.01 10

# 弾丸発射!
data modify storage lib: Argument.VectorMagnitude set value 1.5
execute positioned ^ ^0.75 ^1 as @e[type=silverfish,scores={MobID=422},distance=..0.01] rotated ~ ~-10 run tp @s ^ ^ ^ ~ ~
execute positioned ^ ^0.75 ^1 as @e[type=silverfish,scores={MobID=422},distance=..0.01] rotated ~ ~-10 run function lib:motion/

# 召喚数記録
scoreboard players add @s BP.SummonCount 1

# リセット
data remove storage lib: Argument
scoreboard players set @s General.Mob.Tick 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#> asset:mob/0422.silver_bullet/attack/
#
# Mobの攻撃時の処理
#
# @within function asset:mob/alias/422/attack

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

# 演出
playsound entity.blaze.hurt hostile @a ~ ~ ~ 1 0.65

# ダメージ
# 引数の設定
# 与えるダメージ
data modify storage lib: Argument.Damage set value 20.0f
# 第一属性
data modify storage lib: Argument.AttackType set value "Physical"
# 第二属性
data modify storage lib: Argument.ElementType set value "None"
# デスログ
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/0422.silver_bullet/register
#
# Mobのデータを指定
#
# @within function asset:mob/alias/422/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 422
# 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 1200
# 攻撃力 (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.2
# 索敵範囲 (double) (オプション)
data modify storage asset:mob FollowRange set value 32
# ノックバック耐性 (double) (オプション)
data modify storage asset:mob KnockBackResist set value 0.5
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
# 物理倍率 (float) (オプション)
data modify storage asset:mob Resist.Physical set value 0.5
# 魔法倍率 (float) (オプション)
data modify storage asset:mob Resist.Magic set value 1
# 火倍率 (float) (オプション)
data modify storage asset:mob Resist.Fire set value 0.75
# 水倍率 (float) (オプション)
data modify storage asset:mob Resist.Water set value 1
# 雷倍率 (float) (オプション)
data modify storage asset:mob Resist.Thunder set value 1
# フィールド
# 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/0422.silver_bullet/summon/
#
# Object召喚処理の呼び出し時に実行されるfunction
#
# @within asset:mob/alias/422/summon

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

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

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

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

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

# 元のTick処理を呼び出す
function asset:mob/0421.silver_turret/tick/
8 changes: 8 additions & 0 deletions Asset/data/asset/functions/mob/alias/422/attack.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#> asset:mob/alias/422/attack
#
# Mobの攻撃時の処理のエイリアス
#
# @within asset_manager:mob/triggers/attack/attack.m

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

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

# 本来の処理を呼び出す
function asset:mob/0422.silver_bullet/summon/
1 change: 1 addition & 0 deletions Asset/data/asset/tags/functions/mob/load.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"values": [
"asset:mob/0421.silver_turret/load",
"asset:mob/0372.tutankhamen/load",
"asset:mob/0380.haruclaire_v3/load",
"asset:mob/0311.blazing_inferno/load",
Expand Down
Loading