Special Trainer IDs
This commit is contained in:
+4
-4
@@ -29,10 +29,10 @@
|
||||
(!(gBattleMons[battler].status2 & STATUS2_TRANSFORMED) \
|
||||
&& !(gDisableStructs[battler].mimickedMoves & gBitTable[moveSlot]))
|
||||
|
||||
#define TRAINER_OPPONENT_3FE 0x3FE
|
||||
#define TRAINER_OPPONENT_C00 0xC00
|
||||
#define TRAINER_LINK_OPPONENT 0x800
|
||||
#define SECRET_BASE_OPPONENT 0x400
|
||||
// Special Trainer Ids.
|
||||
#define TRAINER_UNION_ROOM 3072
|
||||
#define TRAINER_LINK_OPPONENT 2048
|
||||
#define TRAINER_SECRET_BASE 1024
|
||||
|
||||
// Battle Actions
|
||||
// These determine what each battler will do in a turn
|
||||
|
||||
@@ -269,7 +269,7 @@ void BattleAI_HandleItemUseBeforeAISetup(void)
|
||||
|
||||
// Items are allowed to use in ONLY trainer battles.
|
||||
if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER)
|
||||
&& (gTrainerBattleOpponent_A != SECRET_BASE_OPPONENT)
|
||||
&& (gTrainerBattleOpponent_A != TRAINER_SECRET_BASE)
|
||||
&& !(gBattleTypeFlags & (BATTLE_TYPE_TRAINER_TOWER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER | BATTLE_TYPE_SAFARI | BATTLE_TYPE_LINK))
|
||||
)
|
||||
{
|
||||
@@ -339,7 +339,7 @@ void BattleAI_SetupAIData(void)
|
||||
AI_THINKING_STRUCT->aiFlags = AI_SCRIPT_ROAMING;
|
||||
return;
|
||||
}
|
||||
else if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER_TOWER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER)) && (gTrainerBattleOpponent_A != SECRET_BASE_OPPONENT))
|
||||
else if (!(gBattleTypeFlags & (BATTLE_TYPE_TRAINER_TOWER | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_BATTLE_TOWER)) && (gTrainerBattleOpponent_A != TRAINER_SECRET_BASE))
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_WILD_SCRIPTED)
|
||||
{
|
||||
|
||||
@@ -1135,7 +1135,7 @@ static void LinkOpponentHandleDrawTrainerPic(void)
|
||||
else
|
||||
{
|
||||
xPos = 176;
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
trainerPicId = GetUnionRoomTrainerPic();
|
||||
}
|
||||
|
||||
@@ -1122,7 +1122,7 @@ static void OpponentHandleDrawTrainerPic(void)
|
||||
{
|
||||
u32 trainerPicId;
|
||||
|
||||
if (gTrainerBattleOpponent_A == 0x400)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
|
||||
trainerPicId = GetSecretBaseTrainerPicIndex();
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId();
|
||||
@@ -1152,7 +1152,7 @@ static void OpponentHandleTrainerSlide(void)
|
||||
{
|
||||
u32 trainerPicId;
|
||||
|
||||
if (gTrainerBattleOpponent_A == 0x400)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
|
||||
trainerPicId = GetSecretBaseTrainerPicIndex();
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|
||||
trainerPicId = GetBattleTowerTrainerFrontSpriteId();
|
||||
|
||||
@@ -1499,7 +1499,7 @@ void BufferStringBattle(u16 stringId)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
stringPtr = sText_Trainer1WantsToBattle;
|
||||
else
|
||||
stringPtr = sText_LinkTrainerWantsToBattle;
|
||||
@@ -1559,7 +1559,7 @@ void BufferStringBattle(u16 stringId)
|
||||
{
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK))
|
||||
stringPtr = sText_Trainer1SentOutPkmn;
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
stringPtr = sText_Trainer1SentOutPkmn;
|
||||
else
|
||||
stringPtr = sText_LinkTrainerSentOutPkmn;
|
||||
@@ -1611,7 +1611,7 @@ void BufferStringBattle(u16 stringId)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
stringPtr = sText_LinkTrainerMultiSentOutPkmn;
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
stringPtr = sText_Trainer1SentOutPkmn2;
|
||||
else
|
||||
stringPtr = sText_LinkTrainerSentOutPkmn2;
|
||||
@@ -1644,7 +1644,7 @@ void BufferStringBattle(u16 stringId)
|
||||
stringPtr = sText_GotAwaySafely;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
stringPtr = sText_TwoWildFled;
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
stringPtr = gUnknown_83FE9D4;
|
||||
else
|
||||
stringPtr = sText_WildFled;
|
||||
@@ -1669,7 +1669,7 @@ void BufferStringBattle(u16 stringId)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
switch (gBattleTextBuff1[0])
|
||||
{
|
||||
@@ -1981,9 +1981,9 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
toCpy = gAbilityNames[sBattlerAbilities[gEffectBattler]];
|
||||
break;
|
||||
case B_TXT_TRAINER1_CLASS: // trainer class name
|
||||
if (gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
|
||||
toCpy = gTrainerClassNames[GetSecretBaseTrainerNameIndex()];
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
toCpy = gTrainerClassNames[GetUnionRoomTrainerClass()];
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_BATTLE_TOWER)
|
||||
toCpy = gTrainerClassNames[GetBattleTowerTrainerClassNameId()];
|
||||
@@ -1995,14 +1995,14 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
toCpy = gTrainerClassNames[gTrainers[gTrainerBattleOpponent_A].trainerClass];
|
||||
break;
|
||||
case B_TXT_TRAINER1_NAME: // trainer1 name
|
||||
if (gTrainerBattleOpponent_A == SECRET_BASE_OPPONENT)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_SECRET_BASE)
|
||||
{
|
||||
for (i = 0; i < (s32)NELEMS(gBattleResources->secretBase->trainerName); i++)
|
||||
text[i] = gBattleResources->secretBase->trainerName[i];
|
||||
text[i] = EOS;
|
||||
toCpy = text;
|
||||
}
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
toCpy = gLinkPlayers[multiplayerId ^ BIT_SIDE].name;
|
||||
}
|
||||
|
||||
+1
-1
@@ -3796,7 +3796,7 @@ static void CreateSecretBaseEnemyParty(struct SecretBaseRecord *secretBaseRecord
|
||||
}
|
||||
}
|
||||
gBattleTypeFlags = 8;
|
||||
gTrainerBattleOpponent_A = SECRET_BASE_OPPONENT;
|
||||
gTrainerBattleOpponent_A = TRAINER_SECRET_BASE;
|
||||
}
|
||||
|
||||
u8 GetSecretBaseTrainerPicIndex(void)
|
||||
|
||||
@@ -58,7 +58,7 @@ static void SetUpPartiesAndStartBattle(void)
|
||||
}
|
||||
IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES);
|
||||
CalculatePlayerPartyCount();
|
||||
gTrainerBattleOpponent_A = TRAINER_OPPONENT_C00;
|
||||
gTrainerBattleOpponent_A = TRAINER_UNION_ROOM;
|
||||
SetMainCallback2(CB2_InitBattle);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user