Skip to content

Commit

Permalink
Fix Razor Wind Known Failing + review
Browse files Browse the repository at this point in the history
  • Loading branch information
PhallenTree authored Feb 23, 2025
1 parent d37c5b2 commit e6bd79f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 1 addition & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -3776,6 +3776,7 @@ BattleScript_TwoTurnMovesSecondTurn::

BattleScript_TwoTurnMovesSecondTurnRet:
setbyte sB_ANIM_TURN, 1
setbyte sB_ANIM_TARGETS_HIT, 0
clearstatusfromeffect BS_ATTACKER, MOVE_EFFECT_CHARGING
clearsemiinvulnerablebit @ only for moves with EFFECT_SEMI_INVULNERABLE/EFFECT_SKY_DROP
return
Expand Down
4 changes: 2 additions & 2 deletions include/battle.h
Original file line number Diff line number Diff line change
Expand Up @@ -829,12 +829,12 @@ struct BattleStruct
u16 commanderActive[MAX_BATTLERS_COUNT];
u32 stellarBoostFlags[NUM_BATTLE_SIDES]; // stored as a bitfield of flags for all types for each side
u8 redCardActivates:1;
u8 padding:7;
u8 bypassMoldBreakerChecks:1; // for ABILITYEFFECT_IMMUNITY
u8 padding:6;
u8 usedEjectItem;
u8 usedMicleBerry;
u8 trainerSlideSpriteIds[MAX_BATTLERS_COUNT];
u8 embodyAspectBoost[NUM_BATTLE_SIDES];
u8 bypassMoldBreakerChecks:1; // for ABILITYEFFECT_IMMUNITY
};

// The palaceFlags member of struct BattleStruct contains 1 flag per move to indicate which moves the AI should consider,
Expand Down
11 changes: 6 additions & 5 deletions src/battle_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -6542,9 +6542,6 @@ bool32 IsNeutralizingGasOnField(void)

bool32 IsMoldBreakerTypeAbility(u32 battler, u32 ability)
{
if (gBattleStruct->bypassMoldBreakerChecks)
return FALSE;

if (gStatuses3[battler] & STATUS3_GASTRO_ACID)
return FALSE;

Expand Down Expand Up @@ -6575,7 +6572,9 @@ u32 GetBattlerAbility(u32 battler)
&& gBattleMons[battler].ability == ABILITY_COMATOSE)
return ABILITY_NONE;

if (noAbilityShield && CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability))
if (!gBattleStruct->bypassMoldBreakerChecks
&& noAbilityShield
&& CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability))
return ABILITY_NONE;

return gBattleMons[battler].ability;
Expand All @@ -6589,7 +6588,9 @@ u32 GetBattlerAbility(u32 battler)
&& noAbilityShield)
return ABILITY_NONE;

if (noAbilityShield && CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability))
if (!gBattleStruct->bypassMoldBreakerChecks
&& noAbilityShield
&& CanBreakThroughAbility(gBattlerAttacker, battler, gBattleMons[gBattlerAttacker].ability))
return ABILITY_NONE;

return gBattleMons[battler].ability;
Expand Down
1 change: 0 additions & 1 deletion test/battle/move_effect/two_turns_attack.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ SINGLE_BATTLE_TEST("Razor Wind needs a charging turn")

SINGLE_BATTLE_TEST("Razor Wind doesn't need to charge with Power Herb")
{
KNOWN_FAILING;
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_POWER_HERB); }
OPPONENT(SPECIES_WOBBUFFET);
Expand Down

0 comments on commit e6bd79f

Please sign in to comment.