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

28 lines
680 B
GDScript
Raw Permalink Normal View History

extends BulletBase
class_name Bow
var count: int = 0
var atk: float = 0
var waitTime: float = 2000
var lifesteal: float = 0.2
func spawn():
var startAngle = rotation - deg_to_rad(count * 10.0 / 2)
for c in count:
for bullet in BulletBase.generate(
ComponentManager.getBullet("Arrow"),
launcher,
position,
startAngle
):
if bullet is Arrow:
bullet.atk = atk
bullet.waitTime = waitTime
bullet.offsetRotation = deg_to_rad(c * 10.0)
bullet.lifesteal = lifesteal
await TickTool.millseconds(waitTime)
tryDestroy()
func ai():
PresetBulletAI.lockLauncher(self , launcher, true)
rotation = position.angle_to_point(launcher.currentFocusedPosition)