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