perish song + prankster interaction

This commit is contained in:
ghoulslash 2021-09-16 11:34:01 -04:00
parent 85f3982fb9
commit aeafd9e222
2 changed files with 16 additions and 6 deletions

View File

@ -3647,19 +3647,28 @@ BattleScript_EffectPerishSong::
waitanimation waitanimation
printstring STRINGID_FAINTINTHREE printstring STRINGID_FAINTINTHREE
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
setbyte sBATTLER, 0 setbyte gBattlerTarget, 0
BattleScript_PerishSongLoop:: 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:: BattleScript_PerishSongLoopIncrement::
addbyte sBATTLER, 1 addbyte gBattlerTarget, 1
jumpifbytenotequal sBATTLER, gBattlersCount, BattleScript_PerishSongLoop jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_PerishSongLoop
goto BattleScript_MoveEnd goto BattleScript_MoveEnd
BattleScript_PerishSongNotAffected:: BattleScript_PerishSongBlocked::
printstring STRINGID_PKMNSXBLOCKSY2 printstring STRINGID_PKMNSXBLOCKSY2
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
goto BattleScript_PerishSongLoopIncrement goto BattleScript_PerishSongLoopIncrement
BattleScript_PerishSongNotAffected:
printstring STRINGID_ITDOESNTAFFECT
waitmessage B_WAIT_TIME_LONG
goto BattleScript_PerishSongLoopIncrement
BattleScript_EffectSandstorm:: BattleScript_EffectSandstorm::
attackcanceler attackcanceler
attackstring attackstring

View File

@ -10605,7 +10605,8 @@ static void Cmd_trysetperishsong(void)
for (i = 0; i < gBattlersCount; i++) for (i = 0; i < gBattlersCount; i++)
{ {
if (gStatuses3[i] & STATUS3_PERISH_SONG 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++; notAffectedCount++;
} }