Fix fast automation routing and blocked quest navigation loops
Isolate hatch, gift, exploration and breakthrough timers; cancel queued automation after settings change. Check battle readiness before local quest navigation and reject exploring teams or disabled sweeps before entry.
This commit is contained in:
@@ -8,6 +8,7 @@ import uuid
|
||||
from .daily import day
|
||||
from .maps import stages
|
||||
from .drop_statistics import SweepStatistics, event_reward, normalize_reward
|
||||
from .team_availability import team_availability_reason
|
||||
|
||||
|
||||
def settled_reward_event(response):
|
||||
@@ -125,6 +126,8 @@ class SweepRunner:
|
||||
return [mid for mid in ids if mid in monsters]
|
||||
|
||||
def reason(self, snapshot, stage, policy, *, team_ids=None, challenge=False):
|
||||
if not policy.enabled:
|
||||
return "扫荡 / 自动挑战已关闭,禁止新的入场"
|
||||
if self.state.get("pending"):
|
||||
return "有未完成的扫荡,请先在游戏内检查"
|
||||
if challenge:
|
||||
@@ -135,8 +138,9 @@ class SweepRunner:
|
||||
return "特殊关卡当前不支持自动挑战"
|
||||
elif not stage.sweep:
|
||||
return stage.reason
|
||||
if not (self.team_ids(snapshot, policy) if team_ids is None else team_ids):
|
||||
return "所选战队无有效魔物"
|
||||
reason = team_availability_reason(snapshot, policy.team)
|
||||
if reason:
|
||||
return reason
|
||||
positions = self.catalog.data.get("stage_task_positions", {})
|
||||
for task in snapshot.raw.get("currentTasks", []):
|
||||
steps = positions.get(str(task.get("typeId")), [])
|
||||
@@ -159,6 +163,8 @@ class SweepRunner:
|
||||
return ""
|
||||
|
||||
def next(self, snapshot, policy):
|
||||
if not policy.enabled:
|
||||
return None
|
||||
for stage in sorted(stages(self.catalog, snapshot), key=lambda s: (s.city, s.number, s.stage_id, s.level)):
|
||||
rule = policy.rules.get(stage.stage_id) or {}
|
||||
if not rule.get("enabled") or str(rule.get("level", "3")) != stage.level:
|
||||
|
||||
Reference in New Issue
Block a user