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/AIPresets/Bullet.gd
T
fallingshrimp e47390333f feat(子弹): 新增狐狸爪子弹及其相关功能
添加FoxZhua子弹类型,包含追踪功能
修改FireScan子弹伤害计算方式为基于距离百分比
扩展BulletBase添加原始伤害和距离计算功能
更新Chick角色使用新子弹和调整攻击逻辑
调整Wave生成逻辑添加Boss检测功能
优化FirePot粒子效果和参数
2025-11-16 16:01:03 +08:00

22 lines
975 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)
static func lerpPosition(bullet: BulletBase, target: Vector2, speed: float):
bullet.position = bullet.position.lerp(target, speed)