Implemented Earth Eater's effect

This commit is contained in:
LOuroboros 2022-12-06 05:29:26 -03:00
parent fa78e3b2c4
commit d6b9f07681
3 changed files with 25 additions and 0 deletions

View File

@ -7144,6 +7144,18 @@ BattleScript_ToxicDebrisActivates::
BattleScript_ToxicDebrisRet:
return
BattleScript_EarthEaterActivates::
call BattleScript_AbilityPopUp
pause B_WAIT_TIME_LONG
tryhealquarterhealth BS_TARGET, BattleScript_EarthEaterRet
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_TARGET
datahpupdate BS_TARGET
printstring STRINGID_PKMNREGAINEDHEALTH
waitmessage B_WAIT_TIME_LONG
BattleScript_EarthEaterRet:
return
BattleScript_PerishSongCountGoesDown::
printstring STRINGID_PKMNPERISHCOUNTFELL
waitmessage B_WAIT_TIME_LONG

View File

@ -448,6 +448,7 @@ extern const u8 BattleScript_CudChewActivates[];
extern const u8 BattleScript_SupremeOverlordActivates[];
extern const u8 BattleScript_CostarActivates[];
extern const u8 BattleScript_ToxicDebrisActivates[];
extern const u8 BattleScript_EarthEaterActivates[];
// zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[];

View File

@ -5925,6 +5925,18 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
effect++;
}
break;
case ABILITY_EARTH_EATER:
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& gBattleMoves[gCurrentMove].type == TYPE_GROUND
&& TARGET_TURN_DAMAGED
&& IsBattlerAlive(gBattlerTarget))
{
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_EarthEaterActivates;
effect++;
}
break;
}
break;
case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker