2025-11-16 14:23:26 +08:00
|
|
|
extends EntityBase
|
|
|
|
|
|
|
|
|
|
func register():
|
|
|
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 120
|
|
|
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.2
|
|
|
|
|
fields[FieldStore.Entity.OFFSET_SHOOT] = 0
|
2025-11-16 14:42:48 +08:00
|
|
|
attackCooldownMap[0] = randi_range(3000, 5000)
|
2026-01-18 14:49:06 +08:00
|
|
|
func spawn():
|
|
|
|
|
texture.play("walk")
|
2025-11-16 14:23:26 +08:00
|
|
|
func ai():
|
|
|
|
|
PresetEntityAI.follow(self, currentFocusedBoss, 300)
|
|
|
|
|
tryAttack(0)
|
|
|
|
|
func attack(type):
|
|
|
|
|
if type == 0:
|
|
|
|
|
var weaponPos = findWeaponAnchor("normal")
|
|
|
|
|
var angle = weaponPos.angle_to_point(currentFocusedBoss.position)
|
|
|
|
|
for i in 3:
|
|
|
|
|
BulletBase.generate(ComponentManager.getBullet("DogCircle"), self, weaponPos, angle)
|
|
|
|
|
await TickTool.millseconds(100)
|
|
|
|
|
return true
|