diff options
Diffstat (limited to 'src/battle_dome.c')
-rw-r--r-- | src/battle_dome.c | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/src/battle_dome.c b/src/battle_dome.c index a5cf168ef..ea1e5abba 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -1211,8 +1211,8 @@ static const u8 gUnknown_0860D1A0[DOME_TOURNAMENT_TRAINERS_COUNT / 2][DOME_ROUND static const u8 gUnknown_0860D1C0[DOME_TOURNAMENT_TRAINERS_COUNT] = {0, 15, 8, 7, 3, 12, 11, 4, 1, 14, 9, 6, 2, 13, 10, 5}; -// Each tourney trainer has a text describing their potential to win, depending on their seed ranking for the current tourney -// Dome Ace Tucker has their own separate potential text +// The first line of text on a trainers info card. It describes their potential to win, based on their seed in the tournament tree. +// Dome Ace Tucker has their own separate potential text. static const u8 *const sBattleDomePotentialTexts[DOME_TOURNAMENT_TRAINERS_COUNT + 1] = { BattleDome_Text_Potential1, // Highest potential @@ -1234,7 +1234,7 @@ static const u8 *const sBattleDomePotentialTexts[DOME_TOURNAMENT_TRAINERS_COUNT BattleDome_Text_PotentialDomeAceTucker, }; -// The first line of text on a trainers info card that gives information about their battle style (dependent on their party's moves) +// The second line of text on a trainers info card. It gives information about their battle style (dependent on their party's moves). static const u8 *const sBattleDomeOpponentStyleTexts[NUM_BATTLE_STYLES] = { [DOME_BATTLE_STYLE_RISKY] = BattleDome_Text_StyleRiskDisaster, @@ -1271,7 +1271,7 @@ static const u8 *const sBattleDomeOpponentStyleTexts[NUM_BATTLE_STYLES] = [DOME_BATTLE_STYLE_UNUSED4] = BattleDome_Text_StyleSampleMessage4, }; -// The second line of text on a trainers info card that gives information about their party's stat spread +// The third line of text on a trainers info card. It that gives information about their party's stat spread (based on their Pokémon's effort values and Nature). static const u8 *const sBattleDomeOpponentStatsTexts[] = { BattleDome_Text_EmphasizesHPAndAtk, // DOME_TEXT_TWO_GOOD_STATS and DOME_TEXT_HP start here @@ -2766,13 +2766,22 @@ static int GetTypeEffectivenessPoints(int move, int targetSpecies, int arg2) } if (TYPE_EFFECT_ATK_TYPE(i) == moveType) { - // BUG: TYPE_x2 is not necessary and makes the condition always false if the ability is wonder guard. + // BUG: the value of TYPE_x2 does not exist in gTypeEffectiveness, so if defAbility is ABILITY_WONDER_GUARD, the conditional always fails + #ifndef BUGFIX if (TYPE_EFFECT_DEF_TYPE(i) == defType1) if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD) typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2) if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_x2) || defAbility != ABILITY_WONDER_GUARD) typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; + #else + if (TYPE_EFFECT_DEF_TYPE(i) == defType1) + if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD) + typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; + if (TYPE_EFFECT_DEF_TYPE(i) == defType2 && defType1 != defType2) + if ((defAbility == ABILITY_WONDER_GUARD && TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE) || defAbility != ABILITY_WONDER_GUARD) + typePower = (typePower * TYPE_EFFECT_MULTIPLIER(i)) / 10; + #endif } i += 3; } @@ -5211,40 +5220,38 @@ static u16 GetWinningMove(int winnerTournamentId, int loserTournamentId, u8 roun } j = bestId; - goto LABEL; - while (j != 0) + do { - for (j = 0, k = 0; k < MAX_MON_MOVES * FRONTIER_PARTY_SIZE; k++) + for (i = 0; i < roundId - 1; i++) { - if (bestScore < moveScores[k]) - { - j = k; - bestScore = moveScores[k]; - } - else if (bestScore == moveScores[k] && moveIds[j] < moveIds[k]) - { - j = k; - } + if (gSaveBlock2Ptr->frontier.domeWinningMoves[sub_81953E8(winnerTournamentId, i)] == moveIds[j]) + break; } - if (i == roundId - 1) - break; - LABEL: + if (i != roundId - 1) { - for (i = 0; i < roundId - 1; i++) - { - if (gSaveBlock2Ptr->frontier.domeWinningMoves[sub_81953E8(winnerTournamentId, i)] == moveIds[j]) - break; - } - if (i == roundId - 1) - break; - moveScores[j] = 0; bestScore = 0; j = 0; for (k = 0; k < MAX_MON_MOVES * FRONTIER_PARTY_SIZE; k++) j += moveScores[k]; + if (j == 0) + break; + j = 0; + for (k = 0; k < MAX_MON_MOVES * FRONTIER_PARTY_SIZE; k++) + { + if (bestScore < moveScores[k]) + { + j = k; + bestScore = moveScores[k]; + } + else if (bestScore == moveScores[k] && moveIds[j] < moveIds[k]) // Yes, these conditions are redundant + { + j = k; + bestScore = moveScores[k]; + } + } } - } + } while (i != roundId - 1); if (moveScores[j] == 0) j = bestId; |