1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 23:11:54 +08:00
Files
Dog-Lynx-And-HCN/scripts/Contents/Bullets/BigLaser.gd
T
fallingshrimp 87c392d8a4 feat(战斗系统): 重构子弹追踪逻辑,使用实体当前焦点位置替代鼠标位置
修改所有子弹追踪逻辑,统一使用launcher.currentFocusedPosition作为目标位置
在EntityBase中新增currentFocusedPosition字段,用于存储当前焦点位置
调整MTY角色的攻击距离参数,使用常量定义最小招架和攻击距离
2026-04-25 13:28:43 +08:00

20 lines
765 B
GDScript

extends BulletBase
class_name BigLaser
var dotTime: float = 100
func spawn():
CameraManager.shake(5000, 100) # 激光会运行5秒(5000毫秒),期间震屏超高强度
CameraManager.playAnimation("bigLaser")
baseDamage *= launcher.fields[FieldStore.Entity.ATTACK_SPEED]
func ai():
rotation = lerp_angle(rotation, ((launcher.currentFocusedPosition - position).angle()), 0.1)
position = launcher.texture.global_position
func applyDot():
hitbox.disabled = true
await TickTool.millseconds(dotTime / launcher.fields[FieldStore.Entity.ATTACK_SPEED])
hitbox.disabled = false
await TickTool.millseconds(dotTime / launcher.fields[FieldStore.Entity.ATTACK_SPEED])
await TickTool.frame() # 等至少一帧,防止跳帧导致没检测到伤害
return true