mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
U-turn does not switch the user out if Emergency Exit activates
This commit is contained in:
parent
ca5a45d34d
commit
a13ffdbfba
@ -2237,3 +2237,8 @@
|
|||||||
.endif
|
.endif
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro jumpifemergencyexited battler:req, ptr:req
|
||||||
|
various \battler, VARIOUS_JUMP_IF_EMERGENCY_EXITED
|
||||||
|
.4byte \ptr
|
||||||
|
.endm
|
||||||
|
@ -3055,6 +3055,7 @@ BattleScript_EffectHitEscape:
|
|||||||
jumpifbyte CMP_NOT_EQUAL gBattleOutcome 0, BattleScript_HitEscapeEnd
|
jumpifbyte CMP_NOT_EQUAL gBattleOutcome 0, BattleScript_HitEscapeEnd
|
||||||
jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_HitEscapeEnd
|
jumpifbattletype BATTLE_TYPE_ARENA, BattleScript_HitEscapeEnd
|
||||||
jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_HitEscapeEnd
|
jumpifcantswitch SWITCH_IGNORE_ESCAPE_PREVENTION | BS_ATTACKER, BattleScript_HitEscapeEnd
|
||||||
|
jumpifemergencyexited BS_TARGET, BattleScript_HitEscapeEnd
|
||||||
openpartyscreen BS_ATTACKER, BattleScript_HitEscapeEnd
|
openpartyscreen BS_ATTACKER, BattleScript_HitEscapeEnd
|
||||||
switchoutabilities BS_ATTACKER
|
switchoutabilities BS_ATTACKER
|
||||||
waitstate
|
waitstate
|
||||||
|
@ -195,6 +195,7 @@ struct SpecialStatus
|
|||||||
// End of byte
|
// End of byte
|
||||||
u8 weatherAbilityDone:1;
|
u8 weatherAbilityDone:1;
|
||||||
u8 terrainAbilityDone:1;
|
u8 terrainAbilityDone:1;
|
||||||
|
u8 emergencyExited:1;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SideTimer
|
struct SideTimer
|
||||||
|
@ -255,6 +255,7 @@
|
|||||||
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 164
|
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 164
|
||||||
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 165
|
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 165
|
||||||
#define VARIOUS_JUMP_IF_NO_VALID_TARGETS 166
|
#define VARIOUS_JUMP_IF_NO_VALID_TARGETS 166
|
||||||
|
#define VARIOUS_JUMP_IF_EMERGENCY_EXITED 167
|
||||||
|
|
||||||
// Cmd_manipulatedamage
|
// Cmd_manipulatedamage
|
||||||
#define DMG_CHANGE_SIGN 0
|
#define DMG_CHANGE_SIGN 0
|
||||||
|
@ -5922,6 +5922,7 @@ static void Cmd_moveend(void)
|
|||||||
if (gBattleResources->flags->flags[i] & RESOURCE_FLAG_EMERGENCY_EXIT)
|
if (gBattleResources->flags->flags[i] & RESOURCE_FLAG_EMERGENCY_EXIT)
|
||||||
{
|
{
|
||||||
gBattleResources->flags->flags[i] &= ~RESOURCE_FLAG_EMERGENCY_EXIT;
|
gBattleResources->flags->flags[i] &= ~RESOURCE_FLAG_EMERGENCY_EXIT;
|
||||||
|
gSpecialStatuses[i].emergencyExited = TRUE;
|
||||||
gBattlerTarget = gBattlerAbility = i;
|
gBattlerTarget = gBattlerAbility = i;
|
||||||
BattleScriptPushCursor();
|
BattleScriptPushCursor();
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER || GetBattlerSide(i) == B_SIDE_PLAYER)
|
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER || GetBattlerSide(i) == B_SIDE_PLAYER)
|
||||||
@ -10269,6 +10270,12 @@ static void Cmd_various(void)
|
|||||||
gBattlescriptCurrInstr += 7;
|
gBattlescriptCurrInstr += 7;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
case VARIOUS_JUMP_IF_EMERGENCY_EXITED:
|
||||||
|
if (gSpecialStatuses[gActiveBattler].emergencyExited)
|
||||||
|
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||||
|
else
|
||||||
|
gBattlescriptCurrInstr += 7;
|
||||||
|
return;
|
||||||
} // End of switch (gBattlescriptCurrInstr[2])
|
} // End of switch (gBattlescriptCurrInstr[2])
|
||||||
|
|
||||||
gBattlescriptCurrInstr += 3;
|
gBattlescriptCurrInstr += 3;
|
||||||
|
@ -515,9 +515,11 @@ void HandleAction_UseMove(void)
|
|||||||
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
||||||
BattleArena_AddMindPoints(gBattlerAttacker);
|
BattleArena_AddMindPoints(gBattlerAttacker);
|
||||||
|
|
||||||
// Record HP of each battler
|
|
||||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||||
|
{
|
||||||
gBattleStruct->hpBefore[i] = gBattleMons[i].hp;
|
gBattleStruct->hpBefore[i] = gBattleMons[i].hp;
|
||||||
|
gSpecialStatuses[i].emergencyExited = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
|
gCurrentActionFuncId = B_ACTION_EXEC_SCRIPT;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user