2025-08-26 12:21:09 +08:00
|
|
|
extends BulletBase
|
2026-05-10 15:47:31 +08:00
|
|
|
class_name PurpleCrystalBullet
|
|
|
|
|
|
|
|
|
|
var cycleRate: float = 0
|
|
|
|
|
var cycleCount: float = 0
|
|
|
|
|
var cycled: bool = false
|
2025-08-26 12:21:09 +08:00
|
|
|
|
|
|
|
|
func ai():
|
2026-05-10 15:47:31 +08:00
|
|
|
PresetBulletAI.forward(self , rotation)
|
2025-08-29 18:34:58 +08:00
|
|
|
func destroy(_beacuseMap: bool):
|
2025-09-21 13:11:31 +08:00
|
|
|
var eff = EffectController.create(ComponentManager.getEffect("PurpleCrystalExplosion"), global_position)
|
2025-09-06 16:55:09 +08:00
|
|
|
eff.rotation = rotation
|
|
|
|
|
eff.shot()
|
2026-05-10 15:47:31 +08:00
|
|
|
func succeedToHit(_dmg: float, entity: EntityBase):
|
|
|
|
|
if MathTool.rate(cycleRate):
|
|
|
|
|
entity.storeEnergy(cycleCount)
|
|
|
|
|
cycled = true
|