Skip to content

Commit 102cec1

Browse files
authored
🍱 [Mob417] アストロスケルトン実装 (#504)
1 parent 441fc3c commit 102cec1

23 files changed

+387
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#> asset:mob/0417.astro_skeleton/attack/
2+
#
3+
# Mobの攻撃時の処理
4+
#
5+
# @within function asset:mob/alias/417/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.925 0.975 0.2 1 ~ ~ ~ 0.5 1 0.5 0 30
12+
playsound entity.blaze.hurt hostile @a ~ ~ ~ 1 0.65
13+
14+
# ダメージ
15+
# 引数の設定
16+
# 与えるダメージ
17+
data modify storage lib: Argument.Damage set value 37.0f
18+
# 第一属性
19+
data modify storage lib: Argument.AttackType set value "Physical"
20+
# 第二属性
21+
data modify storage lib: Argument.ElementType set value "Thunder"
22+
# デスログ
23+
data modify storage lib: Argument.DeathMessage append value '[{"translate": "%1$sは%2$sによって射抜かれた","with":[{"selector":"@s"},{"nbt":"Return.AttackerName","storage":"lib:","interpret":true}]}]'
24+
# 補正functionを実行
25+
function lib:damage/modifier
26+
# ダメージを与える
27+
execute as @p[tag=Victim] at @s run function lib:damage/
28+
# リセット
29+
function lib:damage/reset
30+
31+
# 攻撃力低下エフェクト付与
32+
data modify storage api: Argument set value {ID:51,Duration:200}
33+
function api:global_vars/get_difficulty
34+
execute store result storage api: Argument.Stack int 2 run data get storage api: Return.Difficulty 1
35+
execute as @p[tag=Victim] run function api:entity/mob/effect/give
36+
function api:entity/mob/effect/reset
37+
38+
# 耐性低下エフェクト付与
39+
data modify storage api: Argument set value {ID:57,Duration:200}
40+
function api:global_vars/get_difficulty
41+
execute store result storage api: Argument.Stack int 2 run data get storage api: Return.Difficulty 1
42+
execute as @p[tag=Victim] run function api:entity/mob/effect/give
43+
function api:entity/mob/effect/reset
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#> asset:mob/0417.astro_skeleton/register
2+
#
3+
# Mobのデータを指定
4+
#
5+
# @within function asset:mob/alias/417/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 417
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 {id:"minecraft:bow",Count:1b,tag:{Enchantments:[{id:"punch",lvl:1s}]}}
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 3500
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.2
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/0417.astro_skeleton/summon/
2+
#
3+
# Object召喚処理の呼び出し時に実行されるfunction
4+
#
5+
# @within asset:mob/alias/417/summon
6+
7+
# 元となるEntityを召喚する
8+
summon skeleton ~ ~ ~ {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/0417.astro_skeleton/summon/debug
2+
#
3+
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
4+
#
5+
# @user
6+
# @private
7+
8+
# 召喚
9+
data modify storage api: Argument.ID set value 417
10+
function api:mob/summon
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#> asset:mob/0417.astro_skeleton/tick/
2+
#
3+
# Mobのtick時の処理
4+
#
5+
# @within asset:mob/alias/417/tick
6+
7+
# スコアを増やす
8+
scoreboard players add @s General.Mob.Tick 1
9+
10+
# 100Tick,200Tick時にジャンプ
11+
execute if score @s General.Mob.Tick matches 99 run tp @s ~ ~ ~ facing entity @p[tag=!PlayerShouldInvulnerable,distance=..16,sort=nearest]
12+
execute if score @s General.Mob.Tick matches 100 run function asset:mob/0417.astro_skeleton/tick/jump
13+
execute if score @s General.Mob.Tick matches 199 run tp @s ~ ~ ~ facing entity @p[tag=!PlayerShouldInvulnerable,distance=..16,sort=nearest]
14+
execute if score @s General.Mob.Tick matches 200 run function asset:mob/0417.astro_skeleton/tick/jump
15+
16+
# 300Tick時にテレポート
17+
execute if score @s General.Mob.Tick matches 300.. run function asset:mob/0417.astro_skeleton/tick/teleport
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#> asset:mob/0417.astro_skeleton/tick/jump
2+
#
3+
#
4+
#
5+
# @within function asset:mob/0417.astro_skeleton/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: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#> asset:mob/0417.astro_skeleton/tick/teleport
2+
#
3+
# テレポーターを召喚
4+
#
5+
# @within function asset:mob/0417.astro_skeleton/tick/
6+
7+
# オーバーライドを設定
8+
execute store result storage api: Argument.FieldOverride.MobUUID int 1 run scoreboard players get @s MobUUID
9+
10+
# 召喚
11+
data modify storage api: Argument.ID set value 2170
12+
execute at @a[tag=!PlayerShouldInvulnerable,distance=..64,sort=random,limit=1] run function api:object/summon
13+
14+
# リセット
15+
scoreboard players reset @s General.Mob.Tick
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/alias/417/attack
2+
#
3+
# Mobの攻撃時の処理のエイリアス
4+
#
5+
# @within asset_manager:mob/triggers/attack/attack.m
6+
7+
# 本来の処理を呼び出す
8+
function asset:mob/0417.astro_skeleton/attack/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/alias/417/register
2+
#
3+
# Mobのデータ指定処理のエイリアス
4+
#
5+
# @within asset_manager:mob/triggers/summon/register.m
6+
7+
# 元の登録処理を呼び出す
8+
function asset:mob/0417.astro_skeleton/register
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#> asset:mob/alias/417/summon
2+
#
3+
# Mob召喚処理のエイリアス
4+
#
5+
# @within asset_manager:mob/triggers/summon/summon.m
6+
7+
# 本来の処理を呼び出す
8+
function asset:mob/0417.astro_skeleton/summon/

0 commit comments

Comments
 (0)