Usage of BATTLE_OPPOSITE

This commit is contained in:
Eduardo Quezada
2022-08-27 01:44:39 -04:00
parent 15d611ba65
commit 1f0a952546
6 changed files with 35 additions and 35 deletions
+4 -4
View File
@@ -254,7 +254,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void)
else if (moveTarget == MOVE_TARGET_SELECTED)
chosenMoveId |= GetBattlePalaceTarget();
else
chosenMoveId |= (GetBattlerAtPosition((GetBattlerPosition(gActiveBattler) & BIT_SIDE) ^ BIT_SIDE) << 8);
chosenMoveId |= (GetBattlerAtPosition(BATTLE_OPPOSITE(GetBattlerPosition(gActiveBattler) & BIT_SIDE)) << 8);
return chosenMoveId;
}
@@ -310,7 +310,7 @@ static u16 GetBattlePalaceTarget(void)
}
if (gBattleMons[opposing1].hp == gBattleMons[opposing2].hp)
return (((gActiveBattler & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8;
return (BATTLE_OPPOSITE(gActiveBattler & BIT_SIDE) + (Random() & 2)) << 8;
switch (gBattlePalaceNatureToMoveTarget[GetNatureFromPersonality(gBattleMons[gActiveBattler].personality)])
{
@@ -325,11 +325,11 @@ static u16 GetBattlePalaceTarget(void)
else
return opposing2 << 8;
case PALACE_TARGET_RANDOM:
return (((gActiveBattler & BIT_SIDE) ^ BIT_SIDE) + (Random() & 2)) << 8;
return (BATTLE_OPPOSITE(gActiveBattler & BIT_SIDE) + (Random() & 2)) << 8;
}
}
return (gActiveBattler ^ BIT_SIDE) << 8;
return BATTLE_OPPOSITE(gActiveBattler) << 8;
}
// Wait for the pokemon to finish appearing out from the pokeball on send out