mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-18 01:14:19 +01:00
Fix Damp loop
This commit is contained in:
parent
1435cd4692
commit
6daab7a5c9
@ -2169,6 +2169,7 @@ BattleScript_ExplosionLoop:
|
||||
moveendto MOVEEND_NEXT_TARGET
|
||||
jumpifnexttargetvalid BattleScript_ExplosionLoop
|
||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||
moveendcase MOVEEND_CLEAR_BITS
|
||||
end
|
||||
BattleScript_ExplosionMissed:
|
||||
effectivenesssound
|
||||
@ -6457,7 +6458,9 @@ BattleScript_DampStopsExplosion::
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_PKMNPREVENTSUSAGE
|
||||
pause 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
moveendto MOVEEND_NEXT_TARGET
|
||||
moveendcase MOVEEND_CLEAR_BITS
|
||||
end
|
||||
|
||||
BattleScript_MoveHPDrain_PPLoss::
|
||||
ppreduce
|
||||
|
@ -7850,33 +7850,26 @@ static void Cmd_faintifabilitynotdamp(void)
|
||||
if (gBattleControllerExecFlags)
|
||||
return;
|
||||
|
||||
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
|
||||
{
|
||||
if (gBattleMons[gBattlerTarget].ability == ABILITY_DAMP)
|
||||
break;
|
||||
}
|
||||
|
||||
if (gBattlerTarget == gBattlersCount)
|
||||
{
|
||||
gActiveBattler = gBattlerAttacker;
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].hp;
|
||||
BtlController_EmitHealthBarUpdate(0, INSTANT_HP_BAR_DROP);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattlescriptCurrInstr++;
|
||||
|
||||
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
|
||||
{
|
||||
if (gBattlerTarget == gBattlerAttacker)
|
||||
continue;
|
||||
if (!(gAbsentBattlerFlags & gBitTable[gBattlerTarget]))
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
if ((gBattlerTarget = IsAbilityOnField(ABILITY_DAMP)))
|
||||
{
|
||||
gLastUsedAbility = ABILITY_DAMP;
|
||||
RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability);
|
||||
RecordAbilityBattle(--gBattlerTarget, ABILITY_DAMP);
|
||||
gBattlescriptCurrInstr = BattleScript_DampStopsExplosion;
|
||||
return;
|
||||
}
|
||||
|
||||
gActiveBattler = gBattlerAttacker;
|
||||
gBattleMoveDamage = gBattleMons[gActiveBattler].hp;
|
||||
BtlController_EmitHealthBarUpdate(0, INSTANT_HP_BAR_DROP);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattlescriptCurrInstr++;
|
||||
|
||||
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
|
||||
{
|
||||
if (gBattlerTarget == gBattlerAttacker)
|
||||
continue;
|
||||
if (IsBattlerAlive(gBattlerTarget))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user