mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 01:14:19 +01:00
Oops, I forgot to take the opponent's side into account
This commit is contained in:
parent
6c550cd749
commit
1f97198267
@ -908,6 +908,7 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT];
|
||||
extern bool8 gHasFetchedBall;
|
||||
extern u8 gLastUsedBall;
|
||||
extern u16 gLastThrownBall;
|
||||
extern bool8 gCanRetaliate;
|
||||
extern bool8 gCanPlayerRetaliate;
|
||||
extern bool8 gCanOpponentRetaliate;
|
||||
|
||||
#endif // GUARD_BATTLE_H
|
||||
|
@ -231,7 +231,8 @@ EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA bool8 gHasFetchedBall = FALSE;
|
||||
EWRAM_DATA u8 gLastUsedBall = 0;
|
||||
EWRAM_DATA u16 gLastThrownBall = 0;
|
||||
EWRAM_DATA bool8 gCanRetaliate = FALSE;
|
||||
EWRAM_DATA bool8 gCanPlayerRetaliate = FALSE;
|
||||
EWRAM_DATA bool8 gCanOpponentRetaliate = FALSE;
|
||||
|
||||
// IWRAM common vars
|
||||
void (*gPreBattleCallback1)(void);
|
||||
@ -2877,7 +2878,8 @@ static void BattleStartClearSetData(void)
|
||||
gHasFetchedBall = FALSE;
|
||||
gLastUsedBall = 0;
|
||||
|
||||
gCanRetaliate = FALSE;
|
||||
gCanPlayerRetaliate = FALSE;
|
||||
gCanOpponentRetaliate = FALSE;
|
||||
|
||||
gBattlerAttacker = 0;
|
||||
gBattlerTarget = 0;
|
||||
|
@ -3499,13 +3499,14 @@ static void Cmd_tryfaintmon(void)
|
||||
if (gBattleResults.playerFaintCounter < 0xFF)
|
||||
gBattleResults.playerFaintCounter++;
|
||||
AdjustFriendshipOnBattleFaint(gActiveBattler);
|
||||
gCanRetaliate = TRUE;
|
||||
gCanPlayerRetaliate = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleResults.opponentFaintCounter < 0xFF)
|
||||
gBattleResults.opponentFaintCounter++;
|
||||
gBattleResults.lastOpponentSpecies = GetMonData(&gEnemyParty[gBattlerPartyIndexes[gActiveBattler]], MON_DATA_SPECIES, NULL);
|
||||
gCanOpponentRetaliate = TRUE;
|
||||
}
|
||||
if ((gHitMarker & HITMARKER_DESTINYBOND) && gBattleMons[gBattlerAttacker].hp != 0)
|
||||
{
|
||||
|
@ -7933,10 +7933,13 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
|
||||
MulModifier(&modifier, UQ_4_12(2.0));
|
||||
break;
|
||||
case EFFECT_RETALIATE:
|
||||
if (gCanRetaliate)
|
||||
if (gCanPlayerRetaliate || gCanOpponentRetaliate)
|
||||
{
|
||||
MulModifier(&modifier, UQ_4_12(2.0));
|
||||
gCanRetaliate = FALSE;
|
||||
if (gCanPlayerRetaliate)
|
||||
gCanPlayerRetaliate = FALSE;
|
||||
else if (gCanOpponentRetaliate)
|
||||
gCanOpponentRetaliate = FALSE;
|
||||
}
|
||||
break;
|
||||
case EFFECT_SOLARBEAM:
|
||||
|
Loading…
x
Reference in New Issue
Block a user