diff options
author | GriffinR <griffin.richards@comcast.net> | 2019-10-17 19:22:03 -0400 |
---|---|---|
committer | GriffinR <griffin.richards@comcast.net> | 2019-10-25 15:41:06 -0400 |
commit | 6db014cc32d28a64499af7d605be3a062560d5e0 (patch) | |
tree | 378d719659dd5a32b077bd6ee8140ccae6b2799c /src/pokemon.c | |
parent | 60a592a2c32d07d47c892204659a8576017584d1 (diff) |
Document party_menu first pass
Diffstat (limited to 'src/pokemon.c')
-rw-r--r-- | src/pokemon.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/pokemon.c b/src/pokemon.c index c555ca3d7..18d4fdb12 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -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); } |