Fixes Destiny Bond against Dynamax no failing (#6501)

This commit is contained in:
Alex 2025-03-30 14:18:21 +02:00 committed by GitHub
parent 68a869da99
commit 093e265515
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 1 deletions

View File

@ -13864,10 +13864,29 @@ static void Cmd_trychoosesleeptalkmove(void)
}
}
static inline bool32 IsDanamaxMonPresent(void)
{
for (u32 battler = 0; battler < gBattlersCount; battler++)
{
if (battler == gBattlerAttacker)
continue;
if (GetActiveGimmick(battler) == GIMMICK_DYNAMAX)
return TRUE;
}
return FALSE;
}
static void Cmd_trysetdestinybond(void)
{
CMD_ARGS(const u8 *failInstr);
if (DoesDestinyBondFail(gBattlerAttacker))
if (IsDanamaxMonPresent())
{
gBattlescriptCurrInstr = BattleScript_MoveBlockedByDynamax;
}
else if (DoesDestinyBondFail(gBattlerAttacker))
{
gBattlescriptCurrInstr = cmd->failInstr;
}

View File

@ -1624,3 +1624,15 @@ SINGLE_BATTLE_TEST("Dynamax: Dynamax is reverted before switch out")
MESSAGE("Wobbuffet used Tackle!");
}
}
SINGLE_BATTLE_TEST("Dynamax: Destiny Bond if a dynamaxed battler is present on field")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(opponent, MOVE_DESTINY_BOND); MOVE(player, MOVE_TACKLE, gimmick: GIMMICK_DYNAMAX); }
} SCENE {
MESSAGE("The move was blocked by the power of Dynamax!");
}
}