Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shed Skin chance fix #5558

Merged
merged 2 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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) : RandomPercentage(RNG_SHED_SKIN, 33)))
Copy link
Collaborator

@AlexOn1ine AlexOn1ine Oct 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't 1 in 3 more accurate then 33%?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh sure I suppose it is, I will revert that part :)

{
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
Loading