syntax fixes. add B_PRANKSTER_DARK_TYPES check to perish song

This commit is contained in:
ghoulslash 2021-09-20 21:36:10 -04:00
parent faa963fd04
commit 32d19a9b19
3 changed files with 9 additions and 5 deletions

View File

@ -8153,8 +8153,8 @@ BattleScript_EjectPackActivates::
BattleScript_DarkTypePreventsPrankster::
attackstring
ppreduce
pause 0x20
pause B_WAIT_TIME_SHORT
printstring STRINGID_ITDOESNTAFFECT
waitmessage 0x40
waitmessage B_WAIT_TIME_LONG
orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
goto BattleScript_MoveEnd

View File

@ -5046,7 +5046,7 @@ static void Cmd_moveend(void)
MoveValuesCleanUp();
gBattleScripting.moveEffect = gBattleScripting.savedMoveEffect;
BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]);
gBattleStruct->atkCancellerTracker = 0; // run all cancellers on next target
gBattleStruct->atkCancellerTracker = 0; // Run all cancellers on next target
gBattlescriptCurrInstr = BattleScript_FlushMessageBox;
return;
}
@ -10730,7 +10730,11 @@ static void Cmd_trysetperishsong(void)
{
if (gStatuses3[i] & STATUS3_PERISH_SONG
|| gBattleMons[i].ability == ABILITY_SOUNDPROOF
|| (i != gBattlerAttacker && GetBattlerAbility(gBattlerAttacker) == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(i, TYPE_DARK)))
|| (B_PRANKSTER_DARK_TYPES >= GEN_7
&& i != gBattlerAttacker
&& GetBattlerAbility(gBattlerAttacker) == ABILITY_PRANKSTER
&& IS_BATTLER_OF_TYPE(i, TYPE_DARK))
)
{
notAffectedCount++;
}

View File

@ -3424,7 +3424,7 @@ u8 AtkCanceller_UnableToUseMove(void)
&& GetBattlerAbility(gBattlerTarget) != ABILITY_MAGIC_BOUNCE) // Magic bounce will bounce back prankster'd status move instead of blocking it
{
if (!(gBattleTypeFlags & BATTLE_TYPE_DOUBLE) || !(gBattleMoves[gCurrentMove].target & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY)))
CancelMultiTurnMoves(gBattlerAttacker); // don't cancel moves that can hit two targets bc one target might not be protected
CancelMultiTurnMoves(gBattlerAttacker); // Don't cancel moves that can hit two targets bc one target might not be protected
gBattleScripting.battler = gBattlerAbility = gBattlerTarget;
gBattlescriptCurrInstr = BattleScript_DarkTypePreventsPrankster;
effect = 1;