Merge pull request #1479 from BuffelSaft/orb_fix

Fix Toxic Orb and Flame Orb affecting Pokemon they shouldn't
This commit is contained in:
ghoulslash 2021-05-04 09:31:58 -06:00 committed by GitHub
commit e343090a8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6270,7 +6270,9 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
case HOLD_EFFECT_TOXIC_ORB:
if (!gBattleMons[battlerId].status1
&& CanPoisonType(battlerId, battlerId)
&& GetBattlerAbility(battlerId) != ABILITY_IMMUNITY)
&& GetBattlerAbility(battlerId) != ABILITY_IMMUNITY
&& GetBattlerAbility(battlerId) != ABILITY_COMATOSE
&& IsBattlerAlive)
{
effect = ITEM_STATUS_CHANGE;
gBattleMons[battlerId].status1 = STATUS1_TOXIC_POISON;
@ -6281,7 +6283,10 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
case HOLD_EFFECT_FLAME_ORB:
if (!gBattleMons[battlerId].status1
&& !IS_BATTLER_OF_TYPE(battlerId, TYPE_FIRE)
&& GetBattlerAbility(battlerId) != ABILITY_WATER_VEIL)
&& GetBattlerAbility(battlerId) != ABILITY_WATER_VEIL
&& GetBattlerAbility(battlerId) != ABILITY_WATER_BUBBLE
&& GetBattlerAbility(battlerId) != ABILITY_COMATOSE
&& IsBattlerAlive)
{
effect = ITEM_STATUS_CHANGE;
gBattleMons[battlerId].status1 = STATUS1_BURN;