diff --git a/include/pokemon.h b/include/pokemon.h index e48618328..1b6151669 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -287,7 +287,7 @@ struct BattlePokemon /*0x54*/ u32 otId; }; -struct BaseStats +struct SpeciesInfo { /* 0x00 */ u8 baseHP; /* 0x01 */ u8 baseAttack; @@ -374,7 +374,7 @@ extern struct SpriteTemplate gMultiuseSpriteTemplate; extern const struct BattleMove gBattleMoves[]; extern const u8 gFacilityClassToPicIndex[]; extern const u8 gFacilityClassToTrainerClass[]; -extern const struct BaseStats gBaseStats[]; +extern const struct SpeciesInfo gSpeciesInfo[]; extern const u8 *const gItemEffectTable[]; extern const u32 gExperienceTables[][MAX_LEVEL + 1]; extern const u16 *const gLevelUpLearnsets[]; diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 1ddcc9805..aacbe20ac 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -1379,24 +1379,24 @@ static void Cmd_get_ability(void) return; } - if (gBaseStats[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE) + if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE) { - if (gBaseStats[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE) + if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE) { // AI has no knowledge of opponent, so it guesses which ability. if (Random() & 1) - AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[0]; + AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0]; else - AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[1]; + AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; } else { - AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[0]; // It's definitely ability 1. + AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0]; // It's definitely ability 1. } } else { - AI_THINKING_STRUCT->funcResult = gBaseStats[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1. + AI_THINKING_STRUCT->funcResult = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1. } } else @@ -1427,15 +1427,15 @@ static void Cmd_check_ability(void) { ability = gBattleMons[battlerId].ability; } - else if (gBaseStats[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE) + else if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[0] != ABILITY_NONE) { - if (gBaseStats[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE) + if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[1] != ABILITY_NONE) { u8 abilityDummyVariable = ability; // Needed to match. - if (gBaseStats[gBattleMons[battlerId].species].abilities[0] != abilityDummyVariable - && gBaseStats[gBattleMons[battlerId].species].abilities[1] != abilityDummyVariable) + if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[0] != abilityDummyVariable + && gSpeciesInfo[gBattleMons[battlerId].species].abilities[1] != abilityDummyVariable) { - ability = gBaseStats[gBattleMons[battlerId].species].abilities[0]; + ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0]; } else { @@ -1444,12 +1444,12 @@ static void Cmd_check_ability(void) } else { - ability = gBaseStats[gBattleMons[battlerId].species].abilities[0]; + ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[0]; } } else { - ability = gBaseStats[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1. + ability = gSpeciesInfo[gBattleMons[battlerId].species].abilities[1]; // AI can't actually reach this part since no pokemon has ability 2 and no ability 1. } } else diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 261349dce..0aec2316e 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -199,9 +199,9 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) species = GetMonData(&party[i], MON_DATA_SPECIES); if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0) - monAbility = gBaseStats[species].abilities[1]; + monAbility = gSpeciesInfo[species].abilities[1]; else - monAbility = gBaseStats[species].abilities[0]; + monAbility = gSpeciesInfo[species].abilities[0]; if (absorbingTypeAbility == monAbility && Random() & 1) { @@ -397,9 +397,9 @@ static bool8 FindMonWithFlagsAndSuperEffective(u8 flags, u8 moduloPercent) species = GetMonData(&party[i], MON_DATA_SPECIES); if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0) - monAbility = gBaseStats[species].abilities[1]; + monAbility = gSpeciesInfo[species].abilities[1]; else - monAbility = gBaseStats[species].abilities[0]; + monAbility = gSpeciesInfo[species].abilities[0]; moveFlags = AI_TypeCalc(gLastLandedMoves[gActiveBattler], species, monAbility); if (moveFlags & flags) @@ -703,8 +703,8 @@ u8 GetMostSuitableMonToSwitchInto(void) && i != *(gBattleStruct->monToSwitchIntoId + battlerIn1) && i != *(gBattleStruct->monToSwitchIntoId + battlerIn2)) { - u8 type1 = gBaseStats[species].type1; - u8 type2 = gBaseStats[species].type2; + u8 type1 = gSpeciesInfo[species].type1; + u8 type2 = gSpeciesInfo[species].type2; u8 typeDmg = TYPE_MUL_NORMAL; ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type1, type1, type2, &typeDmg); ModulateByTypeEffectiveness(gBattleMons[opposingBattler].type2, type1, type2, &typeDmg); diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 265bb7f65..42f2725b4 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -1163,7 +1163,7 @@ static void Task_GiveExpToMon(u8 taskId) u16 species = GetMonData(mon, MON_DATA_SPECIES); u8 level = GetMonData(mon, MON_DATA_LEVEL); u32 currExp = GetMonData(mon, MON_DATA_EXP); - u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1]; + u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1]; if (currExp + gainedExp >= nextLvlExp) { @@ -1206,11 +1206,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId) u8 level = GetMonData(mon, MON_DATA_LEVEL); u16 species = GetMonData(mon, MON_DATA_SPECIES); u32 exp = GetMonData(mon, MON_DATA_EXP); - u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level]; + u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level]; u32 expToNextLvl; exp -= currLvlExp; - expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp; + expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp; SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp); PlaySE(SE_EXP); gTasks[taskId].func = Task_GiveExpWithExpBar; @@ -1242,7 +1242,7 @@ static void Task_GiveExpWithExpBar(u8 taskId) level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP); species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES); - expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1]; + expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1]; if (currExp + gainedExp >= expOnNextLvl) { diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index a77144e29..cc134b92e 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -321,7 +321,7 @@ static void Task_GiveExpToMon(u8 taskId) u16 species = GetMonData(mon, MON_DATA_SPECIES); u8 level = GetMonData(mon, MON_DATA_LEVEL); u32 currExp = GetMonData(mon, MON_DATA_EXP); - u32 nextLvlExp = gExperienceTables[gBaseStats[species].growthRate][level + 1]; + u32 nextLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1]; if (currExp + gainedExp >= nextLvlExp) { @@ -364,11 +364,11 @@ static void Task_PrepareToGiveExpWithExpBar(u8 taskId) u8 level = GetMonData(mon, MON_DATA_LEVEL); u16 species = GetMonData(mon, MON_DATA_SPECIES); u32 exp = GetMonData(mon, MON_DATA_EXP); - u32 currLvlExp = gExperienceTables[gBaseStats[species].growthRate][level]; + u32 currLvlExp = gExperienceTables[gSpeciesInfo[species].growthRate][level]; u32 expToNextLvl; exp -= currLvlExp; - expToNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLvlExp; + expToNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLvlExp; SetBattleBarStruct(battlerId, gHealthboxSpriteIds[battlerId], expToNextLvl, exp, -gainedExp); PlaySE(SE_EXP); gTasks[taskId].func = Task_GiveExpWithExpBar; @@ -400,7 +400,7 @@ static void Task_GiveExpWithExpBar(u8 taskId) level = GetMonData(&gPlayerParty[monId], MON_DATA_LEVEL); currExp = GetMonData(&gPlayerParty[monId], MON_DATA_EXP); species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES); - expOnNextLvl = gExperienceTables[gBaseStats[species].growthRate][level + 1]; + expOnNextLvl = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1]; if (currExp + gainedExp >= expOnNextLvl) { diff --git a/src/battle_dome.c b/src/battle_dome.c index d30739ca5..e0911d485 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -2348,8 +2348,8 @@ static void InitDomeTrainers(void) rankingScores[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_SPDEF, NULL); rankingScores[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_SPEED, NULL); rankingScores[0] += GetMonData(&gPlayerParty[trainerId], MON_DATA_MAX_HP, NULL); - monTypesBits |= gBitTable[gBaseStats[GetMonData(&gPlayerParty[trainerId], MON_DATA_SPECIES, NULL)].type1]; - monTypesBits |= gBitTable[gBaseStats[GetMonData(&gPlayerParty[trainerId], MON_DATA_SPECIES, NULL)].type2]; + monTypesBits |= gBitTable[gSpeciesInfo[GetMonData(&gPlayerParty[trainerId], MON_DATA_SPECIES, NULL)].type1]; + monTypesBits |= gBitTable[gSpeciesInfo[GetMonData(&gPlayerParty[trainerId], MON_DATA_SPECIES, NULL)].type2]; } // Count the number of types in the players party, to factor into the ranking @@ -2383,8 +2383,8 @@ static void InitDomeTrainers(void) rankingScores[i] += statValues[STAT_SPDEF]; rankingScores[i] += statValues[STAT_SPEED]; rankingScores[i] += statValues[STAT_HP]; - monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[DOME_MONS[i][j]].species].type1]; - monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[DOME_MONS[i][j]].species].type2]; + monTypesBits |= gBitTable[gSpeciesInfo[gFacilityTrainerMons[DOME_MONS[i][j]].species].type1]; + monTypesBits |= gBitTable[gSpeciesInfo[gFacilityTrainerMons[DOME_MONS[i][j]].species].type2]; } for (monTypesCount = 0, j = 0; j < 32; j++) @@ -2448,7 +2448,7 @@ static void InitDomeTrainers(void) #define CALC_STAT(base, statIndex) \ { \ - u8 baseStat = gBaseStats[species].base; \ + u8 baseStat = gSpeciesInfo[species].base; \ stats[statIndex] = (((2 * baseStat + ivs + evs[statIndex] / 4) * level) / 100) + 5; \ stats[statIndex] = (u8) ModifyStatByNature(nature, stats[statIndex], statIndex); \ } @@ -2481,7 +2481,7 @@ static void CalcDomeMonStats(u16 species, int level, int ivs, u8 evBits, u8 natu } else { - int n = 2 * gBaseStats[species].baseHP; + int n = 2 * gSpeciesInfo[species].baseHP; stats[STAT_HP] = (((n + ivs + evs[STAT_HP] / 4) * level) / 100) + level + 10; } @@ -2750,9 +2750,9 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode) if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || gBattleMoves[move].power == 0) return 0; - defType1 = gBaseStats[targetSpecies].type1; - defType2 = gBaseStats[targetSpecies].type2; - defAbility = gBaseStats[targetSpecies].abilities[0]; + defType1 = gSpeciesInfo[targetSpecies].type1; + defType2 = gSpeciesInfo[targetSpecies].type2; + defAbility = gSpeciesInfo[targetSpecies].abilities[0]; moveType = gBattleMoves[move].type; if (defAbility == ABILITY_LEVITATE && moveType == TYPE_GROUND) @@ -5204,9 +5204,9 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun targetSpecies = gFacilityTrainerMons[DOME_MONS[loserTournamentId][k]].species; if (var & 1) - targetAbility = gBaseStats[targetSpecies].abilities[1]; + targetAbility = gSpeciesInfo[targetSpecies].abilities[1]; else - targetAbility = gBaseStats[targetSpecies].abilities[0]; + targetAbility = gSpeciesInfo[targetSpecies].abilities[0]; var = AI_TypeCalc(moveIds[i * MAX_MON_MOVES + j], targetSpecies, targetAbility); if (var & MOVE_RESULT_NOT_VERY_EFFECTIVE && var & MOVE_RESULT_SUPER_EFFECTIVE) @@ -5883,8 +5883,8 @@ static void InitRandomTourneyTreeResults(void) statSums[i] += statValues[STAT_SPDEF]; statSums[i] += statValues[STAT_SPEED]; statSums[i] += statValues[STAT_HP]; - monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[DOME_MONS[i][j]].species].type1]; - monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[DOME_MONS[i][j]].species].type2]; + monTypesBits |= gBitTable[gSpeciesInfo[gFacilityTrainerMons[DOME_MONS[i][j]].species].type1]; + monTypesBits |= gBitTable[gSpeciesInfo[gFacilityTrainerMons[DOME_MONS[i][j]].species].type2]; } // Because GF hates temporary vars, trainerId acts like monTypesCount here. @@ -6010,12 +6010,12 @@ static void DecideRoundWinners(u8 roundId) } } species = gFacilityTrainerMons[DOME_MONS[tournamentId1][monId1]].species; - points1 += ( gBaseStats[species].baseHP - + gBaseStats[species].baseAttack - + gBaseStats[species].baseDefense - + gBaseStats[species].baseSpeed - + gBaseStats[species].baseSpAttack - + gBaseStats[species].baseSpDefense) / 10; + points1 += ( gSpeciesInfo[species].baseHP + + gSpeciesInfo[species].baseAttack + + gSpeciesInfo[species].baseDefense + + gSpeciesInfo[species].baseSpeed + + gSpeciesInfo[species].baseSpAttack + + gSpeciesInfo[species].baseSpDefense) / 10; } // Random part of the formula. points1 += (Random() & 0x1F); @@ -6033,12 +6033,12 @@ static void DecideRoundWinners(u8 roundId) } } species = gFacilityTrainerMons[DOME_MONS[tournamentId2][monId1]].species; - points2 += ( gBaseStats[species].baseHP - + gBaseStats[species].baseAttack - + gBaseStats[species].baseDefense - + gBaseStats[species].baseSpeed - + gBaseStats[species].baseSpAttack - + gBaseStats[species].baseSpDefense) / 10; + points2 += ( gSpeciesInfo[species].baseHP + + gSpeciesInfo[species].baseAttack + + gSpeciesInfo[species].baseDefense + + gSpeciesInfo[species].baseSpeed + + gSpeciesInfo[species].baseSpAttack + + gSpeciesInfo[species].baseSpDefense) / 10; } // Random part of the formula. points2 += (Random() & 0x1F); diff --git a/src/battle_factory.c b/src/battle_factory.c index a68ef8180..5aeef2e29 100644 --- a/src/battle_factory.c +++ b/src/battle_factory.c @@ -618,9 +618,9 @@ static void GetOpponentMostCommonMonType(void) for (i = 0; i < FRONTIER_PARTY_SIZE; i++) { u32 species = gFacilityTrainerMons[gFrontierTempParty[i]].species; - typeCounts[gBaseStats[species].type1]++; - if (gBaseStats[species].type1 != gBaseStats[species].type2) - typeCounts[gBaseStats[species].type2]++; + typeCounts[gSpeciesInfo[species].type1]++; + if (gSpeciesInfo[species].type1 != gSpeciesInfo[species].type2) + typeCounts[gSpeciesInfo[species].type2]++; } // Determine which are the two most-common types. diff --git a/src/battle_interface.c b/src/battle_interface.c index 355397a1e..469646436 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -2199,9 +2199,9 @@ void UpdateHealthboxAttribute(u8 healthboxSpriteId, struct Pokemon *mon, u8 elem species = GetMonData(mon, MON_DATA_SPECIES); level = GetMonData(mon, MON_DATA_LEVEL); exp = GetMonData(mon, MON_DATA_EXP); - currLevelExp = gExperienceTables[gBaseStats[species].growthRate][level]; + currLevelExp = gExperienceTables[gSpeciesInfo[species].growthRate][level]; currExpBarValue = exp - currLevelExp; - maxExpBarValue = gExperienceTables[gBaseStats[species].growthRate][level + 1] - currLevelExp; + maxExpBarValue = gExperienceTables[gSpeciesInfo[species].growthRate][level + 1] - currLevelExp; SetBattleBarStruct(battlerId, healthboxSpriteId, maxExpBarValue, currExpBarValue, isDoubles); MoveBattleBar(battlerId, healthboxSpriteId, EXP_BAR, 0); } diff --git a/src/battle_main.c b/src/battle_main.c index 06e458a68..fa85608d4 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3097,7 +3097,7 @@ static void BattleStartClearSetData(void) gBattleStruct->runTries = 0; gBattleStruct->safariGoNearCounter = 0; gBattleStruct->safariPkblThrowCounter = 0; - *(&gBattleStruct->safariCatchFactor) = gBaseStats[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275; + *(&gBattleStruct->safariCatchFactor) = gSpeciesInfo[GetMonData(&gEnemyParty[0], MON_DATA_SPECIES)].catchRate * 100 / 1275; gBattleStruct->safariEscapeFactor = 3; gBattleStruct->wildVictorySong = 0; gBattleStruct->moneyMultiplier = 1; @@ -3332,8 +3332,8 @@ void FaintClearSetData(void) gBattleResources->flags->flags[gActiveBattler] = 0; - gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1; - gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2; + gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].type1; + gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].type2; ClearBattlerMoveHistory(gActiveBattler); ClearBattlerAbilityHistory(gActiveBattler); @@ -3400,8 +3400,8 @@ static void BattleIntroDrawTrainersOrMonsSprites(void) for (i = 0; i < sizeof(struct BattlePokemon); i++) ptr[i] = gBattleBufferB[gActiveBattler][4 + i]; - gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1; - gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2; + gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].type1; + gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].type2; gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum); hpOnSwitchout = &gBattleStruct->hpOnSwitchout[GetBattlerSide(gActiveBattler)]; *hpOnSwitchout = gBattleMons[gActiveBattler].hp; diff --git a/src/battle_pike.c b/src/battle_pike.c index 4f9af98ea..174006161 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -845,21 +845,21 @@ static bool8 DoesTypePreventStatus(u16 species, u32 status) switch (status) { case STATUS1_TOXIC_POISON: - if (gBaseStats[species].type1 == TYPE_STEEL || gBaseStats[species].type1 == TYPE_POISON - || gBaseStats[species].type2 == TYPE_STEEL || gBaseStats[species].type2 == TYPE_POISON) + if (gSpeciesInfo[species].type1 == TYPE_STEEL || gSpeciesInfo[species].type1 == TYPE_POISON + || gSpeciesInfo[species].type2 == TYPE_STEEL || gSpeciesInfo[species].type2 == TYPE_POISON) ret = TRUE; break; case STATUS1_FREEZE: - if (gBaseStats[species].type1 == TYPE_ICE || gBaseStats[species].type2 == TYPE_ICE) + if (gSpeciesInfo[species].type1 == TYPE_ICE || gSpeciesInfo[species].type2 == TYPE_ICE) ret = TRUE; break; case STATUS1_PARALYSIS: - if (gBaseStats[species].type1 == TYPE_GROUND || gBaseStats[species].type1 == TYPE_ELECTRIC - || gBaseStats[species].type2 == TYPE_GROUND || gBaseStats[species].type2 == TYPE_ELECTRIC) + if (gSpeciesInfo[species].type1 == TYPE_GROUND || gSpeciesInfo[species].type1 == TYPE_ELECTRIC + || gSpeciesInfo[species].type2 == TYPE_GROUND || gSpeciesInfo[species].type2 == TYPE_ELECTRIC) ret = TRUE; break; case STATUS1_BURN: - if (gBaseStats[species].type1 == TYPE_FIRE || gBaseStats[species].type2 == TYPE_FIRE) + if (gSpeciesInfo[species].type1 == TYPE_FIRE || gSpeciesInfo[species].type2 == TYPE_FIRE) ret = TRUE; break; case STATUS1_SLEEP: @@ -1138,9 +1138,9 @@ bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate) SetMonData(&gEnemyParty[0], MON_DATA_EXP, - &gExperienceTables[gBaseStats[wildMons[headerId][pikeMonId].species].growthRate][monLevel]); + &gExperienceTables[gSpeciesInfo[wildMons[headerId][pikeMonId].species].growthRate][monLevel]); - if (gBaseStats[wildMons[headerId][pikeMonId].species].abilities[1]) + if (gSpeciesInfo[wildMons[headerId][pikeMonId].species].abilities[1]) abilityNum = Random() % 2; else abilityNum = 0; diff --git a/src/battle_pyramid.c b/src/battle_pyramid.c index cbc1589bd..32fab3402 100644 --- a/src/battle_pyramid.c +++ b/src/battle_pyramid.c @@ -1371,7 +1371,7 @@ void GenerateBattlePyramidWildMon(void) } SetMonData(&gEnemyParty[0], MON_DATA_EXP, - &gExperienceTables[gBaseStats[wildMons[id].species].growthRate][lvl]); + &gExperienceTables[gSpeciesInfo[wildMons[id].species].growthRate][lvl]); switch (wildMons[id].abilityNum) { @@ -1381,7 +1381,7 @@ void GenerateBattlePyramidWildMon(void) break; case ABILITY_RANDOM: default: - if (gBaseStats[wildMons[id].species].abilities[1]) + if (gSpeciesInfo[wildMons[id].species].abilities[1]) { i = GetMonData(&gEnemyParty[0], MON_DATA_PERSONALITY, NULL) % 2; SetMonData(&gEnemyParty[0], MON_DATA_ABILITY_NUM, &i); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index fb5a7649a..111713b1f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1595,7 +1595,7 @@ u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility) { s32 i = 0; u8 flags = 0; - u8 type1 = gBaseStats[targetSpecies].type1, type2 = gBaseStats[targetSpecies].type2; + u8 type1 = gSpeciesInfo[targetSpecies].type1, type2 = gSpeciesInfo[targetSpecies].type2; u8 moveType; if (move == MOVE_STRUGGLE) @@ -3274,7 +3274,7 @@ static void Cmd_getexp(void) viaExpShare++; } - calculatedExp = gBaseStats[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7; + calculatedExp = gSpeciesInfo[gBattleMons[gBattlerFainted].species].expYield * gBattleMons[gBattlerFainted].level / 7; if (viaExpShare) // at least one mon is getting exp via exp share { @@ -4604,8 +4604,8 @@ static void Cmd_switchindataupdate(void) for (i = 0; i < sizeof(struct BattlePokemon); i++) monData[i] = gBattleBufferB[gActiveBattler][4 + i]; - gBattleMons[gActiveBattler].type1 = gBaseStats[gBattleMons[gActiveBattler].species].type1; - gBattleMons[gActiveBattler].type2 = gBaseStats[gBattleMons[gActiveBattler].species].type2; + gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].type1; + gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].type2; gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum); // check knocked off item @@ -8888,10 +8888,10 @@ static void Cmd_trydobeatup(void) gBattlescriptCurrInstr += 9; - gBattleMoveDamage = gBaseStats[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack; + gBattleMoveDamage = gSpeciesInfo[GetMonData(&party[gBattleCommunication[0]], MON_DATA_SPECIES)].baseAttack; gBattleMoveDamage *= gBattleMoves[gCurrentMove].power; gBattleMoveDamage *= (GetMonData(&party[gBattleCommunication[0]], MON_DATA_LEVEL) * 2 / 5 + 2); - gBattleMoveDamage /= gBaseStats[gBattleMons[gBattlerTarget].species].baseDefense; + gBattleMoveDamage /= gSpeciesInfo[gBattleMons[gBattlerTarget].species].baseDefense; gBattleMoveDamage = (gBattleMoveDamage / 50) + 2; if (gProtectStructs[gBattlerAttacker].helpingHand) gBattleMoveDamage = gBattleMoveDamage * 15 / 10; @@ -9568,9 +9568,9 @@ static void Cmd_pickup(void) heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)) - ability = gBaseStats[species].abilities[1]; + ability = gSpeciesInfo[species].abilities[1]; else - ability = gBaseStats[species].abilities[0]; + ability = gSpeciesInfo[species].abilities[0]; if (ability == ABILITY_PICKUP && species != SPECIES_NONE @@ -9591,9 +9591,9 @@ static void Cmd_pickup(void) heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)) - ability = gBaseStats[species].abilities[1]; + ability = gSpeciesInfo[species].abilities[1]; else - ability = gBaseStats[species].abilities[0]; + ability = gSpeciesInfo[species].abilities[0]; if (ability == ABILITY_PICKUP && species != SPECIES_NONE @@ -9831,7 +9831,7 @@ static void Cmd_handleballthrow(void) if (gLastUsedItem == ITEM_SAFARI_BALL) catchRate = gBattleStruct->safariCatchFactor * 1275 / 100; else - catchRate = gBaseStats[gBattleMons[gBattlerTarget].species].catchRate; + catchRate = gSpeciesInfo[gBattleMons[gBattlerTarget].species].catchRate; if (gLastUsedItem > ITEM_SAFARI_BALL) { diff --git a/src/battle_tower.c b/src/battle_tower.c index 7eed612ff..1e134b8fa 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -3539,7 +3539,7 @@ void TrySetLinkBattleTowerEnemyPartyLevel(void) u32 species = GetMonData(&gEnemyParty[i], MON_DATA_SPECIES, NULL); if (species) { - SetMonData(&gEnemyParty[i], MON_DATA_EXP, &gExperienceTables[gBaseStats[species].growthRate][enemyLevel]); + SetMonData(&gEnemyParty[i], MON_DATA_EXP, &gExperienceTables[gSpeciesInfo[species].growthRate][enemyLevel]); CalculateMonStats(&gEnemyParty[i]); } } diff --git a/src/contest.c b/src/contest.c index 0f77df814..e5cda17ae 100644 --- a/src/contest.c +++ b/src/contest.c @@ -5320,7 +5320,7 @@ static void SetMoveSpecificAnimData(u8 contestant) switch (move) { case MOVE_CURSE: - if (gBaseStats[species].type1 == TYPE_GHOST || gBaseStats[species].type2 == TYPE_GHOST) + if (gSpeciesInfo[species].type1 == TYPE_GHOST || gSpeciesInfo[species].type2 == TYPE_GHOST) gAnimMoveTurn = 0; else gAnimMoveTurn = 1; diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/species_info.h similarity index 99% rename from src/data/pokemon/base_stats.h rename to src/data/pokemon/species_info.h index 6b6ab12aa..5af84df1f 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/species_info.h @@ -2,7 +2,7 @@ // 255 (MON_GENDERLESS) is reserved for genderless Pokémon. #define PERCENT_FEMALE(percent) min(254, ((percent * 255) / 100)) -#define OLD_UNOWN_BASE_STATS \ +#define OLD_UNOWN_SPECIES_INFO \ { \ .baseHP = 50, \ .baseAttack = 150, \ @@ -34,7 +34,7 @@ .noFlip = FALSE, \ } -const struct BaseStats gBaseStats[] = +const struct SpeciesInfo gSpeciesInfo[] = { [SPECIES_NONE] = {0}, @@ -8070,55 +8070,55 @@ const struct BaseStats gBaseStats[] = .noFlip = FALSE, }, - [SPECIES_OLD_UNOWN_B] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_B] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_C] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_C] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_D] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_D] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_E] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_E] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_F] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_F] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_G] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_G] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_H] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_H] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_I] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_I] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_J] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_J] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_K] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_K] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_L] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_L] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_M] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_M] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_N] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_N] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_O] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_O] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_P] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_P] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_Q] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_Q] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_R] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_R] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_S] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_S] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_T] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_T] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_U] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_U] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_V] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_V] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_W] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_W] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_X] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_X] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_Y] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_Y] = OLD_UNOWN_SPECIES_INFO, - [SPECIES_OLD_UNOWN_Z] = OLD_UNOWN_BASE_STATS, + [SPECIES_OLD_UNOWN_Z] = OLD_UNOWN_SPECIES_INFO, [SPECIES_TREECKO] = { diff --git a/src/daycare.c b/src/daycare.c index 464be1475..c0b692aa4 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -842,7 +842,7 @@ void CreateEgg(struct Pokemon *mon, u16 species, bool8 setHotSpringsLocation) language = LANGUAGE_JAPANESE; SetMonData(mon, MON_DATA_POKEBALL, &ball); SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname); - SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles); + SetMonData(mon, MON_DATA_FRIENDSHIP, &gSpeciesInfo[species].eggCycles); SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel); SetMonData(mon, MON_DATA_LANGUAGE, &language); if (setHotSpringsLocation) @@ -869,7 +869,7 @@ static void SetInitialEggData(struct Pokemon *mon, u16 species, struct DayCare * language = LANGUAGE_JAPANESE; SetMonData(mon, MON_DATA_POKEBALL, &ball); SetMonData(mon, MON_DATA_NICKNAME, sJapaneseEggNickname); - SetMonData(mon, MON_DATA_FRIENDSHIP, &gBaseStats[species].eggCycles); + SetMonData(mon, MON_DATA_FRIENDSHIP, &gSpeciesInfo[species].eggCycles); SetMonData(mon, MON_DATA_MET_LEVEL, &metLevel); SetMonData(mon, MON_DATA_LANGUAGE, &language); } @@ -1031,8 +1031,8 @@ static u8 GetDaycareCompatibilityScore(struct DayCare *daycare) trainerIds[i] = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_OT_ID); personality = GetBoxMonData(&daycare->mons[i].mon, MON_DATA_PERSONALITY); genders[i] = GetGenderFromSpeciesAndPersonality(species[i], personality); - eggGroups[i][0] = gBaseStats[species[i]].eggGroup1; - eggGroups[i][1] = gBaseStats[species[i]].eggGroup2; + eggGroups[i][0] = gSpeciesInfo[species[i]].eggGroup1; + eggGroups[i][1] = gSpeciesInfo[species[i]].eggGroup2; } // check unbreedable egg group diff --git a/src/field_specials.c b/src/field_specials.c index 22292cc4b..03aebb0ce 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1196,7 +1196,7 @@ void IsGrassTypeInParty(void) if (GetMonData(pokemon, MON_DATA_SANITY_HAS_SPECIES) && !GetMonData(pokemon, MON_DATA_IS_EGG)) { species = GetMonData(pokemon, MON_DATA_SPECIES); - if (gBaseStats[species].type1 == TYPE_GRASS || gBaseStats[species].type2 == TYPE_GRASS) + if (gSpeciesInfo[species].type1 == TYPE_GRASS || gSpeciesInfo[species].type2 == TYPE_GRASS) { gSpecialVar_Result = TRUE; return; diff --git a/src/pokedex.c b/src/pokedex.c index 8abf97248..33355d197 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -4701,7 +4701,7 @@ static int DoPokedexSearch(u8 dexMode, u8 order, u8 abcGroup, u8 bodyColor, u8 t { species = NationalPokedexNumToSpecies(sPokedexView->pokedexList[i].dexNum); - if (bodyColor == gBaseStats[species].bodyColor) + if (bodyColor == gSpeciesInfo[species].bodyColor) { sPokedexView->pokedexList[resultsCount] = sPokedexView->pokedexList[i]; resultsCount++; @@ -4727,8 +4727,8 @@ static int DoPokedexSearch(u8 dexMode, u8 order, u8 abcGroup, u8 bodyColor, u8 t { species = NationalPokedexNumToSpecies(sPokedexView->pokedexList[i].dexNum); - types[0] = gBaseStats[species].type1; - types[1] = gBaseStats[species].type2; + types[0] = gSpeciesInfo[species].type1; + types[1] = gSpeciesInfo[species].type2; if (types[0] == type1 || types[1] == type1) { sPokedexView->pokedexList[resultsCount] = sPokedexView->pokedexList[i]; @@ -4745,8 +4745,8 @@ static int DoPokedexSearch(u8 dexMode, u8 order, u8 abcGroup, u8 bodyColor, u8 t { species = NationalPokedexNumToSpecies(sPokedexView->pokedexList[i].dexNum); - types[0] = gBaseStats[species].type1; - types[1] = gBaseStats[species].type2; + types[0] = gSpeciesInfo[species].type1; + types[1] = gSpeciesInfo[species].type2; if ((types[0] == type1 && types[1] == type2) || (types[0] == type2 && types[1] == type1)) { sPokedexView->pokedexList[resultsCount] = sPokedexView->pokedexList[i]; diff --git a/src/pokemon.c b/src/pokemon.c index b65f97bd8..1e40220e2 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -1388,7 +1388,7 @@ const s8 gNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] = #include "data/pokemon/trainer_class_lookups.h" #include "data/pokemon/cry_ids.h" #include "data/pokemon/experience_tables.h" -#include "data/pokemon/base_stats.h" +#include "data/pokemon/species_info.h" #include "data/pokemon/level_up_learnsets.h" #include "data/pokemon/evolution.h" #include "data/pokemon/level_up_learnset_pointers.h" @@ -2245,8 +2245,8 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, SetBoxMonData(boxMon, MON_DATA_LANGUAGE, &gGameLanguage); SetBoxMonData(boxMon, MON_DATA_OT_NAME, gSaveBlock2Ptr->playerName); SetBoxMonData(boxMon, MON_DATA_SPECIES, &species); - SetBoxMonData(boxMon, MON_DATA_EXP, &gExperienceTables[gBaseStats[species].growthRate][level]); - SetBoxMonData(boxMon, MON_DATA_FRIENDSHIP, &gBaseStats[species].friendship); + SetBoxMonData(boxMon, MON_DATA_EXP, &gExperienceTables[gSpeciesInfo[species].growthRate][level]); + SetBoxMonData(boxMon, MON_DATA_FRIENDSHIP, &gSpeciesInfo[species].friendship); value = GetCurrentRegionMapSectionId(); SetBoxMonData(boxMon, MON_DATA_MET_LOCATION, &value); SetBoxMonData(boxMon, MON_DATA_MET_LEVEL, &level); @@ -2286,7 +2286,7 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, SetBoxMonData(boxMon, MON_DATA_SPDEF_IV, &iv); } - if (gBaseStats[species].abilities[1]) + if (gSpeciesInfo[species].abilities[1]) { value = personality & 1; SetBoxMonData(boxMon, MON_DATA_ABILITY_NUM, &value); @@ -2806,7 +2806,7 @@ static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon) #define CALC_STAT(base, iv, ev, statIndex, field) \ { \ - u8 baseStat = gBaseStats[species].base; \ + u8 baseStat = gSpeciesInfo[species].base; \ s32 n = (((2 * baseStat + iv + ev / 4) * level) / 100) + 5; \ u8 nature = GetNature(mon); \ n = ModifyStatByNature(nature, n, statIndex); \ @@ -2841,7 +2841,7 @@ void CalculateMonStats(struct Pokemon *mon) } else { - s32 n = 2 * gBaseStats[species].baseHP + hpIV; + s32 n = 2 * gSpeciesInfo[species].baseHP + hpIV; newMaxHP = (((n + hpEV / 4) * level) / 100) + level + 10; } @@ -2901,7 +2901,7 @@ u8 GetLevelFromMonExp(struct Pokemon *mon) u32 exp = GetMonData(mon, MON_DATA_EXP, NULL); s32 level = 1; - while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp) + while (level <= MAX_LEVEL && gExperienceTables[gSpeciesInfo[species].growthRate][level] <= exp) level++; return level - 1; @@ -2913,7 +2913,7 @@ u8 GetLevelFromBoxMonExp(struct BoxPokemon *boxMon) u32 exp = GetBoxMonData(boxMon, MON_DATA_EXP, NULL); s32 level = 1; - while (level <= MAX_LEVEL && gExperienceTables[gBaseStats[species].growthRate][level] <= exp) + while (level <= MAX_LEVEL && gExperienceTables[gSpeciesInfo[species].growthRate][level] <= exp) level++; return level - 1; @@ -3442,15 +3442,15 @@ u8 GetBoxMonGender(struct BoxPokemon *boxMon) u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL); u32 personality = GetBoxMonData(boxMon, MON_DATA_PERSONALITY, NULL); - switch (gBaseStats[species].genderRatio) + switch (gSpeciesInfo[species].genderRatio) { case MON_MALE: case MON_FEMALE: case MON_GENDERLESS: - return gBaseStats[species].genderRatio; + return gSpeciesInfo[species].genderRatio; } - if (gBaseStats[species].genderRatio > (personality & 0xFF)) + if (gSpeciesInfo[species].genderRatio > (personality & 0xFF)) return MON_FEMALE; else return MON_MALE; @@ -3458,15 +3458,15 @@ u8 GetBoxMonGender(struct BoxPokemon *boxMon) u8 GetGenderFromSpeciesAndPersonality(u16 species, u32 personality) { - switch (gBaseStats[species].genderRatio) + switch (gSpeciesInfo[species].genderRatio) { case MON_MALE: case MON_FEMALE: case MON_GENDERLESS: - return gBaseStats[species].genderRatio; + return gSpeciesInfo[species].genderRatio; } - if (gBaseStats[species].genderRatio > (personality & 0xFF)) + if (gSpeciesInfo[species].genderRatio > (personality & 0xFF)) return MON_FEMALE; else return MON_MALE; @@ -4495,9 +4495,9 @@ u8 GetMonsStateToDoubles_2(void) u8 GetAbilityBySpecies(u16 species, u8 abilityNum) { if (abilityNum) - gLastUsedAbility = gBaseStats[species].abilities[1]; + gLastUsedAbility = gSpeciesInfo[species].abilities[1]; else - gLastUsedAbility = gBaseStats[species].abilities[0]; + gLastUsedAbility = gSpeciesInfo[species].abilities[0]; return gLastUsedAbility; } @@ -4651,8 +4651,8 @@ void CopyPlayerPartyMonToBattleData(u8 battlerId, u8 partyIndex) gBattleMons[battlerId].isEgg = GetMonData(&gPlayerParty[partyIndex], MON_DATA_IS_EGG, NULL); gBattleMons[battlerId].abilityNum = GetMonData(&gPlayerParty[partyIndex], MON_DATA_ABILITY_NUM, NULL); gBattleMons[battlerId].otId = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OT_ID, NULL); - gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1; - gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2; + gBattleMons[battlerId].type1 = gSpeciesInfo[gBattleMons[battlerId].species].type1; + gBattleMons[battlerId].type2 = gSpeciesInfo[gBattleMons[battlerId].species].type2; gBattleMons[battlerId].ability = GetAbilityBySpecies(gBattleMons[battlerId].species, gBattleMons[battlerId].abilityNum); GetMonData(&gPlayerParty[partyIndex], MON_DATA_NICKNAME, nickname); StringCopy_Nickname(gBattleMons[battlerId].nickname, nickname); @@ -4869,7 +4869,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov if ((itemEffect[i] & ITEM3_LEVEL_UP) && GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_LEVEL) { - dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1]; + dataUnsigned = gExperienceTables[gSpeciesInfo[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1]; SetMonData(mon, MON_DATA_EXP, &dataUnsigned); CalculateMonStats(mon); retVal = FALSE; @@ -5948,22 +5948,22 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies) switch (i) { case STAT_HP: - evIncrease = gBaseStats[defeatedSpecies].evYield_HP * multiplier; + evIncrease = gSpeciesInfo[defeatedSpecies].evYield_HP * multiplier; break; case STAT_ATK: - evIncrease = gBaseStats[defeatedSpecies].evYield_Attack * multiplier; + evIncrease = gSpeciesInfo[defeatedSpecies].evYield_Attack * multiplier; break; case STAT_DEF: - evIncrease = gBaseStats[defeatedSpecies].evYield_Defense * multiplier; + evIncrease = gSpeciesInfo[defeatedSpecies].evYield_Defense * multiplier; break; case STAT_SPEED: - evIncrease = gBaseStats[defeatedSpecies].evYield_Speed * multiplier; + evIncrease = gSpeciesInfo[defeatedSpecies].evYield_Speed * multiplier; break; case STAT_SPATK: - evIncrease = gBaseStats[defeatedSpecies].evYield_SpAttack * multiplier; + evIncrease = gSpeciesInfo[defeatedSpecies].evYield_SpAttack * multiplier; break; case STAT_SPDEF: - evIncrease = gBaseStats[defeatedSpecies].evYield_SpDefense * multiplier; + evIncrease = gSpeciesInfo[defeatedSpecies].evYield_SpDefense * multiplier; break; } @@ -6165,12 +6165,12 @@ bool8 TryIncrementMonLevel(struct Pokemon *mon) u16 species = GetMonData(mon, MON_DATA_SPECIES, 0); u8 nextLevel = GetMonData(mon, MON_DATA_LEVEL, 0) + 1; u32 expPoints = GetMonData(mon, MON_DATA_EXP, 0); - if (expPoints > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]) + if (expPoints > gExperienceTables[gSpeciesInfo[species].growthRate][MAX_LEVEL]) { - expPoints = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]; + expPoints = gExperienceTables[gSpeciesInfo[species].growthRate][MAX_LEVEL]; SetMonData(mon, MON_DATA_EXP, &expPoints); } - if (nextLevel > MAX_LEVEL || expPoints < gExperienceTables[gBaseStats[species].growthRate][nextLevel]) + if (nextLevel > MAX_LEVEL || expPoints < gExperienceTables[gSpeciesInfo[species].growthRate][nextLevel]) { return FALSE; } @@ -6494,7 +6494,7 @@ bool32 IsHMMove2(u16 move) bool8 IsMonSpriteNotFlipped(u16 species) { - return gBaseStats[species].noFlip; + return gSpeciesInfo[species].noFlip; } s8 GetMonFlavorRelation(struct Pokemon *mon, u8 flavor) @@ -6615,26 +6615,26 @@ void SetWildMonHeldItem(void) if (rnd < chanceNoItem) return; if (rnd < chanceNotRare) - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gSpeciesInfo[species].itemCommon); else - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gSpeciesInfo[species].itemRare); } } else { - if (gBaseStats[species].itemCommon == gBaseStats[species].itemRare && gBaseStats[species].itemCommon != ITEM_NONE) + if (gSpeciesInfo[species].itemCommon == gSpeciesInfo[species].itemRare && gSpeciesInfo[species].itemCommon != ITEM_NONE) { // Both held items are the same, 100% chance to hold item - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gSpeciesInfo[species].itemCommon); } else { if (rnd < chanceNoItem) return; if (rnd < chanceNotRare) - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemCommon); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gSpeciesInfo[species].itemCommon); else - SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gBaseStats[species].itemRare); + SetMonData(&gEnemyParty[0], MON_DATA_HELD_ITEM, &gSpeciesInfo[species].itemRare); } } } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 9806a75dc..4f2b57131 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2611,8 +2611,8 @@ static void DrawExperienceProgressBar(struct Pokemon *unused) if (summary->level < MAX_LEVEL) { - u32 expBetweenLevels = gExperienceTables[gBaseStats[summary->species].growthRate][summary->level + 1] - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; - u32 expSinceLastLevel = summary->exp - gExperienceTables[gBaseStats[summary->species].growthRate][summary->level]; + u32 expBetweenLevels = gExperienceTables[gSpeciesInfo[summary->species].growthRate][summary->level + 1] - gExperienceTables[gSpeciesInfo[summary->species].growthRate][summary->level]; + u32 expSinceLastLevel = summary->exp - gExperienceTables[gSpeciesInfo[summary->species].growthRate][summary->level]; // Calculate the number of 1-pixel "ticks" to illuminate in the experience progress bar. // There are 8 tiles that make up the bar, and each tile has 8 "ticks". Hence, the numerator @@ -3412,7 +3412,7 @@ static void PrintExpPointsNextLevel(void) PrintTextOnWindow(windowId, gStringVar1, x, 1, 0, 0); if (sum->level < MAX_LEVEL) - expToNextLevel = gExperienceTables[gBaseStats[sum->species].growthRate][sum->level + 1] - sum->exp; + expToNextLevel = gExperienceTables[gSpeciesInfo[sum->species].growthRate][sum->level + 1] - sum->exp; else expToNextLevel = 0; @@ -3788,10 +3788,10 @@ static void SetMonTypeIcons(void) } else { - SetTypeSpritePosAndPal(gBaseStats[summary->species].type1, 120, 48, SPRITE_ARR_ID_TYPE); - if (gBaseStats[summary->species].type1 != gBaseStats[summary->species].type2) + SetTypeSpritePosAndPal(gSpeciesInfo[summary->species].type1, 120, 48, SPRITE_ARR_ID_TYPE); + if (gSpeciesInfo[summary->species].type1 != gSpeciesInfo[summary->species].type2) { - SetTypeSpritePosAndPal(gBaseStats[summary->species].type2, 160, 48, SPRITE_ARR_ID_TYPE + 1); + SetTypeSpritePosAndPal(gSpeciesInfo[summary->species].type2, 160, 48, SPRITE_ARR_ID_TYPE + 1); SetSpriteInvisibility(SPRITE_ARR_ID_TYPE + 1, FALSE); } else diff --git a/src/rom_header_gf.c b/src/rom_header_gf.c index 472efe994..465c0cf41 100644 --- a/src/rom_header_gf.c +++ b/src/rom_header_gf.c @@ -69,7 +69,7 @@ struct GFRomHeader u32 externalEventFlagsOffset; u32 externalEventDataOffset; u32 unk18; - const struct BaseStats * baseStats; + const struct SpeciesInfo * speciesInfo; const u8 (* abilityNames)[]; const u8 * const * abilityDescriptions; const struct Item * items; @@ -150,7 +150,7 @@ static const struct GFRomHeader sGFRomHeader = { .externalEventFlagsOffset = offsetof(struct SaveBlock1, externalEventFlags), .externalEventDataOffset = offsetof(struct SaveBlock1, externalEventData), .unk18 = 0x00000000, - .baseStats = gBaseStats, + .speciesInfo = gSpeciesInfo, .abilityNames = gAbilityNames, .abilityDescriptions = gAbilityDescriptionPointers, .items = gItems, diff --git a/src/trade.c b/src/trade.c index 9c8fb2e8e..61ebaf4cc 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2465,8 +2465,8 @@ int GetUnionRoomTradeMessageId(struct RfuGameCompatibilityData player, struct Rf else { // Player's Pokémon must be of the type the partner requested - if (gBaseStats[playerSpecies2].type1 != requestedType - && gBaseStats[playerSpecies2].type2 != requestedType) + if (gSpeciesInfo[playerSpecies2].type1 != requestedType + && gSpeciesInfo[playerSpecies2].type2 != requestedType) return UR_TRADE_MSG_NOT_MON_PARTNER_WANTS; } diff --git a/src/trainer_hill.c b/src/trainer_hill.c index ad4a84947..0e989a259 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -924,7 +924,7 @@ u8 GetTrainerEncounterMusicIdInTrainerHill(u16 trainerId) static void SetTrainerHillMonLevel(struct Pokemon *mon, u8 level) { u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); - u32 exp = gExperienceTables[gBaseStats[species].growthRate][level]; + u32 exp = gExperienceTables[gSpeciesInfo[species].growthRate][level]; SetMonData(mon, MON_DATA_EXP, &exp); SetMonData(mon, MON_DATA_LEVEL, &level); diff --git a/src/union_room.c b/src/union_room.c index 6a5e8535f..aad8dbaa9 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -4187,7 +4187,7 @@ static s32 IsRequestedTradeInPlayerParty(u32 type, u32 species) for (i = 0; i < gPlayerPartyCount; i++) { species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); - if (gBaseStats[species].type1 == type || gBaseStats[species].type2 == type) + if (gSpeciesInfo[species].type1 == type || gSpeciesInfo[species].type2 == type) return UR_TRADE_MATCH; } return UR_TRADE_NOTYPE; diff --git a/src/wild_encounter.c b/src/wild_encounter.c index eb42cd7bd..6ba13a007 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -379,7 +379,7 @@ static void CreateWildMon(u16 species, u8 level) ZeroEnemyPartyMons(); checkCuteCharm = TRUE; - switch (gBaseStats[species].genderRatio) + switch (gSpeciesInfo[species].genderRatio) { case MON_MALE: case MON_FEMALE: @@ -913,7 +913,7 @@ static bool8 TryGetRandomWildMonIndexByType(const struct WildPokemon *wildMon, u for (validMonCount = 0, i = 0; i < numMon; i++) { - if (gBaseStats[wildMon[i].species].type1 == type || gBaseStats[wildMon[i].species].type2 == type) + if (gSpeciesInfo[wildMon[i].species].type1 == type || gSpeciesInfo[wildMon[i].species].type2 == type) validIndexes[validMonCount++] = i; }