Merge branch '_RHH/master' into _RHH/upcoming

This commit is contained in:
Eduardo Quezada 2024-10-28 12:13:55 -03:00
commit e8b8ca19a9
4 changed files with 134 additions and 101 deletions

View file

@ -49,6 +49,7 @@
#define OW_LARGE_OW_SUPPORT TRUE // If true, adds a small amount of overhead to OW code so that large (48x48, 64x64) OWs will display correctly under bridges, etc.
#define OW_PKMN_OBJECTS_SHARE_PALETTES FALSE // [WIP!! NOT ALL PALETTES HAVE BEEN ADJUSTED FOR THIS!!] If TRUE, follower palettes are taken from battle sprites.
#define OW_GFX_COMPRESS TRUE // Adds support for compressed OW graphics, (Also compresses pokemon follower graphics).
// IMPORTANT: Gfx are loaded into VRAM to avoid continous decompression. If you require more VRAM or want to use a lot of overworld Pokémon at once, you should disable this config.
// Compressed gfx are incompatible with non-power-of-two sprite sizes:
// (You should not use 48x48 sprites/tables for compressed gfx)
// 16x32, 32x32, 64x64 etc are fine

View file

@ -9297,53 +9297,6 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32
if (moveType == TYPE_STEEL)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_TRANSISTOR:
if (moveType == TYPE_ELECTRIC)
{
if (B_TRANSISTOR_BOOST >= GEN_9)
modifier = uq4_12_multiply(modifier, UQ_4_12(5325 / 4096));
else
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
}
break;
case ABILITY_DRAGONS_MAW:
if (moveType == TYPE_DRAGON)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_GORILLA_TACTICS:
if (IS_MOVE_PHYSICAL(move))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_ROCKY_PAYLOAD:
if (moveType == TYPE_ROCK)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_PROTOSYNTHESIS:
{
u8 atkHighestStat = GetHighestStatId(battlerAtk);
if (((weather & B_WEATHER_SUN && WEATHER_HAS_EFFECT) || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk))
&& ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))
&& !(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
}
break;
case ABILITY_QUARK_DRIVE:
{
u8 atkHighestStat = GetHighestStatId(battlerAtk);
if ((gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk))
&& ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))
&& !(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
}
break;
case ABILITY_ORICHALCUM_PULSE:
if (weather & B_WEATHER_SUN && WEATHER_HAS_EFFECT && IS_MOVE_PHYSICAL(move))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
break;
case ABILITY_HADRON_ENGINE:
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && IS_MOVE_SPECIAL(move))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
break;
case ABILITY_SHARPNESS:
if (gMovesInfo[move].slicingMove)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
@ -9510,7 +9463,7 @@ static inline u32 CalcMoveBasePowerAfterModifiers(u32 move, u32 battlerAtk, u32
return uq4_12_multiply_by_int_half_down(modifier, basePower);
}
static inline u32 CalcAttackStat(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, bool32 isCrit, bool32 updateFlags, u32 atkAbility, u32 defAbility, u32 holdEffectAtk)
static inline u32 CalcAttackStat(u32 move, u32 battlerAtk, u32 battlerDef, u32 moveType, bool32 isCrit, bool32 updateFlags, u32 atkAbility, u32 defAbility, u32 holdEffectAtk, u32 weather)
{
u8 atkStage;
u32 atkStat;
@ -9650,6 +9603,57 @@ static inline u32 CalcAttackStat(u32 move, u32 battlerAtk, u32 battlerDef, u32 m
if (gBattleMons[battlerAtk].status1 & STATUS1_ANY && IS_MOVE_PHYSICAL(move))
modifier = uq4_12_multiply_half_down(modifier, UQ_4_12(1.5));
break;
case ABILITY_TRANSISTOR:
if (moveType == TYPE_ELECTRIC)
{
if (B_TRANSISTOR_BOOST >= GEN_9)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
else
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
}
break;
case ABILITY_DRAGONS_MAW:
if (moveType == TYPE_DRAGON)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_GORILLA_TACTICS:
if (IS_MOVE_PHYSICAL(move))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_ROCKY_PAYLOAD:
if (moveType == TYPE_ROCK)
modifier = uq4_12_multiply(modifier, UQ_4_12(1.5));
break;
case ABILITY_PROTOSYNTHESIS:
if (!(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED))
{
u32 atkHighestStat = GetHighestStatId(battlerAtk);
if (((weather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT) || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk))
{
if ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
}
}
break;
case ABILITY_QUARK_DRIVE:
if (!(gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED))
{
u32 atkHighestStat = GetHighestStatId(battlerAtk);
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN || gBattleStruct->boosterEnergyActivates & (1u << battlerAtk))
{
if ((IS_MOVE_PHYSICAL(move) && atkHighestStat == STAT_ATK) || (IS_MOVE_SPECIAL(move) && atkHighestStat == STAT_SPATK))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.3));
}
}
break;
case ABILITY_ORICHALCUM_PULSE:
if ((weather & B_WEATHER_SUN) && WEATHER_HAS_EFFECT && IS_MOVE_PHYSICAL(move))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.33));
break;
case ABILITY_HADRON_ENGINE:
if (gFieldStatuses & STATUS_FIELD_ELECTRIC_TERRAIN && IS_MOVE_SPECIAL(move))
modifier = uq4_12_multiply(modifier, UQ_4_12(1.33));
break;
}
// target's abilities
@ -10199,7 +10203,7 @@ static inline s32 DoMoveDamageCalcVars(u32 move, u32 battlerAtk, u32 battlerDef,
else
gBattleMovePower = CalcMoveBasePowerAfterModifiers(move, battlerAtk, battlerDef, moveType, updateFlags, abilityAtk, abilityDef, holdEffectAtk, weather);
userFinalAttack = CalcAttackStat(move, battlerAtk, battlerDef, moveType, isCrit, updateFlags, abilityAtk, abilityDef, holdEffectAtk);
userFinalAttack = CalcAttackStat(move, battlerAtk, battlerDef, moveType, isCrit, updateFlags, abilityAtk, abilityDef, holdEffectAtk, weather);
targetFinalDefense = CalcDefenseStat(move, battlerAtk, battlerDef, moveType, isCrit, updateFlags, abilityAtk, abilityDef, holdEffectDef, weather);
dmg = CalculateBaseDamage(gBattleMovePower, userFinalAttack, gBattleMons[battlerAtk].level, targetFinalDefense);

View file

@ -746,7 +746,7 @@ static const struct SpriteFrameImage sPicTable_Onix[] = {
};
#if P_GEN_2_CROSS_EVOS
static const struct SpriteFrameImage sPicTable_Steelix[] = {
overworld_ascending_frames(gObjectEventPic_Steelix, 4, 4),
overworld_ascending_frames(gObjectEventPic_Steelix, 8, 8),
};
static const struct SpriteFrameImage sPicTable_SteelixF[] = {
overworld_ascending_frames(gObjectEventPic_SteelixF, 4, 4),
@ -811,7 +811,7 @@ static const struct SpriteFrameImage sPicTable_Exeggutor[] = {
};
#if P_ALOLAN_FORMS
static const struct SpriteFrameImage sPicTable_ExeggutorAlola[] = {
overworld_ascending_frames(gObjectEventPic_ExeggutorAlola, 4, 4),
overworld_ascending_frames(gObjectEventPic_ExeggutorAlola, 8, 8),
};
#endif //P_ALOLAN_FORMS
#endif //P_FAMILY_EXEGGCUTE
@ -1980,13 +1980,13 @@ static const struct SpriteFrameImage sPicTable_Tyranitar[] = {
#if P_FAMILY_LUGIA
static const struct SpriteFrameImage sPicTable_Lugia[] = {
overworld_ascending_frames(gObjectEventPic_Lugia, 4, 4),
overworld_ascending_frames(gObjectEventPic_Lugia, 8, 8),
};
#endif //P_FAMILY_LUGIA
#if P_FAMILY_HO_OH
static const struct SpriteFrameImage sPicTable_HoOh[] = {
overworld_ascending_frames(gObjectEventPic_HoOh, 4, 4),
overworld_ascending_frames(gObjectEventPic_HoOh, 8, 8),
};
#endif //P_FAMILY_HO_OH
@ -2422,7 +2422,7 @@ static const struct SpriteFrameImage sPicTable_Wailmer[] = {
overworld_ascending_frames(gObjectEventPic_Wailmer, 4, 4),
};
static const struct SpriteFrameImage sPicTable_Wailord[] = {
overworld_ascending_frames(gObjectEventPic_Wailord, 4, 4),
overworld_ascending_frames(gObjectEventPic_Wailord, 8, 8),
};
#endif //P_FAMILY_WAILMER
@ -2798,7 +2798,7 @@ static const struct SpriteFrameImage sPicTable_Latios[] = {
#if P_FAMILY_KYOGRE
static const struct SpriteFrameImage sPicTable_Kyogre[] = {
overworld_ascending_frames(gObjectEventPic_Kyogre, 4, 4),
overworld_ascending_frames(gObjectEventPic_Kyogre, 8, 8),
};
#if P_PRIMAL_REVERSIONS
/*static const struct SpriteFrameImage sPicTable_KyogrePrimal[] = {
@ -2809,7 +2809,7 @@ static const struct SpriteFrameImage sPicTable_Kyogre[] = {
#if P_FAMILY_GROUDON
static const struct SpriteFrameImage sPicTable_Groudon[] = {
overworld_ascending_frames(gObjectEventPic_Groudon, 4, 4),
overworld_ascending_frames(gObjectEventPic_Groudon, 8, 8),
};
#if P_PRIMAL_REVERSIONS
/*static const struct SpriteFrameImage sPicTable_GroudonPrimal[] = {
@ -2820,7 +2820,7 @@ static const struct SpriteFrameImage sPicTable_Groudon[] = {
#if P_FAMILY_RAYQUAZA
static const struct SpriteFrameImage sPicTable_Rayquaza[] = {
overworld_ascending_frames(gObjectEventPic_Rayquaza, 4, 4),
overworld_ascending_frames(gObjectEventPic_Rayquaza, 8, 8),
};
#if P_MEGA_EVOLUTIONS
/*static const struct SpriteFrameImage sPicTable_RayquazaMega[] = {
@ -3283,19 +3283,19 @@ static const struct SpriteFrameImage sPicTable_Azelf[] = {
#if P_FAMILY_DIALGA
static const struct SpriteFrameImage sPicTable_Dialga[] = {
overworld_ascending_frames(gObjectEventPic_Dialga, 4, 4),
overworld_ascending_frames(gObjectEventPic_Dialga, 8, 8),
};
static const struct SpriteFrameImage sPicTable_DialgaOrigin[] = {
overworld_ascending_frames(gObjectEventPic_DialgaOrigin, 4, 4),
overworld_ascending_frames(gObjectEventPic_DialgaOrigin, 8, 8),
};
#endif //P_FAMILY_DIALGA
#if P_FAMILY_PALKIA
static const struct SpriteFrameImage sPicTable_Palkia[] = {
overworld_ascending_frames(gObjectEventPic_Palkia, 4, 4),
overworld_ascending_frames(gObjectEventPic_Palkia, 8, 8),
};
static const struct SpriteFrameImage sPicTable_PalkiaOrigin[] = {
overworld_ascending_frames(gObjectEventPic_PalkiaOrigin, 4, 4),
overworld_ascending_frames(gObjectEventPic_PalkiaOrigin, 8, 8),
};
#endif //P_FAMILY_PALKIA
@ -3307,16 +3307,16 @@ static const struct SpriteFrameImage sPicTable_Heatran[] = {
#if P_FAMILY_REGIGIGAS
static const struct SpriteFrameImage sPicTable_Regigigas[] = {
overworld_ascending_frames(gObjectEventPic_Regigigas, 4, 4),
overworld_ascending_frames(gObjectEventPic_Regigigas, 8, 8),
};
#endif //P_FAMILY_REGIGIGAS
#if P_FAMILY_GIRATINA
static const struct SpriteFrameImage sPicTable_GiratinaAltered[] = {
overworld_ascending_frames(gObjectEventPic_GiratinaAltered, 4, 4),
overworld_ascending_frames(gObjectEventPic_GiratinaAltered, 8, 8),
};
static const struct SpriteFrameImage sPicTable_GiratinaOrigin[] = {
overworld_ascending_frames(gObjectEventPic_GiratinaOrigin, 4, 4),
overworld_ascending_frames(gObjectEventPic_GiratinaOrigin, 8, 8),
};
#endif //P_FAMILY_GIRATINA
@ -3353,58 +3353,58 @@ static const struct SpriteFrameImage sPicTable_ShayminSky[] = {
#if P_FAMILY_ARCEUS
static const struct SpriteFrameImage sPicTable_ArceusNormal[] = {
overworld_ascending_frames(gObjectEventPic_ArceusNormal, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusNormal, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusFighting[] = {
overworld_ascending_frames(gObjectEventPic_ArceusFighting, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusFighting, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusFlying[] = {
overworld_ascending_frames(gObjectEventPic_ArceusFlying, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusFlying, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusPoison[] = {
overworld_ascending_frames(gObjectEventPic_ArceusPoison, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusPoison, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusGround[] = {
overworld_ascending_frames(gObjectEventPic_ArceusGround, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusGround, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusRock[] = {
overworld_ascending_frames(gObjectEventPic_ArceusRock, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusRock, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusBug[] = {
overworld_ascending_frames(gObjectEventPic_ArceusBug, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusBug, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusGhost[] = {
overworld_ascending_frames(gObjectEventPic_ArceusGhost, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusGhost, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusSteel[] = {
overworld_ascending_frames(gObjectEventPic_ArceusSteel, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusSteel, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusFire[] = {
overworld_ascending_frames(gObjectEventPic_ArceusFire, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusFire, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusWater[] = {
overworld_ascending_frames(gObjectEventPic_ArceusWater, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusWater, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusGrass[] = {
overworld_ascending_frames(gObjectEventPic_ArceusGrass, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusGrass, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusElectric[] = {
overworld_ascending_frames(gObjectEventPic_ArceusElectric, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusElectric, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusPsychic[] = {
overworld_ascending_frames(gObjectEventPic_ArceusPsychic, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusPsychic, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusIce[] = {
overworld_ascending_frames(gObjectEventPic_ArceusIce, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusIce, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusDragon[] = {
overworld_ascending_frames(gObjectEventPic_ArceusDragon, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusDragon, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusDark[] = {
overworld_ascending_frames(gObjectEventPic_ArceusDark, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusDark, 8, 8),
};
static const struct SpriteFrameImage sPicTable_ArceusFairy[] = {
overworld_ascending_frames(gObjectEventPic_ArceusFairy, 4, 4),
overworld_ascending_frames(gObjectEventPic_ArceusFairy, 8, 8),
};
#endif //P_FAMILY_ARCEUS
@ -4182,7 +4182,7 @@ static const struct SpriteFrameImage sPicTable_TornadusIncarnate[] = {
overworld_ascending_frames(gObjectEventPic_TornadusIncarnate, 4, 4),
};
static const struct SpriteFrameImage sPicTable_TornadusTherian[] = {
overworld_ascending_frames(gObjectEventPic_TornadusTherian, 4, 4),
overworld_ascending_frames(gObjectEventPic_TornadusTherian, 8, 8),
};
#endif //P_FAMILY_TORNADUS
@ -4192,19 +4192,19 @@ static const struct SpriteFrameImage sPicTable_ThundurusIncarnate[] = {
overworld_ascending_frames(gObjectEventPic_ThundurusIncarnate, 4, 4),
};
static const struct SpriteFrameImage sPicTable_ThundurusTherian[] = {
overworld_ascending_frames(gObjectEventPic_ThundurusTherian, 4, 4),
overworld_ascending_frames(gObjectEventPic_ThundurusTherian, 8, 8),
};
#endif //P_FAMILY_THUNDURUS
#if P_FAMILY_RESHIRAM
static const struct SpriteFrameImage sPicTable_Reshiram[] = {
overworld_ascending_frames(gObjectEventPic_Reshiram, 4, 4),
overworld_ascending_frames(gObjectEventPic_Reshiram, 8, 8),
};
#endif //P_FAMILY_RESHIRAM
#if P_FAMILY_ZEKROM
static const struct SpriteFrameImage sPicTable_Zekrom[] = {
overworld_ascending_frames(gObjectEventPic_Zekrom, 4, 4),
overworld_ascending_frames(gObjectEventPic_Zekrom, 8, 8),
};
#endif //P_FAMILY_ZEKROM
@ -4220,16 +4220,16 @@ static const struct SpriteFrameImage sPicTable_LandorusTherian[] = {
#if P_FAMILY_ENAMORUS
static const struct SpriteFrameImage sPicTable_EnamorusIncarnate[] = {
overworld_ascending_frames(gObjectEventPic_EnamorusIncarnate, 4, 4),
overworld_ascending_frames(gObjectEventPic_EnamorusIncarnate, 8, 8),
};
static const struct SpriteFrameImage sPicTable_EnamorusTherian[] = {
overworld_ascending_frames(gObjectEventPic_EnamorusTherian, 4, 4),
overworld_ascending_frames(gObjectEventPic_EnamorusTherian, 8, 8),
};
#endif //P_FAMILY_ENAMORUS
#if P_FAMILY_KYUREM
static const struct SpriteFrameImage sPicTable_Kyurem[] = {
overworld_ascending_frames(gObjectEventPic_Kyurem, 4, 4),
overworld_ascending_frames(gObjectEventPic_Kyurem, 8, 8),
};
#if P_FUSION_FORMS
static const struct SpriteFrameImage sPicTable_KyuremWhite[] = {
@ -4733,23 +4733,23 @@ static const struct SpriteFrameImage sPicTable_Noivern[] = {
#if P_FAMILY_XERNEAS
static const struct SpriteFrameImage sPicTable_XerneasNeutral[] = {
overworld_ascending_frames(gObjectEventPic_XerneasNeutral, 4, 4),
overworld_ascending_frames(gObjectEventPic_XerneasNeutral, 8, 8),
};
static const struct SpriteFrameImage sPicTable_XerneasActive[] = {
overworld_ascending_frames(gObjectEventPic_XerneasActive, 4, 4),
overworld_ascending_frames(gObjectEventPic_XerneasActive, 8, 8),
};
#endif //P_FAMILY_XERNEAS
#if P_FAMILY_YVELTAL
static const struct SpriteFrameImage sPicTable_Yveltal[] = {
overworld_ascending_frames(gObjectEventPic_Yveltal, 4, 4),
overworld_ascending_frames(gObjectEventPic_Yveltal, 8, 8),
};
#endif //P_FAMILY_YVELTAL
#if P_FAMILY_ZYGARDE
static const struct SpriteFrameImage sPicTable_Zygarde50[] = {
overworld_ascending_frames(gObjectEventPic_Zygarde50, 4, 4),
overworld_ascending_frames(gObjectEventPic_Zygarde50, 8, 8),
};
static const struct SpriteFrameImage sPicTable_Zygarde10[] = {
overworld_ascending_frames(gObjectEventPic_Zygarde10, 4, 4),
@ -4776,7 +4776,7 @@ static const struct SpriteFrameImage sPicTable_HoopaConfined[] = {
overworld_ascending_frames(gObjectEventPic_HoopaConfined, 4, 4),
};
static const struct SpriteFrameImage sPicTable_HoopaUnbound[] = {
overworld_ascending_frames(gObjectEventPic_HoopaUnbound, 4, 4),
overworld_ascending_frames(gObjectEventPic_HoopaUnbound, 8, 8),
};
#endif //P_FAMILY_HOOPA

View file

@ -1,6 +1,9 @@
#include "global.h"
#include "test/battle.h"
#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Transistor increases Electric-type move damage", s16 damage)
{
u32 move;
@ -27,12 +30,37 @@ SINGLE_BATTLE_TEST("Transistor increases Electric-type move damage", s16 damage)
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_EQ(results[0].damage, results[1].damage); // Tackle should be unaffected
#if B_TRANSISTOR_BOOST >= GEN_9
EXPECT_MUL_EQ(results[2].damage, Q_4_12(5325 / 4096), results[3].damage); // Wild Charge should be affected
EXPECT_MUL_EQ(results[4].damage, Q_4_12(5325 / 4096), results[5].damage); // Thunder Shock should be affected
#else
EXPECT_MUL_EQ(results[2].damage, Q_4_12(1.5), results[3].damage); // Wild Charge should be affected
EXPECT_MUL_EQ(results[4].damage, Q_4_12(1.5), results[5].damage); // Thunder Shock should be affected
#endif
if (B_TRANSISTOR_BOOST >= GEN_9)
{
EXPECT_MUL_EQ(results[2].damage, Q_4_12(1.3), results[3].damage); // Wild Charge should be affected
EXPECT_MUL_EQ(results[4].damage, Q_4_12(1.3), results[5].damage); // Thunder Shock should be affected
}
else
{
EXPECT_MUL_EQ(results[2].damage, Q_4_12(1.5), results[3].damage); // Wild Charge should be affected
EXPECT_MUL_EQ(results[4].damage, Q_4_12(1.5), results[5].damage); // Thunder Shock should be affected
}
}
}
SINGLE_BATTLE_TEST("Transistor boosts Electric type moves by 1.5 in Gen8 and 1.3 in Gen9+", s16 damage)
{
u16 ability;
PARAMETRIZE { ability = ABILITY_NEUTRALIZING_GAS; }
PARAMETRIZE { ability = ABILITY_LEVITATE; }
GIVEN {
ASSUME(gMovesInfo[MOVE_THUNDER_SHOCK].type == TYPE_ELECTRIC);
PLAYER(SPECIES_REGIELEKI) { Ability(ABILITY_TRANSISTOR); }
OPPONENT(SPECIES_KOFFING) { Ability(ability); }
} WHEN {
TURN { MOVE(player, MOVE_THUNDER_SHOCK); }
} SCENE {
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
if (B_TRANSISTOR_BOOST >= GEN_9)
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.3), results[1].damage);
else
EXPECT_MUL_EQ(results[0].damage, Q_4_12(1.5), results[1].damage);
}
}