1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/Wuwei.gd
T

30 lines
801 B
GDScript
Raw Normal View History

extends BulletBase
class_name WuweiBullet
@export var canMove: bool = true
var rate2: float = 0
func ai():
if canMove:
PresetBulletAI.lockLauncher(self , launcher, true)
PresetBulletAI.trace(self , launcher.currentFocusedPosition, 0.1)
func hitBullet(bullet: BulletBase):
if !is_instance_valid(launcher): return
if BulletTool.canDamage(bullet, launcher):
baseDamage *= rate2 ** bullet.getDamage()
func shoot():
for bullet in BulletBase.generate(
ComponentManager.getBullet("InfinitySword"),
launcher,
position + Vector2.from_angle(rotation) * 400,
rotation
):
if bullet is InfinitySwordBullet:
bullet.baseDamage = baseDamage
bullet.rate2 = rate2
func beReady():
canMove = false
EffectController.create(ComponentManager.getEffect("Danger"), findAnchor("Spawn")).shot()