Fix names and constant usage for union room classes

This commit is contained in:
GriffinR
2022-08-23 12:39:24 -04:00
parent 8a8ba92f21
commit 3771abbe08
7 changed files with 26 additions and 20 deletions

View File

@@ -46,6 +46,7 @@
#include "constants/moves.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/union_room.h"
struct SpeciesItem
{
@@ -1884,7 +1885,9 @@ static const u16 sDeoxysBaseStats[] =
[STAT_SPDEF] = 90,
};
const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE_LINK_FACILITY_CLASSES] =
// The classes used by other players in the Union Room.
// These should correspond with the overworld graphics in sUnionRoomObjGfxIds
const u16 gUnionRoomFacilityClasses[NUM_UNION_ROOM_CLASSES * GENDER_COUNT] =
{
// Male classes
FACILITY_CLASS_COOLTRAINER_M,
@@ -1895,7 +1898,7 @@ const u16 gLinkPlayerFacilityClasses[NUM_MALE_LINK_FACILITY_CLASSES + NUM_FEMALE
FACILITY_CLASS_BUG_CATCHER,
FACILITY_CLASS_PKMN_BREEDER_M,
FACILITY_CLASS_GUITARIST,
// Female Classes
// Female classes
FACILITY_CLASS_COOLTRAINER_F,
FACILITY_CLASS_HEX_MANIAC,
FACILITY_CLASS_PICNICKER,
@@ -2740,9 +2743,9 @@ u16 GetUnionRoomTrainerPic(void)
else
linkId = GetMultiplayerId() ^ 1;
arrId = gLinkPlayers[linkId].trainerId & 7;
arrId |= gLinkPlayers[linkId].gender << 3;
return FacilityClassToPicIndex(gLinkPlayerFacilityClasses[arrId]);
arrId = gLinkPlayers[linkId].trainerId % NUM_UNION_ROOM_CLASSES;
arrId |= gLinkPlayers[linkId].gender * NUM_UNION_ROOM_CLASSES;
return FacilityClassToPicIndex(gUnionRoomFacilityClasses[arrId]);
}
u16 GetUnionRoomTrainerClass(void)
@@ -2755,9 +2758,9 @@ u16 GetUnionRoomTrainerClass(void)
else
linkId = GetMultiplayerId() ^ 1;
arrId = gLinkPlayers[linkId].trainerId & 7;
arrId |= gLinkPlayers[linkId].gender << 3;
return gFacilityClassToTrainerClass[gLinkPlayerFacilityClasses[arrId]];
arrId = gLinkPlayers[linkId].trainerId % NUM_UNION_ROOM_CLASSES;
arrId |= gLinkPlayers[linkId].gender * NUM_UNION_ROOM_CLASSES;
return gFacilityClassToTrainerClass[gUnionRoomFacilityClasses[arrId]];
}
void CreateEventLegalEnemyMon(void)