Fixes Drain Punch / Parental Bond / Scale Shot interaction (#8198)

This commit is contained in:
Alex 2025-11-11 17:41:56 +01:00 committed by GitHub
parent 2e8545ba45
commit 03b6200af5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 20 additions and 2 deletions

View File

@ -6478,7 +6478,7 @@ static void Cmd_moveend(void)
if (!(gBattleStruct->moveResultFlags[gBattlerTarget] & MOVE_RESULT_NO_EFFECT)
&& !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
&& gMultiHitCounter
&& !(moveEffect == EFFECT_PRESENT && gBattleStruct->presentBasePower == 0)) // Silly edge case
&& !(moveEffect == EFFECT_PRESENT && gBattleStruct->presentBasePower == 0)) // Parental Bond edge case
{
gMultiHitCounter--;
if (!IsBattlerAlive(gBattlerTarget) && moveEffect != EFFECT_DRAGON_DARTS)
@ -6487,7 +6487,9 @@ static void Cmd_moveend(void)
gBattleScripting.multihitString[4]++;
if (gMultiHitCounter == 0)
{
if (GetMoveEffectArg_MoveProperty(gCurrentMove) == MOVE_EFFECT_SCALE_SHOT && !NoAliveMonsForEitherParty())
if (moveEffect == EFFECT_MULTI_HIT
&& GetMoveEffectArg_MoveProperty(gCurrentMove) == MOVE_EFFECT_SCALE_SHOT
&& !NoAliveMonsForEitherParty())
BattleScriptCall(BattleScript_ScaleShot);
else
BattleScriptCall(BattleScript_MultiHitPrintStrings);

View File

@ -352,6 +352,22 @@ SINGLE_BATTLE_TEST("Parental Bond does not trigger on two turn attacks")
}
}
SINGLE_BATTLE_TEST("Parental Bond does not trigger Scale Shot effect on Drain Punch")
{
GIVEN {
PLAYER(SPECIES_KANGASKHAN) { Item(ITEM_KANGASKHANITE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_DRAIN_PUNCH, gimmick: GIMMICK_MEGA); MOVE(opponent, MOVE_CELEBRATE); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_DRAIN_PUNCH, player);
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
} THEN {
EXPECT_EQ(player->statStages[STAT_DEF], DEFAULT_STAT_STAGE);
EXPECT_EQ(player->statStages[STAT_SPEED], DEFAULT_STAT_STAGE);
}
}
TO_DO_BATTLE_TEST("Parental Bond tests");
// Temporary TODO: Convert Bulbapedia description into tests.