2025-11-16 13:32:54 +08:00
|
|
|
extends EntityBase
|
|
|
|
|
class_name Maodie
|
|
|
|
|
|
|
|
|
|
func register():
|
|
|
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 75
|
|
|
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = randf_range(0.5, 0.8)
|
2025-11-23 06:51:48 +08:00
|
|
|
attackCooldownMap[0] = randi_range(5000, 8000)
|
|
|
|
|
sprintMultiplier = randf_range(5, 15)
|
2025-11-16 13:32:54 +08:00
|
|
|
func ai():
|
|
|
|
|
PresetEntityAI.follow(self, currentFocusedBoss)
|
|
|
|
|
tryAttack(0, true)
|
|
|
|
|
func attack(type: int):
|
|
|
|
|
if type == 0:
|
2025-11-23 06:51:48 +08:00
|
|
|
BulletBase.generate(ComponentManager.getBullet("ChickSprint"), self, position, 0)
|
2025-11-16 13:32:54 +08:00
|
|
|
trySprint()
|
|
|
|
|
return true
|
|
|
|
|
func sprint():
|
|
|
|
|
move((currentFocusedBoss.position - position).normalized() * sprintMultiplier, true)
|