{ "version": 3, "sources": ["../../../../../data/mods/partnersincrime/abilities.ts"], "sourcesContent": ["export const Abilities: {[k: string]: ModdedAbilityData} = {\r\n\tneutralizinggas: {\r\n\t\tinherit: true,\r\n\t\t// Ability suppression implemented in sim/pokemon.ts:Pokemon#ignoringAbility\r\n\t\tonPreStart(pokemon) {\r\n\t\t\tthis.add('-ability', pokemon, 'Neutralizing Gas');\r\n\t\t\tpokemon.abilityState.ending = false;\r\n\t\t\t// Remove setter's innates before the ability starts\r\n\t\t\tfor (const target of this.getAllActive()) {\r\n\t\t\t\tif (target.hasItem('Ability Shield')) {\r\n\t\t\t\t\tthis.add('-block', target, 'item: Ability Shield');\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif (target.illusion) {\r\n\t\t\t\t\tthis.singleEvent('End', this.dex.abilities.get('Illusion'), target.abilityState, target, pokemon, 'neutralizinggas');\r\n\t\t\t\t}\r\n\t\t\t\tif (target.volatiles['slowstart']) {\r\n\t\t\t\t\tdelete target.volatiles['slowstart'];\r\n\t\t\t\t\tthis.add('-end', target, 'Slow Start', '[silent]');\r\n\t\t\t\t}\r\n\t\t\t\tif (target.m.innate) {\r\n\t\t\t\t\tif (!this.dex.abilities.get(target.m.innate.slice(8)).isPermanent) {\r\n\t\t\t\t\t\ttarget.removeVolatile(target.m.innate);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonEnd(source) {\r\n\t\t\tthis.add('-end', source, 'ability: Neutralizing Gas');\r\n\r\n\t\t\t// FIXME this happens before the pokemon switches out, should be the opposite order.\r\n\t\t\t// Not an easy fix since we cant use a supported event. Would need some kind of special event that\r\n\t\t\t// gathers events to run after the switch and then runs them when the ability is no longer accessible.\r\n\t\t\t// (If you're tackling this, do note extreme weathers have the same issue)\r\n\r\n\t\t\t// Mark this pokemon's ability as ending so Pokemon#ignoringAbility skips it\r\n\t\t\tif (source.abilityState.ending) return;\r\n\t\t\tsource.abilityState.ending = true;\r\n\t\t\tconst sortedActive = this.getAllActive();\r\n\t\t\tthis.speedSort(sortedActive);\r\n\t\t\tfor (const pokemon of sortedActive) {\r\n\t\t\t\tif (pokemon !== source) {\r\n\t\t\t\t\t// Will be suppressed by Pokemon#ignoringAbility if needed\r\n\t\t\t\t\tthis.singleEvent('Start', pokemon.getAbility(), pokemon.abilityState, pokemon);\r\n\t\t\t\t}\r\n\t\t\t\tif (pokemon.m.innate) {\r\n\t\t\t\t\tif (!pokemon.volatiles[pokemon.m.innate]) pokemon.addVolatile(pokemon.m.innate, pokemon);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\ttrace: {\r\n\t\tinherit: true,\r\n\t\tonUpdate(pokemon) {\r\n\t\t\tif (!pokemon.isStarted || this.effectState.gaveUp) return;\r\n\t\t\tconst isAbility = pokemon.ability === 'trace';\r\n\r\n\t\t\tconst additionalBannedAbilities = [\r\n\t\t\t\t// Zen Mode included here for compatability with Gen 5-6\r\n\t\t\t\t'noability', 'flowergift', 'forecast', 'hungerswitch', 'illusion', 'imposter', 'neutralizinggas', 'powerofalchemy', 'receiver', 'trace', 'zenmode',\r\n\t\t\t];\r\n\t\t\tconst possibleTargets = pokemon.adjacentFoes().filter(target => (\r\n\t\t\t\t!target.getAbility().isPermanent && !additionalBannedAbilities.includes(target.ability)\r\n\t\t\t));\r\n\t\t\tif (!possibleTargets.length) return;\r\n\r\n\t\t\tconst target = this.sample(possibleTargets);\r\n\t\t\tconst ability = target.getAbility();\r\n\t\t\tthis.add('-ability', pokemon, ability, '[from] ability: Trace', '[of] ' + target);\r\n\t\t\tif (isAbility) {\r\n\t\t\t\tpokemon.setAbility(ability);\r\n\t\t\t} else {\r\n\t\t\t\tpokemon.removeVolatile('ability:trace');\r\n\t\t\t\tpokemon.addVolatile('ability:' + ability.id, pokemon);\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n};\r\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA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