add Gate 7,8,9,10 support
This commit is contained in:
@ -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,
|
||||
|
@ -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:
|
||||
|
Reference in New Issue
Block a user