mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 23:11:54 +08:00
ec795e534e
为KukeMC添加召唤子实体KukeChild的功能,并在血量低于25%时自动清除所有子实体并恢复血量 在EntityBase中添加tryKill方法统一处理实体销毁逻辑 在EntityTool中添加按类查找实体的工具方法
25 lines
853 B
GDScript
25 lines
853 B
GDScript
extends EntityBase
|
|
class_name KukeChild
|
|
|
|
var masterMine: KukeMC
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 25
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.35
|
|
attackCooldownMap[0] = 100
|
|
attackCooldownMap[1] = 8000
|
|
func ai():
|
|
PresetEntityAI.follow(self, currentFocusedBoss, 700)
|
|
tryAttack(0)
|
|
tryAttack(1)
|
|
if timeLived() > 10000:
|
|
tryKill()
|
|
func attack(type):
|
|
if type == 0:
|
|
BulletBase.generate(preload("res://components/Bullets/PurpleCrystalSmall.tscn"), self, findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position))
|
|
await TickTool.millseconds(randi_range(5, 25))
|
|
elif type == 1:
|
|
BulletBase.generate(preload("res://components/Bullets/BossAttack/KukeMC/HeavyCrystal.tscn"), self, findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position))
|
|
func kill():
|
|
masterMine.tryHeal(100)
|