Spaces:
Running
Running
{ | |
"version": 3, | |
"sources": ["../../../../data/mods/sharedpower/abilities.ts"], | |
"sourcesContent": ["export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTable = {\n\tneutralizinggas: {\n\t\tinherit: true,\n\t\t// Ability suppression implemented in sim/pokemon.ts:Pokemon#ignoringAbility\n\t\tonSwitchIn(pokemon) {\n\t\t\tthis.add('-ability', pokemon, 'Neutralizing Gas');\n\t\t\tpokemon.abilityState.ending = false;\n\t\t\t// Remove setter's innates before the ability starts\n\t\t\tfor (const target of this.getAllActive()) {\n\t\t\t\tif (target.illusion) {\n\t\t\t\t\tthis.singleEvent('End', this.dex.abilities.get('Illusion'), target.abilityState, target, pokemon, 'neutralizinggas');\n\t\t\t\t}\n\t\t\t\tif (target.volatiles['slowstart']) {\n\t\t\t\t\tdelete target.volatiles['slowstart'];\n\t\t\t\t\tthis.add('-end', target, 'Slow Start', '[silent]');\n\t\t\t\t}\n\t\t\t\tif (target.m.abils?.length) {\n\t\t\t\t\tfor (const key of target.m.abils) {\n\t\t\t\t\t\tif (this.dex.abilities.get(key.slice(8)).flags['cantsuppress']) continue;\n\t\t\t\t\t\ttarget.removeVolatile(key);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\tonEnd(source) {\n\t\t\tthis.add('-end', source, 'ability: Neutralizing Gas');\n\n\t\t\t// FIXME this happens before the pokemon switches out, should be the opposite order.\n\t\t\t// Not an easy fix since we cant use a supported event. Would need some kind of special event that\n\t\t\t// gathers events to run after the switch and then runs them when the ability is no longer accessible.\n\t\t\t// (If you're tackling this, do note extreme weathers have the same issue)\n\n\t\t\t// Mark this pokemon's ability as ending so Pokemon#ignoringAbility skips it\n\t\t\tif (source.abilityState.ending) return;\n\t\t\tsource.abilityState.ending = true;\n\t\t\tconst sortedActive = this.getAllActive();\n\t\t\tthis.speedSort(sortedActive);\n\t\t\tfor (const pokemon of sortedActive) {\n\t\t\t\tif (pokemon !== source) {\n\t\t\t\t\t// Will be suppressed by Pokemon#ignoringAbility if needed\n\t\t\t\t\tthis.singleEvent('Start', pokemon.getAbility(), pokemon.abilityState, pokemon);\n\t\t\t\t}\n\t\t\t\tif (pokemon.m.abils?.length) {\n\t\t\t\t\tfor (const innate of pokemon.m.abils) {\n\t\t\t\t\t\t// permanent abilities\n\t\t\t\t\t\tif (pokemon.volatiles[innate]) continue;\n\t\t\t\t\t\tpokemon.addVolatile(innate, pokemon);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n\ttrace: {\n\t\tinherit: true,\n\t\tonUpdate(pokemon) {\n\t\t\tif (!this.effectState.seek) return;\n\t\t\tconst isAbility = pokemon.ability === 'trace';\n\n\t\t\tconst possibleTargets = pokemon.adjacentFoes().filter(\n\t\t\t\ttarget => !target.getAbility().flags['notrace'] && target.ability !== 'noability'\n\t\t\t);\n\t\t\tif (!possibleTargets.length) return;\n\n\t\t\tconst target = this.sample(possibleTargets);\n\t\t\tconst ability = target.getAbility();\n\n\t\t\tif (isAbility) {\n\t\t\t\tif (pokemon.setAbility(ability)) {\n\t\t\t\t\tthis.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpokemon.removeVolatile('ability:trace');\n\t\t\t\tpokemon.addVolatile('ability:' + ability.id, pokemon);\n\t\t\t\tthis.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`);\n\t\t\t}\n\t\t},\n\t},\n};\n"], | |
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,YAAyE;AAAA,EACrF,iBAAiB;AAAA,IAChB,SAAS;AAAA;AAAA,IAET,WAAW,SAAS;AACnB,WAAK,IAAI,YAAY,SAAS,kBAAkB;AAChD,cAAQ,aAAa,SAAS;AAE9B,iBAAW,UAAU,KAAK,aAAa,GAAG;AACzC,YAAI,OAAO,UAAU;AACpB,eAAK,YAAY,O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