2025-09-25 21:57:32 +08:00
|
|
|
extends BulletBase
|
|
|
|
|
|
|
|
|
|
var colors = [
|
|
|
|
|
"#2BEAFF",
|
|
|
|
|
"#FCA500",
|
|
|
|
|
"#0042FF",
|
|
|
|
|
"#D346D0",
|
|
|
|
|
"#0C9B0B",
|
|
|
|
|
"#FDEB0F"
|
|
|
|
|
]
|
|
|
|
|
var index = 0
|
2025-09-26 22:29:28 +08:00
|
|
|
var generationDuration: float = 15000
|
|
|
|
|
var pingAfterGeneration: float = 5000
|
2025-09-25 21:57:32 +08:00
|
|
|
|
|
|
|
|
@onready var heart = $"%heart"
|
2025-09-26 06:49:29 +08:00
|
|
|
@onready var effect: GPUParticles2D = $"%effect"
|
2025-09-25 21:57:32 +08:00
|
|
|
|
2025-09-26 22:37:05 +08:00
|
|
|
func register():
|
|
|
|
|
area_entered.connect(
|
|
|
|
|
func(area):
|
|
|
|
|
var bullet = BulletTool.fromArea(area)
|
|
|
|
|
if bullet and BulletTool.canDamage(bullet, launcher):
|
2025-11-22 08:42:51 +08:00
|
|
|
launcher.storeEnergy(baseDamage * 2)
|
2025-09-26 22:37:05 +08:00
|
|
|
)
|
2025-09-25 21:57:32 +08:00
|
|
|
func spawn():
|
2025-09-26 06:49:29 +08:00
|
|
|
modulate = Color(colors[index % colors.size()])
|
|
|
|
|
effect.emitting = true
|
2025-09-26 22:12:48 +08:00
|
|
|
|
2025-09-25 21:57:32 +08:00
|
|
|
func ai():
|
2025-09-26 22:22:49 +08:00
|
|
|
rotation_degrees = 360.0 / colors.size() * index + timeLived() / generationDuration * 360 - index / 6.0 * 360.0
|
2025-09-25 21:57:32 +08:00
|
|
|
heart.global_rotation_degrees = 0
|
|
|
|
|
PresetBulletAI.lockLauncher(self, launcher, true)
|
|
|
|
|
func applyDot():
|
2025-09-26 22:29:28 +08:00
|
|
|
if timeLived() > generationDuration * ((6.0 - index) / 6.0) + pingAfterGeneration:
|
2025-09-25 22:41:04 +08:00
|
|
|
BulletBase.generate(ComponentManager.getBullet("SoulBall"), launcher, heart.global_position, heart.global_position.angle_to_point(get_global_mouse_position()))
|
2025-09-25 21:57:32 +08:00
|
|
|
await TickTool.millseconds(100)
|
|
|
|
|
return true
|