Fixes Cursed Body failing to disable moves on the last PP (#7940)

This commit is contained in:
PhallenTree 2025-10-13 12:55:39 +01:00 committed by GitHub
parent daf642fdbf
commit 78b11bb35f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 72 additions and 6 deletions

View File

@ -4532,8 +4532,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
&& gDisableStructs[gBattlerAttacker].disabledMove == MOVE_NONE && gDisableStructs[gBattlerAttacker].disabledMove == MOVE_NONE
&& IsBattlerAlive(gBattlerAttacker) && IsBattlerAlive(gBattlerAttacker)
&& !IsAbilityOnSide(gBattlerAttacker, ABILITY_AROMA_VEIL) && !IsAbilityOnSide(gBattlerAttacker, ABILITY_AROMA_VEIL)
&& gBattleMons[gBattlerAttacker].pp[gChosenMovePos] != 0 && gChosenMove != MOVE_STRUGGLE
&& !(GetActiveGimmick(gBattlerAttacker) == GIMMICK_DYNAMAX) // TODO: Max Moves don't make contact, useless?
&& RandomPercentage(RNG_CURSED_BODY, 30)) && RandomPercentage(RNG_CURSED_BODY, 30))
{ {
gDisableStructs[gBattlerAttacker].disabledMove = gChosenMove; gDisableStructs[gBattlerAttacker].disabledMove = gChosenMove;

View File

@ -16,10 +16,77 @@ SINGLE_BATTLE_TEST("Cursed Body triggers 30% of the time")
} }
} }
TO_DO_BATTLE_TEST("Cursed Body cannot disable Struggle") SINGLE_BATTLE_TEST("Cursed Body cannot disable Struggle")
TO_DO_BATTLE_TEST("Cursed Body can trigger if the attacker is behind a Substitute") {
TO_DO_BATTLE_TEST("Cursed Body cannot trigger if the target is behind a Substitute") GIVEN {
TO_DO_BATTLE_TEST("Cursed Body does not stop a multistrike move mid-execution") ASSUME(GetItemHoldEffect(ITEM_CHOICE_SCARF) == HOLD_EFFECT_CHOICE_SCARF);
ASSUME(GetMoveEffect(MOVE_TAUNT) == EFFECT_TAUNT);
ASSUME(GetMoveCategory(MOVE_CELEBRATE) == DAMAGE_CATEGORY_STATUS);
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_CHOICE_SCARF); Moves(MOVE_CELEBRATE); }
OPPONENT(SPECIES_FRILLISH) { Ability(ABILITY_CURSED_BODY); }
} WHEN {
TURN { MOVE(player, MOVE_CELEBRATE); MOVE(opponent, MOVE_TAUNT); }
TURN { FORCED_MOVE(player); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_STRUGGLE, player);
NONE_OF {
ABILITY_POPUP(opponent, ABILITY_CURSED_BODY);
MESSAGE("Wobbuffet's Struggle was disabled by the opposing Frillish's Cursed Body!");
}
}
}
SINGLE_BATTLE_TEST("Cursed Body can trigger if the attacker is behind a Substitute")
{
GIVEN {
ASSUME(GetMoveEffect(MOVE_SUBSTITUTE) == EFFECT_SUBSTITUTE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_FRILLISH) { Ability(ABILITY_CURSED_BODY); }
} WHEN {
TURN { MOVE(player, MOVE_SUBSTITUTE); }
TURN { MOVE(player, MOVE_AQUA_JET); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_AQUA_JET, player);
ABILITY_POPUP(opponent, ABILITY_CURSED_BODY);
MESSAGE("Wobbuffet's Aqua Jet was disabled by the opposing Frillish's Cursed Body!");
}
}
SINGLE_BATTLE_TEST("Cursed Body cannot trigger if the target is behind a Substitute")
{
GIVEN {
ASSUME(GetMoveEffect(MOVE_SUBSTITUTE) == EFFECT_SUBSTITUTE);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_FRILLISH) { Ability(ABILITY_CURSED_BODY); }
} WHEN {
TURN { MOVE(opponent, MOVE_SUBSTITUTE); }
TURN { MOVE(player, MOVE_AQUA_JET); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_AQUA_JET, player);
NONE_OF {
ABILITY_POPUP(opponent, ABILITY_CURSED_BODY);
MESSAGE("Wobbuffet's Aqua Jet was disabled by the opposing Frillish's Cursed Body!");
}
}
}
SINGLE_BATTLE_TEST("Cursed Body does not stop a multistrike move mid-execution")
{
GIVEN {
ASSUME(GetMoveEffect(MOVE_ROCK_BLAST) == EFFECT_MULTI_HIT);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_FRILLISH) { Ability(ABILITY_CURSED_BODY); }
} WHEN {
TURN { MOVE(player, MOVE_ROCK_BLAST); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_ROCK_BLAST, player);
HP_BAR(opponent);
ABILITY_POPUP(opponent, ABILITY_CURSED_BODY);
MESSAGE("Wobbuffet's Rock Blast was disabled by the opposing Frillish's Cursed Body!");
HP_BAR(opponent);
}
}
TO_DO_BATTLE_TEST("Cursed Body disables the move that called another move instead of the called move") TO_DO_BATTLE_TEST("Cursed Body disables the move that called another move instead of the called move")
TO_DO_BATTLE_TEST("Cursed Body disables damaging Z-Moves, but not the base move") // Rotom Powers can restore Z-Moves TO_DO_BATTLE_TEST("Cursed Body disables damaging Z-Moves, but not the base move") // Rotom Powers can restore Z-Moves
TO_DO_BATTLE_TEST("Cursed Body disables the base move of a status Z-Move") TO_DO_BATTLE_TEST("Cursed Body disables the base move of a status Z-Move")