Various BUGFIXes and UBFIXes

This commit is contained in:
ExpoSeed
2021-05-15 15:56:17 -05:00
parent ab8318cc79
commit 361fa594b3
10 changed files with 48 additions and 9 deletions

View File

@@ -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;
}