2025-09-25 21:57:32 +08:00
|
|
|
extends BulletBase
|
2025-11-30 15:46:18 +08:00
|
|
|
class_name SevenSoulBullet
|
2025-09-25 21:57:32 +08:00
|
|
|
|
|
|
|
|
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-11-30 15:46:18 +08:00
|
|
|
var energyCollect: float = 0
|
|
|
|
|
var healAmount: float = 0
|
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
|
|
|
|
|
|
|
|
func spawn():
|
2025-09-26 06:49:29 +08:00
|
|
|
modulate = Color(colors[index % colors.size()])
|
|
|
|
|
effect.emitting = true
|
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)
|
2025-11-30 15:46:18 +08:00
|
|
|
func succeedToHit(_dmg: float, _entity: EntityBase):
|
|
|
|
|
launcher.storeEnergy(getDamage() * energyCollect)
|
|
|
|
|
launcher.tryHeal(healAmount)
|