2025-11-16 13:32:54 +08:00
|
|
|
extends EntityBase
|
|
|
|
|
class_name Maodie
|
|
|
|
|
|
|
|
|
|
func register():
|
|
|
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 75
|
2026-05-10 23:00:47 +08:00
|
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = randf_range(0.4, 0.65)
|
2025-11-23 06:51:48 +08:00
|
|
|
attackCooldownMap[0] = randi_range(5000, 8000)
|
|
|
|
|
sprintMultiplier = randf_range(5, 15)
|
2026-01-18 14:49:06 +08:00
|
|
|
func spawn():
|
|
|
|
|
texture.play("walk")
|
2025-11-16 13:32:54 +08:00
|
|
|
func ai():
|
2026-05-10 23:00:47 +08:00
|
|
|
PresetEntityAI.follow(self , currentFocusedBoss)
|
2025-11-16 13:32:54 +08:00
|
|
|
tryAttack(0, true)
|
|
|
|
|
func attack(type: int):
|
|
|
|
|
if type == 0:
|
2026-05-10 23:00:47 +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)
|