2026-04-05 13:26:37 +08:00
|
|
|
extends EntityBase
|
|
|
|
|
class_name DeepseaEntity
|
|
|
|
|
|
|
|
|
|
func register():
|
|
|
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 2000
|
|
|
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.9
|
|
|
|
|
fields[FieldStore.Entity.OFFSET_SHOOT] = 2
|
2026-04-05 19:42:05 +08:00
|
|
|
attackCooldownMap[0] = 2000
|
|
|
|
|
attackCooldownMap[1] = 5000
|
2026-04-05 13:26:37 +08:00
|
|
|
func ai():
|
|
|
|
|
PresetEntityAI.follow(self , currentFocusedBoss)
|
2026-04-05 14:23:47 +08:00
|
|
|
for i in 2:
|
|
|
|
|
tryAttack(i)
|
2026-04-05 13:26:37 +08:00
|
|
|
func attack(type: int):
|
|
|
|
|
if type == 0:
|
2026-04-05 14:23:47 +08:00
|
|
|
BulletBase.generate(ComponentManager.getBullet("Cement"), self , position, deg_to_rad(randf_range(0, 360)))
|
|
|
|
|
elif type == 1:
|
|
|
|
|
for i in 3:
|
|
|
|
|
BulletBase.generate(ComponentManager.getBullet("Wood"), self , position, position.angle_to_point(currentFocusedBoss.position) + i * deg_to_rad(20))
|
2026-04-05 19:42:05 +08:00
|
|
|
return true
|