add 飞行状态、上马状态、跟随状态监控
This commit is contained in:
@@ -331,7 +331,7 @@ class GameLoopWorker(QThread):
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
from game_state import parse_game_state
|
||||
from game_state import parse_game_state, format_game_state_line
|
||||
except ImportError:
|
||||
self.log_signal.emit("❌ 无法导入 game_state 模块")
|
||||
return
|
||||
@@ -395,19 +395,7 @@ class GameLoopWorker(QThread):
|
||||
while self.running:
|
||||
state = parse_game_state()
|
||||
if state:
|
||||
death_txt = ('存活', '尸体', '灵魂')[state.get('death_state', 0)]
|
||||
target_hp = state.get('target_hp')
|
||||
if target_hp is not None:
|
||||
hp_part = f"血:{state['hp']}% 目标血:{target_hp}% 法:{state['mp']}%"
|
||||
else:
|
||||
hp_part = f"血:{state['hp']}% 法:{state['mp']}%"
|
||||
state_str = (
|
||||
f"{hp_part} | "
|
||||
f"战斗:{'Y' if state['combat'] else 'N'} 目标:{'Y' if state['target'] else 'N'} | "
|
||||
f"空格:{state.get('free_slots', 0)} 耐久:{state.get('durability', 0):.0%} {death_txt} | "
|
||||
f"x:{state['x']} y:{state['y']} 朝向:{state['facing']:.1f}°"
|
||||
)
|
||||
self.state_signal.emit(state_str)
|
||||
self.state_signal.emit(format_game_state_line(state))
|
||||
|
||||
if self.mode == 'patrol' and self.bot_move:
|
||||
self.bot_move.execute_logic(state)
|
||||
|
||||
Reference in New Issue
Block a user