1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 15:01:53 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/PurpleCrystal.gd
T
fallingshrimp 9ea534441b feat(武器系统): 重构武器攻击逻辑并添加音效支持
- 将武器攻击逻辑移至Weapon类中,添加tryAttack方法统一处理冷却和能量消耗
- 为武器添加音效支持,包括攻击音效的播放和管理
- 移除子弹生成时的能量消耗检查,改由武器统一处理
- 调整部分武器的属性和配置,如伤害值和冷却时间
- 修复紫水晶子弹的分裂和折射逻辑错误
2025-09-06 08:50:37 +08:00

26 lines
723 B
GDScript

extends BulletBase
class_name PurpleCrystal
func ai():
PresetAIs.forward(self, rotation)
func destroy(_beacuseMap: bool):
EffectController.create(preload("res://components/Effects/PurpleCrystalExplosion.tscn"), global_position).shot()
func split(index, total, _last):
BulletBase.generate(
preload("res://components/Bullets/PurpleCrystal.tscn"),
launcher,
position,
deg_to_rad(360 / total * index),
true,
isChildRefract
)
func refract(entity, _index, _total, _last):
BulletBase.generate(
preload("res://components/Bullets/PurpleCrystal.tscn"),
launcher,
position,
position.angle_to_point(entity.position) if is_instance_valid(entity) else randf_range(0, deg_to_rad(360)),
isChildSplit,
true
)