From 0a4dc8dbb0e4530618ea0a89df58a00d35cb0f26 Mon Sep 17 00:00:00 2001 From: SoulGateKey Date: Tue, 22 Jul 2025 19:55:33 +0800 Subject: [PATCH] add Gate 7,8,9,10 support --- titles/mai2/const.py | 10 +++++++++- titles/mai2/prismplus.py | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/titles/mai2/const.py b/titles/mai2/const.py index 1813ca6..e395ba0 100644 --- a/titles/mai2/const.py +++ b/titles/mai2/const.py @@ -101,8 +101,16 @@ class Mai2Constants: #黑の扉: Played 11 songs 5: [11003, 11095, 11152, 11224, 11296, 11375, 11452, 11529, 11608, 11669, 11736, 11806], #黄の扉: Use random selection to play one of the songs - 6: [212, 213, 337, 270, 271, 11504, 339, 453, 11336, 11852] + 6: [212, 213, 337, 270, 271, 11504, 339, 453, 11336, 11852], #赤の扉: Played 10 songs + 7: [], + #PRISM TOWER: Get the key after clearing six doors. + 8: [], + #KALEIDXSCOPE_FIRST_STAGE: Clear Prism Tower + 9: [], + #希望の扉: CLEAR KALEIDXSCOPE_FIRST_STAGE + 10: [] + #KALEIDXSCOPE_SECOND_STAGE: JP: scan the DXPASS of 希望の鍵, will automatically unlock after clearing 希望の扉 in artemis } MAI_VERSION_LUT = { "100": VER_MAIMAI, diff --git a/titles/mai2/prismplus.py b/titles/mai2/prismplus.py index 1719189..04b8bc4 100644 --- a/titles/mai2/prismplus.py +++ b/titles/mai2/prismplus.py @@ -33,14 +33,17 @@ class Mai2PrismPlus(Mai2Prism): {"gateId": 4, "phaseId": 6}, {"gateId": 5, "phaseId": 6}, {"gateId": 6, "phaseId": 6}, - {"gateId": 7, "phaseId": 6} + {"gateId": 7, "phaseId": 6}, + {"gateId": 8, "phaseId": 6}, + {"gateId": 9, "phaseId": 6}, + {"gateId": 10, "phaseId": 13} ] } async def handle_get_user_kaleidx_scope_api_request(self, data: Dict) -> Dict: # kaleidxscope keyget condition judgement # player may get key before GateFound - for gate in range(1,8): + for gate in range(1,11): if gate == 1 or gate == 4 or gate == 6: condition_satisfy = 0 for condition in Mai2Constants.KALEIDXSCOPE_KEY_CONDITION[gate]: @@ -95,6 +98,32 @@ class Mai2PrismPlus(Mai2Prism): new_kaleidxscope = {'gateId': 5, "isKeyFound": True} await self.data.score.put_user_kaleidxscope(data["userId"], new_kaleidxscope) + elif gate == 7: + + played_kaleidxscope_list = await self.data.score.get_user_kaleidxscope_list(data["userId"]) + check_results = {} + for i in range(1,7): + check_results[i] = False + for played_kaleidxscope in played_kaleidxscope_list: + if played_kaleidxscope[2] == i and played_kaleidxscope[5] == True: + check_results[i] = True + break + all_true = all(check_results.values()) + + if all_true: + new_kaleidxscope = {'gateId': 7, "isKeyFound": True} + await self.data.score.put_user_kaleidxscope(data["userId"], new_kaleidxscope) + + elif gate == 10: + + played_kaleidxscope_list = await self.data.score.get_user_kaleidxscope_list(data["userId"]) + for played_kaleidxscope in played_kaleidxscope_list: + if played_kaleidxscope[2] == 9 and played_kaleidxscope[5] == True: + new_kaleidxscope = {'gateId': 10, "isGateFound": True, "isKeyFound": True} + await self.data.score.put_user_kaleidxscope(data["userId"], new_kaleidxscope) + + + kaleidxscope = await self.data.score.get_user_kaleidxscope_list(data["userId"]) if kaleidxscope is None: