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`统一管理的方式,提高代码的可维护性和资源管理的统一性
25 lines
813 B
GDScript
25 lines
813 B
GDScript
extends EntityBase
|
|
class_name KukeChild
|
|
|
|
var masterMine: KukeMC
|
|
|
|
func register():
|
|
fields[FieldStore.Entity.MAX_HEALTH] = 25
|
|
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.35
|
|
attackCooldownMap[0] = 100
|
|
attackCooldownMap[1] = 8000
|
|
func ai():
|
|
PresetEntityAI.follow(self, currentFocusedBoss, 700)
|
|
tryAttack(0)
|
|
tryAttack(1)
|
|
if timeLived() > 10000:
|
|
tryKill()
|
|
func attack(type):
|
|
if type == 0:
|
|
BulletBase.generate(ComponentManager.getBullet("PurpleCrystalSmall"), self, findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position))
|
|
await TickTool.millseconds(randi_range(5, 25))
|
|
elif type == 1:
|
|
BulletBase.generate(ComponentManager.getBullet("HeavyCrystal"), self, findWeaponAnchor("normal"), position.angle_to_point(currentFocusedBoss.position))
|
|
func kill():
|
|
masterMine.tryHeal(100)
|