Add simulated challenges to selected uncleared maps

This commit is contained in:
AttilaNet
2026-11-09 08:11:57 +08:00
parent df0259febf
commit f9631c3363
11 changed files with 628 additions and 47 deletions
+9 -2
View File
@@ -20,6 +20,7 @@ class SweepPolicy:
rules: dict = field(default_factory=dict)
keep_stamina: int = 0
team: str = "teamA"
allow_challenge: bool = True
class SweepRunner:
@@ -123,10 +124,16 @@ class SweepRunner:
monsters = snapshot.monsters
return [mid for mid in ids if mid in monsters]
def reason(self, snapshot, stage, policy, *, team_ids=None):
def reason(self, snapshot, stage, policy, *, team_ids=None, challenge=False):
if self.state.get("pending"):
return "有未完成的扫荡,请先在游戏内检查"
if not stage.sweep:
if challenge:
config = self.catalog.data.get("stage_info", {}).get(stage.stage_id, {})
if not stage.unlocked or not stage.open:
return "关卡尚未解锁或当前未开放"
if config.get("special") or config.get("posmode"):
return "特殊关卡当前不支持自动挑战"
elif not stage.sweep:
return stage.reason
if not (self.team_ids(snapshot, policy) if team_ids is None else team_ids):
return "所选战队无有效魔物"