canbestatused for psycho shift

This commit is contained in:
ghoulslash 2022-01-23 13:46:30 -05:00
parent 3e1ddf6b93
commit a165f9926d

View File

@ -8661,19 +8661,13 @@ static void Cmd_various(void)
i = TRUE; i = TRUE;
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) if (gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS)
{ {
if (targetAbility == ABILITY_LIMBER) if (!(CanBeParalyzed(gBattlerTarget)))
{ {
gBattlerAbility = gBattlerTarget; gBattlerAbility = gBattlerTarget;
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3)); BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));
gBattlescriptCurrInstr = BattleScript_PRLZPrevention; gBattlescriptCurrInstr = BattleScript_PRLZPrevention;
i = FALSE; i = FALSE;
} }
else if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_ELECTRIC))
{
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));
gBattlescriptCurrInstr = BattleScript_PRLZPrevention;
i = FALSE;
}
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 3; gBattleCommunication[MULTISTRING_CHOOSER] = 3;
@ -8681,19 +8675,13 @@ static void Cmd_various(void)
} }
else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_PSN_ANY) else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_PSN_ANY)
{ {
if (targetAbility == ABILITY_IMMUNITY) if (!CanBePoisoned(gBattlerTarget, targetAbility))
{ {
gBattlerAbility = gBattlerTarget; gBattlerAbility = gBattlerTarget;
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3)); BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));
gBattlescriptCurrInstr = BattleScript_PSNPrevention; gBattlescriptCurrInstr = BattleScript_PSNPrevention;
i = FALSE; i = FALSE;
} }
else if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_STEEL))
{
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));
gBattlescriptCurrInstr = BattleScript_PSNPrevention;
i = FALSE;
}
else else
{ {
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_POISON) if (gBattleMons[gBattlerAttacker].status1 & STATUS1_POISON)
@ -8704,20 +8692,13 @@ static void Cmd_various(void)
} }
else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_BURN) else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_BURN)
{ {
if (targetAbility == ABILITY_WATER_VEIL if (!CanBeBurned(gBattlerTarget))
|| targetAbility == ABILITY_WATER_BUBBLE)
{ {
gBattlerAbility = gBattlerTarget; gBattlerAbility = gBattlerTarget;
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3)); BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));
gBattlescriptCurrInstr = BattleScript_BRNPrevention; gBattlescriptCurrInstr = BattleScript_BRNPrevention;
i = FALSE; i = FALSE;
} }
else if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_FIRE))
{
BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));
gBattlescriptCurrInstr = BattleScript_BRNPrevention;
i = FALSE;
}
else else
{ {
gBattleCommunication[MULTISTRING_CHOOSER] = 2; gBattleCommunication[MULTISTRING_CHOOSER] = 2;
@ -8725,7 +8706,7 @@ static void Cmd_various(void)
} }
else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP) else if (gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP)
{ {
if (targetAbility == ABILITY_INSOMNIA || targetAbility == ABILITY_VITAL_SPIRIT) if (!CanSleep(gBattlerTarget))
{ {
gBattlerAbility = gBattlerTarget; gBattlerAbility = gBattlerTarget;
// BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3)); // BattleScriptPush(T1_READ_PTR(gBattlescriptCurrInstr + 3));