From 0af0ad5b4917cac010bcb5ee2a92d1c03ec41a2c Mon Sep 17 00:00:00 2001 From: SeafoamQueen <167576411+SeafoamQueen@users.noreply.github.com> Date: Sat, 8 Jun 2024 15:46:16 -0400 Subject: [PATCH] [Bug] Fix run away ability (#1890) * Added fix for Run Away ability being trapped by trapping abilities. Added fix for ghost type pokemon not having a 100% chance to run from battles. * Removed log statement * Removed commented out code * Removed ghost type run away mechanics --- src/data/ability.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/data/ability.ts b/src/data/ability.ts index ebaf1f47504..f36ce64adef 100755 --- a/src/data/ability.ts +++ b/src/data/ability.ts @@ -2949,6 +2949,7 @@ export class ArenaTrapAbAttr extends CheckTrappedAbAttr { /** * Checks if enemy Pokemon is trapped by an Arena Trap-esque ability * If the enemy is a Ghost type, it is not trapped + * If the enemy has the ability Run Away, it is not trapped. * If the user has Magnet Pull and the enemy is not a Steel type, it is not trapped. * If the user has Arena Trap and the enemy is not grounded, it is not trapped. * @param pokemon The {@link Pokemon} with this {@link AbAttr} @@ -2963,6 +2964,9 @@ export class ArenaTrapAbAttr extends CheckTrappedAbAttr { if (otherPokemon.getTypes(true).includes(Type.GHOST) || (otherPokemon.getTypes(true).includes(Type.STELLAR) && otherPokemon.getTypes().includes(Type.GHOST))) { trapped.value = false; return false; + } else if (otherPokemon.hasAbility(Abilities.RUN_AWAY)) { + trapped.value = false; + return false; } trapped.value = true; return true;