Document party_menu first pass

This commit is contained in:
GriffinR
2019-10-17 19:22:03 -04:00
parent 60a592a2c3
commit 6db014cc32
92 changed files with 3119 additions and 2815 deletions
+9 -8
View File
@@ -60,6 +60,7 @@ static void EncryptBoxMon(struct BoxPokemon *boxMon);
static void DecryptBoxMon(struct BoxPokemon *boxMon);
static void sub_806E6CC(u8 taskId);
static bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId);
static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
// EWRAM vars
EWRAM_DATA static u8 sLearningMoveTableID = 0;
@@ -2879,22 +2880,22 @@ u16 GiveMoveToMon(struct Pokemon *mon, u16 move)
return GiveMoveToBoxMon(&mon->box, move);
}
u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
static u16 GiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move)
{
s32 i;
for (i = 0; i < MAX_MON_MOVES; i++)
{
u16 existingMove = GetBoxMonData(boxMon, MON_DATA_MOVE1 + i, NULL);
if (!existingMove)
if (existingMove == MOVE_NONE)
{
SetBoxMonData(boxMon, MON_DATA_MOVE1 + i, &move);
SetBoxMonData(boxMon, MON_DATA_PP1 + i, &gBattleMoves[move].pp);
return move;
}
if (existingMove == move)
return -2;
return MON_ALREADY_KNOWS_MOVE;
}
return 0xFFFF;
return MON_HAS_MAX_MOVES;
}
u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move)
@@ -2949,7 +2950,7 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
move = (gLevelUpLearnsets[species][i] & 0x1FF);
if (GiveMoveToBoxMon(boxMon, move) == 0xFFFF)
if (GiveMoveToBoxMon(boxMon, move) == MON_HAS_MAX_MOVES)
DeleteFirstMoveAndGiveMoveToBoxMon(boxMon, move);
}
}
@@ -4860,7 +4861,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
if (battlerId != 4)
{
gAbsentBattlerFlags &= ~gBitTable[battlerId];
CopyPlayerPartyMonToBattleData(battlerId, pokemon_order_func(gBattlerPartyIndexes[battlerId]));
CopyPlayerPartyMonToBattleData(battlerId, GetBattlerPartyId(gBattlerPartyIndexes[battlerId]));
if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER && gBattleResults.numRevivesUsed < 255)
gBattleResults.numRevivesUsed++;
}
@@ -6439,11 +6440,11 @@ void SetMonPreventsSwitchingString(void)
gBattleTextBuff1[4] = B_BUFF_EOS;
if (GetBattlerSide(gBattleStruct->battlerPreventingSwitchout) == B_SIDE_PLAYER)
gBattleTextBuff1[3] = pokemon_order_func(gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout]);
gBattleTextBuff1[3] = GetBattlerPartyId(gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout]);
else
gBattleTextBuff1[3] = gBattlerPartyIndexes[gBattleStruct->battlerPreventingSwitchout];
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff2, gBattlerInMenuId, pokemon_order_func(gBattlerPartyIndexes[gBattlerInMenuId]))
PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff2, gBattlerInMenuId, GetBattlerPartyId(gBattlerPartyIndexes[gBattlerInMenuId]))
BattleStringExpandPlaceholders(gText_PkmnsXPreventsSwitching, gStringVar4);
}