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/Chick.gd
T
fallingshrimp 9a10e87cb0 Add audio effect and implement FireScan bullet behavior
- Added Rip.wav audio effect to the project.
- Created FireScan bullet script with speed and damage properties.
- Implemented basic AI movement for FireScan bullets.
- Introduced Wave class for managing enemy waves with dynamic counts and spawning logic.
2025-08-26 17:28:20 +08:00

30 lines
855 B
GDScript

extends EntityBase
class_name Chick
@onready var firepot = $"%firepot"
var angle = 0
func _ready():
fields[FieldStore.Entity.MAX_HEALTH] = 1000
fields[FieldStore.Entity.MOVEMENT_SPEED] = 0.1
super._ready()
func ai():
move(currentFocusedBoss.position - position)
if currentFocusedBoss.position.distance_to(position) < 300:
tryAttack(1)
else:
if tryAttack(0):
angle += 20
func attack(type):
if type == 0:
var weaponPos = findWeaponAnchor("normal")
BulletBase.generate(preload("res://components/Bullets/Diamond.tscn"), self, weaponPos, deg_to_rad(angle))
elif type == 1:
var weaponPos = findWeaponAnchor("normal")
var target = weaponPos.angle_to_point(currentFocusedBoss.position)
firepot.global_rotation = target
firepot.shot()
BulletBase.generate(preload("res://components/Bullets/FireScan.tscn"), self, weaponPos, target)