Jofthomas's picture
Jofthomas HF staff
Upload 4781 files
5c2ed06 verified
{
"version": 3,
"sources": ["../../../../data/mods/pokemoves/abilities.ts"],
"sourcesContent": ["export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTable = {\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\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.pokemove && !this.dex.abilities.get(target.m.pokemove.abilities['0']).flags['cantsuppress']) {\n\t\t\t\t\ttarget.removeVolatile('ability:' + this.toID(target.m.pokemove.abilities['0']));\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.pokemove && !pokemon.volatiles['ability:' + this.toID(pokemon.m.pokemove.abilities['0'])]) {\n\t\t\t\t\tpokemon.addVolatile('ability:' + this.toID(pokemon.m.pokemove.abilities['0']), pokemon);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,MAAM,YAAyE;AAAA,EACrF,OAAO;AAAA,IACN,SAAS;AAAA,IACT,SAAS,SAAS;AACjB,UAAI,CAAC,KAAK,YAAY;AAAM;AAC5B,YAAM,YAAY,QAAQ,YAAY;AAEtC,YAAM,kBAAkB,QAAQ,aAAa,EAAE;AAAA,QAC9C,CAAAA,YAAU,CAACA,QAAO,WAAW,EAAE,MAAM,SAAS,KAAKA,QAAO,YAAY;AAAA,MACvE;A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