Skip to content
Open
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
11 changes: 11 additions & 0 deletions Asset/data/asset/functions/mob/0176.killer_bee/attack/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:mob/0176.killer_bee/attack/
#
# Mobの攻撃時の処理
#
# @within function asset:mob/alias/176/attack

# super.attack
function asset:mob/super.attack

# 死
function api:mob/kill
12 changes: 0 additions & 12 deletions Asset/data/asset/functions/mob/0176.killer_bee/hurt/.mcfunction

This file was deleted.

11 changes: 0 additions & 11 deletions Asset/data/asset/functions/mob/0176.killer_bee/load.mcfunction

This file was deleted.

43 changes: 15 additions & 28 deletions Asset/data/asset/functions/mob/0176.killer_bee/register.mcfunction
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#> asset:mob/0176.killer_bee/register
# @within asset:mob/alias/176/register

# 継承 (int) (オプション)
data modify storage asset:mob Extends append value 186
function asset:mob/extends

# 他のモブに継承されることを許可するか (boolean) (オプション)
# data modify storage asset:mob ExtendsSafe set value
# ID (int)
data modify storage asset:mob ID set value 176
# Type (string) Wikiを参照
Expand All @@ -11,38 +17,10 @@
data modify storage asset:mob Name set value '{"text":"キラービー"}'
# Mobの説明文 (TextComponentString[]) (オプション)
data modify storage asset:mob Lore set value ['{"text":"殺人蜂。","color":"white"}','{"text":"一応ミツバチなので針を刺すたびに致命傷を負う。","color":"white"}']
# 武器
# メインハンド (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 {id:"minecraft:stone",Count:1b,tag:{CustomModelData:20054}}
# 胴 (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 1000
# 攻撃力 (double) (オプション)
# data modify storage asset:mob AttackDamage set value 1
# 防御力 (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
# 索敵範囲 (double) (オプション)
# data modify storage asset:mob FollowRange set value
# ノックバック耐性 (double) (オプション)
# data modify storage asset:mob KnockBackResist set value
# 属性倍率 // 1.0fで100% 最低でも25%は軽減されずに入る
# 物理倍率 (float) (オプション)
data modify storage asset:mob Resist.Physical set value 1
Expand All @@ -54,3 +32,12 @@ data modify storage asset:mob Lore set value ['{"text":"殺人蜂。","color":"w
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.Damage set value 25f

# 旋回時間
data modify storage asset:mob Field.TurnTick set value 50

# 毒のID
data modify storage asset:mob Field.PoisonID set value 79

This file was deleted.

39 changes: 0 additions & 39 deletions Asset/data/asset/functions/mob/0176.killer_bee/tick/.mcfunction

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#> asset:mob/0186.ferocious_bee/attack/
#
# Mobの攻撃時の処理
#
# @within function asset:mob/alias/186/attack

#> Private
# @private
#declare score_holder $Difficulty

# Metadataがなければ return
execute unless data storage asset:context Attack{Metadata:"186.Attack"} run return fail

# 難易度値取得
function api:global_vars/get_difficulty
execute store result score $Difficulty Temporary run data get storage api: Return.Difficulty

# 毒を付与
# Stack = (Difficulty * 2), Duration = 80(Difficulty + 1)
data modify storage api: Argument.ID set from storage asset:context this.PoisonID
execute store result storage api: Argument.Stack int 2 run data get storage api: Return.Difficulty
execute store result storage api: Argument.Duration int 80 run scoreboard players add $Difficulty Temporary 1
execute as @a[tag=Victim,distance=..32] run function api:entity/mob/effect/give
function api:entity/mob/effect/reset

# リセット
scoreboard players reset $Difficulty Temporary
15 changes: 12 additions & 3 deletions Asset/data/asset/functions/mob/0186.ferocious_bee/hurt/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
# 演出
playsound entity.bee.hurt hostile @a ~ ~ ~ 1 1

# HurtTimeをスコア化
scoreboard players set @s 56.HurtTime 20
data modify entity @s[scores={56.MoveTime=..179}] NoAI set value 0b
# 以下の処理はDoTの場合は適用されない
execute if data storage asset:context Hurt{IsDoT:true} run return fail

# 以下の処理はプレイヤーからの攻撃でないと適用されない
execute if data storage asset:context Hurt{}

# HurtTimeをフィールドで疑似的に管理
data modify storage asset:context this.HurtTime._ set from storage asset:context this.HurtTime.Max

# のけぞり用にNoAIを無効化
data modify entity @s NoAI set value 0b
data modify storage asset:context this.NoAI set value true
15 changes: 15 additions & 0 deletions Asset/data/asset/functions/mob/0186.ferocious_bee/init/.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#> asset:mob/0186.ferocious_bee/init/
#
# Mobのinit時の処理
#
# @within asset:mob/alias/186/init

# IsBabyの速度補正を打ち消すため、旋回中と突進中の速度をそれぞれ0.66667倍する
execute store result storage asset:context this.MoveSpeed.Turn double 0.0066667 run data get storage asset:context this.MoveSpeed.Turn 100
execute store result storage asset:context this.MoveSpeed.Charge double 0.0066667 run data get storage asset:context this.MoveSpeed.Charge 100

# 速度を初期化しておく
data modify entity @s Attributes[{Name:"minecraft:generic.movement_speed"}].Base set from storage asset:context this.MoveSpeed.Turn

# スコアも初期化しておく
execute store result score @s General.Mob.Tick run data get storage asset:context this.TurnTick -1
11 changes: 0 additions & 11 deletions Asset/data/asset/functions/mob/0186.ferocious_bee/load.mcfunction

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#> asset:mob/0186.ferocious_bee/register
# @within asset:mob/alias/186/register

# 継承 (int) (オプション)
data modify storage asset:mob Extends append value 2002
data modify storage asset:mob Extends append value 2004
function asset:mob/extends
# 継承されることを前提とした、抽象的なモブであるかどうか(boolean)
data modify storage asset:mob IsAbstract set value false

# 他のモブに継承されることを許可するか (boolean) (オプション)
data modify storage asset:mob ExtendsSafe set value true
# ID (int)
data modify storage asset:mob ID set value 186
# Type (string) Wikiを参照
Expand All @@ -10,7 +19,7 @@
# 名前 (TextComponentString) (オプション)
data modify storage asset:mob Name set value '{"text":"凶暴なハチ","color":"yellow"}'
# Mobの説明文 (TextComponentString[]) (オプション)
data modify storage asset:mob Lore set value ['{"text":"ブーーーーン!","color":"white"}','{"text":"毒は持ってない。","color":"white"}']
data modify storage asset:mob Lore set value ['{"text":"ブーーーーン!","color":"white"}','{"text":"毒を持ってるので刺されない用に注意。","color":"white"}']
# 武器
# メインハンド (Compound(Item)) (オプション)
# data modify storage asset:mob Weapon.Mainhand set value
Expand Down Expand Up @@ -38,7 +47,7 @@
# 特殊防御力 (double) (オプション) // 4pointにつきダメージを大きく減らす
# data modify storage asset:mob SpecialDefense set value
# 移動速度 (double) (オプション)
# data modify storage asset:mob Speed set value
data modify storage asset:mob Speed set value 0.2
# 索敵範囲 (double) (オプション)
data modify storage asset:mob FollowRange set value 50
# ノックバック耐性 (double) (オプション)
Expand All @@ -54,3 +63,19 @@
data modify storage asset:mob Resist.Water set value 0.9
# 雷倍率 (float) (オプション)
data modify storage asset:mob Resist.Thunder set value 1

# ダメージ
data modify storage asset:mob Field.Damage set value 11f

# 毒のID
data modify storage asset:mob Field.PoisonID set value 29

# 旋回時間
data modify storage asset:mob Field.TurnTick set value 180

# 速度
data modify storage asset:mob Field.MoveSpeed set value {Turn:0.2,Charge:1.0}

# 疑似HurtTime
data modify storage asset:mob Field.HurtTime._ set value 0
data modify storage asset:mob Field.HurtTime.Max set value 20
47 changes: 20 additions & 27 deletions Asset/data/asset/functions/mob/0186.ferocious_bee/tick/.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,29 @@
#
# @within function asset:mob/alias/186/tick

# スコア関連
scoreboard players add @s 56.MoveTime 1
scoreboard players remove @s[scores={56.HurtTime=0..}] 56.HurtTime 1

# スコアによって速度が変わる
# スコアが180の時にプレイヤーが近くにいなければスコアをリセット
# 180..189の時に、近くのプレイヤーに軸合わせする
# 190以上で突進する
execute if entity @s[scores={56.MoveTime=..179}] unless score @s 56.HurtTime matches 0.. facing entity @p feet positioned ^ ^ ^-100 rotated as @s positioned ^ ^ ^-800 facing entity @s eyes positioned as @s run tp @s ^ ^ ^0.2 ~ ~
execute if entity @s[scores={56.MoveTime=180}] unless entity @p[gamemode=!spectator,distance=..20] run scoreboard players reset @s 56.MoveTime
execute if entity @s[scores={56.MoveTime=180..189}] anchored eyes run tp @s ~ ~ ~ facing entity @p eyes
execute if entity @s[scores={56.MoveTime=190..}] run tp @s ^ ^ ^1 ~ ~

# スコアリセット
scoreboard players reset @s[scores={56.MoveTime=200..}] 56.MoveTime
# Tickスコア
scoreboard players add @s General.Mob.Tick 1

# HurtTimeのデクリメント
execute store result storage asset:context this.HurtTime._ int 0.999999999 run data get storage asset:context this.HurtTime._

# スコアが-1以下 && HurtTime中でない ならプレイヤーを追尾する
execute if score @s General.Mob.Tick matches ..-1 if data storage asset:context this.HurtTime{_:0} run function asset:mob/0186.ferocious_bee/tick/move/turning
# プレイヤーが近くにいなければスコアをリセット
execute if score @s General.Mob.Tick matches 0 unless entity @p[gamemode=!spectator,distance=..40] run function asset:mob/0186.ferocious_bee/tick/reset
# 軸合わせする
execute if score @s General.Mob.Tick matches 0..19 anchored eyes run tp @s ~ ~ ~ facing entity @p[gamemode=!spectator,distance=..40] eyes
# 突進直前の諸々
execute if score @s General.Mob.Tick matches 20 run function asset:mob/0186.ferocious_bee/tick/before_charge
# 突進
execute if score @s General.Mob.Tick matches 20.. run function asset:mob/0186.ferocious_bee/tick/move/charge
# 突進終了
execute if score @s General.Mob.Tick matches 30.. run function asset:mob/0186.ferocious_bee/tick/reset

# のけぞりから復帰
data modify entity @s[scores={56.HurtTime=..0}] NoAI set value 1b

# 演出
execute if entity @s[scores={56.MoveTime=190}] run playsound entity.bee.hurt hostile @a ~ ~ ~ 1 1
execute if entity @s[scores={56.MoveTime=190..}] run particle cloud ~ ~1.25 ~ 0.25 0.25 0.25 0 0

# クールタイムを減らす 0以下にはならない
scoreboard players remove @s[scores={56.AttackCT=1..}] 56.AttackCT 1

# クールタイム中じゃないなら突進時に攻撃
execute if entity @s[scores={56.MoveTime=190..}] unless score @s 56.AttackCT matches 1.. positioned ~-0.5 ~0.5 ~-0.5 if entity @p[tag=!PlayerShouldInvulnerable,dx=0] run function asset:mob/0186.ferocious_bee/tick/damage
execute if data storage asset:context this.HurtTime{_:0,NoAI:false} run function asset:mob/0186.ferocious_bee/tick/end_hurt_time

# カベにぶつかった際の処理はない。壁は貫通するもの

# デスポーン処理
execute unless entity @p[distance=..40] run function api:mob/remove
execute unless entity @p[gamemode=!spectator,distance=..40] run function api:mob/remove
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#> asset:mob/0186.ferocious_bee/tick/before_charge
#
#
#
# @within function asset:mob/0186.ferocious_bee/tick/

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

# 速度設定
data modify entity @s Attributes[{Name:"minecraft:generic.movement_speed"}].Base set from storage asset:context this.MoveSpeed.Charge

This file was deleted.

Loading
Loading