diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d4afe23be4..08444ae569 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4686,7 +4686,8 @@ static void MoveValuesCleanUp(void) gIsCriticalHit = FALSE; gBattleScripting.moveEffect = 0; gBattleCommunication[MISS_TYPE] = 0; - gHitMarker &= ~HITMARKER_DESTINYBOND; + if (!gMultiHitCounter) + gHitMarker &= ~HITMARKER_DESTINYBOND; gHitMarker &= ~HITMARKER_SYNCHRONISE_EFFECT; } diff --git a/test/battle/move_effect/destiny_bond.c b/test/battle/move_effect/destiny_bond.c new file mode 100644 index 0000000000..baba378f6b --- /dev/null +++ b/test/battle/move_effect/destiny_bond.c @@ -0,0 +1,17 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Destiny Bond faints the opposing mon if it fainted from the attack") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DESTINY_BOND); MOVE(opponent, MOVE_TACKLE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DESTINY_BOND, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent); + MESSAGE("Wobbuffet took Foe Wobbuffet with it!"); + MESSAGE("Foe Wobbuffet fainted!"); + } +} diff --git a/test/battle/move_effect/multi_hit.c b/test/battle/move_effect/multi_hit.c index df9cfea807..fca9da8150 100644 --- a/test/battle/move_effect/multi_hit.c +++ b/test/battle/move_effect/multi_hit.c @@ -231,3 +231,28 @@ SINGLE_BATTLE_TEST("Scale Shot decreases defense and increases speed after killi MESSAGE("Bagon's Speed rose!"); } } + +SINGLE_BATTLE_TEST("Multi Hit moves will not disrupt Destiny Bond flag") +{ + u32 hp; + PARAMETRIZE { hp = 11; } + PARAMETRIZE { hp = 55; } + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(55); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_DESTINY_BOND); MOVE(opponent, MOVE_BULLET_SEED); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_DESTINY_BOND, player); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + if (hp == 55) + { + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, opponent); + } + MESSAGE("Wobbuffet took Foe Wobbuffet with it!"); + MESSAGE("Foe Wobbuffet fainted!"); + } +}