add 包满回城

This commit is contained in:
王鹏
2026-04-10 14:36:04 +08:00
parent 8c1460a582
commit afc0e05924
10 changed files with 53 additions and 1 deletions

View File

@@ -118,10 +118,13 @@ class AutoBotMove:
mount_key=str(layout.get("mount_key", "x") or "x"),
mount_hold_sec=float(layout.get("mount_hold_sec", 1.6)),
mount_retry_after_sec=float(layout.get("mount_retry_after_sec", 2.0)),
enable_mount=bool(layout.get("enable_mount", True)),
)
self.death_manager = DeathManager(self.patrol_controller)
vendor_file = vendor_path or get_config_path('vendor.json')
self.logistics_manager = LogisticsManager(vendor_file)
self.logistics_manager.bag_full_hearthstone = bool(layout.get("bag_full_hearthstone", False))
self.logistics_manager.hearthstone_key = str(layout.get("hearthstone_key", "b") or "b")
def _is_effective_target(self, state) -> bool:
"""
@@ -237,6 +240,12 @@ class AutoBotMove:
self.patrol_controller.stop_all()
self.is_moving = False
self.patrol_controller.reset_stuck()
# 勾选"包满炉石回城":按炉石后触发停止回调
if self.logistics_manager.bag_full_hearthstone:
self.logistics_manager.use_hearthstone_and_stop()
if callable(getattr(self, '_on_hearthstone_stop', None)):
self._on_hearthstone_stop()
return
# 中断策略:一旦 GUI 停止,后续 get_state 返回 None使 navigate_path 立即退出。
get_state = (lambda: None if self._should_stop() else parse_game_state())
self.logistics_manager.run_route1_round(get_state, self.patrol_controller)