1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Characters/Hen.gd
T

19 lines
565 B
GDScript
Raw Normal View History

2025-08-26 15:52:54 +08:00
extends EntityBase
class_name Hen
func register():
fields[FieldStore.Entity.MAX_HEALTH] = 100
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.3
fields[FieldStore.Entity.OFFSET_SHOOT] = 10
2025-08-26 15:52:54 +08:00
func ai():
attackCooldownMap[0] = randi_range(1500, 4000)
PresetEntityAI.follow(self, currentFocusedBoss, 300)
2025-08-26 15:52:54 +08:00
tryAttack(0)
func attack(type):
if type == 0:
var weaponPos = findWeaponAnchor("normal")
for i in randi_range(1, 4):
BulletBase.generate(ComponentManager.getBullet("Star"), self, weaponPos, (currentFocusedBoss.position - position).angle())
return true