From aeafd9e2227db86dc5fd63aca0976a5cbf8c4677 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 16 Sep 2021 11:34:01 -0400 Subject: [PATCH] perish song + prankster interaction --- data/battle_scripts_1.s | 19 ++++++++++++++----- src/battle_script_commands.c | 3 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 4c41db86ef..a1076e921c 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3647,19 +3647,28 @@ BattleScript_EffectPerishSong:: waitanimation printstring STRINGID_FAINTINTHREE waitmessage B_WAIT_TIME_LONG - setbyte sBATTLER, 0 + setbyte gBattlerTarget, 0 BattleScript_PerishSongLoop:: - jumpifability BS_SCRIPTING, ABILITY_SOUNDPROOF, BattleScript_PerishSongNotAffected + jumpifability BS_TARGET, ABILITY_SOUNDPROOF, BattleScript_PerishSongBlocked + jumpifability BS_ATTACKER, ABILITY_PRANKSTER, BattleScript_PerishSongCheckPrankster + goto BattleScript_PerishSongLoopIncrement +BattleScript_PerishSongCheckPrankster: + jumpiftype BS_TARGET, TYPE_DARK, BattleScript_PerishSongNotAffected BattleScript_PerishSongLoopIncrement:: - addbyte sBATTLER, 1 - jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_PerishSongLoop + addbyte gBattlerTarget, 1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_PerishSongLoop goto BattleScript_MoveEnd -BattleScript_PerishSongNotAffected:: +BattleScript_PerishSongBlocked:: printstring STRINGID_PKMNSXBLOCKSY2 waitmessage B_WAIT_TIME_LONG goto BattleScript_PerishSongLoopIncrement +BattleScript_PerishSongNotAffected: + printstring STRINGID_ITDOESNTAFFECT + waitmessage B_WAIT_TIME_LONG + goto BattleScript_PerishSongLoopIncrement + BattleScript_EffectSandstorm:: attackcanceler attackstring diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 28e000a7bd..c1da44b2e2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -10605,7 +10605,8 @@ static void Cmd_trysetperishsong(void) for (i = 0; i < gBattlersCount; i++) { if (gStatuses3[i] & STATUS3_PERISH_SONG - || gBattleMons[i].ability == ABILITY_SOUNDPROOF) + || gBattleMons[i].ability == ABILITY_SOUNDPROOF + || (GetBattlerAbility(gBattlerAttacker) == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(i, TYPE_DARK))) { notAffectedCount++; }