mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 04:04:17 +01:00
Merge pull request #2551 from ghoulslash/be/frontier_bp
Reshape sBattlePointAwards to be easier to read
This commit is contained in:
commit
41d846c74c
@ -497,100 +497,46 @@ static const struct FrontierBrainMon sFrontierBrainsMons[][2][FRONTIER_PARTY_SIZ
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sBattlePointAwards[][NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUNT] =
|
static const u8 sBattlePointAwards[NUM_FRONTIER_FACILITIES][FRONTIER_MODE_COUNT][30] =
|
||||||
{
|
{
|
||||||
|
/* facility, mode, tier */
|
||||||
|
[FRONTIER_FACILITY_TOWER] = /* Tier: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 */
|
||||||
{
|
{
|
||||||
{1, 2, 3, 3}, {1, 1}, {4, 5}, {1}, {3, 4}, {1}, {5}
|
[FRONTIER_MODE_SINGLES] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
|
[FRONTIER_MODE_DOUBLES] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
|
[FRONTIER_MODE_MULTIS] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
|
[FRONTIER_MODE_LINK_MULTIS] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
},
|
},
|
||||||
|
[FRONTIER_FACILITY_DOME] =
|
||||||
{
|
{
|
||||||
{2, 3, 4, 4}, {1, 1}, {4, 5}, {1}, {3, 4}, {1}, {5}
|
[FRONTIER_MODE_SINGLES] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15 },
|
||||||
|
[FRONTIER_MODE_DOUBLES] = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15 },
|
||||||
},
|
},
|
||||||
|
[FRONTIER_FACILITY_PALACE] =
|
||||||
{
|
{
|
||||||
{3, 4, 5, 5}, {2, 2}, {5, 6}, {1}, {4, 5}, {2}, {6}
|
[FRONTIER_MODE_SINGLES] = { 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
|
[FRONTIER_MODE_DOUBLES] = { 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
},
|
},
|
||||||
|
[FRONTIER_FACILITY_ARENA] =
|
||||||
{
|
{
|
||||||
{4, 5, 6, 6}, {2, 2}, {5, 6}, {2}, {4, 5}, {2}, {6}
|
[FRONTIER_MODE_SINGLES] = { 1, 1, 1, 2, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
},
|
},
|
||||||
|
[FRONTIER_FACILITY_FACTORY] =
|
||||||
{
|
{
|
||||||
{5, 6, 7, 7}, {3, 3}, {6, 7}, {2}, {5, 6}, {2}, {7}
|
[FRONTIER_MODE_SINGLES] = { 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15 },
|
||||||
|
[FRONTIER_MODE_DOUBLES] = { 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
},
|
},
|
||||||
|
[FRONTIER_FACILITY_PIKE] =
|
||||||
{
|
{
|
||||||
{6, 7, 8, 8}, {3, 3}, {6, 7}, {2}, {5, 6}, {4}, {7}
|
[FRONTIER_MODE_SINGLES] = { 1, 1, 2, 2, 2, 4, 4, 4, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 12, 12, 14, 14, 14, 14, 15, 15, 15, 15, 15 },
|
||||||
},
|
},
|
||||||
|
[FRONTIER_FACILITY_PYRAMID] =
|
||||||
{
|
{
|
||||||
{7, 8, 9, 9}, {4, 4}, {7, 8}, {3}, {6, 7}, {4}, {8}
|
[FRONTIER_MODE_SINGLES] = { 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15 },
|
||||||
},
|
|
||||||
{
|
|
||||||
{8, 9, 10, 10}, {4, 4}, {7, 8}, {3},{6, 7}, {4}, {8}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{9, 10, 11, 11}, {5, 5}, {8, 9}, {4}, {7, 8}, {8}, {9}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{10, 11, 12, 12}, {5, 5}, {8, 9}, {4}, {7, 8}, {8}, {9}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{11, 12, 13, 13}, {6, 6}, {9, 10}, {5,0}, {8, 9}, {8}, {10}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{12, 13, 14, 14}, {6, 6}, {9, 10}, {6,0}, {8, 9}, {8}, {10}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{13, 14, 15, 15}, {7, 7}, {10, 11}, {7}, {9, 10}, {10}, {11}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{14, 15, 15, 15}, {7, 7}, {10, 11}, {8}, {9, 10}, {10}, {11}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {8, 8}, {11, 12}, {9}, {10, 11}, {10}, {12}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {8, 8}, {11, 12}, {10}, {10, 11}, {10}, {12}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {9, 9}, {12, 13}, {11}, {11, 12}, {12}, {13}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {9, 9}, {12, 13}, {12}, {11, 12}, {12}, {13}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {10, 10}, {13, 14}, {13}, {12, 13}, {12}, {14}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {10, 10}, {13, 14}, {14}, {12, 13}, {12}, {14}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {11, 11}, {14, 15}, {15}, {13, 14}, {12}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {11, 11}, {14, 15}, {15}, {13, 14}, {14}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {12, 12}, {15, 15}, {15}, {14, 15}, {14}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {12, 12}, {15, 15}, {15}, {14, 15}, {14}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {13, 13}, {15, 15}, {15}, {15, 15}, {14}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {13, 13}, {15, 15}, {15}, {15, 15}, {15}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {14, 14}, {15, 15}, {15}, {15, 15}, {15}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {14, 14}, {15, 15}, {15}, {15, 15}, {15}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {15, 15}, {15, 15}, {15}, {15, 15}, {15}, {15}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
{15, 15, 15, 15}, {15, 15}, {15, 15}, {15}, {15, 15}, {15}, {15}
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Flags to change the conversation when the Frontier Brain is encountered for a battle
|
// Flags to change the conversation when the Frontier Brain is encountered for a battle
|
||||||
// First bit is has battled them before and not won yet, second bit is has battled them and won (obtained a Symbol)
|
// First bit is has battled them before and not won yet, second bit is has battled them and won (obtained a Symbol)
|
||||||
static const u16 sBattledBrainBitFlags[NUM_FRONTIER_FACILITIES][2] =
|
static const u16 sBattledBrainBitFlags[NUM_FRONTIER_FACILITIES][2] =
|
||||||
@ -1885,10 +1831,10 @@ static void GiveBattlePoints(void)
|
|||||||
|
|
||||||
if (challengeNum != 0)
|
if (challengeNum != 0)
|
||||||
challengeNum--;
|
challengeNum--;
|
||||||
if (challengeNum >= ARRAY_COUNT(sBattlePointAwards))
|
if (challengeNum >= ARRAY_COUNT(sBattlePointAwards[0][0]))
|
||||||
challengeNum = ARRAY_COUNT(sBattlePointAwards) - 1;
|
challengeNum = ARRAY_COUNT(sBattlePointAwards[0][0]) - 1;
|
||||||
|
|
||||||
points = sBattlePointAwards[challengeNum][facility][battleMode];
|
points = sBattlePointAwards[facility][battleMode][challengeNum];
|
||||||
if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN)
|
if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN)
|
||||||
points += 10;
|
points += 10;
|
||||||
gSaveBlock2Ptr->frontier.battlePoints += points;
|
gSaveBlock2Ptr->frontier.battlePoints += points;
|
||||||
@ -1897,8 +1843,8 @@ static void GiveBattlePoints(void)
|
|||||||
gSaveBlock2Ptr->frontier.battlePoints = MAX_BATTLE_FRONTIER_POINTS;
|
gSaveBlock2Ptr->frontier.battlePoints = MAX_BATTLE_FRONTIER_POINTS;
|
||||||
|
|
||||||
points = gSaveBlock2Ptr->frontier.cardBattlePoints;
|
points = gSaveBlock2Ptr->frontier.cardBattlePoints;
|
||||||
points += sBattlePointAwards[challengeNum][facility][battleMode];
|
points += sBattlePointAwards[facility][battleMode][challengeNum];
|
||||||
IncrementDailyBattlePoints(sBattlePointAwards[challengeNum][facility][battleMode]);
|
IncrementDailyBattlePoints(sBattlePointAwards[facility][battleMode][challengeNum]);
|
||||||
if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN)
|
if (gTrainerBattleOpponent_A == TRAINER_FRONTIER_BRAIN)
|
||||||
{
|
{
|
||||||
points += 10;
|
points += 10;
|
||||||
|
Loading…
Reference in New Issue
Block a user