1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Characters/EnergyBlock.gd
T

29 lines
970 B
GDScript
Raw Normal View History

extends EntityBase
class_name EnergyBlockEntity
func register():
fields[FieldStore.Entity.MAX_HEALTH] = 5000
hit.connect(
func(damage: float, bullet: BulletBase, _crit: bool):
bullet.launcher.storeEnergy(damage)
)
attackCooldownMap[0] = 6000
attackCooldownMap[1] = 10000
attackCooldownMap[2] = 4000
attackCooldownMap[3] = 8000
attackCooldownMap[4] = 3000
attackCooldownMap[5] = 2000
attackCooldownMap[6] = 5000
attackMutexes = [1, 4]
func ai():
for i in 7:
tryAttack(i, [1, 3])
func attack(type: int):
if type == 0:
BulletBase.generate(ComponentManager.getBullet("SwingSword"), self , getTrackingAnchor(), getTrackingAnchor().angle_to_point(currentFocusedPosition))
elif type == 5:
var track = getTrackingAnchor()
var bullet = BulletTool.findClosetBulletCanDamage(track, get_tree(), self , 200)
if is_instance_valid(bullet):
BulletBase.generate(ComponentManager.getBullet("Parrier"), self , track, track.angle_to_point(bullet.position))