diff --git a/bemani/backend/popn/common.py b/bemani/backend/popn/common.py index 81d8355..7244c29 100644 --- a/bemani/backend/popn/common.py +++ b/bemani/backend/popn/common.py @@ -45,6 +45,9 @@ class PopnMusicModernBase(PopnMusicBase, ABC): # Biggest ID in the music DB GAME_MAX_MUSIC_ID: int + # Biggest deco part ID in the game + GAME_MAX_DECO_ID: int + # Return the local2 and lobby2 service so that Pop'n Music 24+ will # send game packets. extra_services: List[str] = [ @@ -119,17 +122,16 @@ class PopnMusicModernBase(PopnMusicBase, ABC): return Node.void('pcb24') @abstractmethod - def get_common_config(self) -> Tuple[Dict[int, int], bool, int]: + def get_common_config(self) -> Tuple[Dict[int, int], bool]: """ Return a tuple of configuration options for sending the common node back to the client. The first parameter is a dictionary whose keys are event IDs and values are the event phase number. The second parameter is a bool - representing whether or not to send areas. The third parameter is the number - of deco parts available for purchase. + representing whether or not to send areas. """ def __construct_common_info(self, root: Node) -> None: - phases, send_areas, goods_count = self.get_common_config() + phases, send_areas = self.get_common_config() for phaseid, phase_value in phases.items(): phase = Node.void('phase') @@ -223,7 +225,7 @@ class PopnMusicModernBase(PopnMusicBase, ABC): choco.add_child(Node.s32('param', -1)) # Set up goods, educated guess here. - for goods_id in range(goods_count): + for goods_id in range(self.GAME_MAX_DECO_ID): if goods_id < 15: price = 30 elif goods_id < 30: diff --git a/bemani/backend/popn/peace.py b/bemani/backend/popn/peace.py index 420196a..8b3500e 100644 --- a/bemani/backend/popn/peace.py +++ b/bemani/backend/popn/peace.py @@ -15,6 +15,9 @@ class PopnMusicPeace(PopnMusicModernBase): # Biggest ID in the music DB GAME_MAX_MUSIC_ID: int = 1877 + # Biggest deco part ID in the game + GAME_MAX_DECO_ID: int = 133 + # Item limits are as follows: # 0: 1877 - ID is the music ID that the player purchased/unlocked. # 1: 2284 @@ -146,7 +149,7 @@ class PopnMusicPeace(PopnMusicModernBase): ], } - def get_common_config(self) -> Tuple[Dict[int, int], bool, int]: + def get_common_config(self) -> Tuple[Dict[int, int], bool]: game_config = self.get_game_config() music_phase = game_config.get_int('music_phase') event_archive_phase = game_config.get_int('event_archive_phase') @@ -289,5 +292,4 @@ class PopnMusicPeace(PopnMusicModernBase): 24: 1, }, False, - 133, ) diff --git a/bemani/backend/popn/usaneko.py b/bemani/backend/popn/usaneko.py index 82ac23d..5adcb94 100644 --- a/bemani/backend/popn/usaneko.py +++ b/bemani/backend/popn/usaneko.py @@ -15,6 +15,9 @@ class PopnMusicUsaNeko(PopnMusicModernBase): # Biggest ID in the music DB GAME_MAX_MUSIC_ID: int = 1704 + # Biggest deco part ID in the game + GAME_MAX_DECO_ID: int = 97 + # Item limits are as follows: # 0: 1704 - ID is the music ID that the player purchased/unlocked. # 1: 2201 @@ -120,7 +123,7 @@ class PopnMusicUsaNeko(PopnMusicModernBase): ], } - def get_common_config(self) -> Tuple[Dict[int, int], bool, int]: + def get_common_config(self) -> Tuple[Dict[int, int], bool]: game_config = self.get_game_config() music_phase = game_config.get_int('music_phase') holiday_greeting = game_config.get_int('holiday_greeting') @@ -192,5 +195,4 @@ class PopnMusicUsaNeko(PopnMusicModernBase): 13: 1, }, navikun_enabled, - 97, )