Merge pull request #1712 from AsparagusEduardo/fix_stickyHold
Fix instances where Gastro Acid is not affecting the ability
This commit is contained in:
commit
5bf236fc0d
@ -3685,7 +3685,7 @@ u8 IsRunningFromBattleImpossible(void)
|
|||||||
return 0;
|
return 0;
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||||
return 0;
|
return 0;
|
||||||
if (gBattleMons[gActiveBattler].ability == ABILITY_RUN_AWAY)
|
if (GetBattlerAbility(gActiveBattler) == ABILITY_RUN_AWAY)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if ((i = IsAbilityPreventingEscape(gActiveBattler)))
|
if ((i = IsAbilityPreventingEscape(gActiveBattler)))
|
||||||
|
|||||||
@ -3067,7 +3067,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
gBattlescriptCurrInstr++;
|
gBattlescriptCurrInstr++;
|
||||||
}
|
}
|
||||||
else if (gBattleMons[gBattlerTarget].item
|
else if (gBattleMons[gBattlerTarget].item
|
||||||
&& gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD)
|
&& GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD)
|
||||||
{
|
{
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
gBattlescriptCurrInstr = BattleScript_NoItemSteal;
|
gBattlescriptCurrInstr = BattleScript_NoItemSteal;
|
||||||
@ -9122,7 +9122,7 @@ bool8 UproarWakeUpCheck(u8 battlerId)
|
|||||||
|
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
if (!(gBattleMons[i].status2 & STATUS2_UPROAR) || gBattleMons[battlerId].ability == ABILITY_SOUNDPROOF)
|
if (!(gBattleMons[i].status2 & STATUS2_UPROAR) || GetBattlerAbility(battlerId) == ABILITY_SOUNDPROOF)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
gBattleScripting.battler = i;
|
gBattleScripting.battler = i;
|
||||||
@ -10771,7 +10771,7 @@ static void Cmd_healpartystatus(void)
|
|||||||
else
|
else
|
||||||
party = gEnemyParty;
|
party = gEnemyParty;
|
||||||
|
|
||||||
if (gBattleMons[gBattlerAttacker].ability != ABILITY_SOUNDPROOF)
|
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SOUNDPROOF)
|
||||||
{
|
{
|
||||||
gBattleMons[gBattlerAttacker].status1 = 0;
|
gBattleMons[gBattlerAttacker].status1 = 0;
|
||||||
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_NIGHTMARE);
|
||||||
@ -10787,7 +10787,7 @@ static void Cmd_healpartystatus(void)
|
|||||||
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
|
||||||
&& !(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
|
&& !(gAbsentBattlerFlags & gBitTable[gActiveBattler]))
|
||||||
{
|
{
|
||||||
if (gBattleMons[gActiveBattler].ability != ABILITY_SOUNDPROOF)
|
if (GetBattlerAbility(gActiveBattler) != ABILITY_SOUNDPROOF)
|
||||||
{
|
{
|
||||||
gBattleMons[gActiveBattler].status1 = 0;
|
gBattleMons[gActiveBattler].status1 = 0;
|
||||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_NIGHTMARE);
|
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_NIGHTMARE);
|
||||||
@ -10900,7 +10900,7 @@ static void Cmd_trysetperishsong(void)
|
|||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
if (gStatuses3[i] & STATUS3_PERISH_SONG
|
if (gStatuses3[i] & STATUS3_PERISH_SONG
|
||||||
|| gBattleMons[i].ability == ABILITY_SOUNDPROOF
|
|| GetBattlerAbility(i) == ABILITY_SOUNDPROOF
|
||||||
|| BlocksPrankster(gCurrentMove, gBattlerAttacker, i))
|
|| BlocksPrankster(gCurrentMove, gBattlerAttacker, i))
|
||||||
{
|
{
|
||||||
notAffectedCount++;
|
notAffectedCount++;
|
||||||
@ -11616,7 +11616,7 @@ static void Cmd_tryswapitems(void) // trick
|
|||||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||||
}
|
}
|
||||||
// check if ability prevents swapping
|
// check if ability prevents swapping
|
||||||
else if (gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD)
|
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STICKY_HOLD)
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = BattleScript_StickyHoldActivates;
|
gBattlescriptCurrInstr = BattleScript_StickyHoldActivates;
|
||||||
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
|
gLastUsedAbility = gBattleMons[gBattlerTarget].ability;
|
||||||
|
|||||||
@ -983,6 +983,11 @@ static const u8 sAbilitiesAffectedByMoldBreaker[] =
|
|||||||
[ABILITY_FLUFFY] = 1,
|
[ABILITY_FLUFFY] = 1,
|
||||||
[ABILITY_QUEENLY_MAJESTY] = 1,
|
[ABILITY_QUEENLY_MAJESTY] = 1,
|
||||||
[ABILITY_WATER_BUBBLE] = 1,
|
[ABILITY_WATER_BUBBLE] = 1,
|
||||||
|
[ABILITY_MIRROR_ARMOR] = 1,
|
||||||
|
[ABILITY_PUNK_ROCK] = 1,
|
||||||
|
[ABILITY_ICE_SCALES] = 1,
|
||||||
|
[ABILITY_ICE_FACE] = 1,
|
||||||
|
[ABILITY_PASTEL_VEIL] = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sAbilitiesNotTraced[ABILITIES_COUNT] =
|
static const u8 sAbilitiesNotTraced[ABILITIES_COUNT] =
|
||||||
@ -1263,7 +1268,7 @@ void PressurePPLose(u8 target, u8 attacker, u16 move)
|
|||||||
{
|
{
|
||||||
int moveIndex;
|
int moveIndex;
|
||||||
|
|
||||||
if (gBattleMons[target].ability != ABILITY_PRESSURE)
|
if (GetBattlerAbility(target) != ABILITY_PRESSURE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
|
for (moveIndex = 0; moveIndex < MAX_MON_MOVES; moveIndex++)
|
||||||
@ -1295,7 +1300,7 @@ void PressurePPLoseOnUsingImprison(u8 attacker)
|
|||||||
|
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
if (atkSide != GetBattlerSide(i) && gBattleMons[i].ability == ABILITY_PRESSURE)
|
if (atkSide != GetBattlerSide(i) && GetBattlerAbility(i) == ABILITY_PRESSURE)
|
||||||
{
|
{
|
||||||
for (j = 0; j < MAX_MON_MOVES; j++)
|
for (j = 0; j < MAX_MON_MOVES; j++)
|
||||||
{
|
{
|
||||||
@ -1328,7 +1333,7 @@ void PressurePPLoseOnUsingPerishSong(u8 attacker)
|
|||||||
|
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
for (i = 0; i < gBattlersCount; i++)
|
||||||
{
|
{
|
||||||
if (gBattleMons[i].ability == ABILITY_PRESSURE && i != attacker)
|
if (GetBattlerAbility(i) == ABILITY_PRESSURE && i != attacker)
|
||||||
{
|
{
|
||||||
for (j = 0; j < MAX_MON_MOVES; j++)
|
for (j = 0; j < MAX_MON_MOVES; j++)
|
||||||
{
|
{
|
||||||
@ -2723,8 +2728,8 @@ u8 DoBattlerEndTurnEffects(void)
|
|||||||
{
|
{
|
||||||
gStatuses3[gActiveBattler] -= STATUS3_YAWN_TURN(1);
|
gStatuses3[gActiveBattler] -= STATUS3_YAWN_TURN(1);
|
||||||
if (!(gStatuses3[gActiveBattler] & STATUS3_YAWN) && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY)
|
if (!(gStatuses3[gActiveBattler] & STATUS3_YAWN) && !(gBattleMons[gActiveBattler].status1 & STATUS1_ANY)
|
||||||
&& gBattleMons[gActiveBattler].ability != ABILITY_VITAL_SPIRIT
|
&& GetBattlerAbility(gActiveBattler) != ABILITY_VITAL_SPIRIT
|
||||||
&& gBattleMons[gActiveBattler].ability != ABILITY_INSOMNIA && !UproarWakeUpCheck(gActiveBattler)
|
&& GetBattlerAbility(gActiveBattler) != ABILITY_INSOMNIA && !UproarWakeUpCheck(gActiveBattler)
|
||||||
&& !IsLeafGuardProtected(gActiveBattler))
|
&& !IsLeafGuardProtected(gActiveBattler))
|
||||||
{
|
{
|
||||||
CancelMultiTurnMoves(gActiveBattler);
|
CancelMultiTurnMoves(gActiveBattler);
|
||||||
@ -3121,7 +3126,7 @@ u8 AtkCanceller_UnableToUseMove(void)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
u8 toSub;
|
u8 toSub;
|
||||||
if (gBattleMons[gBattlerAttacker].ability == ABILITY_EARLY_BIRD)
|
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_EARLY_BIRD)
|
||||||
toSub = 2;
|
toSub = 2;
|
||||||
else
|
else
|
||||||
toSub = 1;
|
toSub = 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user