diff --git a/include/global.h b/include/global.h index 057a53b498..b58ef3518b 100644 --- a/include/global.h +++ b/include/global.h @@ -680,7 +680,8 @@ struct Roamer /*0x12*/ u8 tough; /*0x13*/ bool8 active; /*0x14*/ u8 statusB; // Stores frostbite - /*0x14*/ u8 filler[0x7]; + /*0x15*/ bool8 shiny; + /*0x16*/ u8 filler[0x6]; }; struct RamScriptData diff --git a/src/roamer.c b/src/roamer.c index 9bca6fdc45..0fc86b6711 100644 --- a/src/roamer.c +++ b/src/roamer.c @@ -113,6 +113,7 @@ static void CreateInitialRoamerMon(u8 index, u16 species, u8 level) ROAMER(index)->cute = GetMonData(&gEnemyParty[0], MON_DATA_CUTE); ROAMER(index)->smart = GetMonData(&gEnemyParty[0], MON_DATA_SMART); ROAMER(index)->tough = GetMonData(&gEnemyParty[0], MON_DATA_TOUGH); + ROAMER(index)->shiny = GetMonData(&gEnemyParty[0], MON_DATA_IS_SHINY); ROAMER(index)->active = TRUE; sRoamerLocation[index][MAP_GRP] = ROAMER_MAP_GROUP; sRoamerLocation[index][MAP_NUM] = sRoamerLocations[Random() % NUM_LOCATION_SETS][0]; @@ -243,8 +244,6 @@ void CreateRoamerMonInstance(u32 roamerIndex) struct Pokemon *mon = &gEnemyParty[0]; ZeroEnemyPartyMons(); CreateMonWithIVsPersonality(mon, ROAMER(roamerIndex)->species, ROAMER(roamerIndex)->level, ROAMER(roamerIndex)->ivs, ROAMER(roamerIndex)->personality); - // The roamer's status field is u16, but SetMonData expects status to be u32, so will set the roamer's status - // using the status field and the following 3 bytes (cool, beauty, and cute). SetMonData(mon, MON_DATA_STATUS, &status); SetMonData(mon, MON_DATA_HP, &ROAMER(roamerIndex)->hp); SetMonData(mon, MON_DATA_COOL, &ROAMER(roamerIndex)->cool); @@ -252,6 +251,7 @@ void CreateRoamerMonInstance(u32 roamerIndex) SetMonData(mon, MON_DATA_CUTE, &ROAMER(roamerIndex)->cute); SetMonData(mon, MON_DATA_SMART, &ROAMER(roamerIndex)->smart); SetMonData(mon, MON_DATA_TOUGH, &ROAMER(roamerIndex)->tough); + SetMonData(mon, MON_DATA_IS_SHINY, &ROAMER(roamerIndex)->shiny); } bool8 TryStartRoamerEncounter(void)