Jofthomas's picture
Jofthomas HF staff
Upload 4781 files
5c2ed06 verified
{
"version": 3,
"sources": ["../../../../data/mods/gen7pokebilities/abilities.ts"],
"sourcesContent": ["export const Abilities: import('../../../sim/dex-abilities').ModdedAbilityDataTable = {\n\tmummy: {\n\t\tinherit: true,\n\t\tonDamagingHit(damage, target, source, move) {\n\t\t\tif (target.ability === 'mummy') {\n\t\t\t\tconst sourceAbility = source.getAbility();\n\t\t\t\tif (sourceAbility.flags['cantsuppress'] || sourceAbility.id === 'mummy') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (this.checkMoveMakesContact(move, source, target, !source.isAlly(target))) {\n\t\t\t\t\tconst oldAbility = source.setAbility('mummy', target);\n\t\t\t\t\tif (oldAbility) {\n\t\t\t\t\t\tthis.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, `[of] ${source}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst possibleAbilities = [source.ability, ...(source.m.innates || [])]\n\t\t\t\t\t.filter(val => !this.dex.abilities.get(val).flags['cantsuppress'] && val !== 'mummy');\n\t\t\t\tif (!possibleAbilities.length) return;\n\t\t\t\tif (this.checkMoveMakesContact(move, source, target, !source.isAlly(target))) {\n\t\t\t\t\tconst abil = this.sample(possibleAbilities);\n\t\t\t\t\tif (abil === source.ability) {\n\t\t\t\t\t\tconst oldAbility = source.setAbility('mummy', target);\n\t\t\t\t\t\tif (oldAbility) {\n\t\t\t\t\t\t\tthis.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(oldAbility).name, `[of] ${source}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsource.removeVolatile('ability:' + abil);\n\t\t\t\t\t\tsource.addVolatile('ability:mummy', source);\n\t\t\t\t\t\tif (abil) {\n\t\t\t\t\t\t\tthis.add('-activate', target, 'ability: Mummy', this.dex.abilities.get(abil).name, `[of] ${source}`);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t},\n\tpowerofalchemy: {\n\t\tinherit: true,\n\t\tonAllyFaint(ally) {\n\t\t\tconst pokemon = this.effectState.target;\n\t\t\tif (!pokemon.hp) return;\n\t\t\tconst isAbility = pokemon.ability === 'powerofalchemy';\n\t\t\tlet possibleAbilities = [ally.ability];\n\t\t\tif (ally.m.innates) possibleAbilities.push(...ally.m.innates);\n\t\t\tconst additionalBannedAbilities = [pokemon.ability, ...(pokemon.m.innates || [])];\n\t\t\tpossibleAbilities = possibleAbilities\n\t\t\t\t.filter(val => !this.dex.abilities.get(val).flags['noreceiver'] && !additionalBannedAbilities.includes(val));\n\t\t\tif (!possibleAbilities.length) return;\n\t\t\tconst ability = this.dex.abilities.get(possibleAbilities[this.random(possibleAbilities.length)]);\n\t\t\tthis.add('-ability', pokemon, ability, '[from] ability: Power of Alchemy', `[of] ${ally}`);\n\t\t\tif (isAbility) {\n\t\t\t\tpokemon.setAbility(ability);\n\t\t\t} else {\n\t\t\t\tpokemon.removeVolatile(\"ability:powerofalchemy\");\n\t\t\t\tpokemon.addVolatile(`ability:${ability}`, pokemon);\n\t\t\t}\n\t\t},\n\t},\n\treceiver: {\n\t\tinherit: true,\n\t\tonAllyFaint(ally) {\n\t\t\tconst pokemon = this.effectState.target;\n\t\t\tif (!pokemon.hp) return;\n\t\t\tconst isAbility = pokemon.ability === 'receiver';\n\t\t\tlet possibleAbilities = [ally.ability];\n\t\t\tif (ally.m.innates) possibleAbilities.push(...ally.m.innates);\n\t\t\tconst additionalBannedAbilities = [pokemon.ability, ...(pokemon.m.innates || [])];\n\t\t\tpossibleAbilities = possibleAbilities\n\t\t\t\t.filter(val => !this.dex.abilities.get(val).flags['noreceiver'] && !additionalBannedAbilities.includes(val));\n\t\t\tif (!possibleAbilities.length) return;\n\t\t\tconst ability = this.dex.abilities.get(possibleAbilities[this.random(possibleAbilities.length)]);\n\t\t\tthis.add('-ability', pokemon, ability, '[from] ability: Receiver', `[of] ${ally}`);\n\t\t\tif (isAbility) {\n\t\t\t\tpokemon.setAbility(ability);\n\t\t\t} else {\n\t\t\t\tpokemon.removeVolatile(\"ability:receiver\");\n\t\t\t\tpokemon.addVolatile(`ability:${ability}`, pokemon);\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\t\t\tconst possibleTargets: Pokemon[] = [];\n\t\t\tfor (const target of pokemon.side.foe.active) {\n\t\t\t\tif (target && !target.fainted) {\n\t\t\t\t\tpossibleTargets.push(target);\n\t\t\t\t}\n\t\t\t}\n\t\t\twhile (possibleTargets.length) {\n\t\t\t\tconst rand = this.random(possibleTargets.length);\n\t\t\t\tconst target = possibleTargets[rand];\n\t\t\t\tlet possibleAbilities = [target.ability];\n\t\t\t\tif (target.m.innates) possibleAbilities.push(...target.m.innates);\n\t\t\t\tconst additionalBannedAbilities = [pokemon.ability, ...(pokemon.m.innates || [])];\n\t\t\t\tpossibleAbilities = possibleAbilities\n\t\t\t\t\t.filter(val => !this.dex.abilities.get(val).flags['notrace'] && !additionalBannedAbilities.includes(val));\n\t\t\t\tif (!possibleAbilities.length) {\n\t\t\t\t\tpossibleTargets.splice(rand, 1);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst ability = this.dex.abilities.get(this.sample(possibleAbilities));\n\t\t\t\tthis.add('-ability', pokemon, ability, '[from] ability: Trace', `[of] ${target}`);\n\t\t\t\tif (isAbility) {\n\t\t\t\t\tpokemon.setAbility(ability);\n\t\t\t\t} else {\n\t\t\t\t\tpokemon.removeVolatile(\"ability:trace\");\n\t\t\t\t\tpokemon.addVolatile(`ability:${ability}`, pokemon);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t},\n};\n"],
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AA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