mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 11:37:40 +01:00
Review changes for party menu doc
This commit is contained in:
parent
b1ea2592c3
commit
27169f634b
@ -84,7 +84,7 @@ void RunBattleScriptCommands_PopCallbacksStack(void);
|
||||
void RunBattleScriptCommands(void);
|
||||
bool8 TryRunFromBattle(u8 battlerId);
|
||||
|
||||
extern struct UnknownPokemonStruct4 gMultiPartnerParty[PARTY_SIZE / 2];
|
||||
extern struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE];
|
||||
|
||||
extern const struct SpriteTemplate gUnknown_0831AC88;
|
||||
extern const struct OamData gOamData_831ACA8;
|
||||
|
@ -54,6 +54,8 @@
|
||||
|
||||
#define TRAINER_ID_LENGTH 4
|
||||
#define PARTY_SIZE 6
|
||||
#define FRONTIER_PARTY_SIZE 3
|
||||
#define MULTI_PARTY_SIZE PARTY_SIZE / 2
|
||||
#define MAX_MON_MOVES 4
|
||||
|
||||
// string lengths
|
||||
|
@ -220,7 +220,7 @@ struct Apprentice
|
||||
u8 lvlMode:2; // + 1
|
||||
u8 field_1;
|
||||
u8 number;
|
||||
struct ApprenticeMon party[3];
|
||||
struct ApprenticeMon party[MULTI_PARTY_SIZE];
|
||||
u16 easyChatWords[6];
|
||||
u8 playerId[TRAINER_ID_LENGTH];
|
||||
u8 playerName[PLAYER_NAME_LENGTH];
|
||||
@ -282,7 +282,7 @@ struct BattleTowerEReaderTrainer
|
||||
/*0x10*/ u16 greeting[6];
|
||||
/*0x1C*/ u16 farewellPlayerLost[6];
|
||||
/*0x28*/ u16 farewellPlayerWon[6];
|
||||
/*0x34*/ struct BattleTowerPokemon party[3];
|
||||
/*0x34*/ struct BattleTowerPokemon party[FRONTIER_PARTY_SIZE];
|
||||
/*0xB8*/ u32 checksum;
|
||||
};
|
||||
|
||||
@ -329,7 +329,7 @@ struct BattleFrontier
|
||||
/*0xCA9*/ u8 field_CA9_d:1; // 0x20
|
||||
/*0xCA9*/ u8 field_CA9_e:1; // 0x40
|
||||
/*0xCA9*/ u8 field_CA9_f:1; // 0x80
|
||||
/*0xCAA*/ u16 selectedPartyMons[3];
|
||||
/*0xCAA*/ u16 selectedPartyMons[FRONTIER_PARTY_SIZE];
|
||||
/*0xCB0*/ u16 field_CB0;
|
||||
/*0xCB2*/ u16 curChallengeBattleNum; // In case of battle pyramid, the floor.
|
||||
/*0xCB4*/ u16 trainerIds[20];
|
||||
@ -356,7 +356,7 @@ struct BattleFrontier
|
||||
/*0xD14*/ u16 domeRecordWinStreaks[2][2];
|
||||
/*0xD1C*/ u16 domeTotalChampionships[2][2];
|
||||
/*0xD24*/ struct BattleDomeTrainer domeTrainers[DOME_TOURNAMENT_TRAINERS_COUNT];
|
||||
/*0xD64*/ u16 domeMonIds[DOME_TOURNAMENT_TRAINERS_COUNT][3];
|
||||
/*0xD64*/ u16 domeMonIds[DOME_TOURNAMENT_TRAINERS_COUNT][FRONTIER_PARTY_SIZE];
|
||||
/*0xDC4*/ u16 field_DC4;
|
||||
/*0xDC6*/ u16 field_DC6;
|
||||
/*0xDC8*/ u16 palaceWinStreaks[2][2];
|
||||
@ -375,7 +375,7 @@ struct BattleFrontier
|
||||
/*0xE10*/ u8 pikeHintedRoomIndex:3;
|
||||
/*0xE10*/ u8 pikeHintedRoomType:4;
|
||||
/*0xE10*/ u8 pikeHealingRoomsDisabled:1;
|
||||
/*0xE12*/ u16 pikeHeldItemsBackup[3];
|
||||
/*0xE12*/ u16 pikeHeldItemsBackup[FRONTIER_PARTY_SIZE];
|
||||
/*0xE18*/ u16 pyramidRewardItem;
|
||||
/*0xE1A*/ u16 pyramidWinStreaks[2];
|
||||
/*0xE1E*/ u16 pyramidRecordStreaks[2];
|
||||
@ -419,7 +419,7 @@ struct PlayersApprentice
|
||||
/*0xB2*/ u8 field_B2_0:3;
|
||||
/*0xB2*/ u8 field_B2_1:2;
|
||||
/*0xB3*/ u8 field_B3;
|
||||
/*0xB4*/ u8 monIds[3];
|
||||
/*0xB4*/ u8 monIds[MULTI_PARTY_SIZE];
|
||||
/*0xB8*/ struct Sav2_B8 field_B8[9];
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,6 @@ struct PartyMenu
|
||||
TaskFunc task;
|
||||
u8 menuType:4;
|
||||
u8 layout:2;
|
||||
u8 unused:2;
|
||||
s8 slotId;
|
||||
s8 slotId2;
|
||||
u8 action;
|
||||
|
@ -167,7 +167,7 @@ EWRAM_DATA static u32 sUnusedUnknownArray[25] = {0};
|
||||
EWRAM_DATA u32 gBattleTypeFlags = 0;
|
||||
EWRAM_DATA u8 gBattleTerrain = 0;
|
||||
EWRAM_DATA u32 gUnknown_02022FF4 = 0;
|
||||
EWRAM_DATA struct UnknownPokemonStruct4 gMultiPartnerParty[PARTY_SIZE / 2] = {0};
|
||||
EWRAM_DATA struct UnknownPokemonStruct4 gMultiPartnerParty[MULTI_PARTY_SIZE] = {0};
|
||||
EWRAM_DATA static struct UnknownPokemonStruct4* sMultiPartnerPartyBuffer = NULL;
|
||||
EWRAM_DATA u8 *gUnknown_0202305C = NULL;
|
||||
EWRAM_DATA u8 *gUnknown_02023060 = NULL;
|
||||
@ -1249,12 +1249,12 @@ static void CB2_HandleStartMultiPartnerBattle(void)
|
||||
if (gLinkPlayers[playerMultiplayerId].id != 0)
|
||||
{
|
||||
memcpy(gPlayerParty, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2);
|
||||
memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2);
|
||||
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(gPlayerParty, gBlockRecvBuffer[playerMultiplayerId], sizeof(struct Pokemon) * 2);
|
||||
memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2);
|
||||
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[enemyMultiplayerId], sizeof(struct Pokemon) * 2);
|
||||
}
|
||||
gBattleCommunication[MULTIUSE_STATE]++;
|
||||
}
|
||||
@ -1667,7 +1667,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
|
||||
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1684,7 +1684,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
memcpy(gPlayerParty + PARTY_SIZE / 2, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
|
||||
memcpy(gPlayerParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1698,7 +1698,7 @@ static void CB2_HandleStartMultiBattle(void)
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
memcpy(gEnemyParty + PARTY_SIZE / 2, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
|
||||
memcpy(gEnemyParty + MULTI_PARTY_SIZE, gBlockRecvBuffer[id], sizeof(struct Pokemon) * 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ static EWRAM_DATA u16 *sSlot2TilemapBuffer = 0; //
|
||||
EWRAM_DATA u8 gSelectedOrderFromParty[4] = {0};
|
||||
static EWRAM_DATA u16 sPartyMenuItemId = 0;
|
||||
static EWRAM_DATA u16 sUnused_0203CEFE = 0;
|
||||
EWRAM_DATA u8 gBattlePartyCurrentOrder[3] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
|
||||
EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
|
||||
|
||||
// IWRAM common
|
||||
void (*gItemUseCB)(u8, TaskFunc);
|
||||
@ -750,10 +750,10 @@ static void InitPartyMenuBoxes(u8 layout)
|
||||
|
||||
static void RenderPartyMenuBox(u8 slot)
|
||||
{
|
||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot > 2)
|
||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot >= MULTI_PARTY_SIZE)
|
||||
{
|
||||
DisplayPartyPokemonDataForMultiBattle(slot);
|
||||
if (gMultiPartnerParty[slot - 3].species == SPECIES_NONE)
|
||||
if (gMultiPartnerParty[slot - MULTI_PARTY_SIZE].species == SPECIES_NONE)
|
||||
LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON);
|
||||
else
|
||||
LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_MULTI_ALT);
|
||||
@ -986,10 +986,10 @@ static void CreatePartyMonSprites(u8 slot)
|
||||
{
|
||||
u8 actualSlot;
|
||||
|
||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot > 2)
|
||||
if (gPartyMenu.menuType == PARTY_MENU_TYPE_MULTI_SHOWCASE && slot >= MULTI_PARTY_SIZE)
|
||||
{
|
||||
u8 status;
|
||||
actualSlot = slot - 3;
|
||||
actualSlot = slot - MULTI_PARTY_SIZE;
|
||||
|
||||
if (gMultiPartnerParty[actualSlot].species != SPECIES_NONE)
|
||||
{
|
||||
@ -1117,7 +1117,7 @@ static bool8 PartyBoxPal_ParnterOrDisqualifiedInArena(u8 slot)
|
||||
if (gPartyMenu.layout == PARTY_LAYOUT_MULTI && (slot == 1 || slot == 4 || slot == 5))
|
||||
return TRUE;
|
||||
|
||||
if (slot < 3 && (gBattleTypeFlags & BATTLE_TYPE_ARENA) && gMain.inBattle && (gBattleStruct->arenaLostPlayerMons >> GetPartyIdFromBattleSlot(slot) & 1))
|
||||
if (slot < MULTI_PARTY_SIZE && (gBattleTypeFlags & BATTLE_TYPE_ARENA) && gMain.inBattle && (gBattleStruct->arenaLostPlayerMons >> GetPartyIdFromBattleSlot(slot) & 1))
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@ -6076,7 +6076,7 @@ static void Task_MultiPartnerPartySlideIn(u8 taskId)
|
||||
{
|
||||
for (i = 3; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (gMultiPartnerParty[i - 3].species != SPECIES_NONE)
|
||||
if (gMultiPartnerParty[i - MULTI_PARTY_SIZE].species != SPECIES_NONE)
|
||||
AnimateSelectedPartyIcon(sPartyMenuBoxes[i].monSpriteId, 0);
|
||||
}
|
||||
PlaySE(SE_W231); // The Harden SE plays once the partners party mons have slid on screen
|
||||
@ -6107,7 +6107,7 @@ static void SlideMultiPartyMenuBoxSpritesOneStep(u8 taskId)
|
||||
|
||||
for (i = 3; i < PARTY_SIZE; i++)
|
||||
{
|
||||
if (gMultiPartnerParty[i - 3].species != SPECIES_NONE)
|
||||
if (gMultiPartnerParty[i - MULTI_PARTY_SIZE].species != SPECIES_NONE)
|
||||
{
|
||||
MoveMultiPartyMenuBoxSprite(sPartyMenuBoxes[i].monSpriteId, tXPos - 8);
|
||||
MoveMultiPartyMenuBoxSprite(sPartyMenuBoxes[i].itemSpriteId, tXPos - 8);
|
||||
@ -6236,7 +6236,7 @@ void DoBattlePyramidMonsHaveHeldItem(void)
|
||||
u8 i;
|
||||
|
||||
gSpecialVar_Result = FALSE;
|
||||
for (i = 0; i < 3; i++)
|
||||
for (i = 0; i < FRONTIER_PARTY_SIZE; i++)
|
||||
{
|
||||
if (GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM) != ITEM_NONE)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user