Merge pull request #1509 from GriffinRichards/doc-sprman

Document remaining symbols in pokemon.c
This commit is contained in:
GriffinR 2021-10-08 10:38:29 -04:00 committed by GitHub
commit e26f9d10d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 530 additions and 433 deletions

View File

@ -37,8 +37,6 @@
#define B_ACTION_NOTHING_FAINTED 13 // when choosing an action
#define B_ACTION_NONE 0xFF
#define MAX_TRAINER_ITEMS 4
// array entries for battle communication
#define MULTIUSE_STATE 0
#define CURSOR_POSITION 1
@ -594,16 +592,15 @@ struct BattleSpriteData
struct MonSpritesGfx
{
void* firstDecompressed; // ptr to the decompressed sprite of the first pokemon
union
{
void* ptr[4];
u8* byte[4];
union {
void* ptr[MAX_BATTLERS_COUNT];
u8* byte[MAX_BATTLERS_COUNT];
} sprites;
struct SpriteTemplate templates[4];
struct SpriteFrameImage field_74[4][4];
u8 field_F4[0x80];
struct SpriteTemplate templates[MAX_BATTLERS_COUNT];
struct SpriteFrameImage frameImages[MAX_BATTLERS_COUNT][4];
u8 unusedArr[0x80];
u8 *barFontGfx;
void *field_178;
void *unusedPtr;
u16 *buffer;
};

View File

@ -28,6 +28,8 @@
#define ABILITYEFFECT_COUNT_BATTLER_SIDE 0x11
#define ABILITYEFFECT_COUNT_ON_FIELD 0x12
#define ABILITYEFFECT_CHECK_ON_FIELD 0x13
#define ABILITYEFFECT_MUD_SPORT 0xFD
#define ABILITYEFFECT_WATER_SPORT 0xFE
#define ABILITYEFFECT_SWITCH_IN_WEATHER 0xFF
#define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0))

View File

@ -339,4 +339,10 @@
#define MON_PIC_SIZE (64 * 64 / 2)
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
#define BATTLE_ALIVE_ATK_SIDE 1
#define BATTLE_ALIVE_DEF_SIDE 2
#define SKIP_FRONT_ANIM (1 << 7)
#endif // GUARD_CONSTANTS_POKEMON_H

View File

@ -110,6 +110,7 @@
#define TRAINER_PIC_RS_BRENDAN 91
#define TRAINER_PIC_RS_MAY 92
// The player back pics are assumed to alternate according to the gender values (MALE/FEMALE)
#define TRAINER_BACK_PIC_BRENDAN 0
#define TRAINER_BACK_PIC_MAY 1
#define TRAINER_BACK_PIC_RED 2
@ -334,7 +335,7 @@
#define TRAINER_CLASS_SAILOR 0x2f
#define TRAINER_CLASS_COOLTRAINER_2 0x30 // Used for only one trainer.
#define TRAINER_CLASS_MAGMA_ADMIN 0x31
#define TRAINER_CLASS_PKMN_TRAINER_3 0x32
#define TRAINER_CLASS_RIVAL 0x32
#define TRAINER_CLASS_BUG_CATCHER 0x33
#define TRAINER_CLASS_PKMN_RANGER 0x34
#define TRAINER_CLASS_MAGMA_LEADER 0x35

View File

@ -5,6 +5,8 @@
#define SPECIES_SHINY_TAG 500
#define MAX_TRAINER_ITEMS 4
enum {
BATTLER_AFFINE_NORMAL,
BATTLER_AFFINE_EMERGE,
@ -66,7 +68,7 @@ struct Trainer
/*0x02*/ u8 encounterMusic_gender; // last bit is gender
/*0x03*/ u8 trainerPic;
/*0x04*/ u8 trainerName[12];
/*0x10*/ u16 items[4];
/*0x10*/ u16 items[MAX_TRAINER_ITEMS];
/*0x18*/ bool8 doubleBattle;
/*0x1C*/ u32 aiFlags;
/*0x20*/ u8 partySize;

View File

@ -122,20 +122,32 @@ struct Pokemon
u16 spDefense;
};
struct Unknown_806F160_Struct
struct MonSpritesGfxManager
{
u32 field_0_0:4;
u32 field_0_1:4;
u32 field_1:8;
u16 magic:8;
u32 field_3_0:4;
u32 field_3_1:4;
void *bytes;
u8 **byteArrays;
u32 numSprites:4;
u32 numSprites2:4; // Never read
u32 numFrames:8;
u32 active:8;
u32 dataSize:4;
u32 mode:4; // MON_SPR_GFX_MODE_*
void *spriteBuffer;
u8 **spritePointers;
struct SpriteTemplate *templates;
struct SpriteFrameImage *frameImages;
};
enum {
MON_SPR_GFX_MODE_NORMAL,
MON_SPR_GFX_MODE_BATTLE,
MON_SPR_GFX_MODE_FULL_PARTY,
};
enum {
MON_SPR_GFX_MANAGER_A,
MON_SPR_GFX_MANAGER_B, // Nothing ever sets up this manager.
MON_SPR_GFX_MANAGERS_COUNT
};
struct BattlePokemon
{
/*0x00*/ u16 species;
@ -247,6 +259,8 @@ struct Evolution
| (((personality) & 0x00000003) >> 0) \
) % NUM_UNOWN_FORMS)
#define GET_SHINY_VALUE(otId, personality)HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality)
extern u8 gPlayerPartyCount;
extern struct Pokemon gPlayerParty[PARTY_SIZE];
extern u8 gEnemyPartyCount;
@ -261,8 +275,8 @@ extern const u8 *const gItemEffectTable[];
extern const u32 gExperienceTables[][MAX_LEVEL + 1];
extern const u16 *const gLevelUpLearnsets[];
extern const u8 gPPUpGetMask[];
extern const u8 gPPUpSetMask[];
extern const u8 gPPUpAddMask[];
extern const u8 gPPUpClearMask[];
extern const u8 gPPUpAddValues[];
extern const u8 gStatStageRatios[MAX_STAT_STAGE + 1][2];
extern const u16 gLinkPlayerFacilityClasses[];
extern const struct SpriteTemplate gBattlerSpriteTemplates[];
@ -281,7 +295,7 @@ void CreateMonWithIVsPersonality(struct Pokemon *mon, u16 species, u8 level, u32
void CreateMonWithIVsOTID(struct Pokemon *mon, u16 species, u8 level, u8 *ivs, u32 otId);
void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 evSpread);
void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src);
void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl50);
void CreateBattleTowerMon_HandleLevel(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl50);
void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId);
void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerPokemon *dest);
@ -305,12 +319,7 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove);
void DeleteFirstMoveAndGiveMoveToMon(struct Pokemon *mon, u16 move);
void DeleteFirstMoveAndGiveMoveToBoxMon(struct BoxPokemon *boxMon, u16 move);
s32 CalculateBaseDamage(struct BattlePokemon *attacker, struct BattlePokemon *defender, u32 move, u16 sideStatus, u16 powerOverride, u8 typeOverride, u8 bankAtk, u8 bankDef);
u8 CountAliveMonsInBattle(u8 caseId);
#define BATTLE_ALIVE_EXCEPT_ACTIVE 0
#define BATTLE_ALIVE_ATK_SIDE 1
#define BATTLE_ALIVE_DEF_SIDE 2
u8 GetDefaultMoveTarget(u8 battlerId);
u8 GetMonGender(struct Pokemon *mon);
u8 GetBoxMonGender(struct BoxPokemon *boxMon);
@ -330,7 +339,6 @@ void SetMonData(struct Pokemon *mon, s32 field, const void *dataArg);
void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg);
void CopyMon(void *dest, void *src, size_t size);
u8 GiveMonToPlayer(struct Pokemon *mon);
u8 SendMonToPC(struct Pokemon* mon);
u8 CalculatePlayerPartyCount(void);
u8 CalculateEnemyPartyCount(void);
u8 GetMonsStateToDoubles(void);
@ -362,7 +370,6 @@ u16 SpeciesToNationalPokedexNum(u16 species);
u16 SpeciesToHoennPokedexNum(u16 species);
u16 HoennToNationalOrder(u16 hoennNum);
u16 SpeciesToCryId(u16 species);
void sub_806D544(u16 species, u32 personality, u8 *dest);
void DrawSpindaSpots(u16 species, u32 personality, u8 *dest, u8 a4);
void EvolutionRenameMon(struct Pokemon *mon, u16 oldSpecies, u16 newSpecies);
u8 GetPlayerFlankId(void);
@ -413,17 +420,15 @@ void DoMonFrontSpriteAnimation(struct Sprite* sprite, u16 species, bool8 noCry,
void PokemonSummaryDoMonAnimation(struct Sprite* sprite, u16 species, bool8 oneFrame);
void StopPokemonAnimationDelayTask(void);
void BattleAnimateBackSprite(struct Sprite* sprite, u16 species);
u8 sub_806EF08(u8 arg0);
u8 sub_806EF84(u8 arg0, u8 arg1);
u16 sub_806EFF0(u16 arg0);
u8 GetOpposingLinkMultiBattlerId(bool8 rightSide, u8 multiplayerId);
u16 FacilityClassToPicIndex(u16 facilityClass);
u16 PlayerGenderToFrontTrainerPicId(u8 playerGender);
void HandleSetPokedexFlag(u16 nationalNum, u8 caseId, u32 personality);
const u8 *GetTrainerClassNameFromId(u16 trainerId);
const u8 *GetTrainerNameFromId(u16 trainerId);
bool8 HasTwoFramesAnimation(u16 species);
struct Unknown_806F160_Struct *sub_806F2AC(u8 id, u8 arg1);
void sub_806F47C(u8 id);
u8 *sub_806F4F8(u8 id, u8 arg1);
struct MonSpritesGfxManager *CreateMonSpritesGfxManager(u8 managerId, u8 mode);
void DestroyMonSpritesGfxManager(u8 managerId);
u8 *MonSpritesGfxManager_GetSpritePtr(u8 managerId, u8 spriteNum);
#endif // GUARD_POKEMON_H

View File

@ -2,6 +2,7 @@
#include "battle.h"
#include "battle_anim.h"
#include "battle_controllers.h"
#include "data.h"
#include "pokemon.h"
#include "random.h"
#include "util.h"

View File

@ -2286,7 +2286,7 @@ void AnimTask_TransformMon(u8 taskId)
sub_80A6BFC(&animBg, gBattleAnimAttacker);
if (IsContest())
position = 0;
position = B_POSITION_PLAYER_LEFT;
else
position = GetBattlerPosition(gBattleAnimAttacker);

View File

@ -2227,7 +2227,7 @@ void TryShinyAnimation(u8 battler, struct Pokemon *mon)
if (IsBattlerSpriteVisible(battler))
{
shinyValue = HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality);
shinyValue = GET_SHINY_VALUE(otId, personality);
if (shinyValue < SHINY_ODDS)
isShiny = TRUE;

View File

@ -924,13 +924,13 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool8 notTransform
if (IsContest())
{
position = 0;
position = B_POSITION_PLAYER_LEFT;
targetSpecies = gContestResources->moveAnim->targetSpecies;
personalityValue = gContestResources->moveAnim->personality;
otId = gContestResources->moveAnim->otId;
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[targetSpecies],
gMonSpritesGfxPtr->sprites.ptr[0],
gMonSpritesGfxPtr->sprites.ptr[position],
targetSpecies,
gContestResources->moveAnim->targetPersonality);
}
@ -1001,7 +1001,7 @@ void BattleLoadSubstituteOrMonSpriteGfx(u8 battlerId, bool8 loadMonSprite)
if (!loadMonSprite)
{
if (IsContest())
position = 0;
position = B_POSITION_PLAYER_LEFT;
else
position = GetBattlerPosition(battlerId);
@ -1260,11 +1260,11 @@ void AllocateMonSpritesGfx(void)
for (j = 0; j < 4; j++)
{
gMonSpritesGfxPtr->field_74[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE);
gMonSpritesGfxPtr->field_74[i][j].size = MON_PIC_SIZE;
gMonSpritesGfxPtr->frameImages[i][j].data = gMonSpritesGfxPtr->sprites.ptr[i] + (j * MON_PIC_SIZE);
gMonSpritesGfxPtr->frameImages[i][j].size = MON_PIC_SIZE;
}
gMonSpritesGfxPtr->templates[i].images = gMonSpritesGfxPtr->field_74[i];
gMonSpritesGfxPtr->templates[i].images = gMonSpritesGfxPtr->frameImages[i];
}
gMonSpritesGfxPtr->barFontGfx = AllocZeroed(0x1000);
@ -1275,17 +1275,14 @@ void FreeMonSpritesGfx(void)
if (gMonSpritesGfxPtr == NULL)
return;
if (gMonSpritesGfxPtr->buffer != NULL)
FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer);
if (gMonSpritesGfxPtr->field_178 != NULL)
FREE_AND_SET_NULL(gMonSpritesGfxPtr->field_178);
TRY_FREE_AND_SET_NULL(gMonSpritesGfxPtr->buffer);
TRY_FREE_AND_SET_NULL(gMonSpritesGfxPtr->unusedPtr);
FREE_AND_SET_NULL(gMonSpritesGfxPtr->barFontGfx);
FREE_AND_SET_NULL(gMonSpritesGfxPtr->firstDecompressed);
gMonSpritesGfxPtr->sprites.ptr[0] = NULL;
gMonSpritesGfxPtr->sprites.ptr[1] = NULL;
gMonSpritesGfxPtr->sprites.ptr[2] = NULL;
gMonSpritesGfxPtr->sprites.ptr[3] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_RIGHT] = NULL;
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT] = NULL;
FREE_AND_SET_NULL(gMonSpritesGfxPtr);
}

View File

@ -501,7 +501,7 @@ const struct TrainerMoney gTrainerMoneyTable[] =
{TRAINER_CLASS_TWINS, 3},
{TRAINER_CLASS_SAILOR, 8},
{TRAINER_CLASS_COLLECTOR, 15},
{TRAINER_CLASS_PKMN_TRAINER_3, 15},
{TRAINER_CLASS_RIVAL, 15},
{TRAINER_CLASS_PKMN_BREEDER, 10},
{TRAINER_CLASS_PKMN_RANGER, 12},
{TRAINER_CLASS_TEAM_MAGMA, 5},

View File

@ -449,7 +449,7 @@ static const struct PyramidTrainerEncounterMusic sTrainerClassEncounterMusic[54]
{TRAINER_CLASS_PKMN_BREEDER, TRAINER_ENCOUNTER_MUSIC_FEMALE},
{TRAINER_CLASS_COLLECTOR, TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS},
{TRAINER_CLASS_PKMN_RANGER, TRAINER_ENCOUNTER_MUSIC_COOL},
{TRAINER_CLASS_PKMN_TRAINER_3, TRAINER_ENCOUNTER_MUSIC_MALE},
{TRAINER_CLASS_RIVAL, TRAINER_ENCOUNTER_MUSIC_MALE},
{TRAINER_CLASS_YOUNG_COUPLE, TRAINER_ENCOUNTER_MUSIC_GIRL},
{TRAINER_CLASS_PSYCHIC, TRAINER_ENCOUNTER_MUSIC_INTENSE},
{TRAINER_CLASS_SR_AND_JR, TRAINER_ENCOUNTER_MUSIC_TWINS},

View File

@ -1668,7 +1668,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
if (gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j].species != 0
&& gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j].level <= level)
{
CreateBattleTowerMon2(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j], FALSE);
CreateBattleTowerMon_HandleLevel(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j], FALSE);
}
}
return;
@ -3042,7 +3042,7 @@ static void FillPartnerParty(u16 trainerId)
if (monData.nickname[0] == EXT_CTRL_CODE_BEGIN && monData.nickname[1] == EXT_CTRL_CODE_JPN)
trainerName[5] = EOS;
}
CreateBattleTowerMon2(&gPlayerParty[MULTI_PARTY_SIZE + i], &monData, TRUE);
CreateBattleTowerMon_HandleLevel(&gPlayerParty[MULTI_PARTY_SIZE + i], &monData, TRUE);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_NAME, trainerName);
j = IsFrontierTrainerFemale(trainerId + TRAINER_RECORD_MIXING_FRIEND);
SetMonData(&gPlayerParty[MULTI_PARTY_SIZE + i], MON_DATA_OT_GENDER, &j);

View File

@ -1130,11 +1130,11 @@ void TryPutLinkBattleTvShowOnAir(void)
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
{
if ((playerBestMonId < 3 && !GetLinkTrainerFlankId(gBattleScripting.multiplayerId))
|| (playerBestMonId >= 3 && GetLinkTrainerFlankId(gBattleScripting.multiplayerId)))
if ((playerBestMonId < MULTI_PARTY_SIZE && !GetLinkTrainerFlankId(gBattleScripting.multiplayerId))
|| (playerBestMonId >= MULTI_PARTY_SIZE && GetLinkTrainerFlankId(gBattleScripting.multiplayerId)))
{
j = (opponentBestMonId < 3) ? 0 : 1;
PutBattleUpdateOnTheAir(sub_806EF84(j, gBattleScripting.multiplayerId), moveId, playerBestSpecies, opponentBestSpecies);
j = (opponentBestMonId < MULTI_PARTY_SIZE) ? FALSE : TRUE;
PutBattleUpdateOnTheAir(GetOpposingLinkMultiBattlerId(j, gBattleScripting.multiplayerId), moveId, playerBestSpecies, opponentBestSpecies);
}
}
else

View File

@ -3095,14 +3095,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
case ABILITYEFFECT_FIELD_SPORT: // 14
switch (gLastUsedAbility)
{
case 0xFD:
case ABILITYEFFECT_MUD_SPORT:
for (i = 0; i < gBattlersCount; i++)
{
if (gStatuses3[i] & STATUS3_MUDSPORT)
effect = i + 1;
}
break;
case 0xFE:
case ABILITYEFFECT_WATER_SPORT:
for (i = 0; i < gBattlersCount; i++)
{
if (gStatuses3[i] & STATUS3_WATERSPORT)

View File

@ -3122,12 +3122,12 @@ static u8 CreateContestantSprite(u16 species, u32 otId, u32 personality, u32 ind
species = SanitizeSpecies(species);
if (index == gContestPlayerMonIndex)
HandleLoadSpecialPokePic_2(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[0], species, personality);
HandleLoadSpecialPokePic_2(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT], species, personality);
else
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[0], species, personality);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonBackPicTable[species], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT], species, personality);
LoadCompressedPalette(GetMonSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x120, 0x20);
SetMultiuseSpriteTemplateToPokemon(species, 0);
SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_PLAYER_LEFT);
spriteId = CreateSprite(&gMultiuseSpriteTemplate, 0x70, GetBattlerSpriteFinal_Y(2, species, FALSE), 30);
gSprites[spriteId].oam.paletteNum = 2;

View File

@ -361,27 +361,27 @@ static void VBlankCB_ContestPainting(void)
TransferPlttBuffer();
}
static void InitContestMonPixels(u16 species, u8 whichSprite)
static void InitContestMonPixels(u16 species, bool8 backPic)
{
const void *pal = GetMonSpritePalFromSpeciesAndPersonality(species, gContestPaintingWinner->trainerId, gContestPaintingWinner->personality);
LZDecompressVram(pal, gContestPaintingMonPalette);
if (whichSprite == 0)
if (!backPic)
{
HandleLoadSpecialPokePic_DontHandleDeoxys(
&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites.ptr[1],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
species,
gContestPaintingWinner->personality);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[1], gContestPaintingMonPalette, (void *)gContestMonPixels);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
}
else
{
HandleLoadSpecialPokePic_DontHandleDeoxys(
&gMonBackPicTable[species],
gMonSpritesGfxPtr->sprites.ptr[0],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT],
species,
gContestPaintingWinner->personality);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[0], gContestPaintingMonPalette, (void *)gContestMonPixels);
_InitContestMonPixels(gMonSpritesGfxPtr->sprites.ptr[B_POSITION_PLAYER_LEFT], gContestPaintingMonPalette, (void *)gContestMonPixels);
}
}
@ -592,7 +592,7 @@ static void DoContestPaintingImageProcessing(u8 imageEffect)
static void CreateContestPaintingPicture(u8 contestWinnerId, bool8 isForArtist)
{
AllocPaintingResources();
InitContestMonPixels(gContestPaintingWinner->species, 0);
InitContestMonPixels(gContestPaintingWinner->species, FALSE);
DoContestPaintingImageProcessing(GetImageEffectForContestWinner(contestWinnerId));
InitPaintingMonOamData(contestWinnerId);
LoadContestPaintingFrame(contestWinnerId, isForArtist);

View File

@ -893,7 +893,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
{
HandleLoadSpecialPokePic_2(
&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites.ptr[1],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
species,
personality);
}
@ -901,7 +901,7 @@ static void Task_ShowWinnerMonBanner(u8 taskId)
{
HandleLoadSpecialPokePic_DontHandleDeoxys(
&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites.ptr[1],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
species,
personality);
}
@ -2581,13 +2581,13 @@ void ShowContestEntryMonPic(void)
gTasks[taskId].data[0] = 0;
gTasks[taskId].data[1] = species;
if (gSpecialVar_0x8006 == gContestPlayerMonIndex)
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
else
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
palette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
LoadCompressedSpritePalette(palette);
SetMultiuseSpriteTemplateToPokemon(species, 1);
SetMultiuseSpriteTemplateToPokemon(species, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.paletteTag = palette->tag;
spriteId = CreateSprite(&gMultiuseSpriteTemplate, (left + 1) * 8 + 32, (top * 8) + 40, 0);

View File

@ -145,13 +145,13 @@ const u8 gFacilityClassToTrainerClass[] =
[FACILITY_CLASS_SWIMMER_F] = TRAINER_CLASS_SWIMMER_F,
[FACILITY_CLASS_TWINS] = TRAINER_CLASS_TWINS,
[FACILITY_CLASS_SAILOR] = TRAINER_CLASS_SAILOR,
[FACILITY_CLASS_WALLY] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_BRENDAN] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_BRENDAN_2] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_BRENDAN_3] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_MAY] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_MAY_2] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_MAY_3] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_WALLY] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_BRENDAN] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_BRENDAN_2] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_BRENDAN_3] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_MAY] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_MAY_2] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_MAY_3] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_PKMN_BREEDER_M] = TRAINER_CLASS_PKMN_BREEDER,
[FACILITY_CLASS_BUG_CATCHER] = TRAINER_CLASS_BUG_CATCHER,
[FACILITY_CLASS_PKMN_RANGER_M] = TRAINER_CLASS_PKMN_RANGER,
@ -161,11 +161,11 @@ const u8 gFacilityClassToTrainerClass[] =
[FACILITY_CLASS_YOUNG_COUPLE] = TRAINER_CLASS_YOUNG_COUPLE,
[FACILITY_CLASS_OLD_COUPLE] = TRAINER_CLASS_OLD_COUPLE,
[FACILITY_CLASS_SIS_AND_BRO] = TRAINER_CLASS_SIS_AND_BRO,
[FACILITY_CLASS_STEVEN] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_STEVEN] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_SALON_MAIDEN_ANABEL] = TRAINER_CLASS_SALON_MAIDEN,
[FACILITY_CLASS_DOME_ACE_TUCKER] = TRAINER_CLASS_DOME_ACE,
[FACILITY_CLASS_RED] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_LEAF] = TRAINER_CLASS_PKMN_TRAINER_3,
[FACILITY_CLASS_RED] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_LEAF] = TRAINER_CLASS_RIVAL,
[FACILITY_CLASS_RS_BRENDAN] = TRAINER_CLASS_RS_PROTAG,
[FACILITY_CLASS_RS_MAY] = TRAINER_CLASS_RS_PROTAG,
};

View File

@ -49,7 +49,7 @@ const u8 gTrainerClassNames[][13] = {
[TRAINER_CLASS_SAILOR] = _("SAILOR"),
[TRAINER_CLASS_COOLTRAINER_2] = _("COOLTRAINER"),
[TRAINER_CLASS_MAGMA_ADMIN] = _("MAGMA ADMIN"),
[TRAINER_CLASS_PKMN_TRAINER_3] = _("{PKMN} TRAINER"),
[TRAINER_CLASS_RIVAL] = _("{PKMN} TRAINER"),
[TRAINER_CLASS_BUG_CATCHER] = _("BUG CATCHER"),
[TRAINER_CLASS_PKMN_RANGER] = _("{PKMN} RANGER"),
[TRAINER_CLASS_MAGMA_LEADER] = _("MAGMA LEADER"),

View File

@ -7268,7 +7268,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_WALLY_VR_1] =
{
.partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_WALLY,
.trainerName = _("WALLY"),
@ -7282,7 +7282,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_103_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7296,7 +7296,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_110_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7310,7 +7310,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_119_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7324,7 +7324,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_103_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7338,7 +7338,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_110_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7352,7 +7352,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_119_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7366,7 +7366,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_103_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7380,7 +7380,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_110_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7394,7 +7394,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_ROUTE_119_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -7408,7 +7408,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_103_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7422,7 +7422,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_110_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7436,7 +7436,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_119_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7450,7 +7450,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_103_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7464,7 +7464,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_110_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7478,7 +7478,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_119_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7492,7 +7492,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_103_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7506,7 +7506,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_110_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -7520,7 +7520,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_ROUTE_119_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -8290,7 +8290,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_RUSTBORO_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -8304,7 +8304,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_RUSTBORO_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -8388,7 +8388,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_RUSTBORO_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -8402,7 +8402,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_RUSTBORO_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -9186,7 +9186,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_WALLY_MAUVILLE] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_WALLY,
.trainerName = _("WALLY"),
@ -9200,7 +9200,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_WALLY_VR_2] =
{
.partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_WALLY,
.trainerName = _("WALLY"),
@ -9214,7 +9214,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_WALLY_VR_3] =
{
.partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_WALLY,
.trainerName = _("WALLY"),
@ -9228,7 +9228,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_WALLY_VR_4] =
{
.partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_WALLY,
.trainerName = _("WALLY"),
@ -9242,7 +9242,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_WALLY_VR_5] =
{
.partyFlags = F_TRAINER_PARTY_CUSTOM_MOVESET,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_WALLY,
.trainerName = _("WALLY"),
@ -9256,7 +9256,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_LILYCOVE_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -9270,7 +9270,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_LILYCOVE_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -9284,7 +9284,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_BRENDAN_LILYCOVE_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_BRENDAN,
.trainerName = _("BRENDAN"),
@ -9298,7 +9298,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_LILYCOVE_MUDKIP] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -9312,7 +9312,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_LILYCOVE_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -9326,7 +9326,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_LILYCOVE_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -10754,7 +10754,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_RUSTBORO_TREECKO] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -10768,7 +10768,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_MAY_RUSTBORO_TORCHIC] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_FEMALE,
.trainerPic = TRAINER_PIC_MAY,
.trainerName = _("MAY"),
@ -11258,7 +11258,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_STEVEN] =
{
.partyFlags = F_TRAINER_PARTY_HELD_ITEM | F_TRAINER_PARTY_CUSTOM_MOVESET,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_STEVEN,
.trainerName = _("STEVEN"),
@ -11916,7 +11916,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_RED] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_RED,
.trainerName = _("RED"),
@ -11930,7 +11930,7 @@ const struct Trainer gTrainers[] = {
[TRAINER_LEAF] =
{
.partyFlags = 0,
.trainerClass = TRAINER_CLASS_PKMN_TRAINER_3,
.trainerClass = TRAINER_CLASS_RIVAL,
.encounterMusic_gender = F_TRAINER_FEMALE | TRAINER_ENCOUNTER_MUSIC_MALE,
.trainerPic = TRAINER_PIC_LEAF,
.trainerName = _("LEAF"),

View File

@ -411,21 +411,22 @@ bool8 CheckDaycareMonReceivedMail(void)
return _CheckDaycareMonReceivedMail(&gSaveBlock1Ptr->daycare, gSpecialVar_0x8004);
}
static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc)
static u8 EggHatchCreateMonSprite(u8 useAlt, u8 switchID, u8 pokeID, u16* speciesLoc)
{
u8 r5 = 0;
u8 position = 0;
u8 spriteID = 0;
struct Pokemon* mon = NULL;
if (a0 == 0)
if (useAlt == FALSE)
{
mon = &gPlayerParty[pokeID];
r5 = 1;
position = B_POSITION_OPPONENT_LEFT;
}
if (a0 == 1)
if (useAlt == TRUE)
{
// Alternate sprite allocation position. Never reached.
mon = &gPlayerParty[pokeID];
r5 = 3;
position = B_POSITION_OPPONENT_RIGHT;
}
switch (switchID)
{
@ -434,14 +435,14 @@ static u8 EggHatchCreateMonSprite(u8 a0, u8 switchID, u8 pokeID, u16* speciesLoc
u16 species = GetMonData(mon, MON_DATA_SPECIES);
u32 pid = GetMonData(mon, MON_DATA_PERSONALITY);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species],
gMonSpritesGfxPtr->sprites.ptr [(a0 * 2) + 1],
gMonSpritesGfxPtr->sprites.ptr[(useAlt * 2) + B_POSITION_OPPONENT_LEFT],
species, pid);
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
*speciesLoc = species;
}
break;
case 1:
SetMultiuseSpriteTemplateToPokemon(GetMonSpritePalStruct(mon)->tag, r5);
SetMultiuseSpriteTemplateToPokemon(GetMonSpritePalStruct(mon)->tag, position);
spriteID = CreateSprite(&gMultiuseSpriteTemplate, 120, 75, 6);
gSprites[spriteID].invisible = TRUE;
gSprites[spriteID].callback = SpriteCallbackDummy;
@ -535,11 +536,11 @@ static void CB2_EggHatch_0(void)
gMain.state++;
break;
case 5:
EggHatchCreateMonSprite(0, 0, sEggHatchData->eggPartyID, &sEggHatchData->species);
EggHatchCreateMonSprite(FALSE, 0, sEggHatchData->eggPartyID, &sEggHatchData->species);
gMain.state++;
break;
case 6:
sEggHatchData->pokeSpriteID = EggHatchCreateMonSprite(0, 1, sEggHatchData->eggPartyID, &sEggHatchData->species);
sEggHatchData->pokeSpriteID = EggHatchCreateMonSprite(FALSE, 1, sEggHatchData->eggPartyID, &sEggHatchData->species);
gMain.state++;
break;
case 7:

View File

@ -260,12 +260,12 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u
trainerId = GetMonData(mon, MON_DATA_OT_ID);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
DecompressPicFromTable_2(&gMonFrontPicTable[currSpecies],
gMonSpritesGfxPtr->sprites.ptr[1],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
currSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(currSpecies, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x110, 0x20);
SetMultiuseSpriteTemplateToPokemon(currSpecies, 1);
SetMultiuseSpriteTemplateToPokemon(currSpecies, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->preEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
@ -275,12 +275,12 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u
// postEvo sprite
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonSpritesGfxPtr->sprites.ptr[3],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
postEvoSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, 3);
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_RIGHT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
gSprites[ID].callback = SpriteCallbackDummy_2;
@ -352,13 +352,13 @@ static void CB2_EvolutionSceneLoadGraphics(void)
gReservedSpritePaletteCount = 4;
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonSpritesGfxPtr->sprites.ptr[3],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
postEvoSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, 3);
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_RIGHT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
@ -424,7 +424,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
u32 trainerId = GetMonData(mon, MON_DATA_OT_ID);
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY);
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonSpritesGfxPtr->sprites.ptr[3],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
postEvoSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
@ -435,7 +435,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
{
u8 ID;
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, 1);
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
@ -488,13 +488,13 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSprit
sEvoStructPtr->preEvoSpriteId = preEvoSpriteId;
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
gMonSpritesGfxPtr->sprites.ptr[1],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
postEvoSpecies);
pokePal = GetMonSpritePalStructFromOtIdPersonality(postEvoSpecies, trainerId, personality);
LoadCompressedPalette(pokePal->data, 0x120, 0x20);
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, 1);
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);

View File

@ -161,10 +161,7 @@
* - Destroys itself when done.
*/
// These two defines are used with the sCurrItemAndOptionsMenuCheck,
// to distinguish between its two parts.
#define OPTION_MENU_FLAG 0x8000
#define CURRENT_ITEM_MASK 0x7FFF
#define OPTION_MENU_FLAG (1 << 15)
// Static type declarations
@ -685,7 +682,7 @@ static void Task_MainMenuCheckSaveFile(u8 taskId)
break;
}
}
sCurrItemAndOptionMenuCheck &= CURRENT_ITEM_MASK; // turn off the "returning from options menu" flag
sCurrItemAndOptionMenuCheck &= ~OPTION_MENU_FLAG; // turn off the "returning from options menu" flag
tCurrItem = sCurrItemAndOptionMenuCheck;
tItemCount = tMenuType + 2;
}

View File

@ -731,7 +731,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon)
// Load mon gfx
species = GetMonData(mon, MON_DATA_SPECIES2);
personality = GetMonData(mon, MON_DATA_PERSONALITY);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
sPokeblockFeed->loadGfxState++;
break;
case 1:
@ -742,7 +742,7 @@ static bool8 LoadMonAndSceneGfx(struct Pokemon *mon)
palette = GetMonSpritePalStructFromOtIdPersonality(species, trainerId, personality);
LoadCompressedSpritePalette(palette);
SetMultiuseSpriteTemplateToPokemon(palette->tag, 1);
SetMultiuseSpriteTemplateToPokemon(palette->tag, B_POSITION_OPPONENT_LEFT);
sPokeblockFeed->loadGfxState++;
break;
case 2:

File diff suppressed because it is too large Load Diff

View File

@ -1111,7 +1111,7 @@ void ShowPokemonSummaryScreen(u8 mode, void *mons, u8 monIndex, u8 maxMonIndex,
SummaryScreen_SetAnimDelayTaskId(TASK_NONE);
if (gMonSpritesGfxPtr == NULL)
sub_806F2AC(0, 0);
CreateMonSpritesGfxManager(MON_SPR_GFX_MANAGER_A, MON_SPR_GFX_MODE_NORMAL);
SetMainCallback2(CB2_InitSummaryScreen);
}
@ -1500,7 +1500,7 @@ static void CloseSummaryScreen(u8 taskId)
StopCryAndClearCrySongs();
m4aMPlayVolumeControl(&gMPlayInfo_BGM, 0xFFFF, 0x100);
if (gMonSpritesGfxPtr == NULL)
sub_806F47C(0);
DestroyMonSpritesGfxManager(MON_SPR_GFX_MANAGER_A);
FreeSummaryScreen();
DestroyTask(taskId);
}
@ -3873,25 +3873,43 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
if (gMain.inBattle)
{
if (ShouldIgnoreDeoxysForm(3, sMonSummaryScreen->curMonIndex))
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
summary->species2,
summary->pid);
else
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
summary->species2,
summary->pid);
}
else
{
if (gMonSpritesGfxPtr != NULL)
{
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE)
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
summary->species2,
summary->pid);
else
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], gMonSpritesGfxPtr->sprites.ptr[1], summary->species2, summary->pid);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT],
summary->species2,
summary->pid);
}
else
{
if (sMonSummaryScreen->monList.mons == gPlayerParty || sMonSummaryScreen->mode == SUMMARY_MODE_BOX || sMonSummaryScreen->unk40EF == TRUE)
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[summary->species2],
MonSpritesGfxManager_GetSpritePtr(MON_SPR_GFX_MANAGER_A, B_POSITION_OPPONENT_LEFT),
summary->species2,
summary->pid);
else
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2], sub_806F4F8(0, 1), summary->species2, summary->pid);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[summary->species2],
MonSpritesGfxManager_GetSpritePtr(MON_SPR_GFX_MANAGER_A, B_POSITION_OPPONENT_LEFT),
summary->species2,
summary->pid);
}
}
(*state)++;
@ -3899,7 +3917,7 @@ static u8 LoadMonGfxAndSprite(struct Pokemon *mon, s16 *state)
case 1:
pal = GetMonSpritePalStructFromOtIdPersonality(summary->species2, summary->OTID, summary->pid);
LoadCompressedSpritePalette(pal);
SetMultiuseSpriteTemplateToPokemon(pal->tag, 1);
SetMultiuseSpriteTemplateToPokemon(pal->tag, B_POSITION_OPPONENT_LEFT);
(*state)++;
return 0xFF;
}

View File

@ -65,17 +65,18 @@ u8 ScriptGiveMon(u16 species, u8 level, u16 item, u32 unused1, u32 unused2, u8 u
u8 heldItem[2];
struct Pokemon mon;
CreateMon(&mon, species, level, USE_RANDOM_IVS, 0, 0, OT_ID_PLAYER_ID, 0);
CreateMon(&mon, species, level, USE_RANDOM_IVS, FALSE, 0, OT_ID_PLAYER_ID, 0);
heldItem[0] = item;
heldItem[1] = item >> 8;
SetMonData(&mon, MON_DATA_HELD_ITEM, heldItem);
sentToPc = GiveMonToPlayer(&mon);
nationalDexNum = SpeciesToNationalPokedexNum(species);
// Don't set Pokédex flag for MON_CANT_GIVE
switch(sentToPc)
{
case 0:
case 1:
case MON_GIVEN_TO_PARTY:
case MON_GIVEN_TO_PC:
GetSetPokedexFlag(nationalDexNum, FLAG_SET_SEEN);
GetSetPokedexFlag(nationalDexNum, FLAG_SET_CAUGHT);
break;

View File

@ -2770,9 +2770,9 @@ static void LoadTradeMonPic(u8 whichParty, u8 state)
personality = GetMonData(mon, MON_DATA_PERSONALITY);
if (whichParty == TRADE_PLAYER)
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[1], species, personality);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_LEFT], species, personality);
else
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[whichParty * 2 + 1], species, personality);
HandleLoadSpecialPokePic_DontHandleDeoxys(&gMonFrontPicTable[species], gMonSpritesGfxPtr->sprites.ptr[whichParty * 2 + B_POSITION_OPPONENT_LEFT], species, personality);
LoadCompressedSpritePalette(GetMonSpritePalStruct(mon));
sTradeData->monSpecies[whichParty] = species;
@ -3767,7 +3767,7 @@ static bool8 AnimateTradeSequenceCable(void)
case TS_STATE_POKEBALL_ARRIVE_WAIT:
if (gSprites[sTradeData->bouncingPokeballSpriteId].callback == SpriteCallbackDummy)
{
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites.ptr[3], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]);
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]], gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT], sTradeData->monSpecies[TRADE_PARTNER], sTradeData->monPersonalities[TRADE_PARTNER]);
sTradeData->state++;
}
break;
@ -4265,7 +4265,7 @@ static bool8 AnimateTradeSequenceWireless(void)
if (gSprites[sTradeData->bouncingPokeballSpriteId].callback == SpriteCallbackDummy)
{
HandleLoadSpecialPokePic_2(&gMonFrontPicTable[sTradeData->monSpecies[TRADE_PARTNER]],
gMonSpritesGfxPtr->sprites.ptr[3],
gMonSpritesGfxPtr->sprites.ptr[B_POSITION_OPPONENT_RIGHT],
sTradeData->monSpecies[TRADE_PARTNER],
sTradeData->monPersonalities[TRADE_PARTNER]);
sTradeData->state++;

View File

@ -126,7 +126,7 @@ struct
{TRAINER_CLASS_PKMN_BREEDER, TRAINER_ENCOUNTER_MUSIC_FEMALE},
{TRAINER_CLASS_COLLECTOR, TRAINER_ENCOUNTER_MUSIC_SUSPICIOUS},
{TRAINER_CLASS_PKMN_RANGER, TRAINER_ENCOUNTER_MUSIC_COOL},
{TRAINER_CLASS_PKMN_TRAINER_3, TRAINER_ENCOUNTER_MUSIC_MALE},
{TRAINER_CLASS_RIVAL, TRAINER_ENCOUNTER_MUSIC_MALE},
{TRAINER_CLASS_YOUNG_COUPLE, TRAINER_ENCOUNTER_MUSIC_GIRL},
{TRAINER_CLASS_PSYCHIC, TRAINER_ENCOUNTER_MUSIC_INTENSE},
{TRAINER_CLASS_SR_AND_JR, TRAINER_ENCOUNTER_MUSIC_TWINS},