fix: 装备属性面板避让逻辑 + 多项功能更新

- item_tooltip_view.gd: 新增 avoid_rect 属性,tooltip 与装备窗口重叠时自动推到左侧
- inventory_ui.gd: 悬停装备时传入窗口矩形作为避让区域
- 包含其他累积的功能开发和测试文件
This commit is contained in:
shen
2026-09-21 16:38:59 -07:00
parent 1522a8a1a1
commit c93894313a
5498 changed files with 4558004 additions and 1442 deletions
@@ -24,6 +24,7 @@ func _check(condition: bool, msg: String) -> void:
func _init() -> void:
print("=== Running test_combat_death_pickup_entry_parity ===")
_test_entry_and_stop()
_test_main_player_death_gate()
_test_combat_lock_and_unlock()
_test_dead_mob_handling()
_test_ground_item_pick_and_pos()
@@ -70,6 +71,25 @@ func _test_entry_and_stop() -> void:
dummy.free()
pc.free()
func _test_main_player_death_gate() -> void:
print("\n--- Testing Main Character Death Movement Gate ---")
var pc := PlayerCtl.new()
var dummy := Node3D.new()
dummy.position = Vector3.ZERO
pc.player = dummy
pc._is_going = true
pc._key_up = true
pc.set_dead(true)
_check(pc.dead, "set_dead(true) marks the controller dead")
_check(not pc.is_going(), "death clears point-to-move state")
_check(pc._wasd() == Vector2.ZERO, "death clears WASD state")
_check(not pc._goto(Vector3(5, 0, 5)), "dead controller rejects new goto")
pc.set_dead(false)
_check(not pc.dead, "positive-life transition clears controller dead")
_check(pc._goto(Vector3(5, 0, 5)), "revived controller accepts goto")
dummy.free()
pc.free()
# 2. 战斗锁定与解锁测试:挥击结束必须解锁,combo_index 不得永久死锁
func _test_combat_lock_and_unlock() -> void:
print("\n--- Testing Combat Lock & Motion Finish Unlocking ---")
@@ -120,6 +140,15 @@ func _test_combat_lock_and_unlock() -> void:
np._local_time += 0.6
_check(np.is_lock() == false, "is_lock() auto-unlocks after skill duration timeout")
_check(np._using_skill == false, "_using_skill auto-resets after skill duration timeout")
# 有效 MSA 的技能必须由动作结束事件解锁,不能被名义 clip 时长提前解除。
np.start_skill_cast(0.05, false, false, true)
_check(np.is_lock() == true, "motion-driven skill is locked during the MSA motion")
np._local_time += 1.0
_check(np.is_lock() == true, "motion-driven skill ignores timer fallback before motion_bound(wait)")
np._on_motion_bound("wait")
_check(np.is_lock() == false, "motion-driven skill unlocks on motion_bound(wait)")
_check(np._skill_motion_driven == false, "motion-driven flag clears after motion completion")
# 模拟冲锋技能(charge skill)不锁移动
np.start_skill_cast(0.5, true)