Improve task filters, exploration rewards and V4 battle simulation
This commit is contained in:
+16
-5
@@ -289,7 +289,11 @@ class Window(ExplorationPages, ProgressionPages, ActivityPages, W.QMainWindow):
|
||||
self.monster_selection = W.QLabel("选择魔物后可锁定 / 解锁,也可右键操作")
|
||||
self.monster_view = combo([("按牧场分组", 1), ("全部魔物", 0)])
|
||||
self.monster_room = combo([("全部牧场", 0)])
|
||||
for widget in (self.monster_view, self.monster_room, self.lock_monsters, self.unlock_monsters, self.monster_selection):
|
||||
self.breakthrough_settings = W.QPushButton("潜能突破设置")
|
||||
self.breakthrough_settings.setToolTip("定位当前魔物的自动突破目标和优先级;使用材料补满四项潜能再提升阶段,不是同种喂养突破。")
|
||||
self.breakthrough_settings.clicked.connect(self.monsters.reveal_breakthrough)
|
||||
for widget in (self.monster_view, self.monster_room, self.lock_monsters, self.unlock_monsters,
|
||||
self.breakthrough_settings, self.monster_selection):
|
||||
monster_tools.addWidget(widget)
|
||||
for label, currency in (("新建牧场(金币)", "money"), ("新建牧场(氪金)", "ke")):
|
||||
button = W.QPushButton(label)
|
||||
@@ -1592,7 +1596,7 @@ class Window(ExplorationPages, ProgressionPages, ActivityPages, W.QMainWindow):
|
||||
if self.busy or not self.monitoring or not self.strategy_toggle.isChecked() or not self.engine.snapshot:
|
||||
return
|
||||
now = time.monotonic()
|
||||
if now >= self.next_explore and self.explore_enabled.isChecked():
|
||||
if now >= self.next_explore:
|
||||
self.run_fast_automation("explore")
|
||||
elif now >= self.next_breakthrough and self.breakthrough_targets:
|
||||
self.run_fast_automation("breakthrough")
|
||||
@@ -1615,13 +1619,20 @@ class Window(ExplorationPages, ProgressionPages, ActivityPages, W.QMainWindow):
|
||||
def arm_extended_automation(self):
|
||||
active = self.monitoring and self.strategy_toggle.isChecked() and not self.closed and self.engine.snapshot is not None
|
||||
plans = self.latest_render[1] if self.latest_render else []
|
||||
explore_ready = active and self.explore_enabled.isChecked() and any(
|
||||
action.kind in ("explore_start", "explore_finish") and action.path for action in plans)
|
||||
# Pending writes use the existing reconciliation cadence. In particular,
|
||||
# a completed team must not keep a one-second claim loop alive while a
|
||||
# finish or task/battle request is unresolved.
|
||||
pending = active and (self.engine.explore_planner.pending(self.engine.snapshot)
|
||||
or self.engine._progression_pending() or self.engine._breakthrough_pending)
|
||||
if pending:
|
||||
self.next_explore = float("inf")
|
||||
explore_ready = active and not pending and any(action.path and (action.kind == "explore_finish"
|
||||
or action.kind == "explore_start" and self.explore_enabled.isChecked()) for action in plans)
|
||||
breakthrough = active and bool(self.breakthrough_targets) and any(
|
||||
action.kind in ("potential", "breakthrough") for action in plans)
|
||||
now = time.monotonic()
|
||||
explore_delay = 1.0 if explore_ready else None
|
||||
if active and self.explore_enabled.isChecked() and self.engine.snapshot is not None:
|
||||
if active and not pending and self.engine.snapshot is not None:
|
||||
for team in self.engine.snapshot.raw.get("exploreTeams") or []:
|
||||
if not isinstance(team, dict) or team.get("status") not in (1, "1"):
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user