2025-12-14 17:01:09 +08:00
|
|
|
extends BulletBase
|
|
|
|
|
class_name RedCrystalBullet
|
|
|
|
|
|
|
|
|
|
var radius: float = 0
|
2025-12-17 22:21:10 +08:00
|
|
|
var percent: float = 0
|
2025-12-17 22:23:37 +08:00
|
|
|
var count: int = 0
|
2025-12-14 17:01:09 +08:00
|
|
|
|
|
|
|
|
func register():
|
|
|
|
|
hitbox.shape = hitbox.shape.duplicate()
|
|
|
|
|
func ai():
|
|
|
|
|
PresetBulletAI.forward(self, rotation)
|
|
|
|
|
speed = (1 - lifeTimePercent()) * initialSpeed
|
|
|
|
|
func destroy(_beacuseMap: bool):
|
|
|
|
|
hitbox.shape.radius = radius
|
|
|
|
|
EffectController.create(ComponentManager.getEffect("RedCrystalExplosion"), global_position).shot()
|
2026-04-26 14:02:02 +08:00
|
|
|
if !is_instance_valid(launcher):return
|
2025-12-17 22:23:37 +08:00
|
|
|
for i in randi_range(1, count):
|
|
|
|
|
for bullet in BulletBase.generate(ComponentManager.getBullet("CrystalBlock"), launcher, position, deg_to_rad(randf_range(0, 360))):
|
|
|
|
|
if bullet is CrystalBlockBullet:
|
|
|
|
|
bullet.baseDamage = baseDamage * percent
|
2025-12-14 17:01:09 +08:00
|
|
|
await TickTool.millseconds(100)
|