Changed type1 and type2 to be consistent (#2021)
* Changed type1 and type2 in gBattleMons to match gSpeciesInfo * Changed monType1 and monType2 to monTypes to match gSpeciesInfo
This commit is contained in:
@@ -1395,11 +1395,11 @@ static void Cmd_typecalc(void)
|
||||
else if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
|
||||
{
|
||||
// check type1
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0])
|
||||
ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i));
|
||||
// check type2
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 &&
|
||||
gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1] &&
|
||||
gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1])
|
||||
ModulateDmgByType(TYPE_EFFECT_MULTIPLIER(i));
|
||||
}
|
||||
i += 3;
|
||||
@@ -1454,14 +1454,14 @@ static void CheckWonderGuardAndLevitate(void)
|
||||
if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
|
||||
{
|
||||
// check no effect
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0]
|
||||
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE;
|
||||
gProtectStructs[gBattlerAttacker].targetNotAffected = 1;
|
||||
}
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2 &&
|
||||
gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2 &&
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1] &&
|
||||
gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1] &&
|
||||
TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE;
|
||||
@@ -1469,18 +1469,18 @@ static void CheckWonderGuardAndLevitate(void)
|
||||
}
|
||||
|
||||
// check super effective
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 20)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0] && TYPE_EFFECT_MULTIPLIER(i) == 20)
|
||||
flags |= 1;
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
|
||||
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
|
||||
&& gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
|
||||
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE)
|
||||
flags |= 1;
|
||||
|
||||
// check not very effective
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1 && TYPE_EFFECT_MULTIPLIER(i) == 5)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0] && TYPE_EFFECT_MULTIPLIER(i) == 5)
|
||||
flags |= 2;
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
|
||||
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
|
||||
&& gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
|
||||
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE)
|
||||
flags |= 2;
|
||||
}
|
||||
@@ -1570,11 +1570,11 @@ u8 TypeCalc(u16 move, u8 attacker, u8 defender)
|
||||
else if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
|
||||
{
|
||||
// check type1
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].type1)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].types[0])
|
||||
ModulateDmgByType2(TYPE_EFFECT_MULTIPLIER(i), move, &flags);
|
||||
// check type2
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].type2 &&
|
||||
gBattleMons[defender].type1 != gBattleMons[defender].type2)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[defender].types[1] &&
|
||||
gBattleMons[defender].types[0] != gBattleMons[defender].types[1])
|
||||
ModulateDmgByType2(TYPE_EFFECT_MULTIPLIER(i), move, &flags);
|
||||
}
|
||||
i += 3;
|
||||
@@ -3971,7 +3971,7 @@ static void Cmd_jumpiftype2(void)
|
||||
{
|
||||
u8 battlerId = GetBattlerForBattleScript(gBattlescriptCurrInstr[1]);
|
||||
|
||||
if (gBattlescriptCurrInstr[2] == gBattleMons[battlerId].type1 || gBattlescriptCurrInstr[2] == gBattleMons[battlerId].type2)
|
||||
if (gBattlescriptCurrInstr[2] == gBattleMons[battlerId].types[0] || gBattlescriptCurrInstr[2] == gBattleMons[battlerId].types[1])
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
||||
else
|
||||
gBattlescriptCurrInstr += 7;
|
||||
@@ -4520,7 +4520,7 @@ static void Cmd_typecalc2(void)
|
||||
if (TYPE_EFFECT_ATK_TYPE(i) == moveType)
|
||||
{
|
||||
// check type1
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type1)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[0])
|
||||
{
|
||||
if (TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
|
||||
{
|
||||
@@ -4537,22 +4537,22 @@ static void Cmd_typecalc2(void)
|
||||
}
|
||||
}
|
||||
// check type2
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2)
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1])
|
||||
{
|
||||
if (gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
|
||||
if (gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
|
||||
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NO_EFFECT)
|
||||
{
|
||||
gMoveResultFlags |= MOVE_RESULT_DOESNT_AFFECT_FOE;
|
||||
break;
|
||||
}
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
|
||||
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
|
||||
&& gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
|
||||
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_NOT_EFFECTIVE)
|
||||
{
|
||||
flags |= MOVE_RESULT_NOT_VERY_EFFECTIVE;
|
||||
}
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].type2
|
||||
&& gBattleMons[gBattlerTarget].type1 != gBattleMons[gBattlerTarget].type2
|
||||
if (TYPE_EFFECT_DEF_TYPE(i) == gBattleMons[gBattlerTarget].types[1]
|
||||
&& gBattleMons[gBattlerTarget].types[0] != gBattleMons[gBattlerTarget].types[1]
|
||||
&& TYPE_EFFECT_MULTIPLIER(i) == TYPE_MUL_SUPER_EFFECTIVE)
|
||||
{
|
||||
flags |= MOVE_RESULT_SUPER_EFFECTIVE;
|
||||
@@ -4623,8 +4623,8 @@ static void Cmd_switchindataupdate(void)
|
||||
for (i = 0; i < sizeof(struct BattlePokemon); i++)
|
||||
monData[i] = gBattleBufferB[gActiveBattler][4 + i];
|
||||
|
||||
gBattleMons[gActiveBattler].type1 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
|
||||
gBattleMons[gActiveBattler].type2 = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
|
||||
gBattleMons[gActiveBattler].types[0] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[0];
|
||||
gBattleMons[gActiveBattler].types[1] = gSpeciesInfo[gBattleMons[gActiveBattler].species].types[1];
|
||||
gBattleMons[gActiveBattler].ability = GetAbilityBySpecies(gBattleMons[gActiveBattler].species, gBattleMons[gActiveBattler].abilityNum);
|
||||
|
||||
// check knocked off item
|
||||
@@ -7354,8 +7354,8 @@ static void Cmd_tryconversiontypechange(void)
|
||||
else
|
||||
moveType = TYPE_NORMAL;
|
||||
}
|
||||
if (moveType != gBattleMons[gBattlerAttacker].type1
|
||||
&& moveType != gBattleMons[gBattlerAttacker].type2)
|
||||
if (moveType != gBattleMons[gBattlerAttacker].types[0]
|
||||
&& moveType != gBattleMons[gBattlerAttacker].types[1])
|
||||
{
|
||||
break;
|
||||
}
|
||||
@@ -7381,7 +7381,7 @@ static void Cmd_tryconversiontypechange(void)
|
||||
moveType = TYPE_NORMAL;
|
||||
}
|
||||
}
|
||||
while (moveType == gBattleMons[gBattlerAttacker].type1 || moveType == gBattleMons[gBattlerAttacker].type2);
|
||||
while (moveType == gBattleMons[gBattlerAttacker].types[0] || moveType == gBattleMons[gBattlerAttacker].types[1]);
|
||||
|
||||
SET_BATTLER_TYPE(gBattlerAttacker, moveType);
|
||||
PREPARE_TYPE_BUFFER(gBattleTextBuff1, moveType);
|
||||
@@ -7548,12 +7548,12 @@ static void Cmd_weatherdamage(void)
|
||||
{
|
||||
if (gBattleWeather & B_WEATHER_SANDSTORM)
|
||||
{
|
||||
if (gBattleMons[gBattlerAttacker].type1 != TYPE_ROCK
|
||||
&& gBattleMons[gBattlerAttacker].type1 != TYPE_STEEL
|
||||
&& gBattleMons[gBattlerAttacker].type1 != TYPE_GROUND
|
||||
&& gBattleMons[gBattlerAttacker].type2 != TYPE_ROCK
|
||||
&& gBattleMons[gBattlerAttacker].type2 != TYPE_STEEL
|
||||
&& gBattleMons[gBattlerAttacker].type2 != TYPE_GROUND
|
||||
if (gBattleMons[gBattlerAttacker].types[0] != TYPE_ROCK
|
||||
&& gBattleMons[gBattlerAttacker].types[0] != TYPE_STEEL
|
||||
&& gBattleMons[gBattlerAttacker].types[0] != TYPE_GROUND
|
||||
&& gBattleMons[gBattlerAttacker].types[1] != TYPE_ROCK
|
||||
&& gBattleMons[gBattlerAttacker].types[1] != TYPE_STEEL
|
||||
&& gBattleMons[gBattlerAttacker].types[1] != TYPE_GROUND
|
||||
&& gBattleMons[gBattlerAttacker].ability != ABILITY_SAND_VEIL
|
||||
&& !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERGROUND)
|
||||
&& !(gStatuses3[gBattlerAttacker] & STATUS3_UNDERWATER))
|
||||
|
||||
Reference in New Issue
Block a user