Merge pull request #2645 from DizzyEggg/damp_aftermath

Damp shows ability pop-up when reacting with Aftermath
This commit is contained in:
ghoulslash 2023-02-07 10:18:23 -05:00 committed by GitHub
commit 7e9d40d401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 9 deletions

View File

@ -7900,6 +7900,16 @@ BattleScript_AftermathDmg::
waitmessage B_WAIT_TIME_LONG
tryfaintmon BS_ATTACKER
return
BattleScript_DampPreventsAftermath::
pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp
pause 40
copybyte gBattlerAbility, sBATTLER
call BattleScript_AbilityPopUp
printstring STRINGID_PKMNSABILITYPREVENTSABILITY
waitmessage B_WAIT_TIME_LONG
return
BattleScript_MoveUsedIsAsleep::
printstring STRINGID_PKMNFASTASLEEP

View File

@ -451,6 +451,7 @@ extern const u8 BattleScript_EarthEaterActivates[];
extern const u8 BattleScript_MimicryActivates_End3[];
extern const u8 BattleScript_IceFaceNullsDamage[];
extern const u8 BattleScript_BattlerFormChangeWithStringEnd3[];
extern const u8 BattleScript_DampPreventsAftermath[];
// zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[];

View File

@ -638,8 +638,9 @@
#define STRINGID_ELECTRICTERRAINACTIVATEDABILITY 636
#define STRINGID_ABILITYWEAKENEDFSURROUNDINGMONSSTAT 637
#define STRINGID_ATTACKERGAINEDSTRENGTHFROMTHEFALLEN 638
#define STRINGID_PKMNSABILITYPREVENTSABILITY 639
#define BATTLESTRINGS_COUNT 639
#define BATTLESTRINGS_COUNT 640
// This is the string id that gBattleStringsTable starts with.
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,

View File

@ -306,6 +306,7 @@ static const u8 sText_PreventedFromWorking[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_
static const u8 sText_PkmnsXMadeItIneffective[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nmade it ineffective!");
static const u8 sText_PkmnsXPreventsFlinching[] = _("{B_EFF_NAME_WITH_PREFIX}'s {B_EFF_ABILITY}\nprevents flinching!");
static const u8 sText_PkmnsXPreventsYsZ[] = _("{B_ATK_NAME_WITH_PREFIX}'s {B_ATK_ABILITY}\nprevents {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY} from working!");
static const u8 sText_PkmnsAbilityPreventsAbility[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nprevents {B_DEF_NAME_WITH_PREFIX}'s\l{B_DEF_ABILITY} from working!");
static const u8 sText_PkmnsXCuredItsYProblem[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\ncured its {B_BUFF1} problem!");
static const u8 sText_PkmnsXHadNoEffectOnY[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nhad no effect on {B_EFF_NAME_WITH_PREFIX}!");
const u8 gText_StatSharply[] = _("sharply ");
@ -1402,6 +1403,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
[STRINGID_PKMNTOOKTARGETHIGH - BATTLESTRINGS_TABLE_START] = sText_PkmnTookTargetHigh,
[STRINGID_TARGETTOOHEAVY - BATTLESTRINGS_TABLE_START] = sText_TargetTooHeavy,
[STRINGID_ATTACKERLOSTELECTRICTYPE - BATTLESTRINGS_TABLE_START] = sText_AttackerLostElectricType,
[STRINGID_PKMNSABILITYPREVENTSABILITY - BATTLESTRINGS_TABLE_START] = sText_PkmnsAbilityPreventsAbility,
};
const u16 gZEffectStringIds[] =
@ -1592,7 +1594,6 @@ const u16 gUproarAwakeStringIds[] =
{
[B_MSG_CANT_SLEEP_UPROAR] = STRINGID_PKMNCANTSLEEPINUPROAR2,
[B_MSG_UPROAR_KEPT_AWAKE] = STRINGID_UPROARKEPTPKMNAWAKE,
[B_MSG_STAYED_AWAKE_USING] = STRINGID_PKMNSTAYEDAWAKEUSING,
};
const u16 gStatUpStringIds[] =

View File

@ -5566,17 +5566,26 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
}
break;
case ABILITY_AFTERMATH:
if (!IsAbilityOnField(ABILITY_DAMP)
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& gBattleMons[gBattlerTarget].hp == 0
&& IsBattlerAlive(gBattlerAttacker)
&& IsMoveMakingContact(move, gBattlerAttacker))
{
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AftermathDmg;
u8 battler;
if ((battler = IsAbilityOnField(ABILITY_DAMP)))
{
gBattleScripting.battler = battler - 1;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_DampPreventsAftermath;
}
else
{
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
if (gBattleMoveDamage == 0)
gBattleMoveDamage = 1;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AftermathDmg;
}
effect++;
}
break;