Skip to content

Commit

Permalink
Shed Skin chance fix (#5558)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pawkkie authored Oct 24, 2024
1 parent 878721c commit b892ad4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -5019,7 +5019,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
break;
case ABILITY_SHED_SKIN:
if ((gBattleMons[battler].status1 & STATUS1_ANY)
&& (B_ABILITY_TRIGGER_CHANCE >= GEN_4 ? RandomPercentage(RNG_SHED_SKIN, 30) : RandomChance(RNG_SHED_SKIN, 1, 3)))
&& (B_ABILITY_TRIGGER_CHANCE == GEN_4 ? RandomPercentage(RNG_SHED_SKIN, 30) : RandomChance(RNG_SHED_SKIN, 1, 3)))
{
ABILITY_HEAL_MON_STATUS:
if (gBattleMons[battler].status1 & (STATUS1_POISON | STATUS1_TOXIC_POISON))
Expand Down
8 changes: 5 additions & 3 deletions test/battle/ability/shed_skin.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#include "global.h"
#include "test/battle.h"

SINGLE_BATTLE_TEST("Shed Skin triggers 30% of the time")
SINGLE_BATTLE_TEST("Shed Skin triggers 33% of the time")
{
PASSES_RANDOMLY(3, 10, RNG_SHED_SKIN);
if (B_ABILITY_TRIGGER_CHANCE == GEN_4)
PASSES_RANDOMLY(30, 100, RNG_SHED_SKIN);
else
PASSES_RANDOMLY(33, 100, RNG_SHED_SKIN);
GIVEN {
ASSUME(B_ABILITY_TRIGGER_CHANCE >= GEN_4);
ASSUME(gMovesInfo[MOVE_TACKLE].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_ARBOK) { Status1(STATUS1_POISON); Ability(ABILITY_SHED_SKIN); }
Expand Down

0 comments on commit b892ad4

Please sign in to comment.