mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 15:01:53 +08:00
5570cc97a2
实现火山武器系统,包括: 1. 添加火山武器场景和脚本,支持旋转子弹和伤害计算 2. 新增子弹自旋转AI预设 3. 为公鸡角色添加火山武器配置 4. 实现武器升级效果随灵魂等级提升
20 lines
843 B
GDScript
20 lines
843 B
GDScript
class_name PresetBulletAI
|
|
|
|
static func lockLauncher(bullet: BulletBase, launcher: EntityBase, onTexture: bool = false, useSummoned: bool = false):
|
|
if useSummoned:
|
|
if is_instance_valid(bullet.launcherSummoned):
|
|
launcher = bullet.launcherSummoned
|
|
bullet.position = launcher.texture.global_position if onTexture else launcher.position
|
|
static func forward(bullet: BulletBase, rotation: float):
|
|
bullet.forward(Vector2.from_angle(rotation))
|
|
static func trace(bullet: BulletBase, target: Vector2, speed: float):
|
|
bullet.rotation = lerp_angle(
|
|
bullet.rotation,
|
|
bullet.position.angle_to_point(target),
|
|
speed
|
|
)
|
|
static func faceToMouse(bullet: BulletBase):
|
|
bullet.rotation = bullet.position.angle_to_point(bullet.get_global_mouse_position())
|
|
static func selfRotate(bullet: BulletBase, speed: float):
|
|
bullet.rotation += deg_to_rad(speed)
|