Skip to content

Commit 2881ace

Browse files
committed
fix: labyrinth sweep
1 parent b8bf5ac commit 2881ace

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

autopcr/model/handlers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,9 @@ async def update(self, mgr: datamgr, request):
534534
mgr.dispatch_units = self.dispatch_units
535535
mgr.princess_knight_info = self.princess_knight_info
536536
mgr.unit_role_list = self.unit_role_list
537+
if self.receive_labyrinth_passport_count:
538+
num = mgr.get_inventory(db.labyrinth_ticket)
539+
mgr.set_inventory(db.labyrinth_ticket, num + self.receive_labyrinth_passport_count)
537540

538541
@handles
539542
class HomeIndexResponse(responses.HomeIndexResponse):

autopcr/module/modules/labyrinth.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,13 @@ async def do_task(self, client: pcrclient):
305305
raise SkipError(f'当前黎明界票数为{ticket_count},不超过保留数量{ticket_hold}')
306306

307307
top = await client.labyrinth_top()
308+
309+
if top.enter_id:
310+
self._log("检测到已有黎明界开局,先撤退。")
311+
await client.labyrinth_retire(top.enter_id)
312+
top = await client.labyrinth_top()
313+
ticket_count = client.data.get_inventory(db.labyrinth_ticket)
314+
308315
difficulty = self._max_cleared_difficulty(top, guild_id)
309316
if difficulty is None:
310317
raise AbortError(f'公会{guild_id}尚未通关黎明界,无法扫荡!')

0 commit comments

Comments
 (0)