From b892ad4da62ad3e818e779e4c6804212854fcc67 Mon Sep 17 00:00:00 2001 From: Pawkkie <61265402+Pawkkie@users.noreply.github.com> Date: Thu, 24 Oct 2024 05:59:49 -0400 Subject: [PATCH] Shed Skin chance fix (#5558) --- src/battle_util.c | 2 +- test/battle/ability/shed_skin.c | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 2f00f48cf979..079a9dd43633 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -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)) diff --git a/test/battle/ability/shed_skin.c b/test/battle/ability/shed_skin.c index d3030b9baf49..279da677eaf5 100644 --- a/test/battle/ability/shed_skin.c +++ b/test/battle/ability/shed_skin.c @@ -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); }