1
0
mirror of synced 2025-02-22 05:19:29 +01:00

Clean up max deco parts constants for modern common pop'n games.

This commit is contained in:
Jennifer Taylor 2021-09-10 13:30:02 +00:00
parent 43339c7e44
commit 1430103270
3 changed files with 15 additions and 9 deletions

View File

@ -45,6 +45,9 @@ class PopnMusicModernBase(PopnMusicBase, ABC):
# Biggest ID in the music DB # Biggest ID in the music DB
GAME_MAX_MUSIC_ID: int 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 # Return the local2 and lobby2 service so that Pop'n Music 24+ will
# send game packets. # send game packets.
extra_services: List[str] = [ extra_services: List[str] = [
@ -119,17 +122,16 @@ class PopnMusicModernBase(PopnMusicBase, ABC):
return Node.void('pcb24') return Node.void('pcb24')
@abstractmethod @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 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 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 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 representing whether or not to send areas.
of deco parts available for purchase.
""" """
def __construct_common_info(self, root: Node) -> None: 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(): for phaseid, phase_value in phases.items():
phase = Node.void('phase') phase = Node.void('phase')
@ -223,7 +225,7 @@ class PopnMusicModernBase(PopnMusicBase, ABC):
choco.add_child(Node.s32('param', -1)) choco.add_child(Node.s32('param', -1))
# Set up goods, educated guess here. # 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: if goods_id < 15:
price = 30 price = 30
elif goods_id < 30: elif goods_id < 30:

View File

@ -15,6 +15,9 @@ class PopnMusicPeace(PopnMusicModernBase):
# Biggest ID in the music DB # Biggest ID in the music DB
GAME_MAX_MUSIC_ID: int = 1877 GAME_MAX_MUSIC_ID: int = 1877
# Biggest deco part ID in the game
GAME_MAX_DECO_ID: int = 133
# Item limits are as follows: # Item limits are as follows:
# 0: 1877 - ID is the music ID that the player purchased/unlocked. # 0: 1877 - ID is the music ID that the player purchased/unlocked.
# 1: 2284 # 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() game_config = self.get_game_config()
music_phase = game_config.get_int('music_phase') music_phase = game_config.get_int('music_phase')
event_archive_phase = game_config.get_int('event_archive_phase') event_archive_phase = game_config.get_int('event_archive_phase')
@ -289,5 +292,4 @@ class PopnMusicPeace(PopnMusicModernBase):
24: 1, 24: 1,
}, },
False, False,
133,
) )

View File

@ -15,6 +15,9 @@ class PopnMusicUsaNeko(PopnMusicModernBase):
# Biggest ID in the music DB # Biggest ID in the music DB
GAME_MAX_MUSIC_ID: int = 1704 GAME_MAX_MUSIC_ID: int = 1704
# Biggest deco part ID in the game
GAME_MAX_DECO_ID: int = 97
# Item limits are as follows: # Item limits are as follows:
# 0: 1704 - ID is the music ID that the player purchased/unlocked. # 0: 1704 - ID is the music ID that the player purchased/unlocked.
# 1: 2201 # 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() game_config = self.get_game_config()
music_phase = game_config.get_int('music_phase') music_phase = game_config.get_int('music_phase')
holiday_greeting = game_config.get_int('holiday_greeting') holiday_greeting = game_config.get_int('holiday_greeting')
@ -192,5 +195,4 @@ class PopnMusicUsaNeko(PopnMusicModernBase):
13: 1, 13: 1,
}, },
navikun_enabled, navikun_enabled,
97,
) )