mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
e551a6db61
将所有直接使用`load("res://components/...")`加载资源的代码替换为通过`ComponentManager`统一管理的方式,提高代码的可维护性和资源管理的统一性
19 lines
565 B
GDScript
19 lines
565 B
GDScript
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
|
|
|
|
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(ComponentManager.getBullet("Star"), self, weaponPos, (currentFocusedBoss.position - position).angle())
|
|
return true
|