[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
This commit is contained in:
parent
3f9eaf4a5d
commit
0af0ad5b49
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue