diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7591d81a09..60e1688ca9 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5864,6 +5864,15 @@ BattleScript_IllusionOff:: waitmessage 0x40 return +BattleScript_AftermathDmg:: + orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000 + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + printstring STRINGID_AFTERMATHDMG + waitmessage 0x40 + tryfaintmon BS_ATTACKER, FALSE, NULL + return + BattleScript_MoveUsedIsAsleep:: printstring STRINGID_PKMNFASTASLEEP waitmessage 0x40 diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 721c49dab5..448f3b29f6 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -327,5 +327,6 @@ extern const u8 BattleScript_MoveEffectIncinerate[]; extern const u8 BattleScript_MoveEffectBugBite[]; extern const u8 BattleScript_IllusionOff[]; extern const u8 BattleScript_DancerActivates[]; +extern const u8 BattleScript_AftermathDmg[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/src/battle_message.c b/src/battle_message.c index 91fbf02ca0..74c7084490 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -592,7 +592,7 @@ static const u8 sText_TurboblazeEnters[] = _("{B_ATK_NAME_WITH_PREFIX} is radiat static const u8 sText_SlowStartEnters[] = _("{B_ATK_NAME_WITH_PREFIX} can't get it going!"); static const u8 sText_SlowStartEnd[] = _("{B_ATK_NAME_WITH_PREFIX} finally got its act together!"); static const u8 sText_SolarPowerHpDrop[] = _("The {B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\ntakes its toll!"); -static const u8 sText_AftermathDmg[] = _("The {B_DEF_NAME_WITH_PREFIX}\nsuffers the {B_DEF_ABILITY}!"); +static const u8 sText_AftermathDmg[] = _("{B_ATK_NAME_WITH_PREFIX} is hurt!"); static const u8 sText_AnticipationActivates[] = _("The {B_ATK_NAME_WITH_PREFIX} shuddered in {B_ATK_ABILITY}!"); static const u8 sText_ForewarnActivates[] = _("{B_ATK_ABILITY} alerted the {B_ATK_NAME_WITH_PREFIX} to the\n{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}!"); static const u8 sText_IceBodyHpGain[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nhealed it a little bit!"); diff --git a/src/battle_util.c b/src/battle_util.c index 32492410e6..ef7e85ecc1 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3327,6 +3327,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA effect++; } break; + case ABILITY_AFTERMATH: + if (IsAbilityOnField(ABILITY_DAMP)) + break; + else if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerTarget].hp == 0 + && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) + { + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_AftermathDmg; + effect++; + } + break; case ABILITY_EFFECT_SPORE: if (!IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GRASS) && GetBattlerAbility(gBattlerAttacker) != ABILITY_OVERCOAT