1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/VectorStar.gd
T
fallingshrimp ef6e21de78 fix(子弹系统): 修复子弹分裂和折射逻辑并添加调试配置
修复子弹分裂和折射方法未返回子弹实例的问题,确保子弹能正确添加到场景中。同时在Rooster角色中添加非发布环境下的子弹分裂和折射调试配置。
2026-01-17 12:40:58 +08:00

27 lines
849 B
GDScript

extends BulletBase
class_name VectorStar
var tracer: EntityBase = null
var forwardTime: float = 1000
var forwarded: bool = false
var rotateSpeed: float = 1
func ai():
texture.rotation_degrees += rotateSpeed
rotateSpeed += 0.25
PresetBulletAI.forward(self, rotation)
if timeLived() <= forwardTime:
speed = 10 * ((forwardTime - timeLived()) / forwardTime)
else:
speed = (timeLived() - forwardTime) / 30
if is_instance_valid(tracer):
rotation = position.angle_to_point(tracer.getTrackingAnchor())
func split(newBullet: BulletBase, _index: int, _total: int, _lastBullet: float):
if newBullet is VectorStar:
newBullet.forwarded = false
return newBullet
func refract(newBullet: BulletBase, _entity: EntityBase, _index: int, _total: int, _lastBullet: float):
if newBullet is VectorStar:
newBullet.forwarded = false
return newBullet