mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-27 20:24:18 +01:00
Implemented Perish Body
Inspired by Raguzero's implementation.
This commit is contained in:
parent
7d8b8083e8
commit
2b0702ec04
@ -5733,6 +5733,13 @@ BattleScript_PerishSongTakesLife::
|
|||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
end2
|
end2
|
||||||
|
|
||||||
|
BattleScript_PerishBodyActivates::
|
||||||
|
call BattleScript_AbilityPopUp
|
||||||
|
printstring STRINGID_PKMNSWILLPERISHIN3TURNS
|
||||||
|
waitmessage 0x40
|
||||||
|
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_x100000
|
||||||
|
return
|
||||||
|
|
||||||
BattleScript_PerishSongCountGoesDown::
|
BattleScript_PerishSongCountGoesDown::
|
||||||
printstring STRINGID_PKMNPERISHCOUNTFELL
|
printstring STRINGID_PKMNPERISHCOUNTFELL
|
||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
|
@ -354,5 +354,6 @@ extern const u8 BattleScript_BattlerAbilityStatRaiseOnSwitchIn[];
|
|||||||
extern const u8 BattleScript_CottonDownActivates[];
|
extern const u8 BattleScript_CottonDownActivates[];
|
||||||
extern const u8 BattleScript_BallFetch[];
|
extern const u8 BattleScript_BallFetch[];
|
||||||
extern const u8 BattleScript_SandSpitActivates[];
|
extern const u8 BattleScript_SandSpitActivates[];
|
||||||
|
extern const u8 BattleScript_PerishBodyActivates[];
|
||||||
|
|
||||||
#endif // GUARD_BATTLE_SCRIPTS_H
|
#endif // GUARD_BATTLE_SCRIPTS_H
|
||||||
|
@ -561,8 +561,9 @@
|
|||||||
#define STRINGID_FETCHEDPOKEBALL 557
|
#define STRINGID_FETCHEDPOKEBALL 557
|
||||||
#define STRINGID_BATTLERABILITYRAISEDSTAT 558
|
#define STRINGID_BATTLERABILITYRAISEDSTAT 558
|
||||||
#define STRINGID_ASANDSTORMKICKEDUP 559
|
#define STRINGID_ASANDSTORMKICKEDUP 559
|
||||||
|
#define STRINGID_PKMNSWILLPERISHIN3TURNS 560
|
||||||
|
|
||||||
#define BATTLESTRINGS_COUNT 560
|
#define BATTLESTRINGS_COUNT 561
|
||||||
|
|
||||||
//// multichoice message IDs
|
//// multichoice message IDs
|
||||||
// switch in ability message
|
// switch in ability message
|
||||||
|
@ -688,9 +688,11 @@ static const u8 sText_ScreenCleanerActivates[] = _("All screens on the field wer
|
|||||||
static const u8 sText_FetchedPokeBall[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} found\na {B_LAST_ITEM}!");
|
static const u8 sText_FetchedPokeBall[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} found\na {B_LAST_ITEM}!");
|
||||||
static const u8 sText_BattlerAbilityRaisedStat[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nraised its {B_BUFF1}!");
|
static const u8 sText_BattlerAbilityRaisedStat[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX}'s {B_SCR_ACTIVE_ABILITY}\nraised its {B_BUFF1}!");
|
||||||
static const u8 sText_ASandstormKickedUp[] = _("A sandstorm kicked up!");
|
static const u8 sText_ASandstormKickedUp[] = _("A sandstorm kicked up!");
|
||||||
|
static const u8 sText_PkmnsWillPerishIn3Turns[] = _("Both Pokémon will perish\nin three turns!");
|
||||||
|
|
||||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||||
{
|
{
|
||||||
|
[STRINGID_PKMNSWILLPERISHIN3TURNS - 12] = sText_PkmnsWillPerishIn3Turns,
|
||||||
[STRINGID_ASANDSTORMKICKEDUP - 12] = sText_ASandstormKickedUp,
|
[STRINGID_ASANDSTORMKICKEDUP - 12] = sText_ASandstormKickedUp,
|
||||||
[STRINGID_BATTLERABILITYRAISEDSTAT - 12] = sText_BattlerAbilityRaisedStat,
|
[STRINGID_BATTLERABILITYRAISEDSTAT - 12] = sText_BattlerAbilityRaisedStat,
|
||||||
[STRINGID_FETCHEDPOKEBALL - 12] = sText_FetchedPokeBall,
|
[STRINGID_FETCHEDPOKEBALL - 12] = sText_FetchedPokeBall,
|
||||||
|
@ -4663,6 +4663,28 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
|
|||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ABILITY_PERISH_BODY:
|
||||||
|
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||||
|
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||||
|
&& TARGET_TURN_DAMAGED
|
||||||
|
&& IsBattlerAlive(battler)
|
||||||
|
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)
|
||||||
|
&& !(gStatuses3[gBattlerAttacker] & STATUS3_PERISH_SONG))
|
||||||
|
{
|
||||||
|
if (!(gStatuses3[battler] & STATUS3_PERISH_SONG))
|
||||||
|
{
|
||||||
|
gStatuses3[battler] |= STATUS3_PERISH_SONG;
|
||||||
|
gDisableStructs[battler].perishSongTimer = 3;
|
||||||
|
gDisableStructs[battler].perishSongTimerStartValue = 3;
|
||||||
|
}
|
||||||
|
gStatuses3[gBattlerAttacker] |= STATUS3_PERISH_SONG;
|
||||||
|
gDisableStructs[gBattlerAttacker].perishSongTimer = 3;
|
||||||
|
gDisableStructs[gBattlerAttacker].perishSongTimerStartValue = 3;
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
gBattlescriptCurrInstr = BattleScript_PerishBodyActivates;
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker
|
case ABILITYEFFECT_MOVE_END_ATTACKER: // Same as above, but for attacker
|
||||||
|
Loading…
Reference in New Issue
Block a user