Fixes absorb still draining HP when flinched (#5814)
This commit is contained in:
parent
39bc916ca8
commit
12f199c641
2 changed files with 19 additions and 1 deletions
|
@ -5674,7 +5674,9 @@ static void Cmd_moveend(void)
|
||||||
gBattleScripting.moveendState++;
|
gBattleScripting.moveendState++;
|
||||||
break;
|
break;
|
||||||
case MOVEEND_ABSORB:
|
case MOVEEND_ABSORB:
|
||||||
if (gMovesInfo[gCurrentMove].effect == EFFECT_ABSORB)
|
if (gMovesInfo[gCurrentMove].effect == EFFECT_ABSORB
|
||||||
|
&& !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE)
|
||||||
|
&& TARGET_TURN_DAMAGED)
|
||||||
{
|
{
|
||||||
if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && gMovesInfo[gCurrentMove].healingMove)
|
if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && gMovesInfo[gCurrentMove].healingMove)
|
||||||
{
|
{
|
||||||
|
|
|
@ -125,4 +125,20 @@ SINGLE_BATTLE_TEST("Draining Kiss recovers 75% of the damage dealt")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Absorb does not drain any HP if user flinched")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(opponent, MOVE_FAKE_OUT); MOVE(player, MOVE_ABSORB); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_FAKE_OUT, opponent);
|
||||||
|
NONE_OF {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_ABSORB, player);
|
||||||
|
MESSAGE("The opposing Wobbuffet had its energy drained!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
TO_DO_BATTLE_TEST("Absorb recovers 50% of the damage dealt to a Substitute");
|
TO_DO_BATTLE_TEST("Absorb recovers 50% of the damage dealt to a Substitute");
|
||||||
|
|
Loading…
Reference in a new issue