diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c old mode 100644 new mode 100755 index 965745608c..943e7db979 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6061,10 +6061,13 @@ static void Cmd_moveend(void) switch (moveEffect) { case EFFECT_ABSORB: - if (!(gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK) && IsBattlerAlive(gBattlerAttacker)) + if (!(gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK) + && gBattleStruct->moveDamage[gBattlerTarget] > 0 + && IsBattlerAlive(gBattlerAttacker)) { gBattleStruct->moveDamage[gBattlerAttacker] = max(1, (gBattleStruct->moveDamage[gBattlerTarget] * GetMoveAbsorbPercentage(gCurrentMove) / 100)); gBattleStruct->moveDamage[gBattlerAttacker] = GetDrainedBigRootHp(gBattlerAttacker, gBattleStruct->moveDamage[gBattlerAttacker]); + gHitMarker |= HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_IGNORE_DISGUISE; effect = TRUE; if (GetBattlerAbility(gBattlerTarget) == ABILITY_LIQUID_OOZE) diff --git a/test/battle/move_effect/absorb.c b/test/battle/move_effect/absorb.c index 456c888cd4..d497bc3f04 100644 --- a/test/battle/move_effect/absorb.c +++ b/test/battle/move_effect/absorb.c @@ -104,3 +104,17 @@ SINGLE_BATTLE_TEST("Absorb does not drain any HP if user flinched") } TO_DO_BATTLE_TEST("Absorb recovers 50% of the damage dealt to a Substitute"); + +SINGLE_BATTLE_TEST("Absorb does not drain any HP if user does 0 damage") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET) { HP(1); } + OPPONENT(SPECIES_WOBBUFFET) { HP(1); } + } WHEN { + TURN { MOVE(opponent, MOVE_ENDURE); MOVE(player, MOVE_ABSORB); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_ENDURE, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_ABSORB, player); + NOT MESSAGE("The opposing Wobbuffet had its energy drained!"); + } +}