From 2f6cc2be80642a694b6a96d8a974df71ac0cfb6d Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 29 Jul 2018 12:45:08 +0200 Subject: [PATCH] Electric types immune to paralysis --- data/battle_scripts_1.s | 1 + src/battle_script_commands.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d80cd229bf..a5b43daf87 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1445,6 +1445,7 @@ BattleScript_EffectParalyze:: typecalc jumpifmovehadnoeffect BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_PARALYSIS, BattleScript_AlreadyParalyzed + jumpiftype BS_TARGET, TYPE_ELECTRIC, BattleScript_NotAffected jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed accuracycheck BattleScript_ButItFailed, ACC_CURR_MOVE jumpifsideaffecting BS_TARGET, SIDE_STATUS_SAFEGUARD, BattleScript_SafeguardProtected diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 189c4e6bcd..b7f7d55b68 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2230,6 +2230,20 @@ void SetMoveEffect(bool8 primary, u8 certain) else break; } + if ((IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_ELECTRIC)) + && (gHitMarker & HITMARKER_IGNORE_SAFEGUARD) + && (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)) + { + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_PRLZPrevention; + + gBattleCommunication[MULTISTRING_CHOOSER] = 2; + RESET_RETURN + } + if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_ELECTRIC)) + break; + if (gBattleMons[gEffectBattler].ability == ABILITY_LIMBER) + break; if (gBattleMons[gEffectBattler].status1) break;