Merge remote-tracking branch 'pret/master' into render_text
This commit is contained in:
@@ -388,112 +388,128 @@ const struct ApprenticeTrainer gApprentices[] =
|
||||
.otId = 0xBDC9,
|
||||
.facilityClass = 0x43,
|
||||
.species = {SPECIES_BEAUTIFLY, SPECIES_DUSTOX, SPECIES_ILLUMISE, SPECIES_SHIFTRY, SPECIES_BRELOOM, SPECIES_NINJASK, SPECIES_SHEDINJA, SPECIES_PINSIR, SPECIES_HERACROSS, SPECIES_VOLBEAT},
|
||||
.rest = {0, 0, 0x1D, 8, 0x3e, 20, 0, 12, 1, 10, 0x30, 6, 0x44, 20},
|
||||
.id = 0,
|
||||
.easyChatWords = {0x81D, 0x143E, 0xC00, 0xA01, 0x630, 0x1444},
|
||||
},
|
||||
{
|
||||
.name = {_("ヒロオ"), _("LIONEL"), _("LIONEL"), _("CAIO"), _("LUDWIG"), _("LEO")},
|
||||
.otId = 0xCF09,
|
||||
.facilityClass = 0x2B,
|
||||
.species = {SPECIES_SWELLOW, SPECIES_SWALOT, SPECIES_SHUCKLE, SPECIES_MANECTRIC, SPECIES_TORKOAL, SPECIES_HARIYAMA, SPECIES_MIGHTYENA, SPECIES_LUDICOLO, SPECIES_CRAWDAUNT, SPECIES_WHISCASH},
|
||||
.rest = {1, 0, 0x38, 12, 1, 10, 0x30, 6, 6, 10, 0x20, 0x10, 0x13, 0x22},
|
||||
.id = 1,
|
||||
.easyChatWords = {0xC38, 0xA01, 0x630, 0xA06, 0x1020, 0x2213},
|
||||
},
|
||||
{
|
||||
.name = {_("ケイジ"), _("SONNY"), _("HERVE"), _("FEDRO"), _("WENZEL"), _("SANTI")},
|
||||
.otId = 0x2E34,
|
||||
.facilityClass = 0x26,
|
||||
.species = {SPECIES_LINOONE, SPECIES_MIGHTYENA, SPECIES_WHISCASH, SPECIES_ZANGOOSE, SPECIES_SEVIPER, SPECIES_NINETALES, SPECIES_KECLEON, SPECIES_SHUCKLE, SPECIES_MANECTRIC, SPECIES_MACHAMP},
|
||||
.rest = {2, 0, 1, 10, 10, 0x16, 0x15, 14, 0x30, 6, 0x3b, 12, 0x4, 12},
|
||||
.id = 2,
|
||||
.easyChatWords = {0xA01, 0x160A, 0xE15, 0x630, 0xC3B, 0xC04},
|
||||
},
|
||||
{
|
||||
.name = {_("ユラ"), _("LAYLA"), _("LAYLA"), _("ASTRID"), _("SONJA"), _("LOLA")},
|
||||
.otId = 0x84EF,
|
||||
.facilityClass = 0x47,
|
||||
.species = {SPECIES_SWALOT, SPECIES_XATU, SPECIES_ALTARIA, SPECIES_GOLDUCK, SPECIES_FLYGON, SPECIES_ALAKAZAM, SPECIES_GARDEVOIR, SPECIES_WAILORD, SPECIES_GRUMPIG, SPECIES_MIGHTYENA},
|
||||
.rest = {3, 0, 11, 16, 15, 0x1e, 0x39, 16, 0x21, 0x14, 0x3, 12, 0xff, 0xff},
|
||||
.id = 3,
|
||||
.easyChatWords = {0x100B, 0x1E0F, 0x1039, 0x1421, 0xC03, 0xFFFF},
|
||||
},
|
||||
{
|
||||
.name = {_("ヨウカ"), _("MACY"), _("AMELIE"), _("CLEO"), _("MARIA"), _("ELISA")},
|
||||
.otId = 0x1E43,
|
||||
.facilityClass = 0x27,
|
||||
.species = {SPECIES_WIGGLYTUFF, SPECIES_LINOONE, SPECIES_KINGDRA, SPECIES_DELCATTY, SPECIES_RAICHU, SPECIES_FEAROW, SPECIES_STARMIE, SPECIES_MEDICHAM, SPECIES_SHIFTRY, SPECIES_BEAUTIFLY},
|
||||
.rest = {4, 0, 15, 0x1e, 0x14, 16, 6, 16, 15, 0x28, 0x1c, 0x1c, 0x13, 0x1c},
|
||||
.id = 4,
|
||||
.easyChatWords = {0x1E0F, 0x1014, 0x1006, 0x280F, 0x1C1C, 0x1C13},
|
||||
},
|
||||
{
|
||||
.name = {_("ヤスシ"), _("DONTE"), _("BRAHIM"), _("GLAUCO"), _("JOSEF"), _("ROQUE")},
|
||||
.otId = 0x379F,
|
||||
.facilityClass = 0x30,
|
||||
.species = {SPECIES_STARMIE, SPECIES_DODRIO, SPECIES_AGGRON, SPECIES_MAGNETON, SPECIES_MACHAMP, SPECIES_ARMALDO, SPECIES_HERACROSS, SPECIES_NOSEPASS, SPECIES_EXPLOUD, SPECIES_MIGHTYENA},
|
||||
.rest = {5, 0, 0x29, 0x0A, 0x08, 0x14, 0x2F, 0x10, 0x38, 0x16, 0x20, 0x08, 0x00, 0x0C},
|
||||
.id = 5,
|
||||
.easyChatWords = {0xA29, 0x1408, 0x102F, 0x1638, 0x820, 0xC00},
|
||||
},
|
||||
{
|
||||
.name = {_("ミサオ"), _("AMIRA"), _("LAURE"), _("DAFNE"), _("AMELIE"), _("LARA")},
|
||||
.otId = 0xF555,
|
||||
.facilityClass = 0x31,
|
||||
.species = {SPECIES_STARMIE, SPECIES_DODRIO, SPECIES_MAGNETON, SPECIES_MEDICHAM, SPECIES_MIGHTYENA, SPECIES_GLALIE, SPECIES_GOLEM, SPECIES_ELECTRODE, SPECIES_PELIPPER, SPECIES_SHARPEDO},
|
||||
.rest = {6, 0, 0x0B, 0x0C, 0x3E, 0x12, 0x00, 0x0C, 0x31, 0x0A, 0x30, 0x14, 0x00, 0x0C},
|
||||
.id = 6,
|
||||
.easyChatWords = {0xC0B, 0x123E, 0xC00, 0xA31, 0x1430, 0xC00},
|
||||
},
|
||||
{
|
||||
.name = {_("カズサ"), _("KALI"), _("JODIE"), _("ILENIA"), _("KARO"), _("ELSA")},
|
||||
.otId = 0x8D26,
|
||||
.facilityClass = 0x14,
|
||||
.species = {SPECIES_NINETALES, SPECIES_ALAKAZAM, SPECIES_SCEPTILE, SPECIES_SALAMENCE, SPECIES_GOLDUCK, SPECIES_MAWILE, SPECIES_WEEZING, SPECIES_LANTURN, SPECIES_GARDEVOIR, SPECIES_MILOTIC},
|
||||
.rest = {7, 0, 0x06, 0x0A, 0x20, 0x06, 0x1F, 0x0A, 0x02, 0x0A, 0x03, 0x0C, 0xFF, 0xFF},
|
||||
.id = 7,
|
||||
.easyChatWords = {0xA06, 0x620, 0xA1F, 0xA02, 0xC03, 0xFFFF},
|
||||
},
|
||||
{
|
||||
.name = {_("スミレ"), _("ANNIE"), _("ANNIE"), _("IMELDA"), _("INES"), _("ROSA")},
|
||||
.otId = 0x800C,
|
||||
.facilityClass = 0xD,
|
||||
.species = {SPECIES_SCEPTILE, SPECIES_VILEPLUME, SPECIES_BELLOSSOM, SPECIES_ROSELIA, SPECIES_CORSOLA, SPECIES_FLYGON, SPECIES_BRELOOM, SPECIES_MILOTIC, SPECIES_ALTARIA, SPECIES_CRADILY},
|
||||
.rest = {8, 0, 0x22, 0x1E, 0x33, 0x04, 0x0E, 0x02, 0x02, 0x0A, 0x1E, 0x10, 0x00, 0x0C},
|
||||
.id = 8,
|
||||
.easyChatWords = {0x1E22, 0x433, 0x20E, 0xA02, 0x101E, 0xC00},
|
||||
},
|
||||
{
|
||||
.name = {_("アキノリ"), _("DILLEN"), _("RENE"), _("INDRO"), _("DETLEF"), _("PEDRO")},
|
||||
.otId = 0x469f,
|
||||
.facilityClass = 0,
|
||||
.species = {SPECIES_SKARMORY, SPECIES_GOLEM, SPECIES_BLAZIKEN, SPECIES_CAMERUPT, SPECIES_DONPHAN, SPECIES_MUK, SPECIES_SALAMENCE, SPECIES_TROPIUS, SPECIES_SOLROCK, SPECIES_RHYDON},
|
||||
.rest = {9, 0, 0x3D, 0x0A, 0x11, 0x10, 0x1E, 0x0E, 0x1C, 0x20, 0x04, 0x0C, 0xFF, 0xFF},
|
||||
.id = 9,
|
||||
.easyChatWords = {0xA3D, 0x1011, 0xE1E, 0x201C, 0xC04, 0xFFFF},
|
||||
},
|
||||
{
|
||||
.name = {_("トウゾウ"), _("DALLAS"), _("BRUNO"), _("LEARCO"), _("ANSGAR"), _("MANOLO")},
|
||||
.otId = 0x71FC,
|
||||
.facilityClass = 0x2D,
|
||||
.species = {SPECIES_SEAKING, SPECIES_STARMIE, SPECIES_GOLDUCK, SPECIES_TENTACRUEL, SPECIES_OCTILLERY, SPECIES_GOREBYSS, SPECIES_GLALIE, SPECIES_WAILORD, SPECIES_SHARPEDO, SPECIES_KINGDRA},
|
||||
.rest = {10, 0, 0x05, 0x0A, 0x06, 0x06, 0x0E, 0x16, 0x14, 0x0A, 0x00, 0x0C, 0xFF, 0xFF},
|
||||
.id = 10,
|
||||
.easyChatWords = {0xA05, 0x606, 0x160E, 0xA14, 0xC00, 0xFFFF},
|
||||
},
|
||||
{
|
||||
.name = {_("セイヤ"), _("FRANK"), _("FRANK"), _("OLINDO"), _("FRANK"), _("MAURO")},
|
||||
.otId = 0xA39E,
|
||||
.facilityClass = 0x3A,
|
||||
.species = {SPECIES_QUAGSIRE, SPECIES_STARMIE, SPECIES_PELIPPER, SPECIES_CRAWDAUNT, SPECIES_WAILORD, SPECIES_GYARADOS, SPECIES_SWAMPERT, SPECIES_LANTURN, SPECIES_WHISCASH, SPECIES_SHUCKLE},
|
||||
.rest = {11, 0, 0x0E, 0x28, 0x3D, 0x10, 0x0F, 0x24, 0x14, 0x0A, 0x23, 0x1E, 0x24, 0x10},
|
||||
.id = 11,
|
||||
.easyChatWords = {0x280E, 0x103D, 0x240F, 0xA14, 0x1E23, 0x1024},
|
||||
},
|
||||
{
|
||||
.name = {_("リュウジ"), _("LAMONT"), _("XAV"), _("ORFEO"), _("JÜRGEN"), _("JORGE")},
|
||||
.otId = 0xE590,
|
||||
.facilityClass = 0x19,
|
||||
.species = {SPECIES_ABSOL, SPECIES_CROBAT, SPECIES_EXPLOUD, SPECIES_MAGNETON, SPECIES_SHARPEDO, SPECIES_MANECTRIC, SPECIES_METAGROSS, SPECIES_ELECTRODE, SPECIES_NOSEPASS, SPECIES_WEEZING},
|
||||
.rest = {12, 0, 0x20, 0x10, 0x2E, 0x06, 0x0B, 0x10, 0x22, 0x1E, 0x0F, 0x1E, 0x0B, 0x10},
|
||||
.id = 12,
|
||||
.easyChatWords = {0x1020, 0x62E, 0x100B, 0x1E22, 0x1E0F, 0x100B},
|
||||
},
|
||||
{
|
||||
.name = {_("カツアキ"), _("TYRESE"), _("ANDY"), _("PARIDE"), _("DAVID"), _("CHICHO")},
|
||||
.otId = 0xD018,
|
||||
.facilityClass = 10,
|
||||
.species = {SPECIES_BLAZIKEN, SPECIES_GOLEM, SPECIES_MACHAMP, SPECIES_RHYDON, SPECIES_HARIYAMA, SPECIES_AGGRON, SPECIES_MEDICHAM, SPECIES_ZANGOOSE, SPECIES_VIGOROTH, SPECIES_SLAKING},
|
||||
.rest = {13, 0, 0x29, 0x0A, 0x3A, 0x06, 0x15, 0x0E, 0x35, 0x14, 0x34, 0x10, 0x1E, 0x06},
|
||||
.id = 13,
|
||||
.easyChatWords = {0xA29, 0x63A, 0xE15, 0x1435, 0x1034, 0x61E},
|
||||
},
|
||||
{
|
||||
.name = {_("トシミツ"), _("DANTE"), _("DANTE"), _("RAOUL"), _("LOTHAR"), _("PABLO")},
|
||||
.otId = 0xBC75,
|
||||
.facilityClass = 14,
|
||||
.species = {SPECIES_SCEPTILE, SPECIES_SANDSLASH, SPECIES_FLYGON, SPECIES_CLAYDOL, SPECIES_ARMALDO, SPECIES_CROBAT, SPECIES_CRADILY, SPECIES_SOLROCK, SPECIES_LUNATONE, SPECIES_GOLEM},
|
||||
.rest = {14, 0, 0x01, 0x0A, 0x17, 0x10, 0x43, 0x12, 0x22, 0x1E, 0x0B, 0x10, 0x0F, 0x28},
|
||||
.id = 14,
|
||||
.easyChatWords = {0xA01, 0x1017, 0x1243, 0x1E22, 0x100B, 0x280F},
|
||||
},
|
||||
{
|
||||
.name = {_("ローウェン"), _("ARTURO"), _("ARTURO"), _("ROMOLO"), _("BRIAN"), _("ARTURO")},
|
||||
.otId = 0xFA02,
|
||||
.facilityClass = 0x20,
|
||||
.species = {SPECIES_ABSOL, SPECIES_MIGHTYENA, SPECIES_ALAKAZAM, SPECIES_BANETTE, SPECIES_NINETALES, SPECIES_CLAYDOL, SPECIES_MUK, SPECIES_SALAMENCE, SPECIES_WALREIN, SPECIES_DUSCLOPS},
|
||||
.rest = {15, 0, 0x0F, 0x1E, 0x04, 0x14, 0x2F, 0x10, 0x06, 0x10, 0x20, 0x10, 0x03, 0x0E},
|
||||
.id = 15,
|
||||
.easyChatWords = {0x1E0F, 0x1404, 0x102F, 0x1006, 0x1020, 0xE03},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -2222,7 +2238,7 @@ static void sub_81A1370(void)
|
||||
r9 = -1;
|
||||
for (i = 1; i < 4; i++)
|
||||
{
|
||||
if (ReadUnalignedWord(gSaveBlock2Ptr->apprentices[i].playerId) == ReadUnalignedWord(gSaveBlock2Ptr->playerTrainerId)
|
||||
if (GetTrainerId(gSaveBlock2Ptr->apprentices[i].playerId) == GetTrainerId(gSaveBlock2Ptr->playerTrainerId)
|
||||
&& gSaveBlock2Ptr->apprentices[i].number < r10)
|
||||
{
|
||||
r10 = gSaveBlock2Ptr->apprentices[i].number;
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "battle.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_tower.h"
|
||||
#include "frontier_util.h"
|
||||
#include "battle_message.h"
|
||||
#include "event_data.h"
|
||||
#include "overworld.h"
|
||||
@@ -56,13 +57,12 @@ struct UnkStruct_860DD10
|
||||
};
|
||||
|
||||
extern void sub_81B8558(void);
|
||||
extern u32 sub_81A39C4(void);
|
||||
extern u16 sub_81A5060(u8 monId, u8 moveSlotId);
|
||||
extern u8 sub_81A50F0(u8, u8);
|
||||
extern u8 sub_81A50B0(u8);
|
||||
extern u16 GetFrontierBrainMonMove(u8 monId, u8 moveSlotId);
|
||||
extern u8 GetFrontierBrainMonEvs(u8, u8);
|
||||
extern u8 GetFrontierBrainMonNature(u8);
|
||||
extern void sub_81A4C30(void);
|
||||
extern bool8 sub_81A3610(void);
|
||||
extern u16 sub_81A4FF0(u8);
|
||||
extern u8 sub_81A3610(void);
|
||||
extern u16 GetFrontierBrainMonSpecies(u8);
|
||||
extern void ReducePlayerPartyToThree(void);
|
||||
|
||||
extern u8 gUnknown_0203CEF8[];
|
||||
@@ -2408,7 +2408,7 @@ static void sub_818E9CC(void)
|
||||
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
|
||||
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
|
||||
if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860D0EC[battleMode][lvlMode]))
|
||||
gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] = 0;
|
||||
gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode] = 0;
|
||||
|
||||
saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
|
||||
gTrainerBattleOpponent_A = 0;
|
||||
@@ -2422,7 +2422,7 @@ static void sub_818EA84(void)
|
||||
switch (gSpecialVar_0x8005)
|
||||
{
|
||||
case 0:
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode];
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode];
|
||||
break;
|
||||
case 1:
|
||||
gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860D0EC[battleMode][lvlMode]) != 0);
|
||||
@@ -2490,7 +2490,7 @@ static void sub_818ED28(void)
|
||||
switch (gSpecialVar_0x8005)
|
||||
{
|
||||
case 0:
|
||||
gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] = gSpecialVar_0x8006;
|
||||
gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode] = gSpecialVar_0x8006;
|
||||
break;
|
||||
case 1:
|
||||
if (gSpecialVar_0x8006)
|
||||
@@ -2575,7 +2575,7 @@ static void InitDomeTrainers(void)
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
gSaveBlock2Ptr->frontier.domeMonId[0][i] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1], MON_DATA_SPECIES, NULL);
|
||||
gSaveBlock2Ptr->frontier.domeMonIds[0][i] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1], MON_DATA_SPECIES, NULL);
|
||||
for (j = 0; j < 4; j++)
|
||||
gSaveBlock2Ptr->frontier.field_EFC[i].moves[j] = GetMonData(&gPlayerParty[gSaveBlock2Ptr->frontier.selectedPartyMons[i] - 1], MON_DATA_MOVE1 + j, NULL);
|
||||
for (j = 0; j < 6; j++)
|
||||
@@ -2590,7 +2590,7 @@ static void InitDomeTrainers(void)
|
||||
{
|
||||
do
|
||||
{
|
||||
trainerId = sub_8162548(sub_81A39C4(), 0);
|
||||
trainerId = sub_8162548(GetCurrentFacilityWinStreak(), 0);
|
||||
for (j = 1; j < i; j++)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId == trainerId)
|
||||
@@ -2603,7 +2603,7 @@ static void InitDomeTrainers(void)
|
||||
{
|
||||
do
|
||||
{
|
||||
trainerId = sub_8162548(sub_81A39C4() + 1, 0);
|
||||
trainerId = sub_8162548(GetCurrentFacilityWinStreak() + 1, 0);
|
||||
for (j = 1; j < i; j++)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.domeTrainers[j].trainerId == trainerId)
|
||||
@@ -2621,7 +2621,7 @@ static void InitDomeTrainers(void)
|
||||
monTournamentId = RandomizeFacilityTrainerMonId(trainerId);
|
||||
for (k = 0; k < j; k++)
|
||||
{
|
||||
s32 checkingMonId = gSaveBlock2Ptr->frontier.domeMonId[i][k];
|
||||
s32 checkingMonId = gSaveBlock2Ptr->frontier.domeMonIds[i][k];
|
||||
if (checkingMonId == monTournamentId
|
||||
|| species[0] == gFacilityTrainerMons[monTournamentId].species
|
||||
|| species[1] == gFacilityTrainerMons[monTournamentId].species
|
||||
@@ -2630,7 +2630,7 @@ static void InitDomeTrainers(void)
|
||||
}
|
||||
} while (k != j);
|
||||
|
||||
gSaveBlock2Ptr->frontier.domeMonId[i][j] = monTournamentId;
|
||||
gSaveBlock2Ptr->frontier.domeMonIds[i][j] = monTournamentId;
|
||||
species[j] = gFacilityTrainerMons[monTournamentId].species;
|
||||
}
|
||||
|
||||
@@ -2671,10 +2671,10 @@ static void InitDomeTrainers(void)
|
||||
ivs = GetDomeTrainerMonIvs(gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId);
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
CalcDomeMonStats(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species,
|
||||
CalcDomeMonStats(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].species,
|
||||
monLevel, ivs,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].evSpread,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].nature,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].evSpread,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].nature,
|
||||
statValues);
|
||||
|
||||
statSums[i] += statValues[STAT_ATK];
|
||||
@@ -2683,8 +2683,8 @@ static void InitDomeTrainers(void)
|
||||
statSums[i] += statValues[STAT_SPDEF];
|
||||
statSums[i] += statValues[STAT_SPEED];
|
||||
statSums[i] += statValues[STAT_HP];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type1];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type2];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].species].type1];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].species].type2];
|
||||
}
|
||||
|
||||
for (monTypesCount = 0, j = 0; j < 32; j++)
|
||||
@@ -2737,7 +2737,7 @@ static void InitDomeTrainers(void)
|
||||
}
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
gSaveBlock2Ptr->frontier.domeMonId[j][i] = sub_81A4FF0(i);
|
||||
gSaveBlock2Ptr->frontier.domeMonIds[j][i] = GetFrontierBrainMonSpecies(i);
|
||||
}
|
||||
|
||||
Free(statSums);
|
||||
@@ -2799,7 +2799,7 @@ static void SwapDomeTrainers(s32 id1, s32 id2, u16 *statsArray)
|
||||
SWAP(gSaveBlock2Ptr->frontier.domeTrainers[id1].trainerId, gSaveBlock2Ptr->frontier.domeTrainers[id2].trainerId, temp);
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
SWAP(gSaveBlock2Ptr->frontier.domeMonId[id1][i], gSaveBlock2Ptr->frontier.domeMonId[id2][i], temp);
|
||||
SWAP(gSaveBlock2Ptr->frontier.domeMonIds[id1][i], gSaveBlock2Ptr->frontier.domeMonIds[id2][i], temp);
|
||||
}
|
||||
|
||||
static void sub_818F9B0(void)
|
||||
@@ -2829,24 +2829,24 @@ static void CreateDomeMon(u8 monPartyId, u16 tournamentTrainerId, u8 tournamentM
|
||||
u8 fixedIv = GetDomeTrainerMonIvs(tournamentTrainerId); // BUG: Should be using trainerId instead of tournamentTrainerId. As a result, all Pokemon have ivs of 3.
|
||||
u8 level = SetFacilityPtrsGetLevel();
|
||||
CreateMonWithEVSpreadPersonalityOTID(&gEnemyParty[monPartyId],
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].species,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][tournamentMonId]].species,
|
||||
level,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].nature,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][tournamentMonId]].nature,
|
||||
fixedIv,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].evSpread, otId);
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][tournamentMonId]].evSpread, otId);
|
||||
|
||||
happiness = 0xFF;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
SetMonMoveSlot(&gEnemyParty[monPartyId],
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].moves[i], i);
|
||||
if (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].moves[i] == MOVE_FRUSTRATION)
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][tournamentMonId]].moves[i], i);
|
||||
if (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][tournamentMonId]].moves[i] == MOVE_FRUSTRATION)
|
||||
happiness = 0;
|
||||
}
|
||||
|
||||
SetMonData(&gEnemyParty[monPartyId], MON_DATA_FRIENDSHIP, &happiness);
|
||||
SetMonData(&gEnemyParty[monPartyId], MON_DATA_HELD_ITEM,
|
||||
&gBattleFrontierHeldItems[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][tournamentMonId]].itemTableId]);
|
||||
&gBattleFrontierHeldItems[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][tournamentMonId]].itemTableId]);
|
||||
}
|
||||
|
||||
static void CreateDomeTrainerMons(u16 tournamentTrainerId)
|
||||
@@ -2856,7 +2856,7 @@ static void CreateDomeTrainerMons(u16 tournamentTrainerId)
|
||||
s32 i, bits;
|
||||
|
||||
ZeroEnemyPartyMons();
|
||||
bits = GetTrainerMonCountInBits(tournamentTrainerId);
|
||||
bits = GetDomeTrainerMonCountInBits(tournamentTrainerId);
|
||||
otId = Random32();
|
||||
if (Random() % 10 > 5)
|
||||
{
|
||||
@@ -2884,7 +2884,7 @@ static void CreateDomeTrainerMons(u16 tournamentTrainerId)
|
||||
}
|
||||
}
|
||||
|
||||
s32 GetTrainerMonCountInBits(u16 tournamentTrainerId)
|
||||
s32 GetDomeTrainerMonCountInBits(u16 tournamentTrainerId)
|
||||
{
|
||||
s32 bits;
|
||||
if (Random() & 1)
|
||||
@@ -2917,12 +2917,12 @@ static s32 sub_818FCBC(u16 tournamentTrainerId, bool8 arg1)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
array[i] += GetTypeEffectivenessPoints(sub_81A5060(i, moveId),
|
||||
array[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId),
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
array[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][i]].moves[moveId],
|
||||
array[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][i]].moves[moveId],
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 0);
|
||||
}
|
||||
}
|
||||
@@ -2945,12 +2945,12 @@ static s32 sub_818FDB8(u16 tournamentTrainerId, bool8 arg1)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.domeTrainers[tournamentTrainerId].trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
array[i] += GetTypeEffectivenessPoints(sub_81A5060(i, moveId),
|
||||
array[i] += GetTypeEffectivenessPoints(GetFrontierBrainMonMove(i, moveId),
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
array[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentTrainerId][i]].moves[moveId],
|
||||
array[i] += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentTrainerId][i]].moves[moveId],
|
||||
GetMonData(&gPlayerParty[playerMonId], MON_DATA_SPECIES, NULL), 1);
|
||||
}
|
||||
}
|
||||
@@ -3481,13 +3481,13 @@ static void sub_819033C(void)
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] < 999)
|
||||
gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode]++;
|
||||
if (gSaveBlock2Ptr->frontier.field_D1C[battleMode][lvlMode] < 999)
|
||||
gSaveBlock2Ptr->frontier.field_D1C[battleMode][lvlMode]++;
|
||||
if (gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode] < 999)
|
||||
gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode]++;
|
||||
if (gSaveBlock2Ptr->frontier.domeTotalChampionships[battleMode][lvlMode] < 999)
|
||||
gSaveBlock2Ptr->frontier.domeTotalChampionships[battleMode][lvlMode]++;
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode] > gSaveBlock2Ptr->frontier.field_D14[battleMode][lvlMode])
|
||||
gSaveBlock2Ptr->frontier.field_D14[battleMode][lvlMode] = gSaveBlock2Ptr->frontier.field_D0C[battleMode][lvlMode];
|
||||
if (gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode] > gSaveBlock2Ptr->frontier.domeRecordWinStreaks[battleMode][lvlMode])
|
||||
gSaveBlock2Ptr->frontier.domeRecordWinStreaks[battleMode][lvlMode] = gSaveBlock2Ptr->frontier.domeWinStreaks[battleMode][lvlMode];
|
||||
}
|
||||
|
||||
static void ShowDomeOpponentInfo(void)
|
||||
@@ -4756,7 +4756,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
{
|
||||
if (trainerId == TRAINER_PLAYER)
|
||||
{
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i],
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i],
|
||||
SpriteCb_MonIcon,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
@@ -4765,7 +4765,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
}
|
||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i],
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i],
|
||||
SpriteCb_MonIcon,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
@@ -4774,7 +4774,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
}
|
||||
else
|
||||
{
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].species,
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
x | sInfoTrainerMonX[i],
|
||||
y + sInfoTrainerMonY[i],
|
||||
@@ -4837,11 +4837,11 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
{
|
||||
textPrinter.currentY = gUnknown_0860D346[i];
|
||||
if (trainerId == TRAINER_PLAYER)
|
||||
textPrinter.currentChar = gSpeciesNames[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]];
|
||||
textPrinter.currentChar = gSpeciesNames[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]];
|
||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
textPrinter.currentChar = gSpeciesNames[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]];
|
||||
textPrinter.currentChar = gSpeciesNames[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]];
|
||||
else
|
||||
textPrinter.currentChar = gSpeciesNames[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].species];
|
||||
textPrinter.currentChar = gSpeciesNames[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]].species];
|
||||
|
||||
textPrinter.windowId = 1 + i + windowId;
|
||||
if (i == 1)
|
||||
@@ -4875,11 +4875,11 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
for (k = 0; k < DOME_TOURNAMENT_TRAINERS_COUNT; k++)
|
||||
{
|
||||
if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
allocatedArray[k] += sMovePointsForDomeTrainers[sub_81A5060(i, j)][k];
|
||||
allocatedArray[k] += sMovePointsForDomeTrainers[GetFrontierBrainMonMove(i, j)][k];
|
||||
else if (trainerId == TRAINER_PLAYER)
|
||||
allocatedArray[k] += sMovePointsForDomeTrainers[gSaveBlock2Ptr->frontier.field_EFC[i].moves[j]][k];
|
||||
else
|
||||
allocatedArray[k] += sMovePointsForDomeTrainers[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].moves[j]][k];
|
||||
allocatedArray[k] += sMovePointsForDomeTrainers[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]].moves[j]][k];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4916,7 +4916,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
allocatedArray[j] = sub_81A50F0(i, j);
|
||||
allocatedArray[j] = GetFrontierBrainMonEvs(i, j);
|
||||
else
|
||||
allocatedArray[j] = gSaveBlock2Ptr->frontier.field_EFC[i].evs[j];
|
||||
}
|
||||
@@ -4924,7 +4924,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
for (j = 0; j < 5; j++)
|
||||
{
|
||||
if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
nature = sub_81A50B0(i);
|
||||
nature = GetFrontierBrainMonNature(i);
|
||||
else
|
||||
nature = gSaveBlock2Ptr->frontier.field_EFC[i].nature;
|
||||
|
||||
@@ -4952,7 +4952,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
{
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
s32 evBits = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].evSpread;
|
||||
s32 evBits = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]].evSpread;
|
||||
for (k = 0, j = 0; j < 6; j++)
|
||||
{
|
||||
allocatedArray[j] = 0;
|
||||
@@ -4961,7 +4961,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
evBits >>= 1;
|
||||
}
|
||||
k = MAX_TOTAL_EVS / k;
|
||||
evBits = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].evSpread;
|
||||
evBits = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]].evSpread;
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
if (evBits & 1)
|
||||
@@ -4972,7 +4972,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTournamentId)
|
||||
allocatedArray[6] += allocatedArray[0];
|
||||
for (j = 0; j < 5; j++)
|
||||
{
|
||||
nature = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[trainerTournamentId][i]].nature;
|
||||
nature = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[trainerTournamentId][i]].nature;
|
||||
if (gNatureStatTable[nature][j] > 0)
|
||||
{
|
||||
allocatedArray[j + 7] += (allocatedArray[j + 1] * 110) / 100;
|
||||
@@ -5210,7 +5210,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
{
|
||||
if (trainerIds[0] == TRAINER_PLAYER)
|
||||
{
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[0]][i],
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonIds[tournamentIds[0]][i],
|
||||
SpriteCb_MonIcon,
|
||||
x | sFirstTrainerMonX[i],
|
||||
y + sFirstTrainerMonY[i],
|
||||
@@ -5219,7 +5219,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
}
|
||||
else if (trainerIds[0] == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[0]][i],
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonIds[tournamentIds[0]][i],
|
||||
SpriteCb_MonIcon,
|
||||
x | sFirstTrainerMonX[i],
|
||||
y + sFirstTrainerMonY[i],
|
||||
@@ -5228,7 +5228,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
}
|
||||
else
|
||||
{
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[0]][i]].species,
|
||||
sBattleDomeStruct->arr[2 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentIds[0]][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
x | sFirstTrainerMonX[i],
|
||||
y + sFirstTrainerMonY[i],
|
||||
@@ -5250,7 +5250,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
{
|
||||
if (trainerIds[1] == TRAINER_PLAYER)
|
||||
{
|
||||
sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[1]][i],
|
||||
sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonIds[tournamentIds[1]][i],
|
||||
SpriteCb_MonIcon,
|
||||
x | sSecondTrainerMonX[i],
|
||||
y + sSecondTrainerMonY[i],
|
||||
@@ -5259,7 +5259,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
}
|
||||
else if (trainerIds[1] == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[1]][i],
|
||||
sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gSaveBlock2Ptr->frontier.domeMonIds[tournamentIds[1]][i],
|
||||
SpriteCb_MonIcon,
|
||||
x | sSecondTrainerMonX[i],
|
||||
y + sSecondTrainerMonY[i],
|
||||
@@ -5268,7 +5268,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
|
||||
}
|
||||
else
|
||||
{
|
||||
sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentIds[1]][i]].species,
|
||||
sBattleDomeStruct->arr[5 + i + arrId] = CreateMonIcon(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentIds[1]][i]].species,
|
||||
SpriteCb_MonIcon,
|
||||
x | sSecondTrainerMonX[i],
|
||||
y + sSecondTrainerMonY[i],
|
||||
@@ -5564,9 +5564,9 @@ static u16 GetWinningMove(s32 winnerTournamentId, s32 loserTournamentId, u8 roun
|
||||
{
|
||||
moveScores[i * 4 + j] = 0;
|
||||
if (gSaveBlock2Ptr->frontier.domeTrainers[winnerTournamentId].trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
moveIds[i * 4 + j] = sub_81A5060(i, j);
|
||||
moveIds[i * 4 + j] = GetFrontierBrainMonMove(i, j);
|
||||
else
|
||||
moveIds[i * 4 + j] = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[winnerTournamentId][i]].moves[j];
|
||||
moveIds[i * 4 + j] = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[winnerTournamentId][i]].moves[j];
|
||||
|
||||
movePower = gBattleMoves[moveIds[i * 4 + j]].power;
|
||||
if (movePower == 0)
|
||||
@@ -5584,9 +5584,9 @@ static u16 GetWinningMove(s32 winnerTournamentId, s32 loserTournamentId, u8 roun
|
||||
do
|
||||
{
|
||||
var = Random32();
|
||||
} while (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[loserTournamentId][k]].nature != GetNatureFromPersonality(var));
|
||||
} while (gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[loserTournamentId][k]].nature != GetNatureFromPersonality(var));
|
||||
|
||||
targetSpecies = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[loserTournamentId][k]].species;
|
||||
targetSpecies = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[loserTournamentId][k]].species;
|
||||
if (var & 1)
|
||||
targetAbility = gBaseStats[targetSpecies].ability2;
|
||||
else
|
||||
@@ -6193,7 +6193,7 @@ static void sub_8194F58(void)
|
||||
monTournamentId = RandomizeFacilityTrainerMonId(trainerId);
|
||||
for (k = 0; k < j; k++)
|
||||
{
|
||||
s32 checkingMonId = gSaveBlock2Ptr->frontier.domeMonId[i][k];
|
||||
s32 checkingMonId = gSaveBlock2Ptr->frontier.domeMonIds[i][k];
|
||||
if (checkingMonId == monTournamentId
|
||||
|| species[0] == gFacilityTrainerMons[monTournamentId].species
|
||||
|| species[1] == gFacilityTrainerMons[monTournamentId].species
|
||||
@@ -6202,7 +6202,7 @@ static void sub_8194F58(void)
|
||||
}
|
||||
} while (k != j);
|
||||
|
||||
gSaveBlock2Ptr->frontier.domeMonId[i][j] = monTournamentId;
|
||||
gSaveBlock2Ptr->frontier.domeMonIds[i][j] = monTournamentId;
|
||||
species[j] = gFacilityTrainerMons[monTournamentId].species;
|
||||
}
|
||||
gSaveBlock2Ptr->frontier.domeTrainers[i].isEliminated = 0;
|
||||
@@ -6218,10 +6218,10 @@ static void sub_8194F58(void)
|
||||
ivs = GetDomeTrainerMonIvs(gSaveBlock2Ptr->frontier.domeTrainers[i].trainerId);
|
||||
for (j = 0; j < 3; j++)
|
||||
{
|
||||
CalcDomeMonStats(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species,
|
||||
CalcDomeMonStats(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].species,
|
||||
monLevel, ivs,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].evSpread,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].nature,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].evSpread,
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].nature,
|
||||
statValues);
|
||||
|
||||
statSums[i] += statValues[STAT_ATK];
|
||||
@@ -6230,8 +6230,8 @@ static void sub_8194F58(void)
|
||||
statSums[i] += statValues[STAT_SPDEF];
|
||||
statSums[i] += statValues[STAT_SPEED];
|
||||
statSums[i] += statValues[STAT_HP];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type1];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[i][j]].species].type2];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].species].type1];
|
||||
monTypesBits |= gBitTable[gBaseStats[gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[i][j]].species].type2];
|
||||
}
|
||||
|
||||
// Because GF hates temporary vars, trainerId acts like monTypesCount here.
|
||||
@@ -6347,11 +6347,11 @@ static void DecideRoundWinners(u8 roundId)
|
||||
{
|
||||
for (monId2 = 0; monId2 < 3; monId2++)
|
||||
{
|
||||
points1 += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId1][monId1]].moves[moveSlot],
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId2][monId2]].species, 2);
|
||||
points1 += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentId1][monId1]].moves[moveSlot],
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentId2][monId2]].species, 2);
|
||||
}
|
||||
}
|
||||
species = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId1][monId1]].species;
|
||||
species = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentId1][monId1]].species;
|
||||
points1 += ( gBaseStats[species].baseHP
|
||||
+ gBaseStats[species].baseAttack
|
||||
+ gBaseStats[species].baseDefense
|
||||
@@ -6370,11 +6370,11 @@ static void DecideRoundWinners(u8 roundId)
|
||||
{
|
||||
for (monId2 = 0; monId2 < 3; monId2++)
|
||||
{
|
||||
points2 += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId2][monId1]].moves[moveSlot],
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId1][monId2]].species, 2);
|
||||
points2 += GetTypeEffectivenessPoints(gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentId2][monId1]].moves[moveSlot],
|
||||
gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentId1][monId2]].species, 2);
|
||||
}
|
||||
}
|
||||
species = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonId[tournamentId2][monId1]].species;
|
||||
species = gFacilityTrainerMons[gSaveBlock2Ptr->frontier.domeMonIds[tournamentId2][monId1]].species;
|
||||
points2 += ( gBaseStats[species].baseHP
|
||||
+ gBaseStats[species].baseAttack
|
||||
+ gBaseStats[species].baseDefense
|
||||
|
||||
@@ -1670,7 +1670,7 @@ static void CreateFrontierFactorySelectableMons(u8 firstMonId)
|
||||
u32 otId = 0;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 var_2C = gSaveBlock2Ptr->frontier.field_DE2[battleMode][lvlMode] / 7;
|
||||
u8 var_2C = gSaveBlock2Ptr->frontier.factoryWinStreaks[battleMode][lvlMode] / 7;
|
||||
u8 var_28 = 0;
|
||||
|
||||
gFacilityTrainerMons = gBattleFrontierMons;
|
||||
|
||||
@@ -27,7 +27,7 @@ void sub_8195980(void)
|
||||
gSaveBlock2Ptr->frontier.field_CA9_a = 0;
|
||||
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
|
||||
if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860DE98[battleMode][lvlMode]))
|
||||
gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] = 0;
|
||||
gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] = 0;
|
||||
|
||||
saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
|
||||
gTrainerBattleOpponent_A = 0;
|
||||
@@ -44,7 +44,7 @@ void sub_8195A38(void)
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_DC4[1];
|
||||
break;
|
||||
case 1:
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode];
|
||||
gSpecialVar_Result = gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode];
|
||||
break;
|
||||
case 2:
|
||||
gSpecialVar_Result = ((gSaveBlock2Ptr->frontier.field_CDC & gUnknown_0860DE98[battleMode][lvlMode]) != 0);
|
||||
@@ -63,7 +63,7 @@ void sub_8195AE4(void)
|
||||
gSaveBlock2Ptr->frontier.field_DC4[1] = gSpecialVar_0x8006;
|
||||
break;
|
||||
case 1:
|
||||
gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] = gSpecialVar_0x8006;
|
||||
gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] = gSpecialVar_0x8006;
|
||||
break;
|
||||
case 2:
|
||||
if (gSpecialVar_0x8006)
|
||||
@@ -79,9 +79,9 @@ void sub_8195BB0(void)
|
||||
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u32 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] < 50)
|
||||
if (gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] < 50)
|
||||
gSpecialVar_Result = Random() % 3;
|
||||
else if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] < 99)
|
||||
else if (gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] < 99)
|
||||
gSpecialVar_Result = 3;
|
||||
else
|
||||
gSpecialVar_Result = 4;
|
||||
@@ -105,14 +105,14 @@ void sub_8195C7C(void)
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode] < 9999)
|
||||
if (gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode] < 9999)
|
||||
{
|
||||
u16 wat = 0;
|
||||
gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode]++;
|
||||
gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode]++;
|
||||
if (lvlMode < gSaveBlock2Ptr->frontier.field_DD0[battleMode][lvlMode])
|
||||
wat = 1;
|
||||
if (gSaveBlock2Ptr->frontier.field_DC8[battleMode][wat] != 0)
|
||||
gSaveBlock2Ptr->frontier.field_DD0[battleMode][lvlMode] = gSaveBlock2Ptr->frontier.field_DC8[battleMode][lvlMode];
|
||||
if (gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][wat] != 0)
|
||||
gSaveBlock2Ptr->frontier.field_DD0[battleMode][lvlMode] = gSaveBlock2Ptr->frontier.palaceWinStreaks[battleMode][lvlMode];
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -3027,7 +3027,7 @@ static void BattleStartClearSetData(void)
|
||||
if (!(gBattleTypeFlags & BATTLE_TYPE_LINK) && gSaveBlock2Ptr->optionsBattleSceneOff == TRUE)
|
||||
gHitMarker |= HITMARKER_NO_ANIMATIONS;
|
||||
}
|
||||
else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && GetBattleStyleInRecordedBattle())
|
||||
else if (!(gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000)) && GetBattleSceneInRecordedBattle())
|
||||
gHitMarker |= HITMARKER_NO_ANIMATIONS;
|
||||
|
||||
gBattleScripting.battleStyle = gSaveBlock2Ptr->optionsBattleStyle;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
#include "menu.h"
|
||||
#include "recorded_battle.h"
|
||||
#include "international_string_util.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "battle_tower.h"
|
||||
#include "data2.h"
|
||||
|
||||
@@ -2579,7 +2579,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
case B_TXT_TRAINER1_LOSE_TEXT: // trainerA lose text
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
{
|
||||
CopyFrontierTrainerText(FRONTIER_LOSE_TEXT, gTrainerBattleOpponent_A);
|
||||
CopyFrontierTrainerText(FRONTIER_PLAYER_WON_TEXT, gTrainerBattleOpponent_A);
|
||||
toCpy = gStringVar4;
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
|
||||
@@ -2595,7 +2595,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
case B_TXT_TRAINER1_WIN_TEXT: // trainerA win text
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
{
|
||||
CopyFrontierTrainerText(FRONTIER_WIN_TEXT, gTrainerBattleOpponent_A);
|
||||
CopyFrontierTrainerText(FRONTIER_PLAYER_LOST_TEXT, gTrainerBattleOpponent_A);
|
||||
toCpy = gStringVar4;
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
|
||||
@@ -2676,7 +2676,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
case B_TXT_TRAINER2_LOSE_TEXT:
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
{
|
||||
CopyFrontierTrainerText(FRONTIER_LOSE_TEXT, gTrainerBattleOpponent_B);
|
||||
CopyFrontierTrainerText(FRONTIER_PLAYER_WON_TEXT, gTrainerBattleOpponent_B);
|
||||
toCpy = gStringVar4;
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
|
||||
@@ -2692,7 +2692,7 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
case B_TXT_TRAINER2_WIN_TEXT:
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
|
||||
{
|
||||
CopyFrontierTrainerText(FRONTIER_WIN_TEXT, gTrainerBattleOpponent_B);
|
||||
CopyFrontierTrainerText(FRONTIER_PLAYER_LOST_TEXT, gTrainerBattleOpponent_B);
|
||||
toCpy = gStringVar4;
|
||||
}
|
||||
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "random.h"
|
||||
#include "item.h"
|
||||
#include "battle_factory.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "constants/items.h"
|
||||
#include "constants/region_map_sections.h"
|
||||
|
||||
@@ -19,6 +19,8 @@ extern const u16 gBattleFrontierHeldItems[];
|
||||
|
||||
extern u16 gUnknown_03006298[];
|
||||
|
||||
extern void sub_81A4C30(void);
|
||||
|
||||
// This file's functions.
|
||||
static void sub_81B99D4(void);
|
||||
static void sub_81B9A28(void);
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
#include "main.h"
|
||||
#include "international_string_util.h"
|
||||
#include "battle.h"
|
||||
#include "battle_frontier_1.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "recorded_battle.h"
|
||||
#include "easy_chat.h"
|
||||
#include "gym_leader_rematch.h"
|
||||
@@ -30,15 +29,9 @@
|
||||
|
||||
extern u16 gUnknown_03006298[];
|
||||
|
||||
extern void sub_81A3ACC(void);
|
||||
extern void CreateFrontierBrainPokemon(void);
|
||||
extern void sub_81A6CD0(void);
|
||||
extern u16 sub_81A39C4(void);
|
||||
extern void SetFrontierBrainTrainerGfxId(void);
|
||||
extern u8 GetFrontierBrainTrainerPicIndex(void);
|
||||
extern u8 GetFrontierBrainTrainerClass(void);
|
||||
extern u8 IsFrontierBrainFemale(void);
|
||||
extern void CopyFrontierBrainTrainerName(u8 *dst);
|
||||
extern void sub_81A4C30(void);
|
||||
extern u8 sub_81A6CA8(u8, u8);
|
||||
extern void SetMonMoveAvoidReturn(struct Pokemon *mon, u16 move, u8 moveSlot);
|
||||
|
||||
extern const u8 *const *const gUnknown_085DD690[];
|
||||
@@ -220,7 +213,7 @@ static void sub_8161F94(void)
|
||||
gSaveBlock2Ptr->frontier.field_CA9_b = 0;
|
||||
sub_81A3ACC();
|
||||
if (!(gSaveBlock2Ptr->frontier.field_CDC & gUnknown_085DF9AC[battleMode][lvlMode]))
|
||||
gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode] = 0;
|
||||
gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] = 0;
|
||||
|
||||
ValidateBattleTowerRecordChecksums();
|
||||
saved_warp2_set(0, gSaveBlock1Ptr->location.mapGroup, gSaveBlock1Ptr->location.mapNum, -1);
|
||||
@@ -258,7 +251,7 @@ static void sub_81620F4(void)
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode] = gSpecialVar_0x8006;
|
||||
gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] = gSpecialVar_0x8006;
|
||||
break;
|
||||
case 2:
|
||||
if (gSpecialVar_0x8006)
|
||||
@@ -364,7 +357,8 @@ static void ChooseNextBattleTowerTrainer(void)
|
||||
{
|
||||
u16 id;
|
||||
u32 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u32 r5 = sub_81A39C4() / 7;
|
||||
u16 winStreak = GetCurrentFacilityWinStreak();
|
||||
u32 challengeNum = winStreak / 7;
|
||||
SetFacilityPtrsGetLevel();
|
||||
|
||||
if (battleMode == FRONTIER_MODE_MULTIS || battleMode == FRONTIER_MODE_LINK_MULTIS)
|
||||
@@ -385,7 +379,7 @@ static void ChooseNextBattleTowerTrainer(void)
|
||||
s32 i;
|
||||
while (1)
|
||||
{
|
||||
id = sub_8162548(r5, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
|
||||
id = sub_8162548(challengeNum, gSaveBlock2Ptr->frontier.curChallengeBattleNum);
|
||||
|
||||
// Ensure trainer wasn't previously fought in this challenge.
|
||||
for (i = 0; i < gSaveBlock2Ptr->frontier.curChallengeBattleNum; i++)
|
||||
@@ -525,7 +519,7 @@ void SetBattleFacilityTrainerGfxId(u16 trainerId, u8 tempVarId)
|
||||
}
|
||||
else if (trainerId == TRAINER_FRONTIER_BRAIN)
|
||||
{
|
||||
SetFrontierBrainTrainerGfxId();
|
||||
SetFrontierBrainEventObjGfx_2();
|
||||
return;
|
||||
}
|
||||
else if (trainerId < TRAINER_RECORD_MIXING_FRIEND)
|
||||
@@ -769,14 +763,14 @@ u8 GetFrontierTrainerFrontSpriteId(u16 trainerId)
|
||||
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
return gFacilityClassToPicIndex[sub_818649C()];
|
||||
return gFacilityClassToPicIndex[GetRecordedBattleRecordMixFriendClass()];
|
||||
else
|
||||
return gFacilityClassToPicIndex[gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].facilityClass];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
return gFacilityClassToPicIndex[gApprentices[sub_81864A8()].facilityClass];
|
||||
return gFacilityClassToPicIndex[gApprentices[GetRecordedBattleApprenticeId()].facilityClass];
|
||||
else
|
||||
return gFacilityClassToPicIndex[gApprentices[gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].id].facilityClass];
|
||||
}
|
||||
@@ -807,7 +801,7 @@ u8 GetFrontierOpponentClass(u16 trainerId)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
{
|
||||
trainerClass = gFacilityClassToTrainerClass[sub_818649C()];
|
||||
trainerClass = gFacilityClassToTrainerClass[GetRecordedBattleRecordMixFriendClass()];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -819,7 +813,7 @@ u8 GetFrontierOpponentClass(u16 trainerId)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
{
|
||||
trainerClass = gFacilityClassToTrainerClass[gApprentices[sub_81864A8()].facilityClass];
|
||||
trainerClass = gFacilityClassToTrainerClass[gApprentices[GetRecordedBattleApprenticeId()].facilityClass];
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -847,14 +841,14 @@ static u8 GetFrontierTrainerFacilityClass(u16 trainerId)
|
||||
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
facilityClass = sub_818649C();
|
||||
facilityClass = GetRecordedBattleRecordMixFriendClass();
|
||||
else
|
||||
facilityClass = gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].facilityClass;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
facilityClass = gApprentices[sub_81864A8()].facilityClass;
|
||||
facilityClass = gApprentices[GetRecordedBattleApprenticeId()].facilityClass;
|
||||
else
|
||||
facilityClass = gApprentices[gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].id].facilityClass;
|
||||
}
|
||||
@@ -907,8 +901,8 @@ void GetFrontierTrainerName(u8 *dst, u16 trainerId)
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
{
|
||||
id = sub_81864A8();
|
||||
language = sub_81864C0();
|
||||
id = GetRecordedBattleApprenticeId();
|
||||
language = GetRecordedBattleApprenticeLanguage();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1179,7 +1173,7 @@ static void FillFactoryFrontierTrainerParty(u16 trainerId, u8 firstMonId)
|
||||
{
|
||||
u8 lvlMode = gSaveBlock2Ptr->frontier.lvlMode; // Unused variable.
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.winStreaks[battleMode][0] / 7;
|
||||
u8 challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][0] / 7;
|
||||
if (gSaveBlock2Ptr->frontier.curChallengeBattleNum < 6)
|
||||
fixedIV = sub_81A6CA8(challengeNum, 0);
|
||||
else
|
||||
@@ -1297,7 +1291,7 @@ static void HandleSpecialTrainerBattleEnd(void)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
sub_81864CC();
|
||||
RecordedBattle_SaveBattleOutcome();
|
||||
switch (gBattleScripting.specialTrainerBattleType)
|
||||
{
|
||||
case SPECIAL_BATTLE_TOWER:
|
||||
@@ -1480,8 +1474,8 @@ static void SaveCurrentWinStreak(void)
|
||||
u8 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
u16 winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode);
|
||||
|
||||
if (gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode] < winStreak)
|
||||
gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode] = winStreak;
|
||||
if (gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] < winStreak)
|
||||
gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] = winStreak;
|
||||
}
|
||||
|
||||
static void sub_8163EE4(void)
|
||||
@@ -1509,15 +1503,15 @@ static void sub_8163EE4(void)
|
||||
}
|
||||
playerRecord->lvlMode = lvlMode;
|
||||
playerRecord->facilityClass = class;
|
||||
CopyUnalignedWord(playerRecord->trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
CopyTrainerId(playerRecord->trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
StringCopy7(playerRecord->name, gSaveBlock2Ptr->playerName);
|
||||
playerRecord->winStreak = GetCurrentBattleTowerWinStreak(lvlMode, battleMode);
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
{
|
||||
playerRecord->greeting[i] = gSaveBlock1Ptr->unk2BBC[i];
|
||||
playerRecord->unk1C[i] = gSaveBlock1Ptr->unk2BC8[i];
|
||||
playerRecord->unk28[i] = gSaveBlock1Ptr->unk2BD4[i];
|
||||
playerRecord->speechWon[i] = gSaveBlock1Ptr->unk2BC8[i];
|
||||
playerRecord->speechLost[i] = gSaveBlock1Ptr->unk2BD4[i];
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -1535,7 +1529,7 @@ static void SaveBattleTowerProgress(void)
|
||||
{
|
||||
u16 lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
u16 battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode] / 7);
|
||||
s32 challengeNum = (signed)(gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7);
|
||||
|
||||
if (gSpecialVar_0x8005 == 0 && (challengeNum > 1 || gSaveBlock2Ptr->frontier.curChallengeBattleNum != 0))
|
||||
sub_8163EE4();
|
||||
@@ -1625,7 +1619,7 @@ static void sub_81642A0(void)
|
||||
eventObjTemplates = gSaveBlock1Ptr->eventObjectTemplates;
|
||||
lvlMode = gSaveBlock2Ptr->frontier.lvlMode;
|
||||
battleMode = VarGet(VAR_FRONTIER_BATTLE_MODE);
|
||||
challengeNum = gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode] / 7;
|
||||
challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7;
|
||||
species1 = GetMonData(&gPlayerParty[0], MON_DATA_SPECIES, NULL);
|
||||
species2 = GetMonData(&gPlayerParty[1], MON_DATA_SPECIES, NULL);
|
||||
level = SetFacilityPtrsGetLevel();
|
||||
@@ -1795,7 +1789,8 @@ static void sub_8164828(void)
|
||||
s32 i, j, arrId;
|
||||
s32 monPoolId;
|
||||
s32 level = SetFacilityPtrsGetLevel();
|
||||
s32 challengeNum = sub_81A39C4() / 7;
|
||||
u16 winStreak = GetCurrentFacilityWinStreak();
|
||||
s32 challengeNum = winStreak / 7;
|
||||
s32 k = gSpecialVar_LastTalked - 2;
|
||||
s32 trainerId = gSaveBlock2Ptr->frontier.field_CB4[k];
|
||||
|
||||
@@ -1911,7 +1906,7 @@ static void sub_8164B74(void)
|
||||
case 0:
|
||||
if (battleMode == FRONTIER_MODE_LINK_MULTIS)
|
||||
{
|
||||
challengeNum = gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode] / 7;
|
||||
challengeNum = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode] / 7;
|
||||
if (sub_800A520())
|
||||
{
|
||||
SendBlock(bitmask_all_link_players_but_self(), &challengeNum, sizeof(challengeNum));
|
||||
@@ -2069,7 +2064,7 @@ static void ClearBattleTowerRecord(struct EmeraldBattleTowerRecord *record)
|
||||
|
||||
u16 GetCurrentBattleTowerWinStreak(u8 lvlMode, u8 battleMode)
|
||||
{
|
||||
u16 winStreak = gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode];
|
||||
u16 winStreak = gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode];
|
||||
|
||||
if (winStreak > 9999)
|
||||
return 9999;
|
||||
@@ -2164,7 +2159,7 @@ static void FillEReaderTrainerWithPlayerData(void)
|
||||
+ gSaveBlock2Ptr->playerTrainerId[2] + gSaveBlock2Ptr->playerTrainerId[3]) % ARRAY_COUNT(gTowerMaleFacilityClasses)];
|
||||
}
|
||||
|
||||
CopyUnalignedWord(ereaderTrainer->trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
CopyTrainerId(ereaderTrainer->trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
StringCopy7(ereaderTrainer->name, gSaveBlock2Ptr->playerName);
|
||||
|
||||
ereaderTrainer->winStreak = 1;
|
||||
@@ -2425,9 +2420,9 @@ bool32 RubyBattleTowerRecordToEmerald(struct RSBattleTowerRecord *src, struct Em
|
||||
for (i = 0; i < 6; i++)
|
||||
dst->greeting[i] = src->greeting[i];
|
||||
for (i = 0; i < 6; i++)
|
||||
dst->unk1C[i] = gUnknown_085DFA46[i];
|
||||
dst->speechWon[i] = gUnknown_085DFA46[i];
|
||||
for (i = 0; i < 6; i++)
|
||||
dst->unk28[i] = gUnknown_085DFA52[i];
|
||||
dst->speechLost[i] = gUnknown_085DFA52[i];
|
||||
for (i = 0; i < 3; i++)
|
||||
dst->party[i] = src->party[i];
|
||||
|
||||
@@ -2526,14 +2521,14 @@ void GetBattleTowerTrainerLanguage(u8 *dst, u16 trainerId)
|
||||
else if (trainerId < TRAINER_RECORD_MIXING_APPRENTICE)
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
*dst = sub_81864B4();
|
||||
*dst = GetRecordedBattleRecordMixFriendLanguage();
|
||||
else
|
||||
*dst = gSaveBlock2Ptr->frontier.towerRecords[trainerId - TRAINER_RECORD_MIXING_FRIEND].language;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED)
|
||||
*dst = sub_81864C0();
|
||||
*dst = GetRecordedBattleApprenticeLanguage();
|
||||
else
|
||||
*dst = gSaveBlock2Ptr->apprentices[trainerId - TRAINER_RECORD_MIXING_APPRENTICE].language;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "battle_setup.h"
|
||||
#include "battle_frontier_1.h"
|
||||
#include "bike.h"
|
||||
#include "coord_event_weather.h"
|
||||
#include "daycare.h"
|
||||
@@ -31,6 +30,8 @@
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/songs.h"
|
||||
|
||||
extern bool32 sub_8196034(void);
|
||||
|
||||
static EWRAM_DATA u8 sWildEncounterImmunitySteps = 0;
|
||||
static EWRAM_DATA u16 sPreviousPlayerMetatileBehavior = 0;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "field_message_box.h"
|
||||
#include "strings.h"
|
||||
#include "rom_818CFC8.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "pokenav.h"
|
||||
#include "event_data.h"
|
||||
#include "script.h"
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "fldeff_80F9BCC.h"
|
||||
#include "field_poison.h"
|
||||
|
||||
extern bool8 InBattlePike(void);
|
||||
|
||||
static bool32 sub_80F9568(struct Pokemon *pokemon)
|
||||
{
|
||||
u16 species = GetMonData(pokemon, MON_DATA_SPECIES2);
|
||||
|
||||
@@ -2158,73 +2158,73 @@ void sub_8139F20(void)
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
if (gSaveBlock2Ptr->frontier.winStreaks[var][0] >= gSaveBlock2Ptr->frontier.winStreaks[var][1])
|
||||
if (gSaveBlock2Ptr->frontier.towerWinStreaks[var][0] >= gSaveBlock2Ptr->frontier.towerWinStreaks[var][1])
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.winStreaks[var][0];
|
||||
unk = gSaveBlock2Ptr->frontier.towerWinStreaks[var][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.winStreaks[var][1];
|
||||
unk = gSaveBlock2Ptr->frontier.towerWinStreaks[var][1];
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (gSaveBlock2Ptr->frontier.field_D0C[0][0] >= gSaveBlock2Ptr->frontier.field_D0C[0][1])
|
||||
if (gSaveBlock2Ptr->frontier.domeWinStreaks[0][0] >= gSaveBlock2Ptr->frontier.domeWinStreaks[0][1])
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_D0C[0][0];
|
||||
unk = gSaveBlock2Ptr->frontier.domeWinStreaks[0][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_D0C[0][1];
|
||||
unk = gSaveBlock2Ptr->frontier.domeWinStreaks[0][1];
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (gSaveBlock2Ptr->frontier.field_DE2[0][0] >= gSaveBlock2Ptr->frontier.field_DE2[0][1])
|
||||
if (gSaveBlock2Ptr->frontier.factoryWinStreaks[0][0] >= gSaveBlock2Ptr->frontier.factoryWinStreaks[0][1])
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_DE2[0][0];
|
||||
unk = gSaveBlock2Ptr->frontier.factoryWinStreaks[0][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_DE2[0][1];
|
||||
unk = gSaveBlock2Ptr->frontier.factoryWinStreaks[0][1];
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (gSaveBlock2Ptr->frontier.field_DC8[0][0] >= gSaveBlock2Ptr->frontier.field_DC8[0][1])
|
||||
if (gSaveBlock2Ptr->frontier.palaceWinStreaks[0][0] >= gSaveBlock2Ptr->frontier.palaceWinStreaks[0][1])
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_DC8[0][0];
|
||||
unk = gSaveBlock2Ptr->frontier.palaceWinStreaks[0][0];
|
||||
}
|
||||
else
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_DC8[0][1];
|
||||
unk = gSaveBlock2Ptr->frontier.palaceWinStreaks[0][1];
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (gSaveBlock2Ptr->frontier.field_DDA[0] >= gSaveBlock2Ptr->frontier.field_DDA[1])
|
||||
if (gSaveBlock2Ptr->frontier.arenaWinStreaks[0] >= gSaveBlock2Ptr->frontier.arenaWinStreaks[1])
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_DDA[0];
|
||||
unk = gSaveBlock2Ptr->frontier.arenaWinStreaks[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_DDA[1];
|
||||
unk = gSaveBlock2Ptr->frontier.arenaWinStreaks[1];
|
||||
}
|
||||
break;
|
||||
case 8:
|
||||
if (gSaveBlock2Ptr->frontier.field_E04[0] >= gSaveBlock2Ptr->frontier.field_E04[1])
|
||||
if (gSaveBlock2Ptr->frontier.pikeWinStreaks[0] >= gSaveBlock2Ptr->frontier.pikeWinStreaks[1])
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_E04[0];
|
||||
unk = gSaveBlock2Ptr->frontier.pikeWinStreaks[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_E04[1];
|
||||
unk = gSaveBlock2Ptr->frontier.pikeWinStreaks[1];
|
||||
}
|
||||
break;
|
||||
case 9:
|
||||
if (gSaveBlock2Ptr->frontier.field_E1A[0] >= gSaveBlock2Ptr->frontier.field_E1A[1])
|
||||
if (gSaveBlock2Ptr->frontier.pyramidWinStreaks[0] >= gSaveBlock2Ptr->frontier.pyramidWinStreaks[1])
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_E1A[0];
|
||||
unk = gSaveBlock2Ptr->frontier.pyramidWinStreaks[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
unk = gSaveBlock2Ptr->frontier.field_E1A[1];
|
||||
unk = gSaveBlock2Ptr->frontier.pyramidWinStreaks[1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2253,7 +2253,7 @@ void sub_813A080(void)
|
||||
|
||||
for (i = 0; i < 9; i++)
|
||||
{
|
||||
if (gUnknown_085B2CDC[i] > gSaveBlock2Ptr->frontier.winStreaks[battleMode][lvlMode])
|
||||
if (gUnknown_085B2CDC[i] > gSaveBlock2Ptr->frontier.towerWinStreaks[battleMode][lvlMode])
|
||||
{
|
||||
gSpecialVar_0x8005 = 4;
|
||||
gSpecialVar_0x8006 = i + 5;
|
||||
@@ -2997,7 +2997,7 @@ void sub_813A8FC(void)
|
||||
{
|
||||
u8 string[32];
|
||||
u32 x;
|
||||
StringCopy(ConvertIntToDecimalStringN(string, gSaveBlock2Ptr->frontier.frontierBattlePoints, STR_CONV_MODE_RIGHT_ALIGN, 4), gText_BP);
|
||||
StringCopy(ConvertIntToDecimalStringN(string, gSaveBlock2Ptr->frontier.battlePoints, STR_CONV_MODE_RIGHT_ALIGN, 4), gText_BP);
|
||||
x = GetStringRightAlignXOffset(1, string, 48);
|
||||
AddTextPrinterParameterized(gUnknown_0203AB6D, 1, string, x, 1, 0, NULL);
|
||||
}
|
||||
@@ -3028,31 +3028,31 @@ void sub_813A988(void)
|
||||
|
||||
void sub_813A9A4(void)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.frontierBattlePoints < gSpecialVar_0x8004)
|
||||
if (gSaveBlock2Ptr->frontier.battlePoints < gSpecialVar_0x8004)
|
||||
{
|
||||
gSaveBlock2Ptr->frontier.frontierBattlePoints = 0;
|
||||
gSaveBlock2Ptr->frontier.battlePoints = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSaveBlock2Ptr->frontier.frontierBattlePoints -= gSpecialVar_0x8004;
|
||||
gSaveBlock2Ptr->frontier.battlePoints -= gSpecialVar_0x8004;
|
||||
}
|
||||
}
|
||||
|
||||
void sub_813A9D0(void)
|
||||
{
|
||||
if (gSaveBlock2Ptr->frontier.frontierBattlePoints + gSpecialVar_0x8004 > 0x270F)
|
||||
if (gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004 > 9999)
|
||||
{
|
||||
gSaveBlock2Ptr->frontier.frontierBattlePoints = 0x270f;
|
||||
gSaveBlock2Ptr->frontier.battlePoints = 9999;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSaveBlock2Ptr->frontier.frontierBattlePoints = gSaveBlock2Ptr->frontier.frontierBattlePoints + gSpecialVar_0x8004;
|
||||
gSaveBlock2Ptr->frontier.battlePoints = gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004;
|
||||
}
|
||||
}
|
||||
|
||||
u16 sub_813AA04(void)
|
||||
{
|
||||
return gSaveBlock2Ptr->frontier.frontierBattlePoints;
|
||||
return gSaveBlock2Ptr->frontier.battlePoints;
|
||||
}
|
||||
|
||||
void sub_813AA18(void)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "overworld.h"
|
||||
#include "bg.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "constants/rgb.h"
|
||||
#include "fieldmap.h"
|
||||
#include "fldeff_80F9BCC.h"
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "secret_base.h"
|
||||
#include "tv.h"
|
||||
|
||||
extern void sub_81AA078(u16*, u8);
|
||||
|
||||
struct ConnectionFlags
|
||||
{
|
||||
u8 south:1;
|
||||
|
||||
2752
src/frontier_util.c
Normal file
2752
src/frontier_util.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
||||
#include "item_menu.h"
|
||||
#include "battle.h"
|
||||
#include "battle_controllers.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "berry_tag_screen.h"
|
||||
#include "bg.h"
|
||||
#include "constants/items.h"
|
||||
@@ -48,6 +48,8 @@
|
||||
#include "window.h"
|
||||
#include "apprentice.h"
|
||||
|
||||
extern bool8 InBattlePike(void);
|
||||
|
||||
void GoToBagMenu(u8 bagMenuType, u8 pocketId, void ( *postExitMenuMainCallback2)());
|
||||
void CB2_Bag(void);
|
||||
bool8 setup_bag_menu(void);
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "item.h"
|
||||
#include "pokedex.h"
|
||||
#include "apprentice.h"
|
||||
#include "frontier_util.h"
|
||||
|
||||
extern u8 gDifferentSaveFile;
|
||||
extern u16 gSaveFileStatus;
|
||||
@@ -45,7 +46,6 @@ extern void NewGameInitPCItems(void);
|
||||
extern void ClearDecorationInventories(void);
|
||||
extern void ResetFanClub(void);
|
||||
extern void copy_strings_to_sav1(void);
|
||||
extern void sub_81A4B14(void);
|
||||
extern void sub_8195E10(void);
|
||||
extern void sub_801AFD8(void);
|
||||
extern void sub_800E5AC(void);
|
||||
@@ -69,30 +69,30 @@ static const struct ContestWinner sContestWinnerPicDummy =
|
||||
};
|
||||
|
||||
// code
|
||||
void WriteUnalignedWord(u32 var, u8 *dataPtr)
|
||||
void SetTrainerId(u32 trainerId, u8 *dst)
|
||||
{
|
||||
dataPtr[0] = var;
|
||||
dataPtr[1] = var >> 8;
|
||||
dataPtr[2] = var >> 16;
|
||||
dataPtr[3] = var >> 24;
|
||||
dst[0] = trainerId;
|
||||
dst[1] = trainerId >> 8;
|
||||
dst[2] = trainerId >> 16;
|
||||
dst[3] = trainerId >> 24;
|
||||
}
|
||||
|
||||
u32 ReadUnalignedWord(u8* dataPtr)
|
||||
u32 GetTrainerId(u8 *trainerId)
|
||||
{
|
||||
return (dataPtr[3] << 24) | (dataPtr[2] << 16) | (dataPtr[1] << 8) | (dataPtr[0]);
|
||||
return (trainerId[3] << 24) | (trainerId[2] << 16) | (trainerId[1] << 8) | (trainerId[0]);
|
||||
}
|
||||
|
||||
void CopyUnalignedWord(u8 *copyTo, u8 *copyFrom)
|
||||
void CopyTrainerId(u8 *dst, u8 *src)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 4; i++)
|
||||
copyTo[i] = copyFrom[i];
|
||||
dst[i] = src[i];
|
||||
}
|
||||
|
||||
static void InitPlayerTrainerId(void)
|
||||
{
|
||||
u32 trainerId = (Random() << 0x10) | GetGeneratedTrainerIdLower();
|
||||
WriteUnalignedWord(trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
SetTrainerId(trainerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
}
|
||||
|
||||
// L=A isnt set here for some reason.
|
||||
@@ -204,7 +204,7 @@ void NewGameInitData(void)
|
||||
copy_strings_to_sav1();
|
||||
SetLilycoveLady();
|
||||
ResetAllApprenticeData();
|
||||
sub_81A4B14();
|
||||
ClearRankingHallRecords();
|
||||
sub_8195E10();
|
||||
sub_801AFD8();
|
||||
sub_800E5AC();
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include "tv.h"
|
||||
#include "scanline_effect.h"
|
||||
#include "wild_encounter.h"
|
||||
#include "frontier_util.h"
|
||||
#include "constants/abilities.h"
|
||||
#include "constants/map_types.h"
|
||||
#include "constants/maps.h"
|
||||
@@ -136,7 +137,6 @@ extern void sub_8087D74(void);
|
||||
extern void battle_pyramid_map_load_related(u8);
|
||||
extern void sub_80B00E8(u8);
|
||||
extern void sub_80E9238(u8);
|
||||
extern void sub_81A3908(void);
|
||||
extern void sub_81AA2F8(void);
|
||||
extern void sub_8195E10(void);
|
||||
extern void sub_80EDB44(void);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "main.h"
|
||||
#include "battle.h"
|
||||
#include "battle_anim.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "battle_message.h"
|
||||
#include "battle_tent.h"
|
||||
#include "bg.h"
|
||||
@@ -45,6 +45,8 @@
|
||||
#include "constants/songs.h"
|
||||
#include "constants/species.h"
|
||||
|
||||
extern bool8 sub_81A6BF4(void);
|
||||
|
||||
static EWRAM_DATA struct UnkSummaryStruct
|
||||
{
|
||||
/*0x00*/ union {
|
||||
|
||||
@@ -33,31 +33,17 @@
|
||||
#include "new_game.h"
|
||||
#include "daycare.h"
|
||||
#include "international_string_util.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
|
||||
extern void ReceiveSecretBasesData(struct SecretBaseRecord *, size_t, u8);
|
||||
extern void ReceiveEasyChatPairsData(struct EasyChatPair *, size_t, u8);
|
||||
|
||||
// Static type declarations
|
||||
|
||||
struct UnknownRecMixingStruct
|
||||
struct RecordMixingHallRecords
|
||||
{
|
||||
u32 field_0;
|
||||
u16 field_4;
|
||||
u8 field_6[9];
|
||||
};
|
||||
|
||||
struct UnknownRecMixingStruct2
|
||||
{
|
||||
u32 field_0;
|
||||
u16 field_4;
|
||||
u16 field_6;
|
||||
u16 field_8;
|
||||
u8 field_A[16];
|
||||
};
|
||||
|
||||
struct UnknownRecMixingStruct3
|
||||
{
|
||||
u8 field_0[0x810];
|
||||
struct RankingHall1P hallRecords1P[HALL_FACILITIES_COUNT][2][6];
|
||||
struct RankingHall2P hallRecords2P[2][6];
|
||||
};
|
||||
|
||||
struct PlayerRecordsRS
|
||||
@@ -85,7 +71,7 @@ struct PlayerRecordsEmerald
|
||||
/* 0x1210 */ u16 giftItem;
|
||||
/* 0x1214 */ LilycoveLady lilycoveLady;
|
||||
/* 0x1254 */ struct Apprentice apprentice[2];
|
||||
/* 0x12dc */ struct UnkRecordMixingStruct2 unk_12dc;
|
||||
/* 0x12dc */ struct PlayerHallRecords hallRecords;
|
||||
/* 0x1434 */ u8 field_1434[0x10];
|
||||
}; // 0x1444
|
||||
|
||||
@@ -106,12 +92,12 @@ static IWRAM_DATA struct EasyChatPair *sEasyChatPairsSave;
|
||||
static IWRAM_DATA struct RecordMixingDayCareMail *gUnknown_03001148;
|
||||
static IWRAM_DATA void *sBattleTowerSave;
|
||||
static IWRAM_DATA LilycoveLady *sLilycoveLadySave;
|
||||
static IWRAM_DATA void *gUnknown_03001154; // gSaveBlock2Ptr->field_0DC;
|
||||
static IWRAM_DATA void *sApprenticesSave;
|
||||
static IWRAM_DATA void *sBattleTowerSave_Duplicate;
|
||||
static IWRAM_DATA u32 sRecordStructSize;
|
||||
static IWRAM_DATA u8 gUnknown_03001160;
|
||||
static IWRAM_DATA u32 filler_03001164;
|
||||
static IWRAM_DATA u32 gUnknown_03001168[3];
|
||||
static IWRAM_DATA struct PlayerHallRecords *gUnknown_03001168[3];
|
||||
|
||||
static EWRAM_DATA struct RecordMixingDayCareMail gUnknown_02039F9C = {0};
|
||||
static EWRAM_DATA union PlayerRecords *sReceivedRecords = NULL;
|
||||
@@ -137,7 +123,7 @@ static void ReceiveGiftItem(u16 *item, u8 which);
|
||||
static void sub_80E7FF8(u8 taskId);
|
||||
static void sub_80E8110(struct Apprentice *arg0, struct Apprentice *arg1);
|
||||
static void ReceiveApprenticeData(struct Apprentice *arg0, size_t arg1, u32 arg2);
|
||||
static void sub_80E89AC(struct UnkRecordMixingStruct2 *arg0, size_t arg1, u32 arg2);
|
||||
static void ReceiveRankingHallRecords(struct PlayerHallRecords *hallRecords, size_t arg1, u32 arg2);
|
||||
static void sub_80E89F8(struct RecordMixingDayCareMail *dst);
|
||||
static void SanitizeDayCareMailForRuby(struct RecordMixingDayCareMail *src);
|
||||
static void SanitizeEmeraldBattleTowerRecord(struct EmeraldBattleTowerRecord *arg0);
|
||||
@@ -200,7 +186,7 @@ static void SetSrcLookupPointers(void)
|
||||
gUnknown_03001148 = &gUnknown_02039F9C;
|
||||
sBattleTowerSave = &gSaveBlock2Ptr->frontier.towerPlayer;
|
||||
sLilycoveLadySave = &gSaveBlock1Ptr->lilycoveLady;
|
||||
gUnknown_03001154 = gSaveBlock2Ptr->apprentices;
|
||||
sApprenticesSave = gSaveBlock2Ptr->apprentices;
|
||||
sBattleTowerSave_Duplicate = &gSaveBlock2Ptr->frontier.towerPlayer;
|
||||
}
|
||||
|
||||
@@ -266,8 +252,8 @@ static void PrepareExchangePacket(void)
|
||||
if (GetMultiplayerId() == 0)
|
||||
sSentRecord->emerald.giftItem = GetRecordMixingGift();
|
||||
|
||||
sub_80E8110(sSentRecord->emerald.apprentice, gUnknown_03001154);
|
||||
sub_80E8260(&sSentRecord->emerald.unk_12dc);
|
||||
sub_80E8110(sSentRecord->emerald.apprentice, sApprenticesSave);
|
||||
GetPlayerHallRecords(&sSentRecord->emerald.hallRecords);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,7 +286,7 @@ static void ReceiveExchangePacket(u32 which)
|
||||
ReceiveGiftItem(&sReceivedRecords->emerald.giftItem, which);
|
||||
ReceiveLilycoveLadyData(&sReceivedRecords->emerald.lilycoveLady, sizeof(struct PlayerRecordsEmerald), which);
|
||||
ReceiveApprenticeData(sReceivedRecords->emerald.apprentice, sizeof(struct PlayerRecordsEmerald), (u8) which);
|
||||
sub_80E89AC(&sReceivedRecords->emerald.unk_12dc, sizeof(struct PlayerRecordsEmerald), (u8) which);
|
||||
ReceiveRankingHallRecords(&sReceivedRecords->emerald.hallRecords, sizeof(struct PlayerRecordsEmerald), (u8) which);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1571,12 +1557,12 @@ static void sub_80E8110(struct Apprentice *dst, struct Apprentice *src)
|
||||
id = ((i + gSaveBlock2Ptr->playerApprentice.field_B2_1) % 3) + 1;
|
||||
if (src[id].playerName[0] != EOS)
|
||||
{
|
||||
if (ReadUnalignedWord(src[id].playerId) != ReadUnalignedWord(gSaveBlock2Ptr->playerTrainerId))
|
||||
if (GetTrainerId(src[id].playerId) != GetTrainerId(gSaveBlock2Ptr->playerTrainerId))
|
||||
{
|
||||
r8++;
|
||||
var_2C = id;
|
||||
}
|
||||
if (ReadUnalignedWord(src[id].playerId) == ReadUnalignedWord(gSaveBlock2Ptr->playerTrainerId))
|
||||
if (GetTrainerId(src[id].playerId) == GetTrainerId(gSaveBlock2Ptr->playerTrainerId))
|
||||
{
|
||||
var_24++;
|
||||
var_28 = id;
|
||||
@@ -1608,42 +1594,42 @@ static void sub_80E8110(struct Apprentice *dst, struct Apprentice *src)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_80E8260(struct UnkRecordMixingStruct2 *dst)
|
||||
void GetPlayerHallRecords(struct PlayerHallRecords *dst)
|
||||
{
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < 9; i++)
|
||||
for (i = 0; i < HALL_FACILITIES_COUNT; i++)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
CopyUnalignedWord(dst->field_0[i][j].playerId, gSaveBlock2Ptr->playerTrainerId);
|
||||
dst->field_0[i][j].language = GAME_LANGUAGE;
|
||||
StringCopy(dst->field_0[i][j].playerName, gSaveBlock2Ptr->playerName);
|
||||
CopyTrainerId(dst->onePlayer[i][j].id, gSaveBlock2Ptr->playerTrainerId);
|
||||
dst->onePlayer[i][j].language = GAME_LANGUAGE;
|
||||
StringCopy(dst->onePlayer[i][j].name, gSaveBlock2Ptr->playerName);
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
dst->field_120[j].language = GAME_LANGUAGE;
|
||||
CopyUnalignedWord(dst->field_120[j].playerId1, gSaveBlock2Ptr->playerTrainerId);
|
||||
CopyUnalignedWord(dst->field_120[j].playerId2, gSaveBlock2Ptr->frontier.field_EF1[j]);
|
||||
StringCopy(dst->field_120[j].playerName1, gSaveBlock2Ptr->playerName);
|
||||
StringCopy(dst->field_120[j].playerName2, gSaveBlock2Ptr->frontier.field_EE1[j]);
|
||||
dst->twoPlayers[j].language = GAME_LANGUAGE;
|
||||
CopyTrainerId(dst->twoPlayers[j].id1, gSaveBlock2Ptr->playerTrainerId);
|
||||
CopyTrainerId(dst->twoPlayers[j].id2, gSaveBlock2Ptr->frontier.field_EF1[j]);
|
||||
StringCopy(dst->twoPlayers[j].name1, gSaveBlock2Ptr->playerName);
|
||||
StringCopy(dst->twoPlayers[j].name2, gSaveBlock2Ptr->frontier.field_EE1[j]);
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
dst->field_0[0][i].field_4 = gSaveBlock2Ptr->frontier.field_CF0[i];
|
||||
dst->field_0[1][i].field_4 = gSaveBlock2Ptr->frontier.field_CF4[i];
|
||||
dst->field_0[2][i].field_4 = gSaveBlock2Ptr->frontier.field_CF8[i];
|
||||
dst->field_0[3][i].field_4 = gSaveBlock2Ptr->frontier.field_D14[0][i];
|
||||
dst->field_0[4][i].field_4 = gSaveBlock2Ptr->frontier.field_DD0[0][i];
|
||||
dst->field_0[5][i].field_4 = gSaveBlock2Ptr->frontier.field_DDE[i];
|
||||
dst->field_0[6][i].field_4 = gSaveBlock2Ptr->frontier.field_DEA[i];
|
||||
dst->field_0[7][i].field_4 = gSaveBlock2Ptr->frontier.field_E08[i];
|
||||
dst->field_0[8][i].field_4 = gSaveBlock2Ptr->frontier.field_E1E[i];
|
||||
dst->onePlayer[0][i].winStreak = gSaveBlock2Ptr->frontier.towerRecordWinStreaks[FRONTIER_MODE_SINGLES][i];
|
||||
dst->onePlayer[1][i].winStreak = gSaveBlock2Ptr->frontier.towerRecordWinStreaks[FRONTIER_MODE_DOUBLES][i];
|
||||
dst->onePlayer[2][i].winStreak = gSaveBlock2Ptr->frontier.towerRecordWinStreaks[FRONTIER_MODE_MULTIS][i];
|
||||
dst->onePlayer[3][i].winStreak = gSaveBlock2Ptr->frontier.domeRecordWinStreaks[FRONTIER_MODE_SINGLES][i];
|
||||
dst->onePlayer[4][i].winStreak = gSaveBlock2Ptr->frontier.palaceRecordWinStreaks[FRONTIER_MODE_SINGLES][i];
|
||||
dst->onePlayer[5][i].winStreak = gSaveBlock2Ptr->frontier.arenaRecordStreaks[i];
|
||||
dst->onePlayer[6][i].winStreak = gSaveBlock2Ptr->frontier.factoryRecordWinStreaks[FRONTIER_MODE_SINGLES][i];
|
||||
dst->onePlayer[7][i].winStreak = gSaveBlock2Ptr->frontier.pikeRecordStreaks[i];
|
||||
dst->onePlayer[8][i].winStreak = gSaveBlock2Ptr->frontier.pyramidRecordStreaks[i];
|
||||
|
||||
dst->field_120[i].field_8 = gSaveBlock2Ptr->frontier.field_CFC[i];
|
||||
dst->twoPlayers[i].winStreak = gSaveBlock2Ptr->frontier.towerRecordWinStreaks[FRONTIER_MODE_LINK_MULTIS][i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1653,7 +1639,7 @@ static bool32 sub_80E841C(struct Apprentice *arg0, struct Apprentice *arg1)
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
if (ReadUnalignedWord(arg0->playerId) == ReadUnalignedWord(arg1[i].playerId)
|
||||
if (GetTrainerId(arg0->playerId) == GetTrainerId(arg1[i].playerId)
|
||||
&& arg0->number == arg1[i].number)
|
||||
{
|
||||
return TRUE;
|
||||
@@ -1701,538 +1687,144 @@ static void ReceiveApprenticeData(struct Apprentice *arg0, size_t arg1, u32 arg2
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
static void sub_80E8578(struct UnknownRecMixingStruct3 *arg0, struct UnkRecordMixingStruct2 *arg1, size_t arg2, u32 arg3, u32 arg4)
|
||||
static void sub_80E8578(struct RecordMixingHallRecords *dst, void *hallRecords, size_t recordSize, u32 arg3, s32 linkPlayerCount)
|
||||
{
|
||||
asm_unified(" push {r4-r7,lr}\n\
|
||||
mov r7, r10\n\
|
||||
mov r6, r9\n\
|
||||
mov r5, r8\n\
|
||||
push {r5-r7}\n\
|
||||
sub sp, 0x54\n\
|
||||
str r0, [sp]\n\
|
||||
ldr r0, [sp, 0x74]\n\
|
||||
movs r4, 0\n\
|
||||
mov r8, r4\n\
|
||||
movs r5, 0\n\
|
||||
str r5, [sp, 0x4]\n\
|
||||
ldr r4, =gUnknown_03001168\n\
|
||||
b _080E85A0\n\
|
||||
.pool\n\
|
||||
_080E8598:\n\
|
||||
adds r1, r2\n\
|
||||
ldr r6, [sp, 0x4]\n\
|
||||
adds r6, 0x1\n\
|
||||
str r6, [sp, 0x4]\n\
|
||||
_080E85A0:\n\
|
||||
ldr r5, [sp, 0x4]\n\
|
||||
cmp r5, r0\n\
|
||||
bge _080E85B6\n\
|
||||
cmp r5, r3\n\
|
||||
beq _080E85B0\n\
|
||||
stm r4!, {r1}\n\
|
||||
movs r6, 0x1\n\
|
||||
add r8, r6\n\
|
||||
_080E85B0:\n\
|
||||
mov r5, r8\n\
|
||||
cmp r5, 0x3\n\
|
||||
bne _080E8598\n\
|
||||
_080E85B6:\n\
|
||||
movs r6, 0\n\
|
||||
str r6, [sp, 0x4]\n\
|
||||
subs r0, 0x1\n\
|
||||
str r0, [sp, 0x24]\n\
|
||||
_080E85BE:\n\
|
||||
movs r0, 0\n\
|
||||
str r0, [sp, 0x8]\n\
|
||||
ldr r1, [sp, 0x4]\n\
|
||||
adds r1, 0x1\n\
|
||||
str r1, [sp, 0x28]\n\
|
||||
ldr r2, [sp, 0x4]\n\
|
||||
lsls r2, 1\n\
|
||||
str r2, [sp, 0x34]\n\
|
||||
ldr r3, [sp, 0x4]\n\
|
||||
adds r3, r2, r3\n\
|
||||
str r3, [sp, 0x10]\n\
|
||||
movs r4, 0\n\
|
||||
str r4, [sp, 0x44]\n\
|
||||
movs r5, 0\n\
|
||||
str r5, [sp, 0x48]\n\
|
||||
_080E85DC:\n\
|
||||
movs r6, 0\n\
|
||||
mov r8, r6\n\
|
||||
ldr r0, =gSaveBlock2Ptr\n\
|
||||
ldr r1, [r0]\n\
|
||||
ldr r2, [sp, 0x10]\n\
|
||||
lsls r0, r2, 5\n\
|
||||
ldr r3, [sp, 0x48]\n\
|
||||
adds r0, r3, r0\n\
|
||||
adds r3, r0, r1\n\
|
||||
lsls r0, r2, 6\n\
|
||||
ldr r4, [sp, 0x44]\n\
|
||||
adds r0, r4, r0\n\
|
||||
ldr r5, [sp]\n\
|
||||
adds r2, r0, r5\n\
|
||||
_080E85F8:\n\
|
||||
adds r0, r2, 0\n\
|
||||
movs r6, 0x87\n\
|
||||
lsls r6, 2\n\
|
||||
adds r1, r3, r6\n\
|
||||
ldm r1!, {r4-r6}\n\
|
||||
stm r0!, {r4-r6}\n\
|
||||
ldr r1, [r1]\n\
|
||||
str r1, [r0]\n\
|
||||
adds r3, 0x10\n\
|
||||
adds r2, 0x10\n\
|
||||
movs r0, 0x1\n\
|
||||
add r8, r0\n\
|
||||
mov r1, r8\n\
|
||||
cmp r1, 0x2\n\
|
||||
ble _080E85F8\n\
|
||||
movs r2, 0\n\
|
||||
mov r8, r2\n\
|
||||
ldr r3, [sp, 0x24]\n\
|
||||
cmp r8, r3\n\
|
||||
bge _080E86DC\n\
|
||||
ldr r4, [sp, 0x4]\n\
|
||||
lsls r4, 5\n\
|
||||
mov r9, r4\n\
|
||||
ldr r5, [sp, 0x8]\n\
|
||||
lsls r7, r5, 4\n\
|
||||
ldr r6, [sp, 0x34]\n\
|
||||
ldr r1, [sp, 0x4]\n\
|
||||
adds r0, r6, r1\n\
|
||||
lsls r0, 6\n\
|
||||
str r0, [sp, 0x14]\n\
|
||||
ldr r2, [sp]\n\
|
||||
adds r0, r2, r0\n\
|
||||
ldr r3, [sp, 0x44]\n\
|
||||
str r3, [sp, 0x18]\n\
|
||||
adds r0, r3\n\
|
||||
str r0, [sp, 0x1C]\n\
|
||||
ldr r4, [sp, 0x14]\n\
|
||||
adds r0, r3, r4\n\
|
||||
adds r0, r2\n\
|
||||
adds r0, 0x30\n\
|
||||
mov r10, r0\n\
|
||||
_080E864A:\n\
|
||||
movs r5, 0\n\
|
||||
str r5, [sp, 0xC]\n\
|
||||
movs r3, 0\n\
|
||||
mov r6, r8\n\
|
||||
lsls r6, 2\n\
|
||||
str r6, [sp, 0x38]\n\
|
||||
ldr r1, [sp, 0x18]\n\
|
||||
ldr r2, [sp, 0x14]\n\
|
||||
adds r0, r1, r2\n\
|
||||
ldr r4, [sp]\n\
|
||||
adds r5, r0, r4\n\
|
||||
ldr r0, =gUnknown_03001168\n\
|
||||
adds r0, r6, r0\n\
|
||||
str r0, [sp, 0x50]\n\
|
||||
_080E8666:\n\
|
||||
lsls r0, r3, 4\n\
|
||||
ldr r6, [sp, 0x1C]\n\
|
||||
adds r0, r6, r0\n\
|
||||
str r3, [sp, 0x4C]\n\
|
||||
bl ReadUnalignedWord\n\
|
||||
adds r4, r0, 0\n\
|
||||
ldr r1, [sp, 0x50]\n\
|
||||
ldr r0, [r1]\n\
|
||||
add r0, r9\n\
|
||||
adds r0, r7\n\
|
||||
bl ReadUnalignedWord\n\
|
||||
ldr r3, [sp, 0x4C]\n\
|
||||
cmp r4, r0\n\
|
||||
bne _080E86A8\n\
|
||||
ldr r2, [sp, 0xC]\n\
|
||||
adds r2, 0x1\n\
|
||||
str r2, [sp, 0xC]\n\
|
||||
ldr r4, [sp, 0x50]\n\
|
||||
ldr r0, [r4]\n\
|
||||
mov r6, r9\n\
|
||||
adds r1, r7, r6\n\
|
||||
adds r1, r0, r1\n\
|
||||
ldrh r0, [r5, 0x4]\n\
|
||||
ldrh r2, [r1, 0x4]\n\
|
||||
cmp r0, r2\n\
|
||||
bcs _080E86A8\n\
|
||||
adds r0, r5, 0\n\
|
||||
ldm r1!, {r2,r4,r6}\n\
|
||||
stm r0!, {r2,r4,r6}\n\
|
||||
ldr r1, [r1]\n\
|
||||
str r1, [r0]\n\
|
||||
_080E86A8:\n\
|
||||
adds r5, 0x10\n\
|
||||
adds r3, 0x1\n\
|
||||
cmp r3, 0x2\n\
|
||||
ble _080E8666\n\
|
||||
ldr r3, [sp, 0xC]\n\
|
||||
cmp r3, 0\n\
|
||||
bne _080E86CE\n\
|
||||
ldr r0, =gUnknown_03001168\n\
|
||||
ldr r4, [sp, 0x38]\n\
|
||||
adds r0, r4, r0\n\
|
||||
ldr r0, [r0]\n\
|
||||
mov r5, r9\n\
|
||||
adds r2, r7, r5\n\
|
||||
mov r1, r10\n\
|
||||
adds r0, r2\n\
|
||||
ldm r0!, {r2,r3,r6}\n\
|
||||
stm r1!, {r2,r3,r6}\n\
|
||||
ldr r0, [r0]\n\
|
||||
str r0, [r1]\n\
|
||||
_080E86CE:\n\
|
||||
movs r4, 0x10\n\
|
||||
add r10, r4\n\
|
||||
movs r5, 0x1\n\
|
||||
add r8, r5\n\
|
||||
ldr r6, [sp, 0x24]\n\
|
||||
cmp r8, r6\n\
|
||||
blt _080E864A\n\
|
||||
_080E86DC:\n\
|
||||
ldr r0, [sp, 0x44]\n\
|
||||
adds r0, 0x60\n\
|
||||
str r0, [sp, 0x44]\n\
|
||||
ldr r1, [sp, 0x48]\n\
|
||||
adds r1, 0x30\n\
|
||||
str r1, [sp, 0x48]\n\
|
||||
ldr r2, [sp, 0x8]\n\
|
||||
adds r2, 0x1\n\
|
||||
str r2, [sp, 0x8]\n\
|
||||
cmp r2, 0x1\n\
|
||||
bgt _080E86F4\n\
|
||||
b _080E85DC\n\
|
||||
_080E86F4:\n\
|
||||
ldr r3, [sp, 0x28]\n\
|
||||
str r3, [sp, 0x4]\n\
|
||||
cmp r3, 0x8\n\
|
||||
bgt _080E86FE\n\
|
||||
b _080E85BE\n\
|
||||
_080E86FE:\n\
|
||||
movs r4, 0\n\
|
||||
str r4, [sp, 0x8]\n\
|
||||
_080E8702:\n\
|
||||
ldr r5, [sp, 0x8]\n\
|
||||
adds r5, 0x1\n\
|
||||
str r5, [sp, 0x2C]\n\
|
||||
ldr r0, =gSaveBlock2Ptr\n\
|
||||
ldr r1, [r0]\n\
|
||||
movs r0, 0x54\n\
|
||||
ldr r6, [sp, 0x8]\n\
|
||||
muls r0, r6\n\
|
||||
adds r3, r0, r1\n\
|
||||
movs r0, 0xA8\n\
|
||||
muls r0, r6\n\
|
||||
ldr r1, [sp]\n\
|
||||
adds r2, r0, r1\n\
|
||||
movs r4, 0x2\n\
|
||||
mov r8, r4\n\
|
||||
_080E8720:\n\
|
||||
movs r5, 0xD8\n\
|
||||
lsls r5, 3\n\
|
||||
adds r0, r2, r5\n\
|
||||
ldr r6, =0x0000057c\n\
|
||||
adds r1, r3, r6\n\
|
||||
ldm r1!, {r4-r6}\n\
|
||||
stm r0!, {r4-r6}\n\
|
||||
ldm r1!, {r4-r6}\n\
|
||||
stm r0!, {r4-r6}\n\
|
||||
ldr r1, [r1]\n\
|
||||
str r1, [r0]\n\
|
||||
adds r3, 0x1C\n\
|
||||
adds r2, 0x1C\n\
|
||||
movs r0, 0x1\n\
|
||||
negs r0, r0\n\
|
||||
add r8, r0\n\
|
||||
mov r1, r8\n\
|
||||
cmp r1, 0\n\
|
||||
bge _080E8720\n\
|
||||
movs r2, 0\n\
|
||||
mov r8, r2\n\
|
||||
ldr r3, [sp, 0x24]\n\
|
||||
cmp r8, r3\n\
|
||||
blt _080E8752\n\
|
||||
b _080E885A\n\
|
||||
_080E8752:\n\
|
||||
ldr r4, [sp, 0x8]\n\
|
||||
lsls r1, r4, 3\n\
|
||||
movs r0, 0xA8\n\
|
||||
adds r5, r4, 0\n\
|
||||
muls r5, r0\n\
|
||||
str r5, [sp, 0x20]\n\
|
||||
str r5, [sp, 0x3C]\n\
|
||||
subs r1, r4\n\
|
||||
lsls r1, 2\n\
|
||||
mov r10, r1\n\
|
||||
_080E8766:\n\
|
||||
movs r6, 0\n\
|
||||
str r6, [sp, 0xC]\n\
|
||||
mov r0, r8\n\
|
||||
lsls r0, 2\n\
|
||||
str r0, [sp, 0x38]\n\
|
||||
mov r1, r8\n\
|
||||
adds r1, 0x1\n\
|
||||
str r1, [sp, 0x30]\n\
|
||||
ldr r0, =gUnknown_03001168\n\
|
||||
ldr r2, [sp, 0x38]\n\
|
||||
adds r2, r0\n\
|
||||
mov r9, r2\n\
|
||||
ldr r3, [sp]\n\
|
||||
movs r4, 0xD8\n\
|
||||
lsls r4, 3\n\
|
||||
adds r0, r3, r4\n\
|
||||
ldr r5, [sp, 0x3C]\n\
|
||||
adds r7, r5, r0\n\
|
||||
str r6, [sp, 0x40]\n\
|
||||
movs r3, 0x2\n\
|
||||
_080E878E:\n\
|
||||
ldr r1, [sp, 0x20]\n\
|
||||
movs r2, 0xD8\n\
|
||||
lsls r2, 3\n\
|
||||
adds r0, r1, r2\n\
|
||||
ldr r4, [sp]\n\
|
||||
adds r0, r4, r0\n\
|
||||
ldr r6, [sp, 0x40]\n\
|
||||
adds r5, r0, r6\n\
|
||||
adds r0, r5, 0\n\
|
||||
str r3, [sp, 0x4C]\n\
|
||||
bl ReadUnalignedWord\n\
|
||||
adds r4, r0, 0\n\
|
||||
movs r6, 0x90\n\
|
||||
lsls r6, 1\n\
|
||||
add r6, r10\n\
|
||||
mov r1, r9\n\
|
||||
ldr r0, [r1]\n\
|
||||
adds r0, r6\n\
|
||||
bl ReadUnalignedWord\n\
|
||||
ldr r3, [sp, 0x4C]\n\
|
||||
cmp r4, r0\n\
|
||||
bne _080E8808\n\
|
||||
adds r0, r5, 0x4\n\
|
||||
bl ReadUnalignedWord\n\
|
||||
adds r4, r0, 0\n\
|
||||
mov r2, r9\n\
|
||||
ldr r0, [r2]\n\
|
||||
adds r0, r6\n\
|
||||
adds r0, 0x4\n\
|
||||
bl ReadUnalignedWord\n\
|
||||
ldr r3, [sp, 0x4C]\n\
|
||||
cmp r4, r0\n\
|
||||
bne _080E8808\n\
|
||||
ldr r4, [sp, 0xC]\n\
|
||||
adds r4, 0x1\n\
|
||||
str r4, [sp, 0xC]\n\
|
||||
mov r5, r9\n\
|
||||
ldr r0, [r5]\n\
|
||||
mov r6, r10\n\
|
||||
adds r2, r0, r6\n\
|
||||
movs r0, 0x94\n\
|
||||
lsls r0, 1\n\
|
||||
adds r1, r2, r0\n\
|
||||
ldrh r0, [r7, 0x8]\n\
|
||||
ldrh r1, [r1]\n\
|
||||
cmp r0, r1\n\
|
||||
bcs _080E8808\n\
|
||||
adds r0, r7, 0\n\
|
||||
movs r4, 0x90\n\
|
||||
lsls r4, 1\n\
|
||||
adds r1, r2, r4\n\
|
||||
ldm r1!, {r2,r5,r6}\n\
|
||||
stm r0!, {r2,r5,r6}\n\
|
||||
ldm r1!, {r4-r6}\n\
|
||||
stm r0!, {r4-r6}\n\
|
||||
ldr r1, [r1]\n\
|
||||
str r1, [r0]\n\
|
||||
_080E8808:\n\
|
||||
adds r7, 0x1C\n\
|
||||
ldr r0, [sp, 0x40]\n\
|
||||
adds r0, 0x1C\n\
|
||||
str r0, [sp, 0x40]\n\
|
||||
subs r3, 0x1\n\
|
||||
cmp r3, 0\n\
|
||||
bge _080E878E\n\
|
||||
ldr r1, [sp, 0xC]\n\
|
||||
cmp r1, 0\n\
|
||||
bne _080E8850\n\
|
||||
mov r0, r8\n\
|
||||
adds r0, 0x3\n\
|
||||
lsls r1, r0, 3\n\
|
||||
subs r1, r0\n\
|
||||
lsls r1, 2\n\
|
||||
ldr r2, [sp, 0x20]\n\
|
||||
adds r1, r2\n\
|
||||
ldr r3, [sp]\n\
|
||||
adds r1, r3, r1\n\
|
||||
ldr r0, =gUnknown_03001168\n\
|
||||
ldr r4, [sp, 0x38]\n\
|
||||
adds r0, r4, r0\n\
|
||||
ldr r0, [r0]\n\
|
||||
add r0, r10\n\
|
||||
movs r5, 0xD8\n\
|
||||
lsls r5, 3\n\
|
||||
adds r1, r5\n\
|
||||
movs r6, 0x90\n\
|
||||
lsls r6, 1\n\
|
||||
adds r0, r6\n\
|
||||
ldm r0!, {r2-r4}\n\
|
||||
stm r1!, {r2-r4}\n\
|
||||
ldm r0!, {r2,r5,r6}\n\
|
||||
stm r1!, {r2,r5,r6}\n\
|
||||
ldr r0, [r0]\n\
|
||||
str r0, [r1]\n\
|
||||
_080E8850:\n\
|
||||
ldr r3, [sp, 0x30]\n\
|
||||
mov r8, r3\n\
|
||||
ldr r4, [sp, 0x24]\n\
|
||||
cmp r8, r4\n\
|
||||
blt _080E8766\n\
|
||||
_080E885A:\n\
|
||||
ldr r5, [sp, 0x2C]\n\
|
||||
str r5, [sp, 0x8]\n\
|
||||
cmp r5, 0x1\n\
|
||||
bgt _080E8864\n\
|
||||
b _080E8702\n\
|
||||
_080E8864:\n\
|
||||
add sp, 0x54\n\
|
||||
pop {r3-r5}\n\
|
||||
mov r8, r3\n\
|
||||
mov r9, r4\n\
|
||||
mov r10, r5\n\
|
||||
pop {r4-r7}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.pool\n\
|
||||
");
|
||||
s32 i, j, k, l;
|
||||
s32 var_68;
|
||||
|
||||
k = 0;
|
||||
i = 0;
|
||||
while (1)
|
||||
{
|
||||
if (i >= linkPlayerCount)
|
||||
break;
|
||||
if (i != arg3)
|
||||
gUnknown_03001168[k++] = hallRecords;
|
||||
|
||||
if (k == 3)
|
||||
break;
|
||||
hallRecords += recordSize;
|
||||
i++;
|
||||
}
|
||||
|
||||
for (i = 0; i < HALL_FACILITIES_COUNT; i++)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
for (k = 0; k < 3; k++)
|
||||
dst->hallRecords1P[i][j][k] = gSaveBlock2Ptr->hallRecords1P[i][j][k];
|
||||
|
||||
for (k = 0; k < linkPlayerCount - 1; k++)
|
||||
{
|
||||
var_68 = 0;
|
||||
for (l = 0; l < 3; l++)
|
||||
{
|
||||
if (GetTrainerId(dst->hallRecords1P[i][j][l].id) == GetTrainerId(gUnknown_03001168[k]->onePlayer[i][j].id))
|
||||
{
|
||||
var_68++;
|
||||
if (dst->hallRecords1P[i][j][l].winStreak < gUnknown_03001168[k]->onePlayer[i][j].winStreak)
|
||||
dst->hallRecords1P[i][j][l] = gUnknown_03001168[k]->onePlayer[i][j];
|
||||
}
|
||||
}
|
||||
if (var_68 == 0)
|
||||
dst->hallRecords1P[i][j][k + 3] = gUnknown_03001168[k]->onePlayer[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (j = 0; j < 2; j++)
|
||||
{
|
||||
for (k = 0; k < 3; k++)
|
||||
dst->hallRecords2P[j][k] = gSaveBlock2Ptr->hallRecords2P[j][k];
|
||||
|
||||
for (k = 0; k < linkPlayerCount - 1; k++)
|
||||
{
|
||||
var_68 = 0;
|
||||
for (l = 0; l < 3; l++)
|
||||
{
|
||||
if (GetTrainerId(dst->hallRecords2P[j][l].id1) == GetTrainerId(gUnknown_03001168[k]->twoPlayers[j].id1)
|
||||
&& GetTrainerId(dst->hallRecords2P[j][l].id2) == GetTrainerId(gUnknown_03001168[k]->twoPlayers[j].id2))
|
||||
{
|
||||
var_68++;
|
||||
if (dst->hallRecords2P[j][l].winStreak < gUnknown_03001168[k]->twoPlayers[j].winStreak)
|
||||
dst->hallRecords2P[j][l] = gUnknown_03001168[k]->twoPlayers[j];
|
||||
}
|
||||
}
|
||||
if (var_68 == 0)
|
||||
dst->hallRecords2P[j][k + 3] = gUnknown_03001168[k]->twoPlayers[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80E8880(struct UnknownRecMixingStruct *arg0, struct UnknownRecMixingStruct *arg1)
|
||||
static void sub_80E8880(struct RankingHall1P *arg0, struct RankingHall1P *arg1)
|
||||
{
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
s32 r2 = 0;
|
||||
s32 r4 = -1;
|
||||
s32 highestWinStreak = 0;
|
||||
s32 highestId = -1;
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
if (arg1[j].field_4 > r2)
|
||||
if (arg1[j].winStreak > highestWinStreak)
|
||||
{
|
||||
r4 = j;
|
||||
r2 = arg1[j].field_4;
|
||||
highestId = j;
|
||||
highestWinStreak = arg1[j].winStreak;
|
||||
}
|
||||
}
|
||||
|
||||
if (r4 >= 0)
|
||||
if (highestId >= 0)
|
||||
{
|
||||
arg0[i] = arg1[r4];
|
||||
arg1[r4].field_4 = 0;
|
||||
arg0[i] = arg1[highestId];
|
||||
arg1[highestId].winStreak = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void sub_80E88CC(struct UnknownRecMixingStruct2 *arg0, struct UnknownRecMixingStruct2 *arg1)
|
||||
static void sub_80E88CC(struct RankingHall2P *arg0, struct RankingHall2P *arg1)
|
||||
{
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
s32 r2 = 0;
|
||||
s32 r4 = -1;
|
||||
s32 highestWinStreak = 0;
|
||||
s32 highestId = -1;
|
||||
for (j = 0; j < 6; j++)
|
||||
{
|
||||
if (arg1[j].field_8 > r2)
|
||||
if (arg1[j].winStreak > highestWinStreak)
|
||||
{
|
||||
r4 = j;
|
||||
r2 = arg1[j].field_8;
|
||||
highestId = j;
|
||||
highestWinStreak = arg1[j].winStreak;
|
||||
}
|
||||
}
|
||||
|
||||
if (r4 >= 0)
|
||||
if (highestId >= 0)
|
||||
{
|
||||
arg0[i] = arg1[r4];
|
||||
arg1[r4].field_8 = 0;
|
||||
arg0[i] = arg1[highestId];
|
||||
arg1[highestId].winStreak = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
NAKED
|
||||
static void sub_80E8924(struct UnknownRecMixingStruct3 *arg0)
|
||||
static void sub_80E8924(struct RecordMixingHallRecords *arg0)
|
||||
{
|
||||
asm_unified("push {r4-r7,lr}\n\
|
||||
mov r7, r10\n\
|
||||
mov r6, r9\n\
|
||||
mov r5, r8\n\
|
||||
push {r5-r7}\n\
|
||||
mov r9, r0\n\
|
||||
movs r0, 0\n\
|
||||
ldr r1, =gSaveBlock2Ptr\n\
|
||||
mov r10, r1\n\
|
||||
_080E8936:\n\
|
||||
lsls r1, r0, 1\n\
|
||||
adds r2, r0, 0x1\n\
|
||||
mov r8, r2\n\
|
||||
adds r1, r0\n\
|
||||
lsls r0, r1, 5\n\
|
||||
movs r2, 0x87\n\
|
||||
lsls r2, 2\n\
|
||||
adds r7, r0, r2\n\
|
||||
lsls r1, 6\n\
|
||||
mov r0, r9\n\
|
||||
adds r4, r0, r1\n\
|
||||
movs r6, 0\n\
|
||||
movs r5, 0x1\n\
|
||||
_080E8950:\n\
|
||||
mov r1, r10\n\
|
||||
ldr r0, [r1]\n\
|
||||
adds r0, r7\n\
|
||||
adds r0, r6\n\
|
||||
adds r1, r4, 0\n\
|
||||
bl sub_80E8880\n\
|
||||
adds r4, 0x60\n\
|
||||
adds r6, 0x30\n\
|
||||
subs r5, 0x1\n\
|
||||
cmp r5, 0\n\
|
||||
bge _080E8950\n\
|
||||
mov r0, r8\n\
|
||||
cmp r0, 0x8\n\
|
||||
ble _080E8936\n\
|
||||
movs r5, 0\n\
|
||||
ldr r4, =gSaveBlock2Ptr\n\
|
||||
_080E8972:\n\
|
||||
movs r0, 0x54\n\
|
||||
adds r1, r5, 0\n\
|
||||
muls r1, r0\n\
|
||||
ldr r2, =0x0000057c\n\
|
||||
adds r1, r2\n\
|
||||
ldr r0, [r4]\n\
|
||||
adds r0, r1\n\
|
||||
movs r1, 0xA8\n\
|
||||
muls r1, r5\n\
|
||||
movs r2, 0xD8\n\
|
||||
lsls r2, 3\n\
|
||||
adds r1, r2\n\
|
||||
add r1, r9\n\
|
||||
bl sub_80E88CC\n\
|
||||
adds r5, 0x1\n\
|
||||
cmp r5, 0x1\n\
|
||||
ble _080E8972\n\
|
||||
pop {r3-r5}\n\
|
||||
mov r8, r3\n\
|
||||
mov r9, r4\n\
|
||||
mov r10, r5\n\
|
||||
pop {r4-r7}\n\
|
||||
pop {r0}\n\
|
||||
bx r0\n\
|
||||
.pool");
|
||||
s32 i, j;
|
||||
|
||||
for (i = 0; i < HALL_FACILITIES_COUNT; i++)
|
||||
{
|
||||
for (j = 0; j < 2; j++)
|
||||
sub_80E8880(gSaveBlock2Ptr->hallRecords1P[i][j], arg0->hallRecords1P[i][j]);
|
||||
}
|
||||
for (j = 0; j < 2; j++)
|
||||
sub_80E88CC(gSaveBlock2Ptr->hallRecords2P[j], arg0->hallRecords2P[j]);
|
||||
}
|
||||
|
||||
static void sub_80E89AC(struct UnkRecordMixingStruct2 *arg0, size_t arg1, u32 arg2)
|
||||
static void ReceiveRankingHallRecords(struct PlayerHallRecords *hallRecords, size_t recordSize, u32 arg2)
|
||||
{
|
||||
u8 linkPlayerCount = GetLinkPlayerCount();
|
||||
struct UnknownRecMixingStruct3 *largeStructPtr = AllocZeroed(sizeof(struct UnknownRecMixingStruct3));
|
||||
struct RecordMixingHallRecords *largeStructPtr = AllocZeroed(sizeof(struct RecordMixingHallRecords));
|
||||
|
||||
sub_80E8578(largeStructPtr, arg0, arg1, arg2, linkPlayerCount);
|
||||
sub_80E8578(largeStructPtr, hallRecords, recordSize, arg2, linkPlayerCount);
|
||||
sub_80E8924(largeStructPtr);
|
||||
|
||||
Free(largeStructPtr);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
36
src/save.c
36
src/save.c
@@ -712,30 +712,34 @@ u8 HandleSavingData(u8 saveType)
|
||||
|
||||
u8 TrySavingData(u8 saveType) // TrySave
|
||||
{
|
||||
if(gFlashMemoryPresent == TRUE)
|
||||
if (gFlashMemoryPresent != TRUE)
|
||||
{
|
||||
HandleSavingData(saveType);
|
||||
if(gDamagedSaveSectors)
|
||||
DoSaveFailedScreen(saveType);
|
||||
else
|
||||
goto OK; // really?
|
||||
gUnknown_03006294 = 0xFF;
|
||||
return 0xFF;
|
||||
}
|
||||
gUnknown_03006294 = 0xFF;
|
||||
return 0xFF;
|
||||
|
||||
OK:
|
||||
gUnknown_03006294 = 1;
|
||||
return 1;
|
||||
HandleSavingData(saveType);
|
||||
if (!gDamagedSaveSectors)
|
||||
{
|
||||
gUnknown_03006294 = 1;
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
DoSaveFailedScreen(saveType);
|
||||
gUnknown_03006294 = 0xFF;
|
||||
return 0xFF;
|
||||
}
|
||||
}
|
||||
|
||||
u8 sub_8153380(void) // trade.s save
|
||||
bool8 sub_8153380(void) // trade.s save
|
||||
{
|
||||
if (gFlashMemoryPresent != TRUE)
|
||||
return 1;
|
||||
return TRUE;
|
||||
UpdateSaveAddresses();
|
||||
SaveSerializedGame();
|
||||
RestoreSaveBackupVarsAndIncrement(gRamSaveSectionLocations);
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool8 sub_81533AC(void) // trade.s save
|
||||
@@ -744,9 +748,9 @@ bool8 sub_81533AC(void) // trade.s save
|
||||
if (gDamagedSaveSectors)
|
||||
DoSaveFailedScreen(0);
|
||||
if (retVal == 0xFF)
|
||||
return 1;
|
||||
return TRUE;
|
||||
else
|
||||
return 0;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
u8 sub_81533E0(void) // trade.s save
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "global.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "battle_setup.h"
|
||||
#include "berry.h"
|
||||
#include "clock.h"
|
||||
@@ -49,6 +49,11 @@
|
||||
#include "tv.h"
|
||||
#include "window.h"
|
||||
|
||||
extern u16 sub_81A89A0(u8);
|
||||
extern void sub_81A8AF8(void);
|
||||
extern void sub_81A895C(void);
|
||||
extern void sub_81A8934(u8);
|
||||
|
||||
typedef u16 (*SpecialFunc)(void);
|
||||
typedef void (*NativeFunc)(void);
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include "task.h"
|
||||
#include "overworld.h"
|
||||
#include "link.h"
|
||||
#include "battle_frontier_2.h"
|
||||
#include "frontier_util.h"
|
||||
#include "rom_818CFC8.h"
|
||||
#include "field_specials.h"
|
||||
#include "event_object_movement.h"
|
||||
@@ -35,6 +35,8 @@
|
||||
#include "field_player_avatar.h"
|
||||
#include "battle_pyramid_bag.h"
|
||||
|
||||
extern bool8 InBattlePike(void);
|
||||
|
||||
// Menu actions
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -1569,9 +1569,7 @@ asm(".align 2");
|
||||
const u8 gUnknown_085EE410[] = _("Floors cleared: {STR_VAR_2}");
|
||||
|
||||
asm(".align 2");
|
||||
const u8 gText_1Dot[] = _("1.");
|
||||
const u8 gUnknown_085EE427[] = _("2.");
|
||||
const u8 gUnknown_085EE42A[] = _("3.");
|
||||
const u8 gText_123Dot[][3] = {_("1."), _("2."), _("3.")};
|
||||
const u8 gText_SavingDontTurnOff2[] = _("SAVING…\nDON’T TURN OFF THE POWER.");
|
||||
const u8 gText_BlenderMaxSpeedRecord[] = _("BERRY BLENDER\nMAXIMUM SPEED RECORD!");
|
||||
const u8 gText_234Players[] = _("2 PLAYERS\n3 PLAYERS\n4 PLAYERS");
|
||||
|
||||
8
src/tv.c
8
src/tv.c
@@ -1972,7 +1972,7 @@ void sub_80EDB44(void)
|
||||
show->rivalTrainer.nGoldSymbols ++;
|
||||
}
|
||||
}
|
||||
show->rivalTrainer.battlePoints = gSaveBlock2Ptr->frontier.frontierBattlePoints;
|
||||
show->rivalTrainer.battlePoints = gSaveBlock2Ptr->frontier.battlePoints;
|
||||
StringCopy(show->rivalTrainer.playerName, gSaveBlock2Ptr->playerName);
|
||||
tv_store_id_3x(show);
|
||||
show->rivalTrainer.language = gGameLanguage;
|
||||
@@ -2500,7 +2500,7 @@ bool8 sub_80EE818(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void sub_80EE8C8(u16 winStreak, u8 facility)
|
||||
void sub_80EE8C8(u16 winStreak, u8 facilityAndMode)
|
||||
{
|
||||
TVShow *show;
|
||||
|
||||
@@ -2512,8 +2512,8 @@ void sub_80EE8C8(u16 winStreak, u8 facility)
|
||||
show->frontier.active = FALSE;
|
||||
StringCopy(show->frontier.playerName, gSaveBlock2Ptr->playerName);
|
||||
show->frontier.winStreak = winStreak;
|
||||
show->frontier.facility = facility;
|
||||
switch (facility)
|
||||
show->frontier.facility = facilityAndMode;
|
||||
switch (facilityAndMode)
|
||||
{
|
||||
case 1:
|
||||
case 5:
|
||||
|
||||
@@ -95,7 +95,7 @@ u16 TryGetWallpaperWithWaldaPhrase(void)
|
||||
{
|
||||
u16 backgroundClr, foregroundClr;
|
||||
u8 patternId, iconId;
|
||||
u16 trainerId = ReadUnalignedWord(gSaveBlock2Ptr->playerTrainerId);
|
||||
u16 trainerId = GetTrainerId(gSaveBlock2Ptr->playerTrainerId);
|
||||
gSpecialVar_Result = TryCalculateWallpaper(&backgroundClr, &foregroundClr, &iconId, &patternId, trainerId, GetWaldaPhrasePtr());
|
||||
|
||||
if (gSpecialVar_Result)
|
||||
|
||||
Reference in New Issue
Block a user