1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-29 23:41:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Summons/HJM.gd
T

28 lines
660 B
GDScript
Raw Normal View History

extends SummonBase
var attackTime: float = 0
var tracer: EntityBase = null
func register():
fields[FieldStore.Entity.MAX_HEALTH] = 150
fields[FieldStore.Entity.MOVEMENT_SPEED] = 1.5
await TickTool.frame()
attackCooldownMap[0] = attackTime
func spawn():
texture.play("walk")
func ai():
tryAttack(0)
if is_instance_valid(tracer):
PresetEntityAI.follow(self, tracer, 80)
else:
tracer = EntityTool.findClosetEntity(position, get_tree(), !isPlayer(), isPlayer())
func attack(type):
if type == 0:
for bullet in BulletBase.generate(
ComponentManager.getBullet("HJMAttack"),
self,
findWeaponAnchor("normal"),
0
):
bullet.damage = atk