1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-31 08:21:54 +08:00

feat(战斗系统): 重构子弹追踪逻辑,使用实体当前焦点位置替代鼠标位置

修改所有子弹追踪逻辑,统一使用launcher.currentFocusedPosition作为目标位置
在EntityBase中新增currentFocusedPosition字段,用于存储当前焦点位置
调整MTY角色的攻击距离参数,使用常量定义最小招架和攻击距离
This commit is contained in:
2026-04-25 13:28:43 +08:00
parent 7120eaa79e
commit 87c392d8a4
11 changed files with 29 additions and 17 deletions
+3
View File
@@ -108,6 +108,7 @@ var trailing: bool = false
var lastDirection: int = 1
var currentFocusedBoss: EntityBase = null
var currentFocusedPosition: Vector2 = Vector2.ZERO
var charginup: bool = false
var weapons: Array[Weapon] = []
var weaponBag: Array[String] = []
@@ -187,6 +188,8 @@ func _physics_process(_delta: float) -> void:
if !isPlayer() && !currentFocusedBoss:
currentFocusedBoss = MathTool.randomChoiceFrom(get_tree().get_nodes_in_group("players"))
animatree.set("parameters/blend_position", lerpf(animatree.get("parameters/blend_position"), lastDirection, 0.2))
if is_instance_valid(currentFocusedBoss):
currentFocusedPosition = currentFocusedBoss.position
if sprinting:
if sprintAi():
sprinting = false