2025-08-27 19:59:05 +08:00
|
|
|
extends BulletBase
|
2025-08-28 15:45:38 +08:00
|
|
|
class_name BigLaser # 这个子弹是玩家的超级武器,耗能高,dps也高
|
2025-08-27 19:59:05 +08:00
|
|
|
|
2025-08-28 11:14:14 +08:00
|
|
|
func spawn():
|
2025-08-28 15:45:38 +08:00
|
|
|
CameraManager.shake(5000, 100) # 激光会运行5秒,期间震屏100强度
|
2025-08-28 12:00:09 +08:00
|
|
|
CameraManager.playAnimation("bigLaser")
|
2025-08-28 15:45:38 +08:00
|
|
|
fields[FieldStore.Bullet.DAMAGE] *= launcher.fields[FieldStore.Entity.ATTACK_SPEED]
|
2025-08-27 19:59:05 +08:00
|
|
|
func ai():
|
2025-08-28 11:17:53 +08:00
|
|
|
rotation = lerp_angle(rotation, ((get_global_mouse_position() - position).angle()), 0.1)
|
2025-08-27 19:59:05 +08:00
|
|
|
position = launcher.texture.global_position
|
|
|
|
|
func applyDot():
|
|
|
|
|
hitbox.disabled = true
|
2025-08-28 15:53:39 +08:00
|
|
|
await TickTool.millseconds(100 / launcher.fields[FieldStore.Entity.ATTACK_SPEED])
|
2025-08-27 19:59:05 +08:00
|
|
|
hitbox.disabled = false
|
2025-08-28 15:53:39 +08:00
|
|
|
await TickTool.millseconds(100 / launcher.fields[FieldStore.Entity.ATTACK_SPEED])
|
2025-08-28 12:34:41 +08:00
|
|
|
BulletBase.generate(
|
|
|
|
|
preload("res://components/Bullets/LaserPluse.tscn"),
|
|
|
|
|
launcher,
|
|
|
|
|
position,
|
|
|
|
|
rotation
|
|
|
|
|
)
|
2025-08-27 19:59:05 +08:00
|
|
|
return true
|
2025-08-28 15:53:39 +08:00
|
|
|
func succeedToHit(_dmg: float):
|
2025-08-28 16:00:08 +08:00
|
|
|
fields[FieldStore.Bullet.DAMAGE] *= 1.05
|