These are known bugs and glitches in the original Pokémon Platinum game: code that clearly does not work as intended or that only works in limited circumstances but has the possibility to fail or crash.
Fixes are written in the diff
format. If you’ve used Git before, this should
look familiar:
this is some code
- delete red - lines
+ add green + lines
“Acid Rain” is the colloquial name of an in-battle glitch in Pokémon Platinum, Heart Gold, and Soul Silver which results in the simultaneous occurrence of multiple forms of field effects, including multiple instances of weather-based damage and end-of-turn Ability effects. It is triggered under the following conditions:
Fix: Edit res/battle/res/scripts/subscript_pursuit.s
UpdateVar OPCODE_ADD, BTLVAR_FAINTED_MON, BATTLER_ENEMY_SLOT_1
UpdateVar OPCODE_RIGHT_SHIFT, BTLVAR_CALC_TEMP, 0x00000001
CompareVarToValue OPCODE_NEQ, BTLVAR_CALC_TEMP, 0x00000000, _208
- // BUG: Acid Rain (see docs/bugs_and_glitches.md)
- UpdateVarFromVar OPCODE_SUB_TO_ZERO, BTLVAR_FIELD_CONDITIONS, BTLVAR_SCRIPT_TEMP
+ UpdateVarFromVar OPCODE_SET, BTLVAR_FAINTED_MON, BTLVAR_SCRIPT_TEMP
Call BATTLE_SUBSCRIPT_POP_ATTACKER_AND_DEFENDER
UpdateVarFromVar OPCODE_GET, BTLVAR_MOVE_TEMP, BTLVAR_CURRENT_MOVE
The routine MoveIsOnDamagingTurn
in src/battle/battle_lib.c
is used only
by checks related to the ability Wonder Guard. The purpose of this routine
in isolation is to determine if a two-stage move is on its damaging turn;
functionally, this permits the execution of such moves while a Pokémon with
Wonder Guard is on the field, even if the second turn would deal no damage.
The effect for Fire Fang – which is off-by-one from the effect for Shadow Force – was mistakenly included in this routine.
Fix: Edit the routine MoveIsOnDamagingTurn
in src/battle/battle_lib.c
:
static BOOL MoveIsOnDamagingTurn(BattleContext *battleCtx, int move)
{
switch (MOVE_DATA(move).effect) {
case BATTLE_EFFECT_BIDE:
case BATTLE_EFFECT_CHARGE_TURN_HIGH_CRIT:
case BATTLE_EFFECT_CHARGE_TURN_HIGH_CRIT_FLINCH:
case BATTLE_EFFECT_CHARGE_TURN_DEF_UP:
case BATTLE_EFFECT_SKIP_CHARGE_TURN_IN_SUN:
case BATTLE_EFFECT_FLY:
case BATTLE_EFFECT_DIVE:
case BATTLE_EFFECT_DIG:
case BATTLE_EFFECT_BOUNCE:
- case BATTLE_EFFECT_FLINCH_BURN_HIT: // BUG: Fire Fang Always Bypasses Wonder Guard (see docs/bugs_and_glitches.md)
+ case BATTLE_EFFECT_SHADOW_FORCE:
return battleCtx->battleStatusMask & SYSCTL_LAST_OF_MULTI_TURN;
break;
}
return TRUE;
}
During score-evaluation for party members to replace a fainted Pokémon, the trainer AI can generate scores sufficiently high that will exceed the upper bound of its scoring memory. This results in incorrect party members being chosen as replacement battlers.
This bug can apply in each stage of score-evaluation; it is most notable in its evaluation of stage 1, where the AI will treat a quad-effective match-up – for example, a Machamp (Fighting+Fighting) vs. a Bastiodon (Rock+Steel) – as having a score equivalent to 65 rather than 320.
Fix: Edit the routine BattleAI_PostKOSwitchIn
in src/battle/battle_lib.c
:
- u8 score, maxScore;
+ u32 score, maxScore;
When calculating the encounter rate for fishing encounters the abilities Sticky Hold and Suction Cups are supposed to double the encounter rate. However, due to a typo, the encounter rate stays unmodified.
Fix: Edit the routine ov6_0224226C
in src/overlay006/ov6_02240C9C.c
- v0 * 2; // BUG: Abilities do not Increase Fishing Encounter Rate (see docs/bugs_and_glitches.md)
+ v0 *= 2;