mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 03:34:15 +01:00
Label union room battle trainer
This commit is contained in:
parent
fd77eb1eb9
commit
9190af73b7
@ -13,7 +13,7 @@
|
||||
#define TRAINER_PLAYER 1023
|
||||
#define TRAINER_SECRET_BASE 1024
|
||||
#define TRAINER_LINK_OPPONENT 2048
|
||||
#define TRAINER_OPPONENT_C00 3072
|
||||
#define TRAINER_UNION_ROOM 3072
|
||||
#define TRAINER_STEVEN_PARTNER 3075
|
||||
|
||||
#define TRAINER_PIC_HIKER 0
|
||||
|
@ -279,8 +279,8 @@ void sub_80686FC(struct Pokemon *mon, struct BattleTowerPokemon *dest);
|
||||
void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
|
||||
bool8 sub_80688F8(u8 caseId, u8 battlerId);
|
||||
void SetDeoxysStats(void);
|
||||
u16 sub_8068B48(void);
|
||||
u16 sub_8068BB0(void);
|
||||
u16 GetUnionRoomTrainerPic(void);
|
||||
u16 GetUnionRoomTrainerClass(void);
|
||||
void CreateObedientEnemyMon(void);
|
||||
void CalculateMonStats(struct Pokemon *mon);
|
||||
void BoxMonToMon(const struct BoxPokemon *src, struct Pokemon *dest);
|
||||
|
@ -1267,9 +1267,9 @@ static void LinkOpponentHandleDrawTrainerPic(void)
|
||||
else
|
||||
{
|
||||
xPos = 176;
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
trainerPicId = sub_8068B48();
|
||||
trainerPicId = GetUnionRoomTrainerPic();
|
||||
}
|
||||
else if ((gLinkPlayers[GetMultiplayerId() ^ BIT_SIDE].version & 0xFF) == VERSION_FIRE_RED
|
||||
|| (gLinkPlayers[GetMultiplayerId() ^ BIT_SIDE].version & 0xFF) == VERSION_LEAF_GREEN)
|
||||
|
@ -1229,9 +1229,9 @@ static void RecordedOpponentHandleDrawTrainerPic(void)
|
||||
else
|
||||
{
|
||||
xPos = 176;
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
trainerPicId = sub_8068B48();
|
||||
trainerPicId = GetUnionRoomTrainerPic();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -995,7 +995,7 @@ static void CB2_HandleStartBattle(void)
|
||||
sub_8036A5C();
|
||||
SetPlayerBerryDataInBattleStruct();
|
||||
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
gLinkPlayers[0].id = 0;
|
||||
gLinkPlayers[1].id = 1;
|
||||
|
@ -1981,7 +1981,7 @@ void BufferStringBattle(u16 stringID)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
stringPtr = sText_Trainer1WantsToBattle;
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
stringPtr = sText_LinkTrainerWantsToBattlePause;
|
||||
@ -2049,7 +2049,7 @@ void BufferStringBattle(u16 stringID)
|
||||
{
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)))
|
||||
stringPtr = sText_Trainer1SentOutPkmn;
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
stringPtr = sText_Trainer1SentOutPkmn;
|
||||
else
|
||||
stringPtr = sText_LinkTrainerSentOutPkmn;
|
||||
@ -2110,7 +2110,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;
|
||||
@ -2180,7 +2180,7 @@ void BufferStringBattle(u16 stringID)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
switch (gBattleTextBuff1[0])
|
||||
{
|
||||
@ -2495,8 +2495,8 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
case B_TXT_TRAINER1_CLASS: // trainer class name
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE)
|
||||
toCpy = gTrainerClassNames[GetSecretBaseTrainerClass()];
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
toCpy = gTrainerClassNames[sub_8068BB0()];
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
toCpy = gTrainerClassNames[GetUnionRoomTrainerClass()];
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN)
|
||||
toCpy = gTrainerClassNames[GetFrontierBrainTrainerClass()];
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
@ -2517,7 +2517,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
ConvertInternationalString(text, gBattleResources->secretBase->language);
|
||||
toCpy = text;
|
||||
}
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_OPPONENT_C00)
|
||||
else if (gTrainerBattleOpponent_A == TRAINER_UNION_ROOM)
|
||||
{
|
||||
toCpy = gLinkPlayers[multiplayerId ^ BIT_SIDE].name;
|
||||
}
|
||||
|
@ -2725,7 +2725,7 @@ void SetDeoxysStats(void)
|
||||
}
|
||||
}
|
||||
|
||||
u16 sub_8068B48(void)
|
||||
u16 GetUnionRoomTrainerPic(void)
|
||||
{
|
||||
u8 linkId;
|
||||
u32 arrId;
|
||||
@ -2740,7 +2740,7 @@ u16 sub_8068B48(void)
|
||||
return FacilityClassToPicIndex(gLinkPlayerFacilityClasses[arrId]);
|
||||
}
|
||||
|
||||
u16 sub_8068BB0(void)
|
||||
u16 GetUnionRoomTrainerClass(void)
|
||||
{
|
||||
u8 linkId;
|
||||
u32 arrId;
|
||||
|
@ -4302,7 +4302,7 @@ static void ViewURoomPartnerTrainerCard(u8 *unused, struct WirelessLink_URoom *d
|
||||
|
||||
DynamicPlaceholderTextUtil_Reset();
|
||||
|
||||
StringCopy(data->field_C0[0], gTrainerClassNames[sub_8068BB0()]);
|
||||
StringCopy(data->field_C0[0], gTrainerClassNames[GetUnionRoomTrainerClass()]);
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, data->field_C0[0]);
|
||||
|
||||
DynamicPlaceholderTextUtil_SetPlaceholderPtr(1, trainerCard->playerName);
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include "global.h"
|
||||
#include "defines.h"
|
||||
#include "battle.h"
|
||||
#include "task.h"
|
||||
#include "text.h"
|
||||
@ -19,6 +18,7 @@
|
||||
#include "link.h"
|
||||
#include "union_room.h"
|
||||
#include "union_room_battle.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "constants/trainers.h"
|
||||
|
||||
struct UnionRoomBattle
|
||||
@ -69,7 +69,7 @@ static void CB2_SetUpPartiesAndStartBattle(void)
|
||||
}
|
||||
IncrementGameStat(GAME_STAT_NUM_UNION_ROOM_BATTLES);
|
||||
CalculatePlayerPartyCount();
|
||||
gTrainerBattleOpponent_A = TRAINER_OPPONENT_C00;
|
||||
gTrainerBattleOpponent_A = TRAINER_UNION_ROOM;
|
||||
SetMainCallback2(CB2_InitBattle);
|
||||
}
|
||||
|
||||
@ -150,7 +150,7 @@ void CB2_UnionRoomBattle(void)
|
||||
case 3:
|
||||
if (!UpdatePaletteFade())
|
||||
{
|
||||
memset(gBlockSendBuffer, 0, sizeof(gBlockSendBuffer));
|
||||
memset(gBlockSendBuffer, 0, 0x20);
|
||||
if (gSelectedOrderFromParty[0] == -gSelectedOrderFromParty[1])
|
||||
{
|
||||
gBlockSendBuffer[0] = ACTIVITY_DECLINE | IN_UNION_ROOM;
|
||||
@ -159,7 +159,7 @@ void CB2_UnionRoomBattle(void)
|
||||
{
|
||||
gBlockSendBuffer[0] = ACTIVITY_ACCEPT | IN_UNION_ROOM;
|
||||
}
|
||||
SendBlock(0, gBlockSendBuffer, sizeof(gBlockSendBuffer));
|
||||
SendBlock(0, gBlockSendBuffer, 0x20);
|
||||
gMain.state++;
|
||||
}
|
||||
break;
|
||||
@ -175,7 +175,7 @@ void CB2_UnionRoomBattle(void)
|
||||
else
|
||||
{
|
||||
sub_800AC34();
|
||||
if (gBlockRecvBuffer[GetMultiplayerId()][0] == (ACTIVITY_DECLINE | IN_UNION_ROOM)))
|
||||
if (gBlockRecvBuffer[GetMultiplayerId()][0] == (ACTIVITY_DECLINE | IN_UNION_ROOM))
|
||||
{
|
||||
gMain.state = 6;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user