2026-04-02 22:39:29 +08:00
|
|
|
extends BulletBase
|
|
|
|
|
class_name WuweiBullet
|
2026-04-02 22:49:34 +08:00
|
|
|
|
2026-04-03 18:29:14 +08:00
|
|
|
@export var canMove: bool = true
|
|
|
|
|
|
2026-05-08 16:18:13 +08:00
|
|
|
var rate2: float = 0
|
|
|
|
|
|
2026-04-03 18:29:14 +08:00
|
|
|
func ai():
|
|
|
|
|
if canMove:
|
|
|
|
|
PresetBulletAI.lockLauncher(self , launcher, true)
|
2026-04-25 13:28:43 +08:00
|
|
|
PresetBulletAI.trace(self , launcher.currentFocusedPosition, 0.1)
|
2026-05-08 16:18:13 +08:00
|
|
|
func hitBullet(bullet: BulletBase):
|
|
|
|
|
if !is_instance_valid(launcher): return
|
|
|
|
|
if BulletTool.canDamage(bullet, launcher):
|
|
|
|
|
baseDamage *= rate2 ** bullet.getDamage()
|
2026-04-03 18:29:14 +08:00
|
|
|
|
2026-04-02 22:49:34 +08:00
|
|
|
func shoot():
|
2026-04-03 18:29:14 +08:00
|
|
|
for bullet in BulletBase.generate(
|
|
|
|
|
ComponentManager.getBullet("InfinitySword"),
|
|
|
|
|
launcher,
|
|
|
|
|
position + Vector2.from_angle(rotation) * 400,
|
|
|
|
|
rotation
|
|
|
|
|
):
|
|
|
|
|
if bullet is InfinitySwordBullet:
|
|
|
|
|
bullet.baseDamage = baseDamage
|
2026-05-08 16:31:11 +08:00
|
|
|
bullet.rate2 = rate2
|
2026-04-03 18:29:14 +08:00
|
|
|
func beReady():
|
|
|
|
|
canMove = false
|
|
|
|
|
EffectController.create(ComponentManager.getEffect("Danger"), findAnchor("Spawn")).shot()
|