mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 07:21:54 +08:00
19 lines
576 B
GDScript
19 lines
576 B
GDScript
extends EntityBase
|
|
class_name Hen
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 75
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.25
|
|
fields[FieldStore.Entity.OFFSET_SHOOT] = 10
|
|
|
|
func ai():
|
|
attackCooldownMap[0] = randi_range(1500, 4000)
|
|
PresetEntityAI.follow(self, currentFocusedBoss, 300)
|
|
tryAttack(0)
|
|
func attack(type):
|
|
if type == 0:
|
|
var weaponPos = findWeaponAnchor("normal")
|
|
for i in randi_range(1, 4):
|
|
BulletBase.generate(preload("res://components/Bullets/Star.tscn"), self, weaponPos, (currentFocusedBoss.position - position).angle())
|
|
return true
|