TRAINER_SECRET_BASE propagation

This commit is contained in:
PikalaxALT 2019-11-07 09:23:21 -05:00
parent ed426e1f8f
commit 64485f5cd1
3 changed files with 6 additions and 4 deletions

View File

@ -8,6 +8,7 @@
#include "constants/species.h"
#include "constants/pokemon.h"
#include "constants/songs.h"
#include "constants/trainers.h"
#include "constants/game_stat.h"
#include "battle_string_ids.h"
.include "asm/macros/battle_script.inc"
@ -2931,7 +2932,7 @@ BattleScript_PayDayMoneyAndPickUpItems::
BattleScript_LocalBattleLost::
jumpifbattletype BATTLE_TYPE_TRAINER_TOWER, BattleScript_BattleTowerLost
jumpifbattletype BATTLE_TYPE_EREADER_TRAINER, BattleScript_EReaderOrSecretBaseTrainerEnd
jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, 1024, BattleScript_EReaderOrSecretBaseTrainerEnd
jumpifhalfword CMP_EQUAL, gTrainerBattleOpponent_A, TRAINER_SECRET_BASE, BattleScript_EReaderOrSecretBaseTrainerEnd
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, 0, BattleScript_RivalBattleLost
BattleScript_LocalBattleLostPrintWhiteOut::
jumpifbattletype BATTLE_TYPE_TRAINER, BattleScript_LocalBattleLostEnd

View File

@ -165,6 +165,7 @@
#define TRAINER_PIC_LADY 146
#define TRAINER_PIC_PAINTER 147
// Leftover from R/S
#define TRAINER_SECRET_BASE 1024
#define F_TRAINER_FEMALE (1 << 7)

View File

@ -5176,7 +5176,7 @@ static void atk5D_getmoneyreward(void)
// The whole function is using wrong registers.
if (gBattleOutcome == B_OUTCOME_WON)
{
if (gTrainerBattleOpponent_A == 0x400)
if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
{
moneyReward = 20 * gBattleResources->secretBase->party.levels[0] * gBattleStruct->moneyMultiplier;
}
@ -8810,7 +8810,7 @@ static void atkD2_tryswapitems(void) // trick
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_TOWER
|| (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT
&& !(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER))
&& gTrainerBattleOpponent_A != 0x400))
&& gTrainerBattleOpponent_A != TRAINER_SECRET_BASE))
{
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
@ -8821,7 +8821,7 @@ static void atkD2_tryswapitems(void) // trick
// you can't swap items if they were knocked off in regular battles
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_EREADER_TRAINER))
&& gTrainerBattleOpponent_A != 0x400
&& gTrainerBattleOpponent_A != TRAINER_SECRET_BASE
&& (gWishFutureKnock.knockedOffMons[sideAttacker] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]]
|| gWishFutureKnock.knockedOffMons[sideTarget] & gBitTable[gBattlerPartyIndexes[gBattlerTarget]]))
{