Merge remote-tracking branch 'pret/master' into render_text
This commit is contained in:
+75
-75
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user