From 132106499a4ffea90e349a671edf73a542c9dbd9 Mon Sep 17 00:00:00 2001 From: beerpsi Date: Mon, 22 Jul 2024 12:00:29 +0700 Subject: [PATCH] Add map conditions for LUMINOUS ep.III --- core/logger/__init__.py | 5 ++- titles/chuni/luminous.py | 77 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 1 deletion(-) diff --git a/core/logger/__init__.py b/core/logger/__init__.py index 40fcd0e..e618284 100644 --- a/core/logger/__init__.py +++ b/core/logger/__init__.py @@ -53,7 +53,10 @@ def create_logger( logger = artemis_logger.getChild(logger_name) if getattr(logger, "initialized", False): - return MergedLoggerAdapter(logger, {"title": title}) + logger = MergedLoggerAdapter(logger, {"title": title}) + logger.setLevel(level or logging.INFO) + + return logger if core_cfg is None: raise RuntimeError("Root logger has not been initialized.") diff --git a/titles/chuni/luminous.py b/titles/chuni/luminous.py index af61cf8..05fbd2a 100644 --- a/titles/chuni/luminous.py +++ b/titles/chuni/luminous.py @@ -319,7 +319,84 @@ class ChuniLuminous(ChuniSunPlus): ], } ) + + # LUMINOUS ep. III + if 14481 in event_by_id: + start_date = event_by_id[14481]["startDate"].strftime(self.date_time_format) + if not mystic_area_1_added: + conditions.append(mystic_area_1_conditions) + mystic_area_1_added = True + + mystic_area_1_conditions["length"] += 1 + mystic_area_1_conditions["mapAreaConditionList"].append( + { + "type": MapAreaConditionType.MAP_CLEARED.value, + "conditionId": 3020703, + "logicalOpe": MapAreaConditionLogicalOperator.OR.value, + "startDate": start_date, + "endDate": "2099-12-31 00:00:00.0", + } + ) + + conditions.append( + { + "mapAreaId": 3229304, # Mystic Rainbow of LUMINOUS Area 4, + "length": 1, + # Unlocks when LUMINOUS ep. III is completed. + "mapAreaConditionList": [ + { + "type": MapAreaConditionType.MAP_CLEARED.value, + "conditionId": 3020703, + "logicalOpe": MapAreaConditionLogicalOperator.AND.value, + "startDate": start_date, + "endDate": "2099-12-31 00:00:00.0", + }, + ], + } + ) + + # 1UM1N0U5 ep. 111 + if 14483 in event_by_id: + start_date = event_by_id[14483]["startDate"].strftime(self.date_time_format) + + # Finish LUMINOUS ep.III to unlock the six titles in 1UM1N0U5 ep.111. + for i in range(3229201, 3229207): + conditions.append( + { + "mapAreaId": i, + "length": 1, + "mapAreaConditionList": [ + { + "type": MapAreaConditionType.MAP_CLEARED.value, + "conditionId": 3020703, + "logicalOpe": MapAreaConditionLogicalOperator.AND.value, + "startDate": start_date, + "endDate": "2099-12-31 00:00:00.0", + } + ], + }, + ) + + # Finish the 6 title map areas to unlock Ultimate Force. + conditions.append( + { + "mapAreaId": 3229207, # Ultimate Force + "length": 6, + # Finish the 6 other areas + "mapAreaConditionList": [ + { + "type": MapAreaConditionType.MAP_AREA_CLEARED.value, + "conditionId": x, + "logicalOpe": MapAreaConditionLogicalOperator.AND.value, + "startDate": start_date, + "endDate": "2099-12-31 00:00:00.0", + } + for x in range(3229201, 3229207) + ], + }, + ) + return { "length": len(conditions),