summaryrefslogtreecommitdiff
path: root/src/pokemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pokemon.c')
-rw-r--r--src/pokemon.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/pokemon.c b/src/pokemon.c
index f5e79243e..4833f2db6 100644
--- a/src/pokemon.c
+++ b/src/pokemon.c
@@ -2989,11 +2989,11 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
{
s32 i;
- u16 moves[4];
- u8 pp[4];
+ u16 moves[MAX_MON_MOVES];
+ u8 pp[MAX_MON_MOVES];
u8 ppBonuses;
- for (i = 0; i < 3; i++)
+ for (i = 0; i < MAX_MON_MOVES - 1; i++)
{
moves[i] = GetMonData(mon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetMonData(mon, MON_DATA_PP2 + i, NULL);
@@ -3016,11 +3016,11 @@ void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move)
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
{
s32 i;
- u16 moves[4];
- u8 pp[4];
+ u16 moves[MAX_MON_MOVES];
+ u8 pp[MAX_MON_MOVES];
u8 ppBonuses;
- for (i = 0; i < 3; i++)
+ for (i = 0; i < MAX_MON_MOVES - 1; i++)
{
moves[i] = GetBoxMonData(boxMon, MON_DATA_MOVE2 + i, NULL);
pp[i] = GetBoxMonData(boxMon, MON_DATA_PP2 + i, NULL);
@@ -3197,13 +3197,13 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if ((sideStatus & SIDE_STATUS_REFLECT) && gCritMultiplier == 1)
{
- if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(2) == 2)
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
damage = 2 * (damage / 3);
else
damage /= 2;
}
- if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMonsInBattle(2) == 2)
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
damage /= 2;
// moves always do at least 1 damage.
@@ -3244,13 +3244,13 @@ s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *de
if ((sideStatus & SIDE_STATUS_LIGHTSCREEN) && gCritMultiplier == 1)
{
- if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(2) == 2)
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
damage = 2 * (damage / 3);
else
damage /= 2;
}
- if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMonsInBattle(2) == 2)
+ if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) && gBattleMoves[move].target == 8 && CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) == 2)
damage /= 2;
// are effects of weather negated with cloud nine or air lock
@@ -3304,21 +3304,21 @@ u8 CountAliveMonsInBattle(u8 caseId)
switch (caseId)
{
case BATTLE_ALIVE_EXCEPT_ACTIVE:
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (i != gActiveBattler && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_ATK_SIDE:
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerAttacker) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
}
break;
case BATTLE_ALIVE_DEF_SIDE:
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_BATTLERS_COUNT; i++)
{
if (GetBattlerSide(i) == GetBattlerSide(gBattlerTarget) && !(gAbsentBattlerFlags & gBitTable[i]))
retVal++;
@@ -6096,7 +6096,7 @@ u32 CanSpeciesLearnTMHM(u16 species, u8 tm)
u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
{
- u16 learnedMoves[4];
+ u16 learnedMoves[MAX_MON_MOVES];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES, 0);
u8 level = GetMonData(mon, MON_DATA_LEVEL, 0);
@@ -6146,7 +6146,7 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
{
- u16 learnedMoves[4];
+ u16 learnedMoves[MAX_MON_MOVES];
u16 moves[20];
u8 numMoves = 0;
u16 species = GetMonData(mon, MON_DATA_SPECIES2, 0);
@@ -6683,7 +6683,7 @@ u8 sub_806EF08(u8 arg0)
var = (arg0 != 0) ? 2 : 0;
break;
}
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
if (gLinkPlayers[i].id == (s16)(var))
break;
@@ -6706,7 +6706,7 @@ u8 sub_806EF84(u8 arg0, u8 arg1)
var = (arg0 != 0) ? 2 : 0;
break;
}
- for (i = 0; i < 4; i++)
+ for (i = 0; i < MAX_LINK_PLAYERS; i++)
{
if (gLinkPlayers[i].id == (s16)(var))
break;