merge trainer hill changes

This commit is contained in:
shinny456
2019-01-19 10:44:58 -05:00
55 changed files with 8693 additions and 9892 deletions
+2 -2
View File
@@ -1080,7 +1080,7 @@ void ResetApprenticeStruct(struct Apprentice *apprentice)
u8 i;
for (i = 0; i < 6; i++)
apprentice->easyChatWords[i] |= 0xFFFF;
apprentice->easyChatWords[i] = 0xFFFF;
apprentice->playerName[0] = EOS;
apprentice->id = 16;
@@ -1094,7 +1094,7 @@ void ResetAllApprenticeData(void)
for (i = 0; i < 4; i++)
{
for (j = 0; j < 6; j++)
gSaveBlock2Ptr->apprentices[i].easyChatWords[j] |= 0xFFFF;
gSaveBlock2Ptr->apprentices[i].easyChatWords[j] = 0xFFFF;
gSaveBlock2Ptr->apprentices[i].id = 16;
gSaveBlock2Ptr->apprentices[i].playerName[0] = EOS;
gSaveBlock2Ptr->apprentices[i].lvlMode = 0;
+4 -4
View File
@@ -1450,7 +1450,7 @@ void ClearBattleAnimationVars(void)
// Clear index array.
for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++)
sAnimSpriteIndexArray[i] |= 0xFFFF;
sAnimSpriteIndexArray[i] = 0xFFFF;
// Clear anim args.
for (i = 0; i < ANIM_ARGS_COUNT; i++)
@@ -1511,7 +1511,7 @@ void LaunchBattleAnimation(const u8 *const animsTable[], u16 tableId, bool8 isMo
gAnimScriptCallback = RunAnimScriptCommand;
for (i = 0; i < ANIM_SPRITE_INDEX_COUNT; i++)
sAnimSpriteIndexArray[i] |= 0xFFFF;
sAnimSpriteIndexArray[i] = 0xFFFF;
if (isMoveAnim)
{
@@ -1572,7 +1572,7 @@ static void ClearSpriteIndex(u16 index)
{
if (sAnimSpriteIndexArray[i] == index)
{
sAnimSpriteIndexArray[i] |= 0xFFFF;
sAnimSpriteIndexArray[i] = 0xFFFF;
return;
}
}
@@ -1779,7 +1779,7 @@ static void ScriptCmd_end(void)
{
FreeSpriteTilesByTag(gBattleAnimPicTable[sAnimSpriteIndexArray[i]].tag);
FreeSpritePaletteByTag(gBattleAnimPicTable[sAnimSpriteIndexArray[i]].tag);
sAnimSpriteIndexArray[i] |= 0xFFFF; // set terminator.
sAnimSpriteIndexArray[i] = 0xFFFF; // set terminator.
}
}
+1 -1
View File
@@ -3548,7 +3548,7 @@ static void sub_8190400(u8 taskId)
SetVBlankCallback(VblankCb0_BattleDome);
sBattleDomeStruct = AllocZeroed(sizeof(*sBattleDomeStruct));
for (i = 0; i < DOME_TOURNAMENT_TRAINERS_COUNT; i++)
sBattleDomeStruct->arr[i] |= 0xFF;
sBattleDomeStruct->arr[i] = 0xFF;
LoadMonIconPalettes();
i = CreateTask(sub_8190CD4, 0);
gTasks[i].data[0] = 0;
+2 -2
View File
@@ -198,9 +198,9 @@ static void sub_81A5E94(void)
gUnknown_03001288 = FALSE;
for (i = 0; i < 6; i++)
gSaveBlock2Ptr->frontier.field_E70[i].monId |= 0xFFFF;
gSaveBlock2Ptr->frontier.field_E70[i].monId = 0xFFFF;
for (i = 0; i < 3; i++)
gUnknown_03006298[i] |= 0xFFFF;
gUnknown_03006298[i] = 0xFFFF;
SetDynamicWarp(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
gTrainerBattleOpponent_A = 0;
+2 -2
View File
@@ -5862,7 +5862,7 @@ static void HandleAction_NothingIsFainted(void)
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_x100000
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_x8000000 | HITMARKER_x4000000);
| HITMARKER_CHARGING | HITMARKER_x4000000);
}
static void HandleAction_ActionFinished(void)
@@ -5875,7 +5875,7 @@ static void HandleAction_ActionFinished(void)
| HITMARKER_NO_PPDEDUCT | HITMARKER_IGNORE_SAFEGUARD | HITMARKER_IGNORE_ON_AIR
| HITMARKER_IGNORE_UNDERGROUND | HITMARKER_IGNORE_UNDERWATER | HITMARKER_x100000
| HITMARKER_OBEYS | HITMARKER_x10 | HITMARKER_SYNCHRONISE_EFFECT
| HITMARKER_x8000000 | HITMARKER_x4000000);
| HITMARKER_CHARGING | HITMARKER_x4000000);
gCurrentMove = 0;
gBattleMoveDamage = 0;
+1 -4
View File
@@ -16,6 +16,7 @@
#include "string_util.h"
#include "strings.h"
#include "text.h"
#include "trainer_hill.h"
#include "window.h"
#include "constants/battle_string_ids.h"
#include "constants/items.h"
@@ -41,10 +42,6 @@ extern u8 gUnknown_0203C7B4;
extern const u8 gTrainerClassNames[][13];
extern const u16 gUnknown_08D85620[];
extern u8 GetTrainerHillOpponentClass(u16 trainerId); // pokenav
extern void GetTrainerHillTrainerName(u8 *txtPtr, u16 trainerId); // pokenav
extern void CopyTrainerHillTrainerText(u8 arg0, u16 trainerId); // pokenav
// this file's functions
static void ChooseMoveUsedParticle(u8 *textPtr);
static void ChooseTypeOfMoveUsedString(u8 *dst);
+1 -1
View File
@@ -1446,7 +1446,7 @@ static void sub_81A84B4(void)
u8 i;
for (i = 0; i < 14; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] |= 0xFFFF;
gSaveBlock2Ptr->frontier.field_CB4[i] = 0xFFFF;
}
static void sub_81A84EC(void)
+1 -1
View File
@@ -1537,7 +1537,7 @@ void sub_81AA1D8(void)
u8 var0, var1;
for (i = 0; i < 8; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] |= 0xFFFF;
gSaveBlock2Ptr->frontier.field_CB4[i] = 0xFFFF;
id = sub_81AA9E4();
sub_81AA33C(&var0, &var1);
+1 -1
View File
@@ -8459,7 +8459,7 @@ static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a c
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|| gBattleMoves[move].effect == EFFECT_BIDE)
{
if ((gHitMarker & HITMARKER_x8000000))
if ((gHitMarker & HITMARKER_CHARGING))
return 1;
}
return 2;
+9 -17
View File
@@ -29,6 +29,7 @@
#include "field_message_box.h"
#include "sound.h"
#include "strings.h"
#include "trainer_hill.h"
#include "secret_base.h"
#include "string_util.h"
#include "overworld.h"
@@ -61,18 +62,9 @@ struct TrainerBattleParameter
u8 ptrType;
};
extern bool32 InTrainerHill(void);
extern void ClearPoisonStepCounter(void);
extern void sub_808BCF4(void);
extern void sub_80AF6F0(void);
extern u16 sub_81D6180(u8 localId);
extern bool8 GetTrainerHillTrainerFlag(u8 eventObjId);
extern bool8 sub_81D5C18(void);
extern void sub_81D639C(void);
extern void sub_81D6384(void);
extern void sub_81D61E8(void);
extern void sub_80982B8(void);
extern void CopyTrainerHillTrainerText(u8 a0, u16 arg1);
// this file's functions
static void DoBattlePikeWildBattle(void);
@@ -1148,12 +1140,12 @@ const u8 *BattleSetup_ConfigureTrainerBattle(const u8 *data)
{
TrainerBattleLoadArgs(sOrdinaryBattleParams, data);
SetMapVarsToTrainer();
gTrainerBattleOpponent_A = sub_81D6180(gSpecialVar_LastTalked);
gTrainerBattleOpponent_A = LocalIdToHillTrainerId(gSpecialVar_LastTalked);
}
else
{
TrainerBattleLoadArgs(sTrainerBOrdinaryBattleParams, data);
gTrainerBattleOpponent_B = sub_81D6180(gSpecialVar_LastTalked);
gTrainerBattleOpponent_B = LocalIdToHillTrainerId(gSpecialVar_LastTalked);
}
return EventScript_TryDoNormalTrainerBattle;
default:
@@ -1215,7 +1207,7 @@ bool8 GetTrainerFlag(void)
if (InBattlePyramid())
return GetBattlePyramidTrainerFlag(gSelectedEventObject);
else if (InTrainerHill())
return GetTrainerHillTrainerFlag(gSelectedEventObject);
return GetHillTrainerFlag(gSelectedEventObject);
else
return FlagGet(GetTrainerAFlag());
}
@@ -1281,11 +1273,11 @@ void BattleSetup_StartTrainerBattle(void)
gBattleTypeFlags |= BATTLE_TYPE_TRAINER_HILL;
if (gNoOfApproachingTrainers == 2)
sub_81D639C();
FillHillTrainersParties();
else
sub_81D6384();
FillHillTrainerParty();
sub_81D61E8();
SetHillTrainerFlag();
}
sNoOfPossibleTrainerRetScripts = gNoOfApproachingTrainers;
@@ -1367,9 +1359,9 @@ void ShowTrainerIntroSpeech(void)
else if (sub_81D5C18())
{
if (gNoOfApproachingTrainers == 0 || gNoOfApproachingTrainers == 1)
CopyTrainerHillTrainerText(2, sub_81D6180(gSpecialVar_LastTalked));
CopyTrainerHillTrainerText(2, LocalIdToHillTrainerId(gSpecialVar_LastTalked));
else
CopyTrainerHillTrainerText(2, sub_81D6180(gEventObjects[gApproachingTrainers[gApproachingTrainerId].eventObjectId].localId));
CopyTrainerHillTrainerText(2, LocalIdToHillTrainerId(gEventObjects[gApproachingTrainers[gApproachingTrainerId].eventObjectId].localId));
sub_80982B8();
}
+6 -6
View File
@@ -1888,7 +1888,7 @@ static void FillTrainerParty(u16 trainerId, u8 firstMonId, u8 monCount)
else if (trainerId == TRAINER_EREADER)
{
for (i = firstMonId; i < firstMonId + 3; i++)
sub_806819C(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]);
CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]);
return;
}
else if (trainerId == TRAINER_FRONTIER_BRAIN)
@@ -1904,7 +1904,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)
{
sub_8068338(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j], FALSE);
CreateBattleTowerMon2(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].party[j], FALSE);
}
}
return;
@@ -2075,7 +2075,7 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
else if (trainerId == TRAINER_EREADER)
{
for (i = firstMonId; i < firstMonId + 3; i++)
sub_806819C(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]);
CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i - firstMonId]);
return;
}
else if (trainerId == TRAINER_FRONTIER_BRAIN)
@@ -2276,7 +2276,7 @@ void DoSpecialTrainerBattle(void)
case SPECIAL_BATTLE_EREADER:
ZeroEnemyPartyMons();
for (i = 0; i < 3; i++)
sub_806819C(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i]);
CreateBattleTowerMon(&gEnemyParty[i], &gSaveBlock2Ptr->frontier.ereaderTrainer.party[i]);
gBattleTypeFlags = BATTLE_TYPE_TRAINER | BATTLE_TYPE_EREADER_TRAINER;
gTrainerBattleOpponent_A = 0;
CreateTask(Task_StartBattleAfterTransition, 1);
@@ -3258,7 +3258,7 @@ static void FillPartnerParty(u16 trainerId)
if (monData.nickname[0] == EXT_CTRL_CODE_BEGIN && monData.nickname[1] == EXT_CTRL_CODE_JPN)
trainerName[5] = EOS;
}
sub_8068338(&gPlayerParty[3 + i], &monData, TRUE);
CreateBattleTowerMon2(&gPlayerParty[3 + i], &monData, TRUE);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_NAME, trainerName);
j = IsFrontierTrainerFemale(trainerId + TRAINER_RECORD_MIXING_FRIEND);
SetMonData(&gPlayerParty[3 + i], MON_DATA_OT_GENDER, &j);
@@ -3663,7 +3663,7 @@ static void FillTentTrainerParty_(u16 trainerId, u8 firstMonId, u8 monCount)
}
}
u8 sub_81660B8(u8 facilityClass)
u8 FacilityClassToGraphicsId(u8 facilityClass)
{
u8 trainerObjectGfxId;
u8 i;
+3 -5
View File
@@ -3,21 +3,19 @@
#include "battle_controllers.h"
#include "alloc.h"
#include "pokemon.h"
#include "trainer_hill.h"
#include "party_menu.h"
#include "event_data.h"
#include "constants/abilities.h"
#include "random.h"
#include "battle_scripts.h"
extern void sub_81D55D0(void);
extern void sub_81D5694(void);
void AllocateBattleResources(void)
{
gBattleResources = gBattleResources; // something dumb needed to match
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
sub_81D55D0();
InitTrainerHillBattleStruct();
gBattleStruct = AllocZeroed(sizeof(*gBattleStruct));
@@ -47,7 +45,7 @@ void AllocateBattleResources(void)
void FreeBattleResources(void)
{
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
sub_81D5694();
FreeTrainerHillBattleStruct();
if (gBattleResources != NULL)
{
+1
View File
@@ -20,6 +20,7 @@
#include "sprite.h"
#include "task.h"
#include "trainer_see.h"
#include "trainer_hill.h"
#include "util.h"
#include "constants/event_object_movement_constants.h"
#include "constants/event_objects.h"
+1
View File
@@ -25,6 +25,7 @@
#include "sound.h"
#include "start_menu.h"
#include "trainer_see.h"
#include "trainer_hill.h"
#include "wild_encounter.h"
#include "constants/bg_event_constants.h"
#include "constants/event_objects.h"
+1
View File
@@ -13,6 +13,7 @@
#include "string_util.h"
#include "strings.h"
#include "task.h"
#include "trainer_hill.h"
#include "constants/species.h"
static bool32 IsMonValidSpecies(struct Pokemon *pokemon)
+1
View File
@@ -11,6 +11,7 @@
#include "pokenav.h"
#include "script.h"
#include "secret_base.h"
#include "trainer_hill.h"
#include "tv.h"
#include "constants/rgb.h"
+1 -1
View File
@@ -1827,7 +1827,7 @@ void sub_81A3ACC(void)
s32 i;
for (i = 0; i < 20; i++)
gSaveBlock2Ptr->frontier.field_CB4[i] |= 0xFFFF;
gSaveBlock2Ptr->frontier.field_CB4[i] = 0xFFFF;
}
static void sub_81A3B00(void)
+1 -1
View File
@@ -4524,7 +4524,7 @@ void sub_80115EC(s32 a0)
if ((a0 >> i) & 1)
{
gUnknown_03005000.unk_cea[i] = 0;
gUnknown_03005000.unk_cee[i] |= 0xFF;
gUnknown_03005000.unk_cee[i] = 0xFF;
}
}
}
+1 -2
View File
@@ -8,13 +8,12 @@
#include "pokemon_storage_system.h"
#include "random.h"
#include "save_location.h"
#include "trainer_hill.h"
#include "gba/flash_internal.h"
#include "decoration_inventory.h"
static void ApplyNewEncryptionKeyToAllEncryptedData(u32 encryptionKey);
extern void* gUnknown_0203CF5C;
extern bool16 IdentifyFlash(void);
extern void ApplyNewEncryptionKeyToBerryPowder(u32 key);
+1 -1
View File
@@ -22,10 +22,10 @@
#include "text.h"
#include "intro.h"
#include "main.h"
#include "trainer_hill.h"
extern void sub_800B9B8(void);
extern u8 gUnknown_03002748;
extern u32 *gUnknown_0203CF5C;
static void VBlankIntr(void);
static void HBlankIntr(void);
+2 -2
View File
@@ -17,6 +17,7 @@
#include "easy_chat.h"
#include "event_data.h"
#include "money.h"
#include "trainer_hill.h"
#include "tv.h"
#include "coins.h"
#include "text.h"
@@ -49,7 +50,6 @@ extern void copy_strings_to_sav1(void);
extern void InitMatchCallCounters(void);
extern void sub_801AFD8(void);
extern void sub_800E5AC(void);
extern void sub_81D54BC(void);
extern void ResetContestLinkResults(void);
extern void ResetPokeJumpResults(void);
extern void SetBerryPowder(u32* powder, u32 newValue);
@@ -212,7 +212,7 @@ void NewGameInitData(void)
InitMatchCallCounters();
sub_801AFD8();
sub_800E5AC();
sub_81D54BC();
ResetTrainerHillResults();
ResetContestLinkResults();
}
+1 -5
View File
@@ -19,7 +19,6 @@
#include "field_tasks.h"
#include "field_weather.h"
#include "fieldmap.h"
// #include "fldeff_flash.h"
#include "gpu_regs.h"
#include "heal_location.h"
#include "link.h"
@@ -50,6 +49,7 @@
#include "task.h"
// #include "tileset_anim.h"
#include "time_events.h"
#include "trainer_hill.h"
#include "tv.h"
#include "scanline_effect.h"
#include "wild_encounter.h"
@@ -106,7 +106,6 @@ extern void apply_map_tileset2_palette(const struct MapLayout *);
extern void copy_map_tileset2_to_vram_2(const struct MapLayout *);
extern void RestartWildEncounterImmunitySteps(void);
extern void ShowMapNamePopup(void);
extern bool32 InTrainerHill(void);
extern bool32 sub_808651C(void);
extern bool8 sub_80AF6A4(void);
extern bool8 sub_80E909C(void);
@@ -129,14 +128,11 @@ extern void WriteFlashScanlineEffectBuffer(u8);
extern void sub_81AA2F8(void);
extern void InitMatchCallCounters(void);
extern void sub_80EDB44(void);
extern void sub_81D64C0(void);
extern void InitFieldMessageBox(void);
extern void copy_map_tileset1_to_vram(const struct MapLayout *);
extern void copy_map_tileset2_to_vram(const struct MapLayout *);
extern void FieldUpdateBgTilemapScroll(void);
extern void TransferTilesetAnimsBuffer(void);
extern bool32 sub_81D5F48(void);
extern u8 GetCurrentTrainerHillMapId(void);
extern bool8 warp0_in_pokecenter(void);
extern void ResetAllPicSprites(void);
extern void FieldEffectActiveListClear(void);
+5 -5
View File
@@ -1563,7 +1563,7 @@ static void InitPartyMenu(u8 a, u8 b, u8 c, u8 d, u8 e, TaskFunc task, MainCallb
for (i = 0; i <= 15; i++)
gUnknown_0203CEC4->data[i] = 0;
for (i = 0; i < 3; i++)
gUnknown_0203CEC4->unkC[i] |= 0xFF;
gUnknown_0203CEC4->unkC[i] = 0xFF;
if (d == 0)
gUnknown_0203CEC8.unk9 = 0;
@@ -1851,10 +1851,10 @@ static void PartyMenuInitHelperStructs(u8 a)
gUnknown_0203CEDC[i].unk0 = &gUnknown_086156C4[1];
gUnknown_0203CEDC[i].unk4 = gUnknown_08615704[a][i];
gUnknown_0203CEDC[i].windowId = i;
gUnknown_0203CEDC[i].unk9 |= 0xFF;
gUnknown_0203CEDC[i].unkA |= 0xFF;
gUnknown_0203CEDC[i].unkB |= 0xFF;
gUnknown_0203CEDC[i].unkC |= 0xFF;
gUnknown_0203CEDC[i].unk9 = 0xFF;
gUnknown_0203CEDC[i].unkA = 0xFF;
gUnknown_0203CEDC[i].unkB = 0xFF;
gUnknown_0203CEDC[i].unkC = 0xFF;
}
gUnknown_0203CEDC[0].unk0 = &gUnknown_086156C4[0];
if (a == 3)
+4 -4
View File
@@ -1264,7 +1264,7 @@ static void ResetPokedexView(struct PokedexView *pokedexView)
for (i = 0; i < NATIONAL_DEX_COUNT; i++)
{
pokedexView->pokedexList[i].dexNum |= 0xFFFF;
pokedexView->pokedexList[i].dexNum = 0xFFFF;
pokedexView->pokedexList[i].seen = 0;
pokedexView->pokedexList[i].owned = 0;
}
@@ -1281,7 +1281,7 @@ static void ResetPokedexView(struct PokedexView *pokedexView)
pokedexView->seenCount = 0;
pokedexView->ownCount = 0;
for (i = 0; i < 4; i++)
pokedexView->unk61E[i] |= 0xFFFF;
pokedexView->unk61E[i] = 0xFFFF;
pokedexView->unk628 = 0;
pokedexView->unk62A = 0;
pokedexView->unk62C = 0;
@@ -2030,7 +2030,7 @@ void sub_80BC8D4(u8 dexMode, u8 sortMode)
for (i = sPokedexView->pokemonListCount; i < NATIONAL_DEX_COUNT; i++)
{
sPokedexView->pokedexList[i].dexNum |= 0xFFFF;
sPokedexView->pokedexList[i].dexNum = 0xFFFF;
sPokedexView->pokedexList[i].seen = FALSE;
sPokedexView->pokedexList[i].owned = FALSE;
}
@@ -2437,7 +2437,7 @@ u8 sub_80BDA40(void)
if (sPokedexView->unk61E[i] != 0xFFFF)
{
FreeAndDestroyMonPicSprite(sPokedexView->unk61E[i]);
sPokedexView->unk61E[i] |= 0xFFFF;
sPokedexView->unk61E[i] = 0xFFFF;
}
}
return FALSE;
+4 -5
View File
@@ -22,7 +22,6 @@
#include "pokemon_animation.h"
#include "pokemon_summary_screen.h"
#include "pokemon_storage_system.h"
#include "pokenav.h"
#include "random.h"
#include "recorded_battle.h"
#include "rtc.h"
@@ -31,6 +30,7 @@
#include "strings.h"
#include "task.h"
#include "text.h"
#include "trainer_hill.h"
#include "util.h"
#include "constants/abilities.h"
#include "constants/battle_frontier.h"
@@ -74,7 +74,6 @@ extern const u8 gTrainerClassNames[][13];
extern u16 get_unknown_box_id(void);
extern void set_unknown_box_id(u8);
extern bool8 sub_806F104(void);
extern u8 sub_81D63C8(u16 trainerOpponentId);
// this file's functions
static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon);
@@ -2745,7 +2744,7 @@ void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedI
CalculateMonStats(mon);
}
void sub_806819C(struct Pokemon *mon, struct BattleTowerPokemon *src)
void CreateBattleTowerMon(struct Pokemon *mon, struct BattleTowerPokemon *src)
{
s32 i;
u8 nickname[30];
@@ -2799,7 +2798,7 @@ void sub_806819C(struct Pokemon *mon, struct BattleTowerPokemon *src)
CalculateMonStats(mon);
}
void sub_8068338(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl50)
void CreateBattleTowerMon2(struct Pokemon *mon, struct BattleTowerPokemon *src, bool8 lvl50)
{
s32 i;
u8 nickname[30];
@@ -6083,7 +6082,7 @@ u8 GetTrainerEncounterMusicId(u16 trainerOpponentId)
if (InBattlePyramid())
return GetTrainerEncounterMusicIdInBattlePyramind(trainerOpponentId);
else if (sub_81D5C18())
return sub_81D63C8(trainerOpponentId);
return GetTrainerEncounterMusicIdInTrainerHill(trainerOpponentId);
else
return TRAINER_ENCOUNTER_MUSIC(trainerOpponentId);
}
+2 -2
View File
@@ -124,7 +124,7 @@ void sub_8184DA4(u8 arg0)
{
for (j = 0; j < BATTLER_RECORD_SIZE; j++)
{
sBattleRecords[i][j] |= 0xFF;
sBattleRecords[i][j] = 0xFF;
}
sBattleFlags = gBattleTypeFlags;
sAI_Scripts = gBattleResources->ai->aiFlags;
@@ -206,7 +206,7 @@ void RecordedBattle_ClearBattlerAction(u8 battlerId, u8 bytesToClear)
for (i = 0; i < bytesToClear; i++)
{
sRecordedBytesNo[battlerId]--;
sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] |= 0xFF;
sBattleRecords[battlerId][sRecordedBytesNo[battlerId]] = 0xFF;
if (sRecordedBytesNo[battlerId] == 0)
break;
}
+1 -1
View File
@@ -82,7 +82,7 @@ bool32 sub_8034C54(u32 count)
for (i = 0; i < count; i++)
{
gUnknown_02022E10->array[i].isActive = FALSE;
gUnknown_02022E10->array[i].firstOamId |= 0xFF;
gUnknown_02022E10->array[i].firstOamId = 0xFF;
}
return TRUE;
+3 -6
View File
@@ -7,6 +7,7 @@
#include "overworld.h"
#include "pokemon_storage_system.h"
#include "main.h"
#include "trainer_hill.h"
#include "constants/game_stat.h"
static u16 CalculateChecksum(void *data, u16 size);
@@ -17,10 +18,6 @@ static u8 ClearSaveData_2(u16 a1, const struct SaveSectionLocation *location);
static u8 TryWriteSector(u8 sector, u8 *data);
static u8 HandleWriteSector(u16 a1, const struct SaveSectionLocation *location);
// for the chunk declarations
extern u32 gUnknown_0203CF5C;
// Divide save blocks into individual chunks to be written to flash sectors
// Each 4 KiB flash sector contains 3968 bytes of actual data followed by a 128 byte footer
@@ -662,10 +659,10 @@ static void UpdateSaveAddresses(void)
u8 HandleSavingData(u8 saveType)
{
u8 i;
u32 backupVar = gUnknown_0203CF5C;
u32 *backupVar = gUnknown_0203CF5C;
u8 *tempAddr;
gUnknown_0203CF5C = 0;
gUnknown_0203CF5C = NULL;
UpdateSaveAddresses();
switch (saveType)
{
+5 -5
View File
@@ -782,10 +782,10 @@ const struct MenuAction MultichoiceList_112[] =
const struct MenuAction MultichoiceList_113[] =
{
{gUnknown_085EB32D, NULL},
{gUnknown_085EB33E, NULL},
{gUnknown_085EB350, NULL},
{gUnknown_085EB361, NULL},
{gText_NormalTagMatch, NULL},
{gText_VarietyTagMatch, NULL},
{gText_UniqueTagMatch, NULL},
{gText_ExpertTagMatch, NULL},
{gText_Exit, NULL},
};
@@ -1407,7 +1407,7 @@ static void sub_80E2578(void)
for (i = 0; i < ARRAY_COUNT(gUnknown_03001124); i++)
{
gUnknown_03001124[i] |= 0xFF;
gUnknown_03001124[i] = 0xFF;
}
GetFontAttribute(1, FONTATTR_MAX_LETTER_WIDTH);
+11 -11
View File
@@ -252,7 +252,7 @@ const u8 gText_ThePokemonList[] = _("the POKéMON LIST");
const u8 gText_TheShop[] = _("the shop");
const u8 gText_ThePC[] = _("the PC");
const u8 *const gReturnToXStringsTable[] =
const u8 *const gReturnToXStringsTable[] =
{
gText_TheField,
gText_TheBattle,
@@ -268,7 +268,7 @@ const u8 *const gReturnToXStringsTable[] =
gText_ThePC
};
const u8 *const gReturnToXStringsTable2[] =
const u8 *const gReturnToXStringsTable2[] =
{
gText_TheField,
gText_TheBattle,
@@ -283,7 +283,7 @@ const u8 gText_TMHMPocket[] = _("TMs & HMs");
const u8 gText_BerriesPocket[] = _("BERRIES");
const u8 gText_KeyItemsPocket[] = _("KEY ITEMS");
const u8 *const gPocketNamesStringsTable[] =
const u8 *const gPocketNamesStringsTable[] =
{
gText_ItemsPocket,
gText_PokeBallsPocket,
@@ -749,10 +749,10 @@ const u8 gUnknown_085EB2FF[] = _("I'll battle now!");
const u8 gUnknown_085EB310[] = _("I won!");
const u8 gUnknown_085EB317[] = _("I lost!");
const u8 gUnknown_085EB31F[] = _("I won't tell.");
const u8 gUnknown_085EB32D[] = _("NORMAL TAG MATCH");
const u8 gUnknown_085EB33E[] = _("VARIETY TAG MATCH");
const u8 gUnknown_085EB350[] = _("UNIQUE TAG MATCH");
const u8 gUnknown_085EB361[] = _("EXPERT TAG MATCH");
const u8 gText_NormalTagMatch[] = _("NORMAL TAG MATCH");
const u8 gText_VarietyTagMatch[] = _("VARIETY TAG MATCH");
const u8 gText_UniqueTagMatch[] = _("UNIQUE TAG MATCH");
const u8 gText_ExpertTagMatch[] = _("EXPERT TAG MATCH");
const u8 gUnknown_085EB372[] = _("TRADE CENTER");
const u8 gUnknown_085EB37F[] = _("COLOSSEUM");
const u8 gUnknown_085EB389[] = _("RECORD CORNER");
@@ -1737,10 +1737,10 @@ const u8 gText_Lv[] = _("{LV}");
const u8 gText_TimeBoard[] = _("TIME BOARD");
const u8 gText_TimeCleared[] = _("TIME CLEARED ");
const u8 gText_XMinYDotZSec[] = _("{STR_VAR_1} min. {STR_VAR_2}.{STR_VAR_3} sec.");
const u8 gUnknown_085EF8B6[] = _("1F");
const u8 gUnknown_085EF8B9[] = _("2F");
const u8 gUnknown_085EF8BC[] = _("3F");
const u8 gUnknown_085EF8BF[] = _("4F");
const u8 gText_TrainerHill1F[] = _("1F");
const u8 gText_TrainerHill2F[] = _("2F");
const u8 gText_TrainerHill3F[] = _("3F");
const u8 gText_TrainerHill4F[] = _("4F");
const u8 gText_TeachWhichMoveToPkmn[] = _("Teach which move to {STR_VAR_1}?");
const u8 gText_TeachX[] = _("Teach {STR_VAR_2}?");
const u8 gText_PkmnLearnedMove4[] = _("{STR_VAR_1} learned\n{STR_VAR_2}!");
+1121
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -109,7 +109,7 @@ static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8
{
if (paletteTag == 0xFFFF)
{
sCreatingSpriteTemplate.paletteTag |= 0xFFFF;
sCreatingSpriteTemplate.paletteTag = 0xFFFF;
LoadCompressedPalette(GetFrontSpritePalFromSpeciesAndPersonality(species, otId, personality), 0x100 + paletteSlot * 0x10, 0x20);
}
else
@@ -122,7 +122,7 @@ static void LoadPicPaletteByTagOrSlot(u16 species, u32 otId, u32 personality, u8
{
if (paletteTag == 0xFFFF)
{
sCreatingSpriteTemplate.paletteTag |= 0xFFFF;
sCreatingSpriteTemplate.paletteTag = 0xFFFF;
LoadCompressedPalette(gTrainerFrontPicPaletteTable[species].data, 0x100 + paletteSlot * 0x10, 0x20);
}
else
+2 -4
View File
@@ -6,18 +6,16 @@
#include "field_effect.h"
#include "field_player_avatar.h"
#include "pokemon.h"
#include "pokenav.h"
#include "script.h"
#include "script_movement.h"
#include "sprite.h"
#include "task.h"
#include "trainer_see.h"
#include "trainer_hill.h"
#include "util.h"
#include "battle_pyramid.h"
#include "constants/field_effects.h"
extern bool32 InTrainerHill(void);
extern bool8 GetTrainerHillTrainerFlag(u8 eventObjectId);
extern void sub_809BE48(u16 npcId);
// this file's functions
@@ -240,7 +238,7 @@ static u8 CheckTrainer(u8 eventObjectId)
}
else if (InTrainerHill() == TRUE)
{
if (GetTrainerHillTrainerFlag(eventObjectId))
if (GetHillTrainerFlag(eventObjectId))
return 0;
}
else