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-16 16:34:59 +08:00
|
|
|
attackCooldownMap[0] = randi_range(2500, 6000)
|
2025-11-16 13:48:55 +08:00
|
|
|
sprintMultiplier = randf_range(10, 35)
|
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-17 22:38:06 +08:00
|
|
|
for bullet in BulletBase.generate(ComponentManager.getBullet("ChickSprint"), self, position, 0):
|
|
|
|
|
if bullet is ChickSprint:
|
|
|
|
|
bullet.atk = 0.2
|
2025-11-16 13:32:54 +08:00
|
|
|
trySprint()
|
|
|
|
|
return true
|
|
|
|
|
func sprint():
|
|
|
|
|
move((currentFocusedBoss.position - position).normalized() * sprintMultiplier, true)
|