Skip to content

Commit

Permalink
forgot to add
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexOn1ine committed Aug 12, 2024
1 parent fe21a30 commit 810f354
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -8257,6 +8257,8 @@ u32 GetMoveTarget(u16 move, u8 setTarget)
{
u8 targetBattler = 0;
u32 moveTarget, side;
u32 moveType;
GET_MOVE_TYPE(move, moveType);

if (setTarget != NO_TARGET_OVERRIDE)
moveTarget = setTarget - 1;
Expand All @@ -8274,15 +8276,15 @@ u32 GetMoveTarget(u16 move, u8 setTarget)
else
{
targetBattler = SetRandomTarget(gBattlerAttacker);
if (gMovesInfo[move].type == TYPE_ELECTRIC
if (moveType == TYPE_ELECTRIC
&& IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_LIGHTNING_ROD)
&& GetBattlerAbility(targetBattler) != ABILITY_LIGHTNING_ROD)
{
targetBattler ^= BIT_FLANK;
RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability);
gSpecialStatuses[targetBattler].lightningRodRedirected = TRUE;
}
else if (gMovesInfo[move].type == TYPE_WATER
else if (moveType == TYPE_WATER
&& IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_STORM_DRAIN)
&& GetBattlerAbility(targetBattler) != ABILITY_STORM_DRAIN)
{
Expand Down Expand Up @@ -10467,7 +10469,8 @@ uq4_12_t CalcTypeEffectivenessMultiplier(u32 move, u32 moveType, u32 battlerAtk,
uq4_12_t CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef)
{
uq4_12_t modifier = UQ_4_12(1.0);
u8 moveType = gMovesInfo[move].type;
u32 moveType;
GET_MOVE_TYPE(move, moveType);

if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY)
{
Expand Down

0 comments on commit 810f354

Please sign in to comment.