mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
Updated defeat condition on multi battles
This commit is contained in:
parent
a5659f3339
commit
ffe35fbb06
@ -5925,6 +5925,7 @@ BattleScript_PayDayMoneyAndPickUpItems::
|
||||
end2
|
||||
|
||||
BattleScript_LocalBattleLost::
|
||||
jumpifbattletype BATTLE_TYPE_INGAME_PARTNER, BattleScript_LocalBattleLostPrintWhiteOut
|
||||
jumpifbattletype BATTLE_TYPE_DOME, BattleScript_CheckDomeDrew
|
||||
jumpifbattletype BATTLE_TYPE_FRONTIER, BattleScript_LocalBattleLostPrintTrainersWinText
|
||||
jumpifbattletype BATTLE_TYPE_TRAINER_HILL, BattleScript_LocalBattleLostPrintTrainersWinText
|
||||
|
@ -226,8 +226,9 @@
|
||||
#define B_LAST_USED_BALL TRUE // If TRUE, the "last used ball" feature from Gen 7 will be implemented
|
||||
#define B_LAST_USED_BALL_BUTTON R_BUTTON // If last used ball is implemented, this button (or button combo) will trigger throwing the last used ball.
|
||||
|
||||
// Other
|
||||
#define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter.
|
||||
// Other settings
|
||||
#define B_DOUBLE_WILD_CHANCE 0 // % chance of encountering two Pokémon in a Wild Encounter.
|
||||
#define B_NEW_MULTI_BATTLE_DEFEAT_CONDITION TRUE // In Gen5+, multi battles end when the Player and also their Partner don't have any more Pokémon to fight.
|
||||
|
||||
// Animation Settings
|
||||
#define B_NEW_SWORD_PARTICLE FALSE // If set to TRUE, it updates Swords Dance's particle.
|
||||
|
@ -4113,6 +4113,28 @@ static void Cmd_getexp(void)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef B_NEW_MULTI_BATTLE_DEFEAT_CONDITION == TRUE
|
||||
static bool32 NoAliveMonsForPlayerAndPartner(void)
|
||||
{
|
||||
u32 i;
|
||||
u32 HP_count = 0;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && (gPartnerTrainerId == TRAINER_STEVEN_PARTNER || gPartnerTrainerId >= TRAINER_CUSTOM_PARTNER))
|
||||
{
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_SPECIES) && !GetMonData(&gPlayerParty[i], MON_DATA_IS_EGG)
|
||||
&& (!(gBattleTypeFlags & BATTLE_TYPE_ARENA) || !(gBattleStruct->arenaLostPlayerMons & gBitTable[i])))
|
||||
{
|
||||
HP_count += GetMonData(&gPlayerParty[i], MON_DATA_HP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (HP_count == 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
static bool32 NoAliveMonsForPlayer(void)
|
||||
{
|
||||
u32 i;
|
||||
@ -4168,7 +4190,11 @@ static void Cmd_unknown_24(void)
|
||||
if (gBattleControllerExecFlags)
|
||||
return;
|
||||
|
||||
if (NoAliveMonsForPlayer())
|
||||
#ifdef B_NEW_MULTI_BATTLE_DEFEAT_CONDITION == TRUE
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER) && NoAliveMonsForPlayerAndPartner())
|
||||
gBattleOutcome |= B_OUTCOME_LOST;
|
||||
#endif
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_MULTI | BATTLE_TYPE_INGAME_PARTNER)) && NoAliveMonsForPlayer())
|
||||
gBattleOutcome |= B_OUTCOME_LOST;
|
||||
if (NoAliveMonsForOpponent())
|
||||
gBattleOutcome |= B_OUTCOME_WON;
|
||||
|
Loading…
Reference in New Issue
Block a user