Use OTID constants for CreateMon

This commit is contained in:
GriffinR 2019-08-30 23:06:43 -04:00 committed by huderlem
parent 45767f9c00
commit 5d30304f4e
12 changed files with 23 additions and 23 deletions

View File

@ -64,7 +64,7 @@ void SetUpBattleVarsAndBirchZigzagoon(void)
if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE) if (gBattleTypeFlags & BATTLE_TYPE_FIRST_BATTLE)
{ {
ZeroEnemyPartyMons(); ZeroEnemyPartyMons();
CreateMon(&gEnemyParty[0], SPECIES_ZIGZAGOON, 2, 32, 0, 0, 0, 0); CreateMon(&gEnemyParty[0], SPECIES_ZIGZAGOON, 2, 32, 0, 0, OT_ID_PLAYER_ID, 0);
i = 0; i = 0;
SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &i); SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &i);
} }

View File

@ -415,7 +415,7 @@ static void SetPlayerAndOpponentParties(void)
monLevel, monLevel,
ivs, ivs,
TRUE, gSaveBlock2Ptr->frontier.rentalMons[i].personality, TRUE, gSaveBlock2Ptr->frontier.rentalMons[i].personality,
0, 0); OT_ID_PLAYER_ID, 0);
count = 0; count = 0;
bits = gFacilityTrainerMons[monSetId].evSpread; bits = gFacilityTrainerMons[monSetId].evSpread;
@ -456,7 +456,7 @@ static void SetPlayerAndOpponentParties(void)
monLevel, monLevel,
ivs, ivs,
TRUE, gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality, TRUE, gSaveBlock2Ptr->frontier.rentalMons[i + 3].personality,
0, 0); OT_ID_PLAYER_ID, 0);
count = 0; count = 0;
bits = gFacilityTrainerMons[monSetId].evSpread; bits = gFacilityTrainerMons[monSetId].evSpread;

View File

@ -2004,7 +2004,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
personalityValue += nameHash << 8; personalityValue += nameHash << 8;
fixedIV = partyData[i].iv * 31 / 255; fixedIV = partyData[i].iv * 31 / 255;
CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, 2, 0); CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)
{ {
@ -2022,7 +2022,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
personalityValue += nameHash << 8; personalityValue += nameHash << 8;
fixedIV = partyData[i].iv * 31 / 255; fixedIV = partyData[i].iv * 31 / 255;
CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, 2, 0); CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem); SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem);
break; break;
@ -2036,7 +2036,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir
personalityValue += nameHash << 8; personalityValue += nameHash << 8;
fixedIV = partyData[i].iv * 31 / 255; fixedIV = partyData[i].iv * 31 / 255;
CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, 2, 0); CreateMon(&party[i], partyData[i].species, partyData[i].lvl, fixedIV, TRUE, personalityValue, OT_ID_RANDOM_NO_SHINY, 0);
SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem); SetMonData(&party[i], MON_DATA_HELD_ITEM, &partyData[i].heldItem);

View File

@ -3190,7 +3190,7 @@ static void FillPartnerParty(u16 trainerId)
sStevenMons[i].level, sStevenMons[i].level,
sStevenMons[i].fixedIV, sStevenMons[i].fixedIV,
TRUE, i, // BUG: personality was stored in the 'j' variable. As a result, Steven's pokemon do not have the intended natures. TRUE, i, // BUG: personality was stored in the 'j' variable. As a result, Steven's pokemon do not have the intended natures.
TRUE, STEVEN_OTID); OT_ID_PRESET, STEVEN_OTID);
for (j = 0; j < 6; j++) for (j = 0; j < 6; j++)
SetMonData(&gPlayerParty[3 + i], MON_DATA_HP_EV + j, &sStevenMons[i].evs[j]); SetMonData(&gPlayerParty[3 + i], MON_DATA_HP_EV + j, &sStevenMons[i].evs[j]);
for (j = 0; j < MAX_MON_MOVES; j++) for (j = 0; j < MAX_MON_MOVES; j++)

View File

@ -835,7 +835,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation)
u8 metLocation; u8 metLocation;
u8 isEgg; u8 isEgg;
CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, FALSE, 0, FALSE, 0); CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, FALSE, 0, OT_ID_PLAYER_ID, 0);
metLevel = 0; metLevel = 0;
ball = ITEM_POKE_BALL; ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE; language = LANGUAGE_JAPANESE;
@ -862,7 +862,7 @@ static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare *
u8 language; u8 language;
personality = daycare->offspringPersonality; personality = daycare->offspringPersonality;
CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, TRUE, personality, FALSE, 0); CreateMon(mon, species, EGG_HATCH_LEVEL, 0x20, TRUE, personality, OT_ID_PLAYER_ID, 0);
metLevel = 0; metLevel = 0;
ball = ITEM_POKE_BALL; ball = ITEM_POKE_BALL;
language = LANGUAGE_JAPANESE; language = LANGUAGE_JAPANESE;

View File

@ -322,7 +322,7 @@ static void CreatedHatchedMon(struct Pokemon *egg, struct Pokemon *temp)
pokerus = GetMonData(egg, MON_DATA_POKERUS); pokerus = GetMonData(egg, MON_DATA_POKERUS);
obedience = GetMonData(egg, MON_DATA_OBEDIENCE); obedience = GetMonData(egg, MON_DATA_OBEDIENCE);
CreateMon(temp, species, EGG_HATCH_LEVEL, 32, TRUE, personality, 0, 0); CreateMon(temp, species, EGG_HATCH_LEVEL, 32, TRUE, personality, OT_ID_PLAYER_ID, 0);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
{ {

View File

@ -1442,7 +1442,7 @@ void SetShoalItemFlag(u16 v0)
void PutZigzagoonInPlayerParty(void) void PutZigzagoonInPlayerParty(void)
{ {
u16 monData; u16 monData;
CreateMon(&gPlayerParty[0], SPECIES_ZIGZAGOON, 7, 0x20, FALSE, 0, FALSE, 0); CreateMon(&gPlayerParty[0], SPECIES_ZIGZAGOON, 7, 0x20, FALSE, 0, OT_ID_PLAYER_ID, 0);
monData = TRUE; monData = TRUE;
SetMonData(&gPlayerParty[0], MON_DATA_ABILITY_NUM, &monData); SetMonData(&gPlayerParty[0], MON_DATA_ABILITY_NUM, &monData);
monData = MOVE_TACKLE; monData = MOVE_TACKLE;

View File

@ -2503,7 +2503,7 @@ void CreateFrontierBrainPokemon(void)
monLevel, monLevel,
sFrontierBrainsMons[facility][symbol][i].fixedIV, sFrontierBrainsMons[facility][symbol][i].fixedIV,
TRUE, j, TRUE, j,
TRUE, FRONTIER_BRAIN_OTID); OT_ID_PRESET, FRONTIER_BRAIN_OTID);
SetMonData(&gEnemyParty[monPartyId], MON_DATA_HELD_ITEM, &sFrontierBrainsMons[facility][symbol][i].heldItem); SetMonData(&gEnemyParty[monPartyId], MON_DATA_HELD_ITEM, &sFrontierBrainsMons[facility][symbol][i].heldItem);
for (j = 0; j < NUM_STATS; j++) for (j = 0; j < NUM_STATS; j++)
SetMonData(&gEnemyParty[monPartyId], MON_DATA_HP_EV + j, &sFrontierBrainsMons[facility][symbol][i].evs[j]); SetMonData(&gEnemyParty[monPartyId], MON_DATA_HP_EV + j, &sFrontierBrainsMons[facility][symbol][i].evs[j]);

View File

@ -2341,7 +2341,7 @@ void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedI
u16 evAmount; u16 evAmount;
u8 evsBits; u8 evsBits;
CreateMon(mon, species, level, fixedIV, 0, 0, 0, 0); CreateMon(mon, species, level, fixedIV, 0, 0, OT_ID_PLAYER_ID, 0);
evsBits = evSpread; evsBits = evSpread;
@ -2373,7 +2373,7 @@ void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src)
u8 language; u8 language;
u8 value; u8 value;
CreateMon(mon, src->species, src->level, 0, 1, src->personality, 1, src->otId); CreateMon(mon, src->species, src->level, 0, 1, src->personality, OT_ID_PRESET, src->otId);
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(mon, src->moves[i], i); SetMonMoveSlot(mon, src->moves[i], i);
@ -2435,7 +2435,7 @@ void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src,
else else
level = src->level; level = src->level;
CreateMon(mon, src->species, level, 0, 1, src->personality, 1, src->otId); CreateMon(mon, src->species, level, 0, 1, src->personality, OT_ID_PRESET, src->otId);
for (i = 0; i < MAX_MON_MOVES; i++) for (i = 0; i < MAX_MON_MOVES; i++)
SetMonMoveSlot(mon, src->moves[i], i); SetMonMoveSlot(mon, src->moves[i], i);
@ -2497,7 +2497,7 @@ void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 m
0x1F, 0x1F,
TRUE, TRUE,
personality, personality,
TRUE, OT_ID_PRESET,
otId); otId);
SetMonData(mon, MON_DATA_HELD_ITEM, &src->party[monId].item); SetMonData(mon, MON_DATA_HELD_ITEM, &src->party[monId].item);
@ -2527,7 +2527,7 @@ void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level,
i = Random32(); i = Random32();
} while (nature != GetNatureFromPersonality(i)); } while (nature != GetNatureFromPersonality(i));
CreateMon(mon, species, level, fixedIV, TRUE, i, TRUE, otId); CreateMon(mon, species, level, fixedIV, TRUE, i, OT_ID_PRESET, otId);
evsBits = evSpread; evsBits = evSpread;
for (i = 0; i < NUM_STATS; i++) for (i = 0; i < NUM_STATS; i++)
{ {
@ -4458,7 +4458,7 @@ void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord)
15, 15,
1, 1,
gBattleResources->secretBase->party.personality[i], gBattleResources->secretBase->party.personality[i],
2, OT_ID_RANDOM_NO_SHINY,
0); 0);
SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleResources->secretBase->party.heldItems[i]); SetMonData(&gEnemyParty[i], MON_DATA_HELD_ITEM, &gBattleResources->secretBase->party.heldItems[i]);

View File

@ -67,7 +67,7 @@ static void CreateInitialRoamerMon(bool16 createLatios)
else else
(&gSaveBlock1Ptr->roamer)->species = SPECIES_LATIOS; (&gSaveBlock1Ptr->roamer)->species = SPECIES_LATIOS;
CreateMon(&gEnemyParty[0], (&gSaveBlock1Ptr->roamer)->species, 40, 0x20, 0, 0, 0, 0); CreateMon(&gEnemyParty[0], (&gSaveBlock1Ptr->roamer)->species, 40, 0x20, 0, 0, OT_ID_PLAYER_ID, 0);
(&gSaveBlock1Ptr->roamer)->level = 40; (&gSaveBlock1Ptr->roamer)->level = 40;
(&gSaveBlock1Ptr->roamer)->status = 0; (&gSaveBlock1Ptr->roamer)->status = 0;
(&gSaveBlock1Ptr->roamer)->active = TRUE; (&gSaveBlock1Ptr->roamer)->active = TRUE;

View File

@ -551,7 +551,7 @@ u8 ScriptGiveMon(u16 species, u8 level, u16 item, u32 unused1, u32 unused2, u8 u
u8 heldItem[2]; u8 heldItem[2];
struct Pokemon mon; struct Pokemon mon;
CreateMon(&mon, species, level, 32, 0, 0, 0, 0); CreateMon(&mon, species, level, 32, 0, 0, OT_ID_PLAYER_ID, 0);
heldItem[0] = item; heldItem[0] = item;
heldItem[1] = item >> 8; heldItem[1] = item >> 8;
SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem); SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem);
@ -624,7 +624,7 @@ void CreateScriptedWildMon(u16 species, u8 level, u16 item)
u8 heldItem[2]; u8 heldItem[2];
ZeroEnemyPartyMons(); ZeroEnemyPartyMons();
CreateMon(&gEnemyParty[0], species, level, 0x20, 0, 0, 0, 0); CreateMon(&gEnemyParty[0], species, level, 0x20, 0, 0, OT_ID_PLAYER_ID, 0);
if (item) if (item)
{ {
heldItem[0] = item; heldItem[0] = item;

View File

@ -1551,7 +1551,7 @@ static void sub_80773D0(void)
for (i = 0; i < PARTY_SIZE; i++) for (i = 0; i < PARTY_SIZE; i++)
{ {
CreateMon(&gEnemyParty[i], SPECIES_NONE, 0, 0x20, FALSE, 0, 0, 0); CreateMon(&gEnemyParty[i], SPECIES_NONE, 0, 0x20, FALSE, 0, OT_ID_PLAYER_ID, 0);
} }
sub_807A19C(0); sub_807A19C(0);
@ -5832,7 +5832,7 @@ static void _CreateInGameTradePokemon(u8 whichPlayerMon, u8 whichInGameTrade)
u8 isMail; u8 isMail;
struct Pokemon *pokemon = &gEnemyParty[0]; struct Pokemon *pokemon = &gEnemyParty[0];
CreateMon(pokemon, inGameTrade->species, level, 32, TRUE, inGameTrade->personality, TRUE, inGameTrade->otId); CreateMon(pokemon, inGameTrade->species, level, 32, TRUE, inGameTrade->personality, OT_ID_PRESET, inGameTrade->otId);
SetMonData(pokemon, MON_DATA_HP_IV, &inGameTrade->ivs[0]); SetMonData(pokemon, MON_DATA_HP_IV, &inGameTrade->ivs[0]);
SetMonData(pokemon, MON_DATA_ATK_IV, &inGameTrade->ivs[1]); SetMonData(pokemon, MON_DATA_ATK_IV, &inGameTrade->ivs[1]);