Update to v2.10.3 [Enhance] map local restrict

- Add support for locally restricting songs or challenges in the map of world mode
This commit is contained in:
Lost-MSth
2023-01-26 21:15:09 +08:00
parent 9fbdcd5edb
commit fbd5d83626
10 changed files with 191 additions and 120 deletions

View File

@@ -1,6 +1,6 @@
from .config_manager import Config
ARCAEA_SERVER_VERSION = 'v2.10.2'
ARCAEA_SERVER_VERSION = 'v2.10.3'
class Constant:

View File

@@ -22,6 +22,8 @@ class Purchase:
self.items: list = []
# TODO: "discount_reason": "extend"
@property
def price_displayed(self) -> int:
'''

View File

@@ -106,7 +106,7 @@ class Map:
self.available_from: int = None
self.available_to: int = None
self.is_repeatable: bool = None
self.require_id: str = None
self.require_id: 'str | list[str]' = None
self.require_type: str = None
self.require_value: int = None
self.coordinate: str = None
@@ -115,6 +115,9 @@ class Map:
self.steps: list = []
self.__rewards: list = None
self.require_localunlock_songid: str = None
self.require_localunlock_challengeid: str = None
@property
def rewards(self) -> list:
if self.__rewards is None:
@@ -155,6 +158,8 @@ class Map:
'custom_bg': self.custom_bg,
'stamina_cost': self.stamina_cost,
'step_count': self.step_count,
'require_localunlock_songid': self.require_localunlock_songid,
'require_localunlock_challengeid': self.require_localunlock_challengeid,
'steps': [s.to_dict() for s in self.steps],
}
@@ -174,6 +179,8 @@ class Map:
self.coordinate = raw_dict.get('coordinate')
self.custom_bg = raw_dict.get('custom_bg', '')
self.stamina_cost = raw_dict.get('stamina_cost')
self.require_localunlock_songid = raw_dict.get('require_localunlock_songid', '')
self.require_localunlock_challengeid = raw_dict.get('require_localunlock_challengeid', '')
self.steps = [Step().from_dict(s) for s in raw_dict.get('steps')]
return self