Skip to content

Commit 37f1dbe

Browse files
authored
🍱 [Mob418] アストロゾンビを実装 (#506)
1 parent fb00a45 commit 37f1dbe

File tree

10 files changed

+191
-0
lines changed

10 files changed

+191
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#> asset:mob/0418.astro_zombie/attack/
2+
#
3+
# Mobの攻撃時の処理
4+
#
5+
# @within function asset:mob/alias/418/attack
6+
7+
# バニラの攻撃じゃなかったら return
8+
execute unless data storage asset:context Attack{IsVanilla:true} run return fail
9+
10+
# 演出
11+
execute as @p[tag=Victim] at @s run particle dust 0.975 0.2 0.2 1 ~ ~ ~ 0.5 1 0.5 0 30
12+
playsound entity.blaze.shoot hostile @a ~ ~ ~ 1 1.4
13+
14+
# ダメージ
15+
# 引数の設定
16+
# 与えるダメージ(経過時間によって変化)
17+
execute if score @s General.Mob.Tick matches ..500 run data modify storage lib: Argument.Damage set value 45.0f
18+
execute if score @s General.Mob.Tick matches 501..1000 run data modify storage lib: Argument.Damage set value 50.0f
19+
execute if score @s General.Mob.Tick matches 1001.. run data modify storage lib: Argument.Damage set value 55.0f
20+
# 第一属性
21+
data modify storage lib: Argument.AttackType set value "Physical"
22+
# 第二属性
23+
data modify storage lib: Argument.ElementType set value "Fire"
24+
# デスログ
25+
data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによって殴り倒された","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
26+
# 補正functionを実行
27+
function lib:damage/modifier
28+
# ダメージを与える
29+
execute as @p[tag=Victim] at @s run function lib:damage/
30+
# リセット
31+
function lib:damage/reset
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#> asset:mob/0418.astro_zombie/register
2+
#
3+
# Mobのデータを指定
4+
#
5+
# @within function asset:mob/alias/418/register
6+
7+
# 他のモブに継承されることを許可するか (boolean) (オプション)
8+
# data modify storage asset:mob ExtendsSafe set value
9+
# 継承されることを前提とした、抽象的なモブであるかどうか(boolean)
10+
data modify storage asset:mob IsAbstract set value false
11+
# ID (int)
12+
data modify storage asset:mob ID set value 418
13+
# Type (string) Wikiを参照
14+
data modify storage asset:mob Type set value "Enemy"
15+
# 干渉可能か否か (boolean)
16+
data modify storage asset:mob Interferable set value true
17+
# 名前 (TextComponentString) (オプション)
18+
data modify storage asset:mob Name set value '[{"text":"アストロスケルトン","color":"white"}]'
19+
# Mobの説明文 (TextComponentString[]) (オプション)
20+
# data modify storage asset:mob Lore set value
21+
# 武器
22+
# メインハンド (Compound(Item)) (オプション)
23+
# data modify storage asset:mob Weapon.Mainhand set value
24+
# オフハンド (Compound(Item)) (オプション)
25+
# data modify storage asset:mob Weapon.Offhand set value
26+
# 武器ドロップ率 ([float, float]) (オプション)
27+
# data modify storage asset:mob WeaponDropChances set value
28+
# 防具
29+
# 頭 (Compound(Item)) (オプション)
30+
data modify storage asset:mob Armor.Head set value {id:"minecraft:glass",Count:1b}
31+
# 胴 (Compound(Item)) (オプション)
32+
data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:14737632},Trim:{material:"minecraft:quartz",pattern:"minecraft:coast"},Unbreakable:1b}}
33+
# 脚 (Compound(Item)) (オプション)
34+
data modify storage asset:mob Armor.Legs set value {id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:14737632},Trim:{material:"minecraft:quartz",pattern:"minecraft:coast"},Unbreakable:1b}}
35+
# 足 (Compound(Item)) (オプション)
36+
data modify storage asset:mob Armor.Feet set value {id:"minecraft:leather_boots",Count:1b,tag:{display:{color:14737632},Trim:{material:"minecraft:quartz",pattern:"minecraft:coast"},Unbreakable:1b}}
37+
# 防具ドロップ率 ([float, float]) (オプション)
38+
# data modify storage asset:mob ArmorDropChances set value
39+
# 体力 (double) (オプション)
40+
data modify storage asset:mob Health set value 3900
41+
# 攻撃力 (double) (オプション)
42+
# data modify storage asset:mob AttackDamage set value
43+
# 防御力 (double) (オプション) // 被ダメージがある程度大きい場合1ptにつき0.8%カット、小さい場合1ptにつき約4%カット 20pt以上は頭打ち
44+
# data modify storage asset:mob Defense set value
45+
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
46+
# data modify storage asset:mob SpecialDefense set value
47+
# 移動速度 (double) (オプション)
48+
data modify storage asset:mob Speed set value 0.25
49+
# 索敵範囲 (double) (オプション)
50+
data modify storage asset:mob FollowRange set value 32
51+
# ノックバック耐性 (double) (オプション)
52+
data modify storage asset:mob KnockBackResist set value 0.5
53+
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
54+
# 物理倍率 (float) (オプション)
55+
data modify storage asset:mob Resist.Physical set value 0.75
56+
# 魔法倍率 (float) (オプション)
57+
data modify storage asset:mob Resist.Magic set value 0.75
58+
# 火倍率 (float) (オプション)
59+
data modify storage asset:mob Resist.Fire set value 1
60+
# 水倍率 (float) (オプション)
61+
data modify storage asset:mob Resist.Water set value 1
62+
# 雷倍率 (float) (オプション)
63+
data modify storage asset:mob Resist.Thunder set value 1
64+
# フィールド
65+
# data modify storage asset:mob Field.myValue set value
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/0418.astro_zombie/summon/
2+
#
3+
# Object召喚処理の呼び出し時に実行されるfunction
4+
#
5+
# @within asset:mob/alias/418/summon
6+
7+
# 元となるEntityを召喚する
8+
summon zombie ~ ~ ~ {Tags:["MobInit","AntiBurn","AlwaysSlowFall"]}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#> asset:mob/0418.astro_zombie/summon/debug
2+
#
3+
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
4+
#
5+
# @user
6+
# @private
7+
8+
# 召喚
9+
data modify storage api: Argument.ID set value 418
10+
function api:mob/summon
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#> asset:mob/0418.astro_zombie/tick/
2+
#
3+
# Mobのtick時の処理
4+
#
5+
# @within asset:mob/alias/418/tick
6+
7+
#> score
8+
# @private
9+
#declare score_holder $BM.Temp
10+
11+
# スコアを増やす
12+
scoreboard players add @s General.Mob.Tick 1
13+
14+
# スコアによって移動速度を増加
15+
execute if score @s General.Mob.Tick matches 501 run effect give @s speed infinite 0 true
16+
execute if score @s General.Mob.Tick matches 1001 run effect give @s speed infinite 1 true
17+
18+
# 強化演出
19+
execute if score @s General.Mob.Tick matches 501..1000 run particle dust 0.975 0.8 0.2 0.75 ~ ~1 ~ 0.5 1 0.5 0 2
20+
execute if score @s General.Mob.Tick matches 1001.. run particle dust 0.975 0.2 0.2 0.75 ~ ~1 ~ 0.5 1 0.5 0 2
21+
22+
# 100Tickごとにジャンプ
23+
scoreboard players operation $BM.Temp Temporary = @s General.Mob.Tick
24+
scoreboard players operation $BM.Temp Temporary %= $100 Const
25+
execute if score $BM.Temp Temporary matches 0 run tp @s ~ ~ ~ facing entity @p[tag=!PlayerShouldInvulnerable,distance=..16,sort=nearest]
26+
execute if score $BM.Temp Temporary matches 0 run function asset:mob/0418.astro_zombie/tick/jump
27+
28+
# リセット
29+
scoreboard players reset $BM.Temp Temporary
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#> asset:mob/0418.astro_zombie/tick/jump
2+
#
3+
#
4+
#
5+
# @within function asset:mob/0418.astro_zombie/tick/
6+
7+
# 演出
8+
playsound item.trident.return hostile @a ~ ~ ~ 1.0 1.75
9+
playsound block.soul_sand.place hostile @a ~ ~ ~ 1.0 0.8
10+
11+
# 突進する
12+
data modify storage lib: Argument.VectorMagnitude set value 1
13+
execute facing entity @p[tag=!PlayerShouldInvulnerable,distance=..16,sort=nearest] feet rotated ~ ~-25 run function lib:motion/
14+
15+
# リセット
16+
data remove storage lib: Argument
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/alias/418/attack
2+
#
3+
# Mobの攻撃時の処理のエイリアス
4+
#
5+
# @within asset_manager:mob/triggers/attack/attack.m
6+
7+
# 本来の処理を呼び出す
8+
function asset:mob/0418.astro_zombie/attack/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/alias/418/register
2+
#
3+
# Mobのデータ指定処理のエイリアス
4+
#
5+
# @within asset_manager:mob/triggers/summon/register.m
6+
7+
# 元の登録処理を呼び出す
8+
function asset:mob/0418.astro_zombie/register
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/alias/418/summon
2+
#
3+
# Mob召喚処理のエイリアス
4+
#
5+
# @within asset_manager:mob/triggers/summon/summon.m
6+
7+
# 本来の処理を呼び出す
8+
function asset:mob/0418.astro_zombie/summon/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/alias/418/tick
2+
#
3+
# Tick時処理のエイリアス
4+
#
5+
# @within asset_manager:mob/triggers/tick/tick.m
6+
7+
# 元のTick処理を呼び出す
8+
function asset:mob/0418.astro_zombie/tick/

0 commit comments

Comments
 (0)