Skip to content

Commit 0b18de8

Browse files
authored
Merge pull request #503 from ProjectTSB/dev/haiiro_mob415
2 parents 3537f98 + a7a91c6 commit 0b18de8

30 files changed

+251
-107
lines changed

Asset/data/asset/functions/mob/0027.skull_sniper/0.load.mcfunction

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#> asset:mob/0027.skull_sniper/_index.d
2+
# @private
3+
4+
#> temp
5+
# @within function asset:mob/0027.skull_sniper/tick/**
6+
#declare score_holder $R.Temp
7+
8+
#> target
9+
# @within function asset:mob/0027.skull_sniper/tick/**
10+
#declare tag R.Target

Asset/data/asset/functions/mob/0027.skull_sniper/register.mcfunction

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
#> asset:mob/0027.skull_sniper/register
2-
# @within asset:mob/alias/27/register
2+
#
3+
# Mobのデータを指定
4+
#
5+
# @within function asset:mob/alias/27/register
36

7+
# 他のモブに継承されることを許可するか (boolean) (オプション)
8+
data modify storage asset:mob ExtendsSafe set value true
9+
# 継承されることを前提とした、抽象的なモブであるかどうか(boolean)
10+
data modify storage asset:mob IsAbstract set value false
411
# ID (int)
512
data modify storage asset:mob ID set value 27
613
# Type (string) Wikiを参照
@@ -13,7 +20,7 @@
1320
# メインハンド (Compound(Item)) (オプション)
1421
data modify storage asset:mob Weapon.Mainhand set value {id:"minecraft:carrot_on_a_stick",Count:1b,tag:{CustomModelData:212}}
1522
# オフハンド (Compound(Item)) (オプション)
16-
data modify storage asset:mob Weapon.Offhand set value {}
23+
# data modify storage asset:mob Weapon.Offhand set value {}
1724
# 武器ドロップ率 ([float, float]) (オプション)
1825
# data modify storage asset:mob WeaponDropChances set value
1926
# 防具
@@ -22,9 +29,9 @@
2229
# 胴 (Compound(Item)) (オプション)
2330
data modify storage asset:mob Armor.Chest set value {id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:2377487}}}
2431
# 脚 (Compound(Item)) (オプション)
25-
data modify storage asset:mob Armor.Legs set value {}
32+
# data modify storage asset:mob Armor.Legs set value {}
2633
# 足 (Compound(Item)) (オプション)
27-
data modify storage asset:mob Armor.Feet set value {}
34+
# data modify storage asset:mob Armor.Feet set value {}
2835
# 防具ドロップ率 ([float, float]) (オプション)
2936
# data modify storage asset:mob ArmorDropChances set value
3037
# 体力 (double) (オプション)
@@ -52,3 +59,6 @@
5259
data modify storage asset:mob Resist.Water set value 1
5360
# 雷倍率 (float) (オプション)
5461
data modify storage asset:mob Resist.Thunder set value 1
62+
# フィールド
63+
data modify storage asset:mob Field.Damage set value 22
64+
data modify storage asset:mob Field.Pierce set value 0

Asset/data/asset/functions/mob/0027.skull_sniper/tick/.mcfunction

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@
44
#
55
# @within function asset:mob/alias/27/tick
66

7-
# 発泡後は正数になるまでスコアを増やす。
8-
execute positioned ^ ^ ^30 unless entity @p[gamemode=!spectator,distance=..30] run scoreboard players add @s[scores={R.Attackcool=..0}] R.Attackcool 1
9-
# 視点先にプレイヤーがいたらスコアを増やす
10-
execute positioned ^ ^ ^30 if entity @p[gamemode=!spectator,distance=..30] run scoreboard players add @s R.Attackcool 1
11-
# プレイヤーに警告を吐く
12-
execute if entity @s[scores={R.Attackcool=1..}] positioned ^ ^ ^30 if entity @p[gamemode=!spectator,distance=..30] positioned ^ ^ ^-30 positioned ~ ~1.5 ~0 facing entity @p[gamemode=!spectator,distance=..30] eyes run function asset:mob/0027.skull_sniper/tick/2.3.check
13-
# 視点先にいない場合諦める
14-
execute positioned ^ ^ ^30 unless entity @p[gamemode=!spectator,distance=..30] run scoreboard players reset @s[scores={R.Attackcool=1..}] R.Attackcool
7+
# 状態制御
8+
execute if score @s General.Mob.Tick matches 0 run function asset:mob/0027.skull_sniper/tick/select/
159

16-
# 発泡処理
17-
execute if score @s R.Attackcool matches 90 positioned ~ ~1.5 ~ facing entity @p[gamemode=!spectator,distance=..30] eyes run function asset:mob/0027.skull_sniper/tick/2.1.shot
18-
tag @s[tag=Landing,scores={R.Attackcool=90}] remove Landing
19-
scoreboard players set @s[scores={R.Attackcool=90}] R.Attackcool -80
10+
# 攻撃処理
11+
execute if score @s General.Mob.Tick matches 0.. anchored eyes run function asset:mob/0027.skull_sniper/tick/attack/
12+
13+
# 加算
14+
scoreboard players add @s General.Mob.Tick 1

Asset/data/asset/functions/mob/0027.skull_sniper/tick/2.1.shot.mcfunction

Lines changed: 0 additions & 22 deletions
This file was deleted.

Asset/data/asset/functions/mob/0027.skull_sniper/tick/2.2.hit.mcfunction

Lines changed: 0 additions & 30 deletions
This file was deleted.

Asset/data/asset/functions/mob/0027.skull_sniper/tick/2.3.check.mcfunction

Lines changed: 0 additions & 20 deletions
This file was deleted.

Asset/data/asset/functions/mob/0027.skull_sniper/tick/_index.d.mcfunction

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/
2+
#
3+
# 攻撃処理
4+
#
5+
# @within asset:mob/0027.skull_sniper/tick/
6+
7+
# タグ付与を試みる
8+
execute store result score $R.Temp Temporary run data get storage asset:context this.Target.ID
9+
execute as @a[distance=..55] if score @s UserID = $R.Temp Temporary run tag @s add R.Target
10+
scoreboard players reset $R.Temp
11+
# ターゲットがいなければリセット
12+
execute unless entity @a[tag=R.Target,tag=!PlayerShouldInvulnerable,distance=..55,limit=1] run return run function asset:mob/0027.skull_sniper/tick/reset
13+
# ターゲットがいればその方向を向く
14+
execute facing entity @a[tag=R.Target,tag=!PlayerShouldInvulnerable,distance=..55,limit=1] eyes run tp @s ~ ~ ~ ~ ~
15+
16+
# 処理
17+
execute if score @s General.Mob.Tick matches 0..89 as @a[tag=R.Target,tag=!PlayerShouldInvulnerable,distance=..55,limit=1] run function asset:mob/0027.skull_sniper/tick/attack/warn
18+
execute if score @s General.Mob.Tick matches 90 facing entity @a[tag=R.Target,tag=!PlayerShouldInvulnerable,distance=..55,limit=1] eyes positioned ^ ^ ^ run function asset:mob/0027.skull_sniper/tick/attack/shot/
19+
execute if score @s General.Mob.Tick matches 110 run function asset:mob/0027.skull_sniper/tick/reset
20+
21+
# リセット
22+
tag @a[distance=..55] remove R.Target
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/
2+
#
3+
# 弾の処理
4+
#
5+
# @within function asset:mob/0027.skull_sniper/tick/attack/
6+
7+
# 演出
8+
function asset:mob/0027.skull_sniper/tick/attack/shot/vfx/shot
9+
10+
# 再帰開始
11+
data modify storage asset:temp Projectile.Damage set from storage asset:context this.Damage
12+
data modify storage asset:temp Projectile.Pierce set from storage asset:context this.Pierce
13+
function asset:mob/0027.skull_sniper/tick/attack/shot/rec
14+
15+
# リセット
16+
data remove storage asset:temp Projectile
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/detect_block
2+
# @within function asset:mob/0027.skull_sniper/tick/attack/shot/rec
3+
4+
execute unless block ~ ~ ~ #lib:no_collision run data modify storage asset:temp Projectile.IsHitBlock set value true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/detect_entity
2+
# @within function asset:mob/0027.skull_sniper/tick/attack/shot/rec
3+
4+
execute positioned ~-0.25 ~-0.25 ~-0.25 as @a[tag=!PlayerShouldInvulnerable,dx=0] positioned ~-0.5 ~-0.5 ~-0.5 if entity @s[dx=0] run data modify storage asset:temp Projectile.IsHitEntity set value true
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/hit_block
2+
# @within function asset:mob/0027.skull_sniper/tick/attack/shot/rec
3+
4+
# ブロックを破壊する
5+
execute store success score $R.Temp Temporary if predicate api:area/is_breakable unless block ^ ^ ^ #lib:unbreakable run setblock ^ ^ ^ air destroy
6+
7+
# 破壊できたかチェック
8+
execute if score $R.Temp Temporary matches 1 store result storage asset:temp Projectile.Pierce int 0.9999999999 run data get storage asset:temp Projectile.Pierce
9+
execute unless score $R.Temp Temporary matches 1 run data modify storage asset:temp Projectile.Pierce set value -1
10+
11+
# リセット
12+
scoreboard players reset $R.Temp Temporary
13+
data remove storage asset:temp Projectile.IsHitBlock
14+
# 破壊できないならストップさせる
15+
execute if data storage asset:temp Projectile{Pierce:-1} run return 1
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/hit_entity
2+
# @within function asset:mob/0027.skull_sniper/tick/attack/shot/rec
3+
4+
# 演出
5+
execute positioned ~-0.25 ~-0.25 ~-0.25 as @a[tag=!PlayerShouldInvulnerable,dx=0] positioned ~-0.5 ~-0.5 ~-0.5 if entity @s[dx=0] at @s run function asset:mob/0027.skull_sniper/tick/attack/shot/vfx/hit_entity
6+
7+
# ダメージ
8+
data modify storage api: Argument.Damage set from storage asset:temp Projectile.Damage
9+
data modify storage api: Argument.AttackType set value "Physical"
10+
function api:damage/modifier
11+
execute positioned ~-0.25 ~-0.25 ~-0.25 as @a[tag=!PlayerShouldInvulnerable,dx=0] positioned ~-0.5 ~-0.5 ~-0.5 if entity @s[dx=0] run function api:damage/
12+
13+
# リセット
14+
function api:damage/reset
15+
data remove storage asset:temp Projectile.IsHitEntity
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/rec
2+
# @within function
3+
# asset:mob/0027.skull_sniper/tick/attack/shot/
4+
# asset:mob/0027.skull_sniper/tick/attack/shot/rec
5+
6+
# 演出
7+
function asset:mob/0027.skull_sniper/tick/attack/shot/vfx/rec
8+
9+
# 衝突判定
10+
# ブロック
11+
function asset:mob/0027.skull_sniper/tick/attack/shot/detect_block
12+
execute if data storage asset:temp Projectile{IsHitBlock:true} if data storage asset:temp Projectile{Pierce:0} run return 0
13+
execute if data storage asset:temp Projectile{IsHitBlock:true} unless data storage asset:temp Projectile{Pierce:0} if function asset:mob/0027.skull_sniper/tick/attack/shot/hit_block run return 0
14+
# エンティティ
15+
function asset:mob/0027.skull_sniper/tick/attack/shot/detect_entity
16+
execute if data storage asset:temp Projectile{IsHitEntity:true} run return run function asset:mob/0027.skull_sniper/tick/attack/shot/hit_entity
17+
18+
# 再帰
19+
execute positioned ^ ^ ^0.5 if entity @s[distance=..55] run function asset:mob/0027.skull_sniper/tick/attack/shot/rec
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/vfx/hit_entity
2+
# @within function asset:mob/0027.skull_sniper/tick/attack/shot/hit_entity
3+
4+
playsound entity.generic.explode neutral @a ~ ~ ~ 1 1
5+
particle dust 0.145 0.18 0.153 0.75 ~ ~ ~ 0 0 0 0 1
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/vfx/rec
2+
# @within function asset:mob/0027.skull_sniper/tick/attack/shot/rec
3+
4+
particle dust 0.145 0.18 0.153 0.75 ~ ~ ~ 0 0 0 0 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/shot/vfx/shot
2+
# @within function asset:mob/0027.skull_sniper/tick/attack/shot/
3+
4+
playsound minecraft:entity.generic.explode hostile @a ~ ~ ~ 1 1.5
5+
playsound minecraft:entity.generic.explode hostile @a ~ ~ ~ 1 2
6+
playsound minecraft:entity.blaze.shoot hostile @a ~ ~ ~ 1 0.75
7+
playsound minecraft:entity.wither.hurt hostile @a ~ ~ ~ 1 1.5
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#> asset:mob/0027.skull_sniper/tick/attack/warn
2+
# @within asset:mob/0027.skull_sniper/tick/attack/
3+
4+
execute facing entity @s eyes if function asset:mob/0027.skull_sniper/tick/target/ at @s run playsound block.note_block.bit hostile @s ~ ~ ~ 0.5 2
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#> asset:mob/0027.skull_sniper/tick/reset
2+
#
3+
# リセット処理
4+
#
5+
# @within function asset:mob/0027.skull_sniper/tick/**
6+
7+
# クールダウン
8+
execute store result score @s General.Mob.Tick run random value -50..-20
9+
10+
# 形態リセット
11+
data remove storage asset:context this.Target
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#> asset:mob/0027.skull_sniper/tick/select/
2+
# @within function asset:mob/0027.skull_sniper/tick/
3+
4+
# プレイヤーを1名ターゲットする
5+
# ただし間に壁がないプレイヤーに限定する
6+
execute positioned ^ ^ ^15 as @a[tag=!PlayerShouldInvulnerable,distance=..40,sort=nearest] at @e[type=#lib:living,tag=this,distance=..55,limit=1] anchored eyes run function asset:mob/0027.skull_sniper/tick/select/foreach
7+
8+
# いなければ再待機
9+
execute unless data storage asset:context this.Target.ID run function asset:mob/0027.skull_sniper/tick/reset
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#> asset:mob/0027.skull_sniper/tick/select/foreach
2+
# @within asset:mob/0027.skull_sniper/tick/select/
3+
4+
# ターゲットが完了していれば終了
5+
execute if data storage asset:context this.Target.ID run return fail
6+
7+
# プレイヤーが視認できるか確認する
8+
tag @s add R.Target
9+
execute facing entity @s eyes run function asset:mob/0027.skull_sniper/tick/target/
10+
tag @s remove R.Target
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#> asset:mob/0027.skull_sniper/tick/target/
2+
#
3+
# プレイヤーをターゲットする処理
4+
#
5+
# @output
6+
# result isVisible : boolean
7+
# storage asset:context this.Target.ID? : UserID
8+
# @within function
9+
# asset:mob/0027.skull_sniper/tick/attack/warn
10+
# asset:mob/0027.skull_sniper/tick/select/foreach
11+
# asset:mob/0027.skull_sniper/tick/target/
12+
13+
execute if data storage asset:context this.Target run particle minecraft:dust 0.58 0 0 0.75 ~ ~ ~ 0 0 0 0 1
14+
execute if entity @s[dx=0] run return run function asset:mob/0027.skull_sniper/tick/target/fetch
15+
execute positioned ^ ^ ^0.5 if block ^ ^ ^ #lib:no_collision run return run function asset:mob/0027.skull_sniper/tick/target/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#> asset:mob/0027.skull_sniper/tick/target/fetch
2+
# @within function asset:mob/0027.skull_sniper/tick/target/
3+
4+
execute store result storage asset:context this.Target.ID int 1 run scoreboard players get @a[tag=R.Target,distance=..55,limit=1] UserID
5+
return 1
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#> asset:mob/0415.skull_sniper_antimateriel_custom/init/
2+
#
3+
# Mobのinit時の処理
4+
#
5+
# @within asset:mob/alias/415/init
6+
7+
# 貫通するブロック数を規定する
8+
function api:global_vars/get_difficulty
9+
execute store result storage asset:context this.Pierce int 0.9999999999 run data get storage api: Return.Difficulty 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#> asset:mob/0415.skull_sniper_antimateriel_custom/register
2+
#
3+
# Mobのデータを指定
4+
#
5+
# @within function asset:mob/alias/415/register
6+
7+
# 継承
8+
data modify storage asset:mob Extends append value 27
9+
function asset:mob/extends
10+
# 継承されることを前提とした、抽象的なモブであるかどうか(boolean)
11+
data modify storage asset:mob IsAbstract set value false
12+
# ID (int)
13+
data modify storage asset:mob ID set value 415
14+
# 名前 (TextComponentString) (オプション)
15+
data modify storage asset:mob Name set value '{"text":"","color":"white","extra":[{"text":"スカルスナイパー"},{"text":" "},{"text":"対物カスタム","color":"gray","bold":true}]}'
16+
# 体力 (double) (オプション)
17+
data modify storage asset:mob Health set value 1200
18+
# フィールド
19+
data modify storage asset:mob Field.Damage set value 42
20+
# data modify storage asset:mob Field.Pierce set value
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#> asset:mob/0415.skull_sniper_antimateriel_custom/summon/debug
2+
#
3+
# 動作チェック用の召喚処理 使い終わったら消してもいいかも
4+
#
5+
# @user
6+
# @private
7+
8+
# 召喚
9+
data modify storage api: Argument.ID set value 415
10+
function api:mob/summon

0 commit comments

Comments
 (0)