Skip to content

Commit

Permalink
Fix some abilities preventing stat dropping move effects when used on…
Browse files Browse the repository at this point in the history
… self (#4696)

* Move SOLAR_POWER_HP_DROP label

* Abilities don't prevent self stat dropping effects

Hyper cutter does not stop MOVE_EFFECT_ATK_MINUS_1 and MOVE_EFFECT_ATK_MINUS_2.
Big Pecks does not stop MOVE_EFFECT_DEF_MINUS_1 and MOVE_EFFECT_DEF_MINUS_2.
Keen Eye and Illuminate do not stop MOVE_EFFECT_ACC_MINUS_1 and MOVE_EFFECT_ACC_MINUS_2.
  • Loading branch information
Sneed69 authored Jun 2, 2024
1 parent 2d1ef1f commit ad8576d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/battle_script_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -3350,7 +3350,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
case MOVE_EFFECT_SP_DEF_MINUS_1:
case MOVE_EFFECT_ACC_MINUS_1:
case MOVE_EFFECT_EVS_MINUS_1:
flags = affectsUser;
if (affectsUser == MOVE_EFFECT_AFFECTS_USER)
flags = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN;
else
flags = 0;
if (mirrorArmorReflected)
flags |= (STAT_CHANGE_ALLOW_PTR * !affectsUser);
else
Expand Down Expand Up @@ -3400,7 +3403,10 @@ void SetMoveEffect(bool32 primary, bool32 certain)
case MOVE_EFFECT_SP_DEF_MINUS_2:
case MOVE_EFFECT_ACC_MINUS_2:
case MOVE_EFFECT_EVS_MINUS_2:
flags = affectsUser;
if (affectsUser == MOVE_EFFECT_AFFECTS_USER)
flags = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN;
else
flags = 0;
if (mirrorArmorReflected && !affectsUser)
flags |= STAT_CHANGE_ALLOW_PTR;
if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE,
Expand Down

0 comments on commit ad8576d

Please sign in to comment.