{ "version": 3, "sources": ["../../../../../data/mods/ssb/abilities.ts"], "sourcesContent": ["import {SSBSet, ssbSets} from \"./random-teams\";\r\nimport {getName} from './conditions';\r\n\r\n// Used in many abilities, placed here to reduce the number of updates needed and to reduce the chance of errors\r\nconst STRONG_WEATHERS = ['desolateland', 'primordialsea', 'deltastream', 'heavyhailstorm', 'winterhail', 'turbulence'];\r\n\r\n/**\r\n * Assigns a new set to a Pok\u00E9mon\r\n * @param pokemon the Pokemon to assign the set to\r\n * @param newSet the SSBSet to assign\r\n */\r\nexport function changeSet(context: Battle, pokemon: Pokemon, newSet: SSBSet, changeAbility = false) {\r\n\tif (pokemon.transformed) return;\r\n\tconst evs: StatsTable = {\r\n\t\thp: newSet.evs?.hp || 0,\r\n\t\tatk: newSet.evs?.atk || 0,\r\n\t\tdef: newSet.evs?.def || 0,\r\n\t\tspa: newSet.evs?.spa || 0,\r\n\t\tspd: newSet.evs?.spd || 0,\r\n\t\tspe: newSet.evs?.spe || 0,\r\n\t};\r\n\tconst ivs: StatsTable = {\r\n\t\thp: newSet.ivs?.hp || 31,\r\n\t\tatk: newSet.ivs?.atk || 31,\r\n\t\tdef: newSet.ivs?.def || 31,\r\n\t\tspa: newSet.ivs?.spa || 31,\r\n\t\tspd: newSet.ivs?.spd || 31,\r\n\t\tspe: newSet.ivs?.spe || 31,\r\n\t};\r\n\tpokemon.set.evs = evs;\r\n\tpokemon.set.ivs = ivs;\r\n\tif (newSet.nature) pokemon.set.nature = Array.isArray(newSet.nature) ? context.sample(newSet.nature) : newSet.nature;\r\n\tconst oldShiny = pokemon.set.shiny;\r\n\tpokemon.set.shiny = (typeof newSet.shiny === 'number') ? context.randomChance(1, newSet.shiny) : !!newSet.shiny;\r\n\tlet percent = (pokemon.hp / pokemon.baseMaxhp);\r\n\tif (newSet.species === 'Shedinja') percent = 1;\r\n\tpokemon.formeChange(newSet.species, context.effect, true);\r\n\tconst details = pokemon.species.name + (pokemon.level === 100 ? '' : ', L' + pokemon.level) +\r\n\t\t(pokemon.gender === '' ? '' : ', ' + pokemon.gender) + (pokemon.set.shiny ? ', shiny' : '');\r\n\tif (oldShiny !== pokemon.set.shiny) context.add('replace', pokemon, details);\r\n\tif (changeAbility) pokemon.setAbility(newSet.ability as string);\r\n\r\n\tpokemon.baseMaxhp = pokemon.species.name === 'Shedinja' ? 1 : Math.floor(Math.floor(\r\n\t\t2 * pokemon.species.baseStats.hp + pokemon.set.ivs.hp + Math.floor(pokemon.set.evs.hp / 4) + 100\r\n\t) * pokemon.level / 100 + 10);\r\n\tconst newMaxHP = pokemon.baseMaxhp;\r\n\tpokemon.hp = Math.round(newMaxHP * percent);\r\n\tpokemon.maxhp = newMaxHP;\r\n\tcontext.add('-heal', pokemon, pokemon.getHealth, '[silent]');\r\n\tif (pokemon.item) {\r\n\t\tlet item = newSet.item;\r\n\t\tif (typeof item !== 'string') item = item[context.random(item.length)];\r\n\t\tif (context.toID(item) !== (pokemon.item || pokemon.lastItem)) pokemon.setItem(item);\r\n\t}\r\n\tif (!pokemon.m.datacorrupt) {\r\n\t\tconst newMoves = changeMoves(context, pokemon, newSet.moves.concat(newSet.signatureMove));\r\n\t\tpokemon.moveSlots = newMoves;\r\n\t\t// @ts-ignore Necessary so pokemon doesn't get 8 moves\r\n\t\tpokemon.baseMoveSlots = newMoves;\r\n\t}\r\n\tcontext.add('-ability', pokemon, `${pokemon.getAbility().name}`);\r\n\tcontext.add('message', `${pokemon.name} changed form!`);\r\n}\r\n\r\n/**\r\n * Assigns new moves to a Pokemon\r\n * @param pokemon The Pokemon whose moveset is to be modified\r\n * @param newSet The set whose moves should be assigned\r\n */\r\nexport function changeMoves(context: Battle, pokemon: Pokemon, newMoves: (string | string[])[]) {\r\n\tconst carryOver = pokemon.moveSlots.slice().map(m => m.pp / m.maxpp);\r\n\t// In case there are ever less than 4 moves\r\n\twhile (carryOver.length < 4) {\r\n\t\tcarryOver.push(1);\r\n\t}\r\n\tconst result = [];\r\n\tlet slot = 0;\r\n\tfor (const newMove of newMoves) {\r\n\t\tconst moveName = Array.isArray(newMove) ? newMove[context.random(newMove.length)] : newMove;\r\n\t\tconst move = context.dex.moves.get(context.toID(moveName));\r\n\t\tif (!move.id) continue;\r\n\t\tconst moveSlot = {\r\n\t\t\tmove: move.name,\r\n\t\t\tid: move.id,\r\n\t\t\t// eslint-disable-next-line max-len\r\n\t\t\tpp: ((move.noPPBoosts || move.isZ) ? Math.floor(move.pp * carryOver[slot]) : Math.floor((move.pp * (8 / 5)) * carryOver[slot])),\r\n\t\t\tmaxpp: ((move.noPPBoosts || move.isZ) ? move.pp : move.pp * 8 / 5),\r\n\t\t\ttarget: move.target,\r\n\t\t\tdisabled: false,\r\n\t\t\tdisabledSource: '',\r\n\t\t\tused: false,\r\n\t\t};\r\n\t\tresult.push(moveSlot);\r\n\t\tslot++;\r\n\t}\r\n\treturn result;\r\n}\r\n\r\nexport const Abilities: {[k: string]: ModdedAbilityData} = {\r\n\t/*\r\n\t// Example\r\n\t\"abilityid\": {\r\n\t\tdesc: \"\", // long description\r\n\t\tshortDesc: \"\", // short description, shows up in /dt\r\n\t\tname: \"Ability Name\",\r\n\t\t// The bulk of an ability is not easily shown in an example since it varies\r\n\t\t// For more examples, see https://github.com/smogon/pokemon-showdown/blob/master/data/abilities.js\r\n\t},\r\n\t*/\r\n\t// Please keep abilites organized alphabetically based on staff member name!\r\n\t// Aelita\r\n\tscyphozoa: {\r\n\t\tdesc: \"On switch-in, this Pokemon removes all field conditions, entry hazards, and stat boosts on both sides, gaining one random boost for every field condition, entry hazard, or boosted stat that gets cleared. This Pokemon's moves ignore abilities. If this Pokemon is a Zygarde in its 10% or 50% Forme, it changes to Complete Forme when it has 1/2 or less of its maximum HP at the end of the turn.\",\r\n\t\tshortDesc: \"Power Construct + Mold Breaker. On switch-in, clears everything for random boosts.\",\r\n\t\tname: \"Scyphozoa\",\r\n\t\tonSwitchIn(source) {\r\n\t\t\tlet successes = 0;\r\n\t\t\tthis.add('-ability', source, 'Scyphozoa');\r\n\t\t\tthis.add('-clearallboost');\r\n\t\t\tfor (const pokemon of this.getAllActive()) {\r\n\t\t\t\tconst boostTotal = Object.values(pokemon.boosts).reduce((num, add) => num + add);\r\n\t\t\t\tif (boostTotal !== 0 || pokemon.positiveBoosts()) successes++;\r\n\t\t\t\tpokemon.clearBoosts();\r\n\t\t\t\tif (pokemon.removeVolatile('substitute')) successes++;\r\n\t\t\t}\r\n\t\t\tconst target = source.side.foe.active[0];\r\n\r\n\t\t\tconst removeAll = [\r\n\t\t\t\t'reflect', 'lightscreen', 'auroraveil', 'safeguard', 'mist', 'gmaxsteelsurge',\r\n\t\t\t\t'spikes', 'toxicspikes', 'stealthrock', 'stickyweb',\r\n\t\t\t];\r\n\t\t\tconst silentRemove = ['reflect', 'lightscreen', 'auroraveil', 'safeguard', 'mist'];\r\n\t\t\tfor (const sideCondition of removeAll) {\r\n\t\t\t\tif (target.side.removeSideCondition(sideCondition)) {\r\n\t\t\t\t\tif (!silentRemove.includes(sideCondition)) {\r\n\t\t\t\t\t\tthis.add('-sideend', target.side, this.dex.conditions.get(sideCondition).name, '[from] ability: Scyphozoa', '[of] ' + source);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsuccesses++;\r\n\t\t\t\t}\r\n\t\t\t\tif (source.side.removeSideCondition(sideCondition)) {\r\n\t\t\t\t\tif (!silentRemove.includes(sideCondition)) {\r\n\t\t\t\t\t\tthis.add('-sideend', source.side, this.dex.conditions.get(sideCondition).name, '[from] ability: Scyphozoa', '[of] ' + source);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tsuccesses++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor (const clear in this.field.pseudoWeather) {\r\n\t\t\t\tif (clear.endsWith('mod') || clear.endsWith('clause')) continue;\r\n\t\t\t\tthis.field.removePseudoWeather(clear);\r\n\t\t\t\tsuccesses++;\r\n\t\t\t}\r\n\t\t\tif (this.field.clearWeather()) successes++;\r\n\t\t\tif (this.field.clearTerrain()) successes++;\r\n\t\t\tconst stats: BoostID[] = [];\r\n\t\t\tconst exclude: string[] = ['accuracy', 'evasion'];\r\n\t\t\tfor (let x = 0; x < successes; x++) {\r\n\t\t\t\tlet stat: BoostID;\r\n\t\t\t\tfor (stat in source.boosts) {\r\n\t\t\t\t\tif (source.boosts[stat] < 6 && !exclude.includes(stat)) {\r\n\t\t\t\t\t\tstats.push(stat);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (stats.length) {\r\n\t\t\t\t\tconst randomStat = this.sample(stats);\r\n\t\t\t\t\tconst boost: SparseBoostsTable = {};\r\n\t\t\t\t\tboost[randomStat] = 1;\r\n\t\t\t\t\tthis.boost(boost, source, source);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tisPermanent: true,\r\n\t\tonModifyMove(move) {\r\n\t\t\tmove.ignoreAbility = true;\r\n\t\t},\r\n\t\tonResidualOrder: 27,\r\n\t\tonResidual(pokemon) {\r\n\t\t\tif (pokemon.baseSpecies.baseSpecies !== 'Zygarde' || pokemon.transformed || !pokemon.hp) return;\r\n\t\t\tif (pokemon.species.id === 'zygardecomplete' || pokemon.hp > pokemon.maxhp / 2) return;\r\n\t\t\tthis.add('-activate', pokemon, 'ability: Scyphozoa');\r\n\t\t\tpokemon.formeChange('Zygarde-Complete', this.effect, true);\r\n\t\t\tpokemon.baseMaxhp = Math.floor(Math.floor(\r\n\t\t\t\t2 * pokemon.species.baseStats['hp'] + pokemon.set.ivs['hp'] + Math.floor(pokemon.set.evs['hp'] / 4) + 100\r\n\t\t\t) * pokemon.level / 100 + 10);\r\n\t\t\tconst newMaxHP = pokemon.volatiles['dynamax'] ? (2 * pokemon.baseMaxhp) : pokemon.baseMaxhp;\r\n\t\t\tpokemon.hp = newMaxHP - (pokemon.maxhp - pokemon.hp);\r\n\t\t\tpokemon.maxhp = newMaxHP;\r\n\t\t\tthis.add('-heal', pokemon, pokemon.getHealth, '[silent]');\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// aegii\r\n\tsetthestage: {\r\n\t\tdesc: \"If this Pokemon is an Aegislash, it changes to Blade Forme before attempting to use an attacking move, and changes to Shield Forme before attempting to use King's Shield. This Pokemon's moves that match one of its types have a same-type attack bonus (STAB) of 2 instead of 1.5. On switch-in, this Pokemon selects a physical or special set.\",\r\n\t\tshortDesc: \"Stance Change + Adaptability; on switch-in, selects physical or special set.\",\r\n\t\tisPermanent: true,\r\n\t\tonSwitchIn(pokemon) {\r\n\t\t\tif (pokemon.species.baseSpecies !== 'Aegislash') return;\r\n\t\t\tconst forme = this.randomChance(1, 2) ? 'aegii-Alt' : 'aegii';\r\n\t\t\tchangeSet(this, pokemon, ssbSets[forme]);\r\n\t\t\tconst setType = pokemon.moves.includes('shadowball') ? 'specially' : 'physically';\r\n\t\t\tthis.add('-message', `aegii currently has a ${setType} oriented set.`);\r\n\t\t},\r\n\t\tonModifyMove(move, attacker, defender) {\r\n\t\t\tmove.stab = 2;\r\n\t\t\tif (attacker.species.baseSpecies !== 'Aegislash' || attacker.transformed) return;\r\n\t\t\tif (move.category === 'Status' && move.id !== 'kingsshield' && move.id !== 'reset') return;\r\n\t\t\tconst targetForme = (move.id === 'kingsshield' || move.id === 'reset' ? 'Aegislash' : 'Aegislash-Blade');\r\n\t\t\tif (attacker.species.name !== targetForme) attacker.formeChange(targetForme);\r\n\t\t},\r\n\t\tname: \"Set the Stage\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Aeonic\r\n\tarsene: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Sandstorm. If Sandstorm is active, this Pokemon's Speed is doubled. This Pokemon takes no damage from Sandstorm.\",\r\n\t\tshortDesc: \"Sand Stream + Sand Rush.\",\r\n\t\tname: \"Arsene\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('sandstorm');\r\n\t\t},\r\n\t\tonModifySpe(spe, pokemon) {\r\n\t\t\tif (this.field.isWeather('sandstorm')) {\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonImmunity(type) {\r\n\t\t\tif (type === 'sandstorm') return false;\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Aethernum\r\n\trainyseason: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Rain Dance. If Rain Dance or Heavy Rain is active, this Pokemon has doubled Speed, collects a raindrop, and restores 1/8 of its maximum HP, rounded down, at the end of each turn. If this Pokemon is holding Big Root, it will restore 1/6 of its maximum HP, rounded down, at the end of the turn. If this Pokemon is holding Utility Umbrella, its HP does not get restored and it does not collect raindrops. Each raindrop raises this Pokemon's Defense and Special Defense by 1 stage while it is collected.\",\r\n\t\tshortDesc: \"Drizzle + Swift Swim. Restore HP if raining. Collect raindrops.\",\r\n\t\tname: \"Rainy Season\",\r\n\t\tisPermanent: true,\r\n\t\tonStart(source) {\r\n\t\t\tfor (const action of this.queue) {\r\n\t\t\t\tif (action.choice === 'runPrimal' && action.pokemon === source && source.species.id === 'kyogre') return;\r\n\t\t\t\tif (action.choice !== 'runSwitch' && action.choice !== 'runPrimal') break;\r\n\t\t\t}\r\n\t\t\tthis.field.setWeather('raindance');\r\n\t\t},\r\n\t\tonWeather(target, source, effect) {\r\n\t\t\tif (target.hasItem('utilityumbrella')) return;\r\n\t\t\tif (['raindance', 'primordialsea'].includes(effect.id)) {\r\n\t\t\t\tthis.heal(target.baseMaxhp / (target.hasItem('bigroot') ? 6 : 8));\r\n\t\t\t\ttarget.addVolatile('raindrop');\r\n\t\t\t}\r\n\t\t},\r\n\t\tonModifySpe(spe, pokemon) {\r\n\t\t\tif (['raindance', 'primordialsea'].includes(pokemon.effectiveWeather())) {\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Akir\r\n\tfortifications: {\r\n\t\tdesc: \"Pokemon making contact with this Pokemon lose 1/8 of their maximum HP, rounded down. At the end of every turn, this Pokemon Restores 1/16 of its max HP.\",\r\n\t\tshortDesc: \"Foe loses 1/8 HP if makes contact; Restores 1/16 of its max HP every turn.\",\r\n\t\tonDamagingHitOrder: 1,\r\n\t\tonDamagingHit(damage, target, source, move) {\r\n\t\t\tif (this.checkMoveMakesContact(move, source, target, true)) {\r\n\t\t\t\tthis.damage(source.baseMaxhp / 8, source, target);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonResidual(pokemon) {\r\n\t\t\tthis.heal(pokemon.baseMaxhp / 16);\r\n\t\t},\r\n\t\tname: \"Fortifications\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Alpha\r\n\ticeage: {\r\n\t\tdesc: \"The weather becomes an extremely heavy hailstorm that prevents damaging Steel-type moves from executing, causes Ice-type moves to be 50% stronger, causes all non-Ice-type Pokemon on the opposing side to take 1/8 damage from hail, and causes all moves to have a 10% chance to freeze. This weather bypasses Magic Guard and Overcoat. This weather remains in effect until the 3 turns are up, or the weather is changed by Delta Stream, Desolate Land, or Primordial Sea.\",\r\n\t\tshortDesc: \"Weather: Steel fail. 1.5x Ice.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('heavyhailstorm');\r\n\t\t},\r\n\t\tonAnySetWeather(target, source, weather) {\r\n\t\t\tif (this.field.getWeather().id === 'heavyhailstorm' && !STRONG_WEATHERS.includes(weather.id)) return false;\r\n\t\t},\r\n\t\tonEnd(pokemon) {\r\n\t\t\tif (this.field.weatherState.source !== pokemon) return;\r\n\t\t\tfor (const target of this.getAllActive()) {\r\n\t\t\t\tif (target === pokemon) continue;\r\n\t\t\t\tif (target.hasAbility('iceage')) {\r\n\t\t\t\t\tthis.field.weatherState.source = target;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.field.clearWeather();\r\n\t\t},\r\n\t\tname: \"Ice Age\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Annika\r\n\toverprotective: {\r\n\t\tdesc: \"If this Pokemon is the last unfainted team member, its Speed is raised by 1 stage.\",\r\n\t\tshortDesc: \"+1 Speed on switch-in if all other team members have fainted.\",\r\n\t\tonSwitchIn(pokemon) {\r\n\t\t\tif (pokemon.side.pokemonLeft === 1) this.boost({spe: 1});\r\n\t\t},\r\n\t\tname: \"Overprotective\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// A Quag To The Past\r\n\tcarefree: {\r\n\t\tdesc: \"This Pokemon blocks certain status moves and instead uses the move against the original user. This Pokemon ignores other Pokemon's Attack, Special Attack, and accuracy stat stages when taking damage, and ignores other Pokemon's Defense, Special Defense, and evasiveness stat stages when dealing damage.\",\r\n\t\tshortDesc: \"Magic Bounce + Unaware.\",\r\n\t\tonAnyModifyBoost(boosts, pokemon) {\r\n\t\t\tconst unawareUser = this.effectState.target;\r\n\t\t\tif (unawareUser === pokemon) return;\r\n\t\t\tif (unawareUser === this.activePokemon && pokemon === this.activeTarget) {\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['evasion'] = 0;\r\n\t\t\t}\r\n\t\t\tif (pokemon === this.activePokemon && unawareUser === this.activeTarget) {\r\n\t\t\t\tboosts['atk'] = 0;\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spa'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['accuracy'] = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonTryHitPriority: 1,\r\n\t\tonTryHit(target, source, move) {\r\n\t\t\tif (target === source || move.hasBounced || !move.flags['reflectable']) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst newMove = this.dex.getActiveMove(move.id);\r\n\t\t\tnewMove.hasBounced = true;\r\n\t\t\tnewMove.pranksterBoosted = false;\r\n\t\t\tthis.add('-ability', target, 'Carefree');\r\n\t\t\tthis.actions.useMove(newMove, target, source);\r\n\t\t\treturn null;\r\n\t\t},\r\n\t\tonAllyTryHitSide(target, source, move) {\r\n\t\t\tif (target.isAlly(source) || move.hasBounced || !move.flags['reflectable']) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst newMove = this.dex.getActiveMove(move.id);\r\n\t\t\tnewMove.hasBounced = true;\r\n\t\t\tnewMove.pranksterBoosted = false;\r\n\t\t\tthis.add('-ability', target, 'Carefree');\r\n\t\t\tthis.actions.useMove(newMove, this.effectState.target, source);\r\n\t\t\treturn null;\r\n\t\t},\r\n\t\tcondition: {\r\n\t\t\tduration: 1,\r\n\t\t},\r\n\t\tname: \"Carefree\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Arby\r\n\twavesurge: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Wave Terrain for 5 turns. During the effect, the accuracy of Water-type moves is multiplied by 1.2, all current entry hazards are removed, and no entry hazards can be set.\",\r\n\t\tshortDesc: \"On switch-in, 5 turns: no hazards; Water move acc 1.2x.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setTerrain('waveterrain');\r\n\t\t},\r\n\t\tname: \"Wave Surge\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Archas\r\n\tindomitable: {\r\n\t\tdesc: \"This Pokemon cures itself if it is confused or has a major status condition. Single use.\",\r\n\t\tonUpdate(pokemon) {\r\n\t\t\tif ((pokemon.status || pokemon.volatiles['confusion']) && !this.effectState.indomitableActivated) {\r\n\t\t\t\tthis.add('-activate', pokemon, 'ability: Indomitable');\r\n\t\t\t\tpokemon.cureStatus();\r\n\t\t\t\tpokemon.removeVolatile('confusion');\r\n\t\t\t\tthis.effectState.indomitableActivated = true;\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Indomitable\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// biggie\r\n\tsuperarmor: {\r\n\t\tdesc: \"Reduces damage taken from physical moves by 25% if the user has not yet attacked.\",\r\n\t\tonSourceModifyDamage(damage, source, target, move) {\r\n\t\t\tif (this.queue.willMove(target) && move.category === 'Physical') {\r\n\t\t\t\treturn this.chainModify(0.75);\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Super Armor\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Billo\r\n\tproofpolicy: {\r\n\t\tdesc: \"Pokemon making contact with this Pokemon have the effects of Yawn, Taunt, and Torment applied to them.\",\r\n\t\tshortDesc: \"Upon contact, opposing Pokemon is made drowsy and applies Taunt + Torment.\",\r\n\t\tonDamagingHit(damage, target, source, move) {\r\n\t\t\tif (this.checkMoveMakesContact(move, source, target, true)) {\r\n\t\t\t\tsource.addVolatile('taunt', target);\r\n\t\t\t\tsource.addVolatile('yawn', target);\r\n\t\t\t\tsource.addVolatile('torment', target);\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Proof Policy\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Brandon\r\n\tbanesurge: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Bane Terrain for 5 turns. For the duration of the effect, all Pokemon use their weaker offensive stat for all attacks. The move category used does not change.\",\r\n\t\tshortDesc: \"On switch-in, 5 turns: all Pokemon use weaker offensive stat.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setTerrain('baneterrain');\r\n\t\t},\r\n\t\tname: \"Bane Surge\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// brouha\r\n\tturbulence: {\r\n\t\tdesc: \"While this Pokemon is on the field, all entry hazards and terrains are removed at the end of each turn, non-Flying-type Pokemon lose 6% of their HP, rounded down, at the end of each turn.\",\r\n\t\tshortDesc: \"End of each turn: clears terrain/hazards, non-Flying lose 6% HP.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('turbulence');\r\n\t\t},\r\n\t\tonAnySetWeather(target, source, weather) {\r\n\t\t\tif (this.field.getWeather().id === 'turbulence' && !STRONG_WEATHERS.includes(weather.id)) return false;\r\n\t\t},\r\n\t\tonEnd(pokemon) {\r\n\t\t\tif (this.field.weatherState.source !== pokemon) return;\r\n\t\t\tfor (const target of this.getAllActive()) {\r\n\t\t\t\tif (target === pokemon) continue;\r\n\t\t\t\tif (target.hasAbility('turbulence')) {\r\n\t\t\t\t\tthis.field.weatherState.source = target;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.field.clearWeather();\r\n\t\t},\r\n\t\tname: \"Turbulence\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Buffy\r\n\tspeedcontrol: {\r\n\t\tonStart(pokemon) {\r\n\t\t\tthis.boost({spe: 1}, pokemon);\r\n\t\t},\r\n\t\tdesc: \"On switch-in, this Pokemon's Speed is raised by 1 stage.\",\r\n\t\tname: \"Speed Control\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// cant say\r\n\tragequit: {\r\n\t\tdesc: \"If a Pokemon with this ability uses a move that misses or fails, the Pokemon faints and reduces the foe's Attack and Special Attack by 2 stages\",\r\n\t\tshortDesc: \"If move misses or fails, use Memento.\",\r\n\t\tname: \"Rage Quit\",\r\n\t\tonAfterMove(pokemon, target, move) {\r\n\t\t\tif (pokemon.moveThisTurnResult === false) {\r\n\t\t\t\tthis.add('-ability', pokemon, 'Rage Quit');\r\n\t\t\t\tpokemon.faint();\r\n\t\t\t\tif (pokemon.side.foe.active[0]) {\r\n\t\t\t\t\tthis.boost({atk: -2, spa: -2}, pokemon.side.foe.active[0], pokemon, null, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Celine\r\n\tguardianarmor: {\r\n\t\tdesc: \"On switch-in, this Pokemon's Defense and Special Defense are raised by 2 stages.\",\r\n\t\tname: \"Guardian Armor\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tthis.boost({def: 2, spd: 2}, pokemon);\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// drampa's grandpa\r\n\toldmanpa: {\r\n\t\tdesc: \"This Pokemon's sound-based moves have their power multiplied by 1.3. This Pokemon takes halved damage from sound-based moves. This Pokemon ignores other Pokemon's Attack, Special Attack, and accuracy stat stages when taking damage, and ignores other Pokemon's Defense, Special Defense, and evasiveness stat stages when dealing damage. Upon switching in, this Pokemon's Defense and Special Defense are raised by 1 stage.\",\r\n\t\tshortDesc: \"Effects of Punk Rock + Unaware. On switch-in, boosts Def and Sp. Def by 1.\",\r\n\t\tname: \"Old Manpa\",\r\n\t\tonBasePowerPriority: 7,\r\n\t\tonBasePower(basePower, attacker, defender, move) {\r\n\t\t\tif (move.flags['sound']) {\r\n\t\t\t\tthis.debug('Old Manpa boost');\r\n\t\t\t\treturn this.chainModify([5325, 4096]);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonSourceModifyDamage(damage, source, target, move) {\r\n\t\t\tif (move.flags['sound']) {\r\n\t\t\t\tthis.debug('Old Manpa weaken');\r\n\t\t\t\treturn this.chainModify(0.5);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonAnyModifyBoost(boosts, pokemon) {\r\n\t\t\tconst unawareUser = this.effectState.target;\r\n\t\t\tif (unawareUser === pokemon) return;\r\n\t\t\tif (unawareUser === this.activePokemon && pokemon === this.activeTarget) {\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['evasion'] = 0;\r\n\t\t\t}\r\n\t\t\tif (pokemon === this.activePokemon && unawareUser === this.activeTarget) {\r\n\t\t\t\tboosts['atk'] = 0;\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spa'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['accuracy'] = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonStart(pokemon) {\r\n\t\t\tthis.boost({def: 1, spd: 1});\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// dream\r\n\tgreedpunisher: {\r\n\t\tdesc: \"This Pokemon can only be damaged by direct attacks. On switch-in, this Pokemon's stats are boosted based on the number of hazards on the field. 1 random stat is raised if 1-2 hazards are up, and 2 random stats are raised if 3 or more hazards are up.\",\r\n\t\tshortDesc: \"On switch-in, boosts stats based on the number of hazards on this Pokemon's side.\",\r\n\t\tname: \"Greed Punisher\",\r\n\t\tonSwitchIn(pokemon) {\r\n\t\t\tconst side = pokemon.side;\r\n\t\t\tconst sideConditions = Object.keys(side.sideConditions);\r\n\t\t\tconst activeCount = sideConditions.length;\r\n\t\t\tconst stats: BoostID[] = [];\r\n\t\t\tconst exclude: string[] = ['accuracy', 'evasion'];\r\n\t\t\tfor (let x = 0; x < activeCount; x++) {\r\n\t\t\t\tlet stat: BoostID;\r\n\t\t\t\tfor (stat in pokemon.boosts) {\r\n\t\t\t\t\tif (pokemon.boosts[stat] < 6 && !exclude.includes(stat)) {\r\n\t\t\t\t\t\tstats.push(stat);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (stats.length) {\r\n\t\t\t\t\tconst randomStat = this.sample(stats);\r\n\t\t\t\t\tconst boost: SparseBoostsTable = {};\r\n\t\t\t\t\tboost[randomStat] = 1;\r\n\t\t\t\t\tthis.boost(boost, pokemon, pokemon);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (effect.id === 'heavyhailstorm') return;\r\n\t\t\tif (effect.effectType !== 'Move') {\r\n\t\t\t\tif (effect.effectType === 'Ability') this.add('-activate', source, 'ability: ' + effect.name);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Emeri\r\n\tdrakeskin: {\r\n\t\tdesc: \"This Pokemon's Normal-type moves become Dragon-type moves and have their power multiplied by 1.2. This effect comes after other effects that change a move's type, but before Ion Deluge and Electrify's effects.\",\r\n\t\tshortDesc: \"This Pokemon's Normal-type moves become Dragon type and have 1.2x power.\",\r\n\t\tname: \"Drake Skin\",\r\n\t\tonModifyTypePriority: -1,\r\n\t\tonModifyType(move, pokemon) {\r\n\t\t\tconst noModifyType = [\r\n\t\t\t\t'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'terrainpulse', 'weatherball',\r\n\t\t\t];\r\n\t\t\tif (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status')) {\r\n\t\t\t\tmove.type = 'Dragon';\r\n\t\t\t\tmove.typeChangerBoosted = this.effect;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonBasePowerPriority: 23,\r\n\t\tonBasePower(basePower, pokemon, target, move) {\r\n\t\t\tif (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]);\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// EpicNikolai\r\n\tdragonheart: {\r\n\t\tdesc: \"Once per battle, when this Pokemon's HP is at or below 25% of its max HP, this Pokemon heals 50% of its max HP.\",\r\n\t\tshortDesc: \"Once per battle, heals 50% when 25% or lower.\",\r\n\t\tname: \"Dragon Heart\",\r\n\t\tonUpdate(pokemon) {\r\n\t\t\tif (pokemon.hp > 0 && pokemon.hp < pokemon.maxhp / 4 && !this.effectState.dragonheart) {\r\n\t\t\t\tthis.effectState.dragonheart = true;\r\n\t\t\t\tthis.heal(pokemon.maxhp / 2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// estarossa\r\n\tsandsoftime: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Sandstorm. If Sandstorm is active, this Pokemon's Ground-, Rock-, and Steel-type attacks have their power multiplied by 1.3. This Pokemon takes no damage from Sandstorm.\",\r\n\t\tshortDesc: \"Sand Stream + Sand Force.\",\r\n\t\tname: \"Sands of Time\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('sandstorm');\r\n\t\t},\r\n\t\tonImmunity(type, pokemon) {\r\n\t\t\tif (type === 'sandstorm') return false;\r\n\t\t},\r\n\t\tonBasePower(basePower, attacker, defender, move) {\r\n\t\t\tif (this.field.isWeather('sandstorm')) {\r\n\t\t\t\tif (move.type === 'Rock' || move.type === 'Ground' || move.type === 'Steel') {\r\n\t\t\t\t\tthis.debug('Sands of Time boost');\r\n\t\t\t\t\treturn this.chainModify([5325, 4096]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// fart\r\n\tbipolar: {\r\n\t\tdesc: \"If this Pokemon is a Kartana, then when it switches in, it changes to two random types and gets corresponding STAB attacks.\",\r\n\t\tshortDesc: \"Kartana: User gains 2 random types and STAB moves on switch-in.\",\r\n\t\tname: \"Bipolar\",\r\n\t\tisPermanent: true,\r\n\t\tonSwitchIn(pokemon) {\r\n\t\t\tif (pokemon.species.baseSpecies !== 'Kartana') return;\r\n\t\t\tconst typeMap: {[key: string]: string} = {\r\n\t\t\t\tNormal: \"Return\",\r\n\t\t\t\tFighting: \"Sacred Sword\",\r\n\t\t\t\tFlying: \"Drill Peck\",\r\n\t\t\t\tPoison: \"Poison Jab\",\r\n\t\t\t\tGround: \"Earthquake\",\r\n\t\t\t\tRock: \"Stone Edge\",\r\n\t\t\t\tBug: \"Lunge\",\r\n\t\t\t\tGhost: \"Shadow Bone\",\r\n\t\t\t\tSteel: \"Iron Head\",\r\n\t\t\t\tElectric: \"Zing Zap\",\r\n\t\t\t\tPsychic: \"Psychic Fangs\",\r\n\t\t\t\tIce: \"Icicle Crash\",\r\n\t\t\t\tDragon: \"Dual Chop\",\r\n\t\t\t\tDark: \"Jaw Lock\",\r\n\t\t\t\tFairy: \"Play Rough\",\r\n\t\t\t};\r\n\t\t\tconst types = Object.keys(typeMap);\r\n\t\t\tthis.prng.shuffle(types);\r\n\t\t\tconst newTypes = [types[0], types[1]];\r\n\t\t\tthis.add('-start', pokemon, 'typechange', newTypes.join('/'));\r\n\t\t\tpokemon.setType(newTypes);\r\n\t\t\tlet move = this.dex.moves.get(typeMap[newTypes[0]]);\r\n\t\t\tpokemon.moveSlots[3] = pokemon.moveSlots[1];\r\n\t\t\tpokemon.moveSlots[1] = {\r\n\t\t\t\tmove: move.name,\r\n\t\t\t\tid: move.id,\r\n\t\t\t\tpp: move.pp,\r\n\t\t\t\tmaxpp: move.pp,\r\n\t\t\t\ttarget: move.target,\r\n\t\t\t\tdisabled: false,\r\n\t\t\t\tused: false,\r\n\t\t\t\tvirtual: true,\r\n\t\t\t};\r\n\t\t\tmove = this.dex.moves.get(typeMap[newTypes[1]]);\r\n\t\t\tpokemon.moveSlots[2] = {\r\n\t\t\t\tmove: move.name,\r\n\t\t\t\tid: move.id,\r\n\t\t\t\tpp: move.pp,\r\n\t\t\t\tmaxpp: move.pp,\r\n\t\t\t\ttarget: move.target,\r\n\t\t\t\tdisabled: false,\r\n\t\t\t\tused: false,\r\n\t\t\t\tvirtual: true,\r\n\t\t\t};\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Finland\r\n\twindingsong: {\r\n\t\tdesc: \"If this Pokemon's species is Alcremie, it alternates one of its moves between two different options at the end of each turn, depending on the forme of Alcremie.\",\r\n\t\tshortDesc: \"Alcremie: alternates between moves each turn.\",\r\n\t\tname: \"Winding Song\",\r\n\t\tisPermanent: true,\r\n\t\tonResidual(pokemon) {\r\n\t\t\tif (pokemon.species.baseSpecies !== 'Alcremie') return;\r\n\t\t\tlet coolMoves = [];\r\n\t\t\tif (pokemon.species.forme === 'Lemon-Cream') {\r\n\t\t\t\tcoolMoves = ['Reflect', 'Light Screen'];\r\n\t\t\t} else if (pokemon.species.forme === 'Ruby-Swirl') {\r\n\t\t\t\tcoolMoves = ['Refresh', 'Destiny Bond'];\r\n\t\t\t} else if (pokemon.species.forme === 'Mint-Cream') {\r\n\t\t\t\tcoolMoves = ['Light of Ruin', 'Sparkling Aria'];\r\n\t\t\t} else {\r\n\t\t\t\tcoolMoves = ['Infestation', 'Whirlwind'];\r\n\t\t\t}\r\n\t\t\tlet oldMove;\r\n\t\t\tlet move;\r\n\t\t\tif (pokemon.moves.includes(this.toID(coolMoves[0]))) {\r\n\t\t\t\toldMove = this.toID(coolMoves[0]);\r\n\t\t\t\tmove = this.dex.moves.get(coolMoves[1]);\r\n\t\t\t} else if (pokemon.moves.includes(this.toID(coolMoves[1]))) {\r\n\t\t\t\toldMove = this.toID(coolMoves[1]);\r\n\t\t\t\tmove = this.dex.moves.get(coolMoves[0]);\r\n\t\t\t} else {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!oldMove || !move) return;\r\n\t\t\tconst sketchIndex = pokemon.moves.indexOf(oldMove);\r\n\t\t\tif (sketchIndex < 0) return false;\r\n\t\t\tconst sketchedMove = {\r\n\t\t\t\tmove: move.name,\r\n\t\t\t\tid: move.id,\r\n\t\t\t\tpp: (move.pp * 8 / 5),\r\n\t\t\t\tmaxpp: (move.pp * 8 / 5),\r\n\t\t\t\ttarget: move.target,\r\n\t\t\t\tdisabled: false,\r\n\t\t\t\tused: false,\r\n\t\t\t};\r\n\t\t\tpokemon.moveSlots[sketchIndex] = sketchedMove;\r\n\t\t\tpokemon.baseMoveSlots[sketchIndex] = sketchedMove;\r\n\t\t\tthis.add('-message', `Finland changed its move ${this.dex.moves.get(oldMove).name} to ${move.name}!`);\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// frostyicelad\r\n\ticeshield: {\r\n\t\tdesc: \"This Pokemon can only be damaged by direct attacks. This Pokemon cannot lose its held item due to another Pokemon's attack.\",\r\n\t\tshortDesc: \"Can only be damaged by direct attacks. Cannot lose its held item.\",\r\n\t\tname: \"Ice Shield\",\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (effect.effectType !== 'Move') {\r\n\t\t\t\tif (effect.effectType === 'Ability') this.add('-activate', source, 'ability: ' + effect.name);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonTakeItem(item, pokemon, source) {\r\n\t\t\tif (this.suppressingAbility(pokemon) || !pokemon.hp || pokemon.item === 'stickybarb') return;\r\n\t\t\tif (!this.activeMove) throw new Error(\"Battle.activeMove is null\");\r\n\t\t\tif ((source && source !== pokemon) || this.activeMove.id === 'knockoff') {\r\n\t\t\t\tthis.add('-activate', pokemon, 'ability: Ice Shield');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// gallant's pear\r\n\tarmortime: {\r\n\t\tname: \"Armor Time\",\r\n\t\tdesc: \"If this Pokemon uses a status move or King Giri Giri Slash, it changes its typing and boosts one of its stats by 1 stage randomly between four options: Bug/Fire type with a Special Attack boost, Bug/Steel type with a Defense boost, Bug/Rock type with a Special Defense boost, and Bug/Electric type with a Speed boost.\",\r\n\t\tshortDesc: \"On use of status or King Giri Giri Slash, the user changes type and gets a boost.\",\r\n\t\tisPermanent: true,\r\n\t\tonBeforeMove(source, target, move) {\r\n\t\t\tif (move.category !== \"Status\" && move.id !== \"kinggirigirislash\") return;\r\n\t\t\tconst types = ['Fire', 'Steel', 'Rock', 'Electric'];\r\n\t\t\tconst type = ['Bug', this.sample(types)];\r\n\t\t\tif (!source.setType(type)) return;\r\n\t\t\tthis.add('-start', source, 'typechange', type.join('/'), '[from] ability: Armor Time');\r\n\t\t\tswitch (type[1]) {\r\n\t\t\tcase 'Fire':\r\n\t\t\t\tthis.add('-message', 'Armor Time: Fire Armor!');\r\n\t\t\t\tthis.boost({spa: 1}, source);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'Steel':\r\n\t\t\t\tthis.add('-message', 'Armor Time: Steel Armor!');\r\n\t\t\t\tthis.boost({def: 1}, source);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'Rock':\r\n\t\t\t\tthis.add('-message', 'Armor Time: Rock Armor!');\r\n\t\t\t\tthis.boost({spd: 1}, source);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'Electric':\r\n\t\t\t\tthis.add('-message', 'Armor Time: Electric Armor!');\r\n\t\t\t\tthis.boost({spe: 1}, source);\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Gimmick\r\n\tic3peak: {\r\n\t\tdesc: \"This Pokemon's Normal-type moves become Ice-type moves and have their power multiplied by 1.2. This Pokemon's moves, if they are not affected by Refrigerate, have their Base Power multiplied by the number of consecutive turns the move is used by this Pokemon.\",\r\n\t\tshortDesc: \"Refrigerate; Echoed Voice modifier on non-Refrigerate moves.\",\r\n\t\tname: \"IC3PEAK\",\r\n\t\tonModifyTypePriority: -1,\r\n\t\tonModifyType(move, pokemon) {\r\n\t\t\tconst noModifyType = [\r\n\t\t\t\t'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'terrainpulse', 'weatherball',\r\n\t\t\t];\r\n\t\t\tif (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status')) {\r\n\t\t\t\tmove.type = 'Ice';\r\n\t\t\t\tmove.typeChangerBoosted = this.effect;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonBasePowerPriority: 23,\r\n\t\tonBasePower(basePower, pokemon, target, move) {\r\n\t\t\tif (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]);\r\n\t\t},\r\n\t\tonModifyMovePriority: -2,\r\n\t\tonModifyMove(move, attacker) {\r\n\t\t\tif (move.typeChangerBoosted === this.effect) return;\r\n\t\t\tmove.onTry = function () {\r\n\t\t\t\tthis.field.addPseudoWeather('echoedvoiceclone');\r\n\t\t\t\tthis.field.pseudoWeather.echoedvoiceclone.lastmove = move.name;\r\n\t\t\t};\r\n\t\t\t// eslint-disable-next-line @typescript-eslint/no-shadow\r\n\t\t\tmove.basePowerCallback = function (pokemon, target, move) {\r\n\t\t\t\tif (this.field.pseudoWeather.echoedvoiceclone) {\r\n\t\t\t\t\tif (this.field.pseudoWeather.echoedvoiceclone.lastmove === move.name) {\r\n\t\t\t\t\t\treturn move.basePower * this.field.pseudoWeather.echoedvoiceclone.multiplier;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.field.removePseudoWeather('echoedvoiceclone');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn move.basePower;\r\n\t\t\t};\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// GMars\r\n\tcapsulearmor: {\r\n\t\tdesc: \"While in Minior-Meteor forme, this Pokemon cannot be affected by major status conditions and is immune to critical hits. This ability cannot be ignored by Moongeist Beam, Sunsteel Strike, Mold Breaker, Teravolt, or Turboblaze.\",\r\n\t\tshortDesc: \"Minior-Meteor: Immune to crits and status\",\r\n\t\tname: \"Capsule Armor\",\r\n\t\tisPermanent: true,\r\n\t\tisBreakable: false,\r\n\t\tonCriticalHit: false,\r\n\t\tonSetStatus(status, target, source, effect) {\r\n\t\t\tif (target.species.id !== 'miniormeteor' || target.transformed) return;\r\n\t\t\tif ((effect as Move)?.status) {\r\n\t\t\t\tthis.add('-immune', target, '[from] ability: Capsule Armor');\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\tonTryAddVolatile(status, target) {\r\n\t\t\tif (target.species.id !== 'miniormeteor' || target.transformed) return;\r\n\t\t\tif (status.id !== 'yawn') return;\r\n\t\t\tthis.add('-immune', target, '[from] ability: Capsule Armor');\r\n\t\t\treturn null;\r\n\t\t},\r\n\t},\r\n\r\n\t// grimAuxiliatrix\r\n\taluminumalloy: {\r\n\t\tdesc: \"This Pokemon restores 1/3 of its maximum HP, rounded down, when it switches out, and other Pokemon cannot lower this Pokemon's stat stages. -1 Speed, +1 Def/Sp.Def when hit with a Water-type attacking move, switching into rain or starting rain while this Pokemon is on the field.\",\r\n\t\tshortDesc: \"Regenerator+Clear Body.+1 def/spd,-1 spe in rain/hit by water\",\r\n\t\tname: \"Aluminum Alloy\",\r\n\t\tonSwitchIn(pokemon) {\r\n\t\t\tif (['raindance', 'primordialsea'].includes(pokemon.effectiveWeather())) {\r\n\t\t\t\tthis.boost({def: 1, spd: 1, spe: -1}, pokemon, pokemon);\r\n\t\t\t\tthis.add('-message', `${pokemon.name} is rusting...`);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonDamagingHit(damage, target, source, move) {\r\n\t\t\tif (move.type === 'Water') {\r\n\t\t\t\tthis.boost({def: 1, spd: 1, spe: -1}, target, target);\r\n\t\t\t\tthis.add('-message', `${target.name} is rusting...`);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonWeatherChange() {\r\n\t\t\tconst pokemon = this.effectState.target;\r\n\t\t\tif (this.field.isWeather(['raindance', 'primordialsea'])) {\r\n\t\t\t\tthis.boost({def: 1, spd: 1, spe: -1}, pokemon, pokemon);\r\n\t\t\t\tthis.add('-message', `${pokemon.name} is rusting...`);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonSwitchOut(pokemon) {\r\n\t\t\tpokemon.heal(pokemon.baseMaxhp / 3);\r\n\t\t},\r\n\t\tonTryBoost(boost, target, source, effect) {\r\n\t\t\tif (source && target === source) return;\r\n\t\t\tlet showMsg = false;\r\n\t\t\tlet i: BoostID;\r\n\t\t\tfor (i in boost) {\r\n\t\t\t\tif (boost[i]! < 0) {\r\n\t\t\t\t\tdelete boost[i];\r\n\t\t\t\t\tshowMsg = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (showMsg && !(effect as ActiveMove).secondaries && effect.id !== 'octolock') {\r\n\t\t\t\tthis.add(\"-fail\", target, \"unboost\", \"[from] ability: Aluminum Alloy\", \"[of] \" + target);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// HoeenHero\r\n\ttropicalcyclone: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Rain Dance. If Rain Dance or Heavy Rain is active, this Pokemon's Speed is doubled.\",\r\n\t\tshortDesc: \"Summons Rain. 2x Speed while rain is active.\",\r\n\t\tname: \"Tropical Cyclone\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('raindance');\r\n\t\t},\r\n\t\tonModifySpe(spe, pokemon) {\r\n\t\t\tif (['raindance', 'primordialsea'].includes(pokemon.effectiveWeather())) {\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Hydro\r\n\thydrostatic: {\r\n\t\tdesc: \"This Pokemon is immune to Water- and Electric-type moves and raises its Special Attack by 1 stage when hit by a Water- or Electric-type move. If this Pokemon is not the target of a single-target Water- or Electric-type move used by another Pokemon, this Pokemon redirects that move to itself if it is within the range of that move. This Pokemon's Water- and Electric-type moves have their accuracy multiplied by 1.3.\",\r\n\t\tshortDesc: \"Storm Drain + Lightning Rod. This Pokemon's Water/Electric moves have 1.3x acc.\",\r\n\t\tonSourceModifyAccuracyPriority: 9,\r\n\t\tonSourceModifyAccuracy(accuracy, source, target, move) {\r\n\t\t\tif (typeof accuracy !== 'number') return;\r\n\t\t\tif (!['Water', 'Electric'].includes(move.type)) return;\r\n\t\t\tthis.debug('hydrostatic - enhancing accuracy');\r\n\t\t\treturn accuracy * 1.3;\r\n\t\t},\r\n\t\tonTryHit(target, source, move) {\r\n\t\t\tif (target !== source && ['Water', 'Electric'].includes(move.type)) {\r\n\t\t\t\tif (!this.boost({spa: 1})) {\r\n\t\t\t\t\tthis.add('-immune', target, '[from] ability: Hydrostatic');\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonAnyRedirectTarget(target, source, source2, move) {\r\n\t\t\tif (!['Water', 'Electric'].includes(move.type) || move.flags['pledgecombo']) return;\r\n\t\t\tconst redirectTarget = ['randomNormal', 'adjacentFoe'].includes(move.target) ? 'normal' : move.target;\r\n\t\t\tif (this.validTarget(this.effectState.target, source, redirectTarget)) {\r\n\t\t\t\tif (move.smartTarget) move.smartTarget = false;\r\n\t\t\t\tif (this.effectState.target !== target) {\r\n\t\t\t\t\tthis.add('-activate', this.effectState.target, 'ability: Hydrostatic');\r\n\t\t\t\t}\r\n\t\t\t\treturn this.effectState.target;\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Hydrostatic\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Inactive\r\n\tdragonsfury: {\r\n\t\tdesc: \"If this Pokemon has a non-volatile status condition, its Defense is multiplied by 1.5x and its HP is restored by 25% of damage it deals.\",\r\n\t\tshortDesc: \"If this Pokemon is statused, its Def is 1.5x and it heals for 25% of dmg dealt.\",\r\n\t\tonModifyDefPriority: 6,\r\n\t\tonModifyDef(def, pokemon) {\r\n\t\t\tif (pokemon.status) {\r\n\t\t\t\treturn this.chainModify(1.5);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonModifyMove(move, attacker) {\r\n\t\t\tif (attacker.status) move.drain = [1, 4];\r\n\t\t},\r\n\t\tname: \"Dragon's Fury\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Iyarito\r\n\tpollodiablo: {\r\n\t\tdesc: \"This Pokemon's Special Attack is 1.5x, but it can only select the first move it executes.\",\r\n\t\tshortDesc: \"This Pokemon's Sp. Atk is 1.5x, but it can only select the first move it executes.\",\r\n\t\tname: \"Pollo Diablo\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tpokemon.abilityState.choiceLock = \"\";\r\n\t\t},\r\n\t\tonBeforeMove(pokemon, target, move) {\r\n\t\t\tif (move.isZOrMaxPowered || move.id === 'struggle') return;\r\n\t\t\tif (pokemon.abilityState.choiceLock && pokemon.abilityState.choiceLock !== move.id) {\r\n\t\t\t\tthis.addMove('move', pokemon, move.name);\r\n\t\t\t\tthis.attrLastMove('[still]');\r\n\t\t\t\tthis.debug(\"Disabled by Pollo Diablo\");\r\n\t\t\t\tthis.add('-fail', pokemon);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonModifyMove(move, pokemon) {\r\n\t\t\tif (pokemon.abilityState.choiceLock || move.isZOrMaxPowered || move.id === 'struggle') return;\r\n\t\t\tpokemon.abilityState.choiceLock = move.id;\r\n\t\t},\r\n\t\tonModifySpAPriority: 1,\r\n\t\tonModifySpA(spa, pokemon) {\r\n\t\t\tif (pokemon.volatiles['dynamax']) return;\r\n\t\t\tthis.debug('Pollo Diablo Spa Boost');\r\n\t\t\treturn this.chainModify(1.5);\r\n\t\t},\r\n\t\tonDisableMove(pokemon) {\r\n\t\t\tif (!pokemon.abilityState.choiceLock) return;\r\n\t\t\tif (pokemon.volatiles['dynamax']) return;\r\n\t\t\tfor (const moveSlot of pokemon.moveSlots) {\r\n\t\t\t\tif (moveSlot.id !== pokemon.abilityState.choiceLock) {\r\n\t\t\t\t\tpokemon.disableMove(moveSlot.id, false, this.effectState.sourceEffect);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonEnd(pokemon) {\r\n\t\t\tpokemon.abilityState.choiceLock = \"\";\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Jett\r\n\tdeceiver: {\r\n\t\tdesc: \"This Pokemon's moves that match one of its types have a same-type attack bonus of 2 instead of 1.5. If this Pokemon is at full HP, it survives one hit with at least 1 HP.\",\r\n\t\tshortDesc: \"Adaptability + Sturdy.\",\r\n\t\tonModifyMove(move) {\r\n\t\t\tmove.stab = 2;\r\n\t\t},\r\n\t\tonTryHit(pokemon, target, move) {\r\n\t\t\tif (move.ohko) {\r\n\t\t\t\tthis.add('-immune', pokemon, '[from] ability: Deceiver');\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonDamagePriority: -100,\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (target.hp === target.maxhp && damage >= target.hp && effect && effect.effectType === 'Move') {\r\n\t\t\t\tthis.add('-ability', target, 'Deceiver');\r\n\t\t\t\treturn target.hp - 1;\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Deceiver\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Jho\r\n\tvenomize: {\r\n\t\tdesc: \"This Pokemon's Normal-type moves become Poison-type moves and have their power multiplied by 1.2. This effect comes after other effects that change a move's type, but before Ion Deluge and Electrify's effects.\",\r\n\t\tshortDesc: \"This Pokemon's Normal-type moves become Poison type and have 1.2x power.\",\r\n\t\tonModifyTypePriority: -1,\r\n\t\tonModifyType(move, pokemon) {\r\n\t\t\tconst noModifyType = [\r\n\t\t\t\t'judgment', 'multiattack', 'naturalgift', 'revelationdance', 'technoblast', 'terrainpulse', 'weatherball',\r\n\t\t\t];\r\n\t\t\tif (move.type === 'Normal' && !noModifyType.includes(move.id) && !(move.isZ && move.category !== 'Status')) {\r\n\t\t\t\tmove.type = 'Poison';\r\n\t\t\t\tmove.typeChangerBoosted = this.effect;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonBasePowerPriority: 23,\r\n\t\tonBasePower(basePower, pokemon, target, move) {\r\n\t\t\tif (move.typeChangerBoosted === this.effect) return this.chainModify([4915, 4096]);\r\n\t\t},\r\n\t\tname: \"Venomize\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Jordy\r\n\tdivinesandstorm: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Sandstorm. This Pokemon does not take recoil damage besides Struggle/Life Orb/crash damage.\",\r\n\t\tshortDesc: \"Sand Stream + Rock Head.\",\r\n\t\tname: \"Divine Sandstorm\",\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (effect.id === 'recoil') {\r\n\t\t\t\tif (!this.activeMove) return;\r\n\t\t\t\tif (this.activeMove.id !== 'struggle') return null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonStart(pokemon) {\r\n\t\t\tthis.field.setWeather('sandstorm');\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Kaiju Bunny\r\n\tsecondwind: {\r\n\t\tdesc: \"Once per battle, when this Pokemon's HP is at or below 25% of its max HP, this Pokemon heals 50% of its max HP.\",\r\n\t\tshortDesc: \"Once per battle, heals 50% when 25% or lower.\",\r\n\t\tname: \"Second Wind\",\r\n\t\tonUpdate(pokemon) {\r\n\t\t\tif (pokemon.hp > 0 && pokemon.hp < pokemon.maxhp / 4 && !this.effectState.dragonheart) {\r\n\t\t\t\tthis.effectState.dragonheart = true;\r\n\t\t\t\tthis.heal(pokemon.maxhp / 2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Kennedy\r\n\tfalsenine: {\r\n\t\tdesc: \"This Pokemon's type changes to match the type of the move it is about to use. This effect comes after all effects that change a move's type. This Pokemon's critical hit ratio is raised by 1 stage.\",\r\n\t\tshortDesc: \"Protean + Super Luck.\",\r\n\t\tonPrepareHit(source, target, move) {\r\n\t\t\tif (move.hasBounced) return;\r\n\t\t\tconst type = move.type;\r\n\t\t\tif (type && type !== '???' && source.getTypes().join() !== type) {\r\n\t\t\t\tif (!source.setType(type)) return;\r\n\t\t\t\tthis.add('-start', source, 'typechange', type, '[from] ability: False Nine');\r\n\t\t\t}\r\n\t\t},\r\n\t\tonModifyCritRatio(critRatio) {\r\n\t\t\treturn critRatio + 1;\r\n\t\t},\r\n\t\tname: \"False Nine\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Kev\r\n\tkingofatlantis: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Rain Dance for 5 turns, plus 1 additional turn for each Water-type teammate. This Pokemon also has the effects of Dry Skin.\",\r\n\t\tshortDesc: \"Drizzle + Dry Skin; +1 turn of rain for each Water-type teammate.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('raindance', source);\r\n\t\t\t// See conditions.ts for weather modifications.\r\n\t\t},\r\n\t\tonTryHit(target, source, move) {\r\n\t\t\tif (target !== source && move.type === 'Water') {\r\n\t\t\t\tif (!this.heal(target.baseMaxhp / 4)) {\r\n\t\t\t\t\tthis.add('-immune', target, '[from] ability: King of Atlantis');\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonFoeBasePowerPriority: 17,\r\n\t\tonFoeBasePower(basePower, attacker, defender, move) {\r\n\t\t\tif (this.effectState.target !== defender) return;\r\n\t\t\tif (move.type === 'Fire') {\r\n\t\t\t\treturn this.chainModify(1.25);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonWeather(target, source, effect) {\r\n\t\t\tif (target.hasItem('utilityumbrella')) return;\r\n\t\t\tif (effect.id === 'raindance' || effect.id === 'primordialsea') {\r\n\t\t\t\tthis.heal(target.baseMaxhp / 8);\r\n\t\t\t} else if (effect.id === 'sunnyday' || effect.id === 'desolateland') {\r\n\t\t\t\tthis.damage(target.baseMaxhp / 8, target, target);\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"King of Atlantis\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// KingSwordYT\r\n\tbambookingdom: {\r\n\t\tdesc: \"On switch-in, this Pokemon's Defense and Special Defense are raised by 1 stage. Attacking moves used by this Pokemon have their priority set to -7.\",\r\n\t\tshortDesc: \"+1 Def/SpD. -7 priority on attacks.\",\r\n\t\tname: \"Bamboo Kingdom\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tthis.boost({def: 1, spd: 1}, pokemon);\r\n\t\t},\r\n\t\tonModifyPriority(priority, pokemon, target, move) {\r\n\t\t\tif (move?.category !== 'Status') return -7;\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Kipkluif\r\n\tdegenerator: {\r\n\t\tdesc: \"While this Pokemon is active, foes that switch out lose 1/3 of their maximum HP, rounded down. This damage will never cause a Pokemon to faint, and will instead leave them at 1 HP.\",\r\n\t\tshortDesc: \"While this Pokemon is active, foes that switch out lose 1/3 of their maximum HP.\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tpokemon.side.foe.addSideCondition('degeneratormod', pokemon);\r\n\t\t\tconst data = pokemon.side.foe.getSideConditionData('degeneratormod');\r\n\t\t\tif (!data.sources) {\r\n\t\t\t\tdata.sources = [];\r\n\t\t\t}\r\n\t\t\tdata.sources.push(pokemon);\r\n\t\t},\r\n\t\tonEnd(pokemon) {\r\n\t\t\tpokemon.side.foe.removeSideCondition('degeneratormod');\r\n\t\t},\r\n\t\tname: \"Degenerator\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Lionyx\r\n\ttension: {\r\n\t\tdesc: \"On switch-in, the Pokemon builds up tension, making the next attack always hit and always be a critical hit.\",\r\n\t\tshortDesc: \"On switch-in, the Pokemon's next attack will always be a critical hit and will always hit.\",\r\n\t\tname: \"Tension\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tthis.add('-ability', pokemon, 'Tension');\r\n\t\t\tpokemon.addVolatile('tension');\r\n\t\t},\r\n\t\tcondition: {\r\n\t\t\tonStart(pokemon, source, effect) {\r\n\t\t\t\tif (effect && (['imposter', 'psychup', 'transform'].includes(effect.id))) {\r\n\t\t\t\t\tthis.add('-start', pokemon, 'move: Tension', '[silent]');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.add('-start', pokemon, 'move: Tension');\r\n\t\t\t\t}\r\n\t\t\t\tthis.add(\"-message\", `${pokemon.name} has built up tension!`);\r\n\t\t\t},\r\n\t\t\tonModifyCritRatio(critRatio) {\r\n\t\t\t\treturn 5;\r\n\t\t\t},\r\n\t\t\tonAnyInvulnerability(target, source, move) {\r\n\t\t\t\tif (move && (source === this.effectState.target || target === this.effectState.target)) return 0;\r\n\t\t\t},\r\n\t\t\tonSourceAccuracy(accuracy) {\r\n\t\t\t\treturn true;\r\n\t\t\t},\r\n\t\t\tonAfterMove(pokemon, source) {\r\n\t\t\t\tpokemon.removeVolatile('tension');\r\n\t\t\t},\r\n\t\t\tonEnd(pokemon) {\r\n\t\t\t\tthis.add('-end', pokemon, 'move: Tension', '[silent]');\r\n\t\t\t},\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// LittEleven\r\n\tdarkroyalty: {\r\n\t\tdesc: \"While this Pokemon is active, priority moves from opposing Pokemon targeted at allies are prevented from having an effect. Dark-type attacks used by this Pokemon have their power multiplied by 1.2.\",\r\n\t\tshortDesc: \"Immune to priority. Dark-type attacks have 1.2x power.\",\r\n\t\tonFoeTryMove(target, source, move) {\r\n\t\t\tconst targetAllExceptions = ['perishsong', 'flowershield', 'rototiller'];\r\n\t\t\tif (move.target === 'foeSide' || (move.target === 'all' && !targetAllExceptions.includes(move.id))) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tconst dazzlingHolder = this.effectState.target;\r\n\t\t\tif ((source.isAlly(dazzlingHolder) || move.target === 'all') && move.priority > 0.1) {\r\n\t\t\t\tthis.attrLastMove('[still]');\r\n\t\t\t\tthis.add('-ability', dazzlingHolder, 'Dark Royalty');\r\n\t\t\t\tthis.add('cant', target, move, '[of] ' + dazzlingHolder);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonAllyBasePower(basePower, attacker, defender, move) {\r\n\t\t\tif (move.type === 'Dark') {\r\n\t\t\t\tthis.debug('Dark Royalty boost');\r\n\t\t\t\treturn this.chainModify(1.2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Dark Royalty\",\r\n\t},\r\n\r\n\t// Lunala\r\n\tmagichat: {\r\n\t\tdesc: \"This Pokemon can only be damaged by direct attacks. This Pokemon blocks certain status moves and instead uses the move against the original user.\",\r\n\t\tshortDesc: \"Magic Guard + Magic Bounce.\",\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (effect.id === 'heavyhailstorm') return;\r\n\t\t\tif (effect.effectType !== 'Move') {\r\n\t\t\t\tif (effect.effectType === 'Ability') this.add('-activate', source, 'ability: ' + effect.name);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonTryHitPriority: 1,\r\n\t\tonTryHit(target, source, move) {\r\n\t\t\tif (target === source || move.hasBounced || !move.flags['reflectable']) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst newMove = this.dex.getActiveMove(move.id);\r\n\t\t\tnewMove.hasBounced = true;\r\n\t\t\tnewMove.pranksterBoosted = false;\r\n\t\t\tthis.add('-ability', target, 'Magic Hat');\r\n\t\t\tthis.actions.useMove(newMove, target, source);\r\n\t\t\treturn null;\r\n\t\t},\r\n\t\tonAllyTryHitSide(target, source, move) {\r\n\t\t\tif (target.isAlly(source) || move.hasBounced || !move.flags['reflectable']) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst newMove = this.dex.getActiveMove(move.id);\r\n\t\t\tnewMove.hasBounced = true;\r\n\t\t\tnewMove.pranksterBoosted = false;\r\n\t\t\tthis.add('-ability', target, 'Magic Hat');\r\n\t\t\tthis.actions.useMove(newMove, this.effectState.target, source);\r\n\t\t\treturn null;\r\n\t\t},\r\n\t\tcondition: {\r\n\t\t\tduration: 1,\r\n\t\t},\r\n\t\tname: \"Magic Hat\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Mad Monty \u00BE\u00B0\r\n\tpetrichor: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Rain Dance. If Rain Dance or Heavy Rain is active, this Pokemon's Electric-type moves have 1.2x power.\",\r\n\t\tshortDesc: \"Summons rain. Electric-type moves have 1.2x power in rain.\",\r\n\t\tname: \"Petrichor\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('raindance');\r\n\t\t},\r\n\t\tonBasePowerPriority: 23,\r\n\t\tonBasePower(basePower, pokemon, target, move) {\r\n\t\t\tif (move.type === 'Electric' && this.field.getWeather().id === 'raindance') {\r\n\t\t\t\treturn this.chainModify([4915, 4096]);\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\r\n\t// Marshmallon\r\n\tstubbornness: {\r\n\t\tdesc: \"this Pokemon does not take recoil damage. The first time an opposing Pokemon boosts a stat each time this Pokemon is active, this Pokemon's Attack, Defense, and Special Defense are raised by 1 stage; each time the opponent boosts after this, this Pokemon's Attack is boosted by 1 stage. Activation of opposing Stubbornness will not activate Stubbornness.\",\r\n\t\tshortDesc: \"Rock Head + when foe first boosts, Atk/Def/SpD+1. Further foe boosts=+1 Atk.\",\r\n\t\tname: \"Stubbornness\",\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (effect.id === 'recoil') {\r\n\t\t\t\tif (!this.activeMove) throw new Error(\"Battle.activeMove is null\");\r\n\t\t\t\tif (this.activeMove.id !== 'struggle') return null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonSwitchOut(pokemon) {\r\n\t\t\tif (this.effectState.happened) delete this.effectState.happened;\r\n\t\t},\r\n\t\tonFoeAfterBoost(boost, target, source, effect) {\r\n\t\t\tconst pokemon = target.side.foe.active[0];\r\n\t\t\tlet success = false;\r\n\t\t\tlet i: BoostID;\r\n\t\t\tfor (i in boost) {\r\n\t\t\t\tif (boost[i]! > 0) {\r\n\t\t\t\t\tsuccess = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Infinite Loop preventer\r\n\t\t\tif (effect?.name === 'Stubbornness') return;\r\n\t\t\tif (success) {\r\n\t\t\t\tif (!this.effectState.happened) {\r\n\t\t\t\t\tthis.boost({atk: 1, def: 1, spd: 1}, pokemon);\r\n\t\t\t\t\tthis.effectState.happened = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthis.boost({atk: 1}, pokemon);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Mitsuki\r\n\tphotosynthesis: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Sunny Day. If Sunny Day is active and this Pokemon is not holding Utility Umbrella, this Pokemon's Speed is doubled.\",\r\n\t\tshortDesc: \"Drought + Chlorophyll\",\r\n\t\tname: \"Photosynthesis\",\r\n\t\tonStart(source) {\r\n\t\t\tfor (const action of this.queue) {\r\n\t\t\t\tif (action.choice === 'runPrimal' && action.pokemon === source && source.species.id === 'groudon') return;\r\n\t\t\t\tif (action.choice !== 'runSwitch' && action.choice !== 'runPrimal') break;\r\n\t\t\t}\r\n\t\t\tthis.field.setWeather('sunnyday');\r\n\t\t},\r\n\t\tonModifySpe(spe, pokemon) {\r\n\t\t\tif (['sunnyday', 'desolateland'].includes(pokemon.effectiveWeather())) {\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// n10siT\r\n\tgreedymagician: {\r\n\t\tdesc: \"This Pokemon steals the item off a Pokemon it hits with an attack. If this Pokemon already has an item, it is replaced with the stolen item. This ability does not affect Doom Desire and Future Sight.\",\r\n\t\tshortDesc: \"Steals item from foe on attack; replace current item with stolen item.\",\r\n\t\tname: \"Greedy Magician\",\r\n\t\tonSourceHit(target, source, move) {\r\n\t\t\tif (!move || !target) return;\r\n\t\t\tif (target !== source && move.category !== 'Status') {\r\n\t\t\t\tconst yourItem = target.takeItem(source);\r\n\t\t\t\tif (!yourItem) return;\r\n\t\t\t\tif (!source.setItem(yourItem)) {\r\n\t\t\t\t\ttarget.item = yourItem.id;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.add('-item', source, yourItem, '[from] ability: Greedy Magician', '[of] ' + source);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Nol\r\n\tburningsoul: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Sunny Day. If this Pokemon is at full HP, it survives one hit with at least 1 HP. OHKO moves fail when used against this Pokemon.\",\r\n\t\tshortDesc: \"Drought + Sturdy.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('sunnyday');\r\n\t\t},\r\n\t\tonTryHit(pokemon, target, move) {\r\n\t\t\tif (move.ohko) {\r\n\t\t\t\tthis.add('-immune', pokemon, '[from] ability: Burning Soul');\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonDamagePriority: -100,\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (target.hp === target.maxhp && damage >= target.hp && effect && effect.effectType === 'Move') {\r\n\t\t\t\tthis.add('-ability', target, 'Burning Soul');\r\n\t\t\t\treturn target.hp - 1;\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Burning Soul\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Notater517\r\n\tlastminutelag: {\r\n\t\tdesc: \"This Pokemon applies the Recharge status to the opposing Pokemon if this Pokemon needs to recharge. If this Pokemon KOs an opposing Pokemon with a recharge move, then the user does not need to recharge.\",\r\n\t\tshortDesc: \"Gives Recharge to the target if this Pokemon has it. KO: No recharge.\",\r\n\t\tonModifyMove(move, pokemon, target) {\r\n\t\t\tif (move.self?.volatileStatus === 'mustrecharge') {\r\n\t\t\t\tif (!move.volatileStatus) {\r\n\t\t\t\t\tmove.volatileStatus = 'mustrecharge';\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif (!move.secondaries) move.secondaries = [];\r\n\t\t\t\t\tmove.secondaries.push({chance: 100, volatileStatus: 'mustrecharge'});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tonAfterMoveSecondarySelf(pokemon, target, move) {\r\n\t\t\tif (!target || target.fainted || target.hp <= 0) {\r\n\t\t\t\tif (pokemon.volatiles['mustrecharge']) {\r\n\t\t\t\t\tthis.add('-ability', pokemon, 'Last Minute Lag');\r\n\t\t\t\t\tthis.add('-end', pokemon, 'mustrecharge');\r\n\t\t\t\t\tdelete pokemon.volatiles['mustrecharge'];\r\n\t\t\t\t\tthis.hint('It may look like this Pokemon is going to recharge next turn, but it will not recharge.');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Last-Minute Lag\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// nui\r\n\tconditionoverride: {\r\n\t\tdesc: \"This Pokemon can attract opponents regardless of gender. Pokemon that are attracted have their Special Defense stat reduced by 25%.\",\r\n\t\tshortDesc: \"Attracts anyone. Attracted Pokemon have SpD reduced by 25%.\",\r\n\t\t// See conditions.ts for implementation\r\n\t\tname: \"Condition Override\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// pants\r\n\tghostspores: {\r\n\t\tdesc: \"This Pokemon ignores the foe's stat boosts. On switch-out, this Pokemon regenerates 1/3 HP, rounded down. If this Pokemon is hit by an attack, Leech Seed is applied to the foe. If this Pokemon is KOed, Curse is applied to the foe.\",\r\n\t\tshortDesc: \"Unaware + Regenerator. If hit, foe is Leech Seeded. If KOed, foe is Cursed.\",\r\n\t\tname: 'Ghost Spores',\r\n\t\tonDamagingHit(damage, target, source, move) {\r\n\t\t\tif (!target.hp) {\r\n\t\t\t\tsource.addVolatile('curse', target);\r\n\t\t\t} else {\r\n\t\t\t\tsource.addVolatile('leechseed', target);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonAnyModifyBoost(boosts, pokemon) {\r\n\t\t\tconst unawareUser = this.effectState.target;\r\n\t\t\tif (unawareUser === pokemon) return;\r\n\t\t\tif (unawareUser === this.activePokemon && pokemon === this.activeTarget) {\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['evasion'] = 0;\r\n\t\t\t}\r\n\t\t\tif (pokemon === this.activePokemon && unawareUser === this.activeTarget) {\r\n\t\t\t\tboosts['atk'] = 0;\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spa'] = 0;\r\n\t\t\t\tboosts['accuracy'] = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonSwitchOut(pokemon) {\r\n\t\t\tpokemon.heal(pokemon.baseMaxhp / 3);\r\n\t\t},\r\n\t},\r\n\r\n\t// PartMan\r\n\thecatomb: {\r\n\t\tdesc: \"This Pokemon's Speed is raised by 1 stage if it attacks and knocks out another Pokemon. If the Pokemon is Chandelure and is not shiny, it changes its set.\",\r\n\t\tshortDesc: \"Spe +1 on KOing foe. Chandelure: changes sets.\",\r\n\t\tname: 'Hecatomb',\r\n\t\tonSourceAfterFaint(length, target, source, effect) {\r\n\t\t\tif (effect && effect.effectType === 'Move') {\r\n\t\t\t\tthis.boost({spe: length}, source);\r\n\t\t\t\tif (source.species.baseSpecies !== 'Chandelure') return;\r\n\t\t\t\tif (source.set.shiny) return;\r\n\t\t\t\tsource.m.nowShiny = true;\r\n\t\t\t\tthis.add(`c:|${Math.floor(Date.now() / 1000)}|${getName('PartMan')}|THE LIGHT! IT BURNS!`);\r\n\t\t\t\tchangeSet(this, source, ssbSets['PartMan-Shiny']);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// peapod\r\n\tstealthblack: {\r\n\t\tdesc: \"No competitive use.\",\r\n\t\tname: 'Stealth Black',\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Perish Song\r\n\tsoupsipper: {\r\n\t\tdesc: \"This Pokemon is immune to Grass- and Water-type moves, restores 1/4 of its maximum HP, rounded down, when hit by these types, and boosts its Attack by 1 stage when hit by these types.\",\r\n\t\tshortDesc: \"Immune to Water and Grass moves, heals 1/4 HP and gains +1 Atk when hit by them.\",\r\n\t\tonTryHit(target, source, move) {\r\n\t\t\tif (target !== source && ['Water', 'Grass'].includes(move.type)) {\r\n\t\t\t\tlet success = false;\r\n\t\t\t\tif (this.heal(target.baseMaxhp / 4)) success = true;\r\n\t\t\t\tif (this.boost({atk: 1})) success = true;\r\n\t\t\t\tif (!success) {\r\n\t\t\t\t\tthis.add('-immune', target, '[from] ability: Soup Sipper');\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Soup Sipper\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// phiwings99\r\n\tplausibledeniability: {\r\n\t\tdesc: \"This Pokemon's Status moves have priority raised by 1, but Dark-types are immune. Additionally, This Pokemon ignores other Pokemon's Attack, Special Attack, and accuracy stat stages when taking damage, and ignores other Pokemon's Defense, Special Defense, and evasiveness stat stages when dealing damage.\",\r\n\t\tshortDesc: \"Unaware + Prankster. Dark-types still immune to Prankster moves.\",\r\n\t\tname: \"Plausible Deniability\",\r\n\t\tonAnyModifyBoost(boosts, pokemon) {\r\n\t\t\tconst unawareUser = this.effectState.target;\r\n\t\t\tif (unawareUser === pokemon) return;\r\n\t\t\tif (unawareUser === this.activePokemon && pokemon === this.activeTarget) {\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['evasion'] = 0;\r\n\t\t\t}\r\n\t\t\tif (pokemon === this.activePokemon && unawareUser === this.activeTarget) {\r\n\t\t\t\tboosts['atk'] = 0;\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spa'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['accuracy'] = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonModifyPriority(priority, pokemon, target, move) {\r\n\t\t\tif (move?.category === 'Status') {\r\n\t\t\t\tmove.pranksterBoosted = true;\r\n\t\t\t\treturn priority + 1;\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// piloswine gripado\r\n\tforeverwinternights: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Winter Hail. Winter Hail is hail that also lowers the Speed of non-Ice-type Pokemon by 50%. This weather remains in effect until this Ability is no longer active for any Pokemon, or the weather is changed by Delta Stream, Desolate Land, or Primordial Sea.\",\r\n\t\tshortDesc: \"Sets permahail until this Pokemon switches out. Non-Ice: 1/2 Speed\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('winterhail');\r\n\t\t},\r\n\t\tonAnySetWeather(target, source, weather) {\r\n\t\t\tif (this.field.getWeather().id === 'winterhail' && !STRONG_WEATHERS.includes(weather.id)) return false;\r\n\t\t},\r\n\t\tonEnd(pokemon) {\r\n\t\t\tif (this.field.weatherState.source !== pokemon) return;\r\n\t\t\tfor (const target of this.getAllActive()) {\r\n\t\t\t\tif (target === pokemon) continue;\r\n\t\t\t\tif (target.hasAbility('winterhail')) {\r\n\t\t\t\t\tthis.field.weatherState.source = target;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.field.clearWeather();\r\n\t\t},\r\n\t\tname: \"Forever Winter Nights\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// PiraTe Princess\r\n\twildmagicsurge: {\r\n\t\tdesc: \"Randomly changes this Pokemon's type at the end of every turn to the type of one of its moves; same-type attack bonus (STAB) is 2 instead of 1.5.\",\r\n\t\tshortDesc: \"Adaptability + Randomly changes to the type of one of its moves every turn.\",\r\n\t\tname: \"Wild Magic Surge\",\r\n\t\tonModifyMove(move) {\r\n\t\t\tmove.stab = 2;\r\n\t\t},\r\n\t\tonResidual(pokemon) {\r\n\t\t\tif (!pokemon.hp) return;\r\n\t\t\tconst types = pokemon.moveSlots.map(slot => this.dex.moves.get(slot.id).type);\r\n\t\t\tconst type = types.length ? this.sample(types) : '???';\r\n\t\t\tif (this.dex.types.isName(type) && pokemon.setType(type)) {\r\n\t\t\t\tthis.add('-ability', pokemon, 'Wild Magic Surge');\r\n\t\t\t\tthis.add('-start', pokemon, 'typechange', type);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Psynergy\r\n\tsupernova: {\r\n\t\tdesc: \"On switch-in, if total positive boosts - total negative boosts \u2265 8, both Pokemon faint.\",\r\n\t\tonStart(source) {\r\n\t\t\tlet result = 0;\r\n\t\t\tconst pokemon = this.getAllActive();\r\n\t\t\tfor (const poke of pokemon) {\r\n\t\t\t\tresult += Object.values(poke.boosts).reduce((total, x) => total + x);\r\n\t\t\t}\r\n\t\t\tif (result < 8) return;\r\n\t\t\tthis.add('-ability', source, 'Supernova');\r\n\t\t\tfor (const x of pokemon) {\r\n\t\t\t\tthis.add('-anim', x, 'Explosion', x);\r\n\t\t\t\tx.faint();\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Supernova\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// ptoad\r\n\tswampysurge: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Swampy Terrain. Swampy Terrain halves the power of Electric-, Grass-, and Ice-type moves used by grounded Pokemon and heals grounded Water- and Ground-types by 1/16 of their maximum HP, rounded down, each turn.\",\r\n\t\tshortDesc: \"5 turns: Grounded: 1/2 Elec/Grass/Ice power, +1/16 HP/turn for Water or Ground.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setTerrain('swampyterrain');\r\n\t\t},\r\n\t\tname: \"Swampy Surge\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Rach\r\n\tburnitdown: {\r\n\t\tdesc: \"On switch-in, this Pokemon lowers the foe's higher offensive stat.\",\r\n\t\tshortDesc: \"Lower the foe's higher offensive stat.\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tlet totalatk = 0;\r\n\t\t\tlet totalspa = 0;\r\n\t\t\tfor (const target of pokemon.foes()) {\r\n\t\t\t\ttotalatk += target.getStat('atk', false, true);\r\n\t\t\t\ttotalspa += target.getStat('spa', false, true);\r\n\t\t\t}\r\n\t\t\tfor (const target of pokemon.foes()) {\r\n\t\t\t\tthis.add('-ability', pokemon, 'BURN IT DOWN!');\r\n\t\t\t\tif (totalatk && totalatk >= totalspa) {\r\n\t\t\t\t\tthis.boost({atk: -1}, target, pokemon, null, true);\r\n\t\t\t\t} else if (totalspa) {\r\n\t\t\t\t\tthis.boost({spa: -1}, target, pokemon, null, true);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"BURN IT DOWN!\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Rage\r\n\tinversionsurge: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Inversion Terrain. While Inversion Terrain is active, type effectiveness for all Pokemon on the field is inverted, and paralyzed Pokemon have doubled, instead of halved, Speed.\",\r\n\t\tshortDesc: \"Summons Inversion Terrain; 5 turns: Inverse Battle, par: 2x Spe.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setTerrain('inversionterrain');\r\n\t\t},\r\n\t\tname: \"Inversion Surge\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Raihan Kibana\r\n\troyalcoat: {\r\n\t\tdesc: \"If Sandstorm is active, this Pokemon's Speed is doubled and its Special Defense is multiplied by 1.5. This Pokemon takes no damage from Sandstorm.\",\r\n\t\tshortDesc: \"If Sandstorm, Speed x2 and SpD x1.5; immunity to Sandstorm.\",\r\n\t\tname: \"Royal Coat\",\r\n\t\tonModifySpe(spe, pokemon) {\r\n\t\t\tif (this.field.isWeather('sandstorm')) {\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonModifySpD(spd, pokemon) {\r\n\t\t\tif (this.field.isWeather('sandstorm')) {\r\n\t\t\t\treturn this.chainModify(1.5);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonImmunity(type, pokemon) {\r\n\t\t\tif (type === 'sandstorm') return false;\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// RavioliQueen\r\n\tphantomplane: {\r\n\t\tdesc: \"On switch-in, this Pokemon summons Pitch Black Terrain. While Pitch Black Terrain is active, all non-Ghost-type Pokemon take damage equal to 1/16 of their max HP, rounded down, at the end of each turn.\",\r\n\t\tshortDesc: \"Summons Pitch Black Terrain, which damages non-Ghosts by 1/16 per turn.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setTerrain('pitchblackterrain');\r\n\t\t},\r\n\t\tname: \"Phantom Plane\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Robb576\r\n\tthenumbersgame: {\r\n\t\tdesc: \"If this Pokemon is a forme of Necrozma, its forme changes on switch-in depending on the number of unfainted Pokemon on the user's team: Necrozma-Dusk-Mane if 3 or fewer Pokemon and Necrozma-Dawn-Wings was sent out already; Necrozma-Ultra if it is the last Pokemon left on the team and Necrozma-Dusk-Mane was sent out already.\",\r\n\t\tshortDesc: \"Changes forme on switch-in depending on # of remaining Pokemon on user's team.\",\r\n\t\tname: \"The Numbers Game\",\r\n\t\tisPermanent: true,\r\n\t\tonStart(target) {\r\n\t\t\tif (target.baseSpecies.baseSpecies !== 'Necrozma' || target.transformed) return;\r\n\t\t\tif (target.side.pokemonLeft <= 3) {\r\n\t\t\t\tif (target.species.name === 'Necrozma-Dusk-Mane' && target.side.pokemonLeft === 1 && target.m.flag2) {\r\n\t\t\t\t\tchangeSet(this, target, ssbSets['Robb576-Ultra']);\r\n\t\t\t\t} else if (target.species.name === \"Necrozma-Dawn-Wings\" && target.m.flag1) {\r\n\t\t\t\t\tchangeSet(this, target, ssbSets['Robb576-Dusk-Mane']);\r\n\t\t\t\t\ttarget.m.flag2 = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttarget.m.flag1 = true;\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Sectonia\r\n\troyalaura: {\r\n\t\tdesc: \"If this Pokemon is the target of an opposing Pokemon's move, that move loses one additional PP. Moves used by this Pokemon only use 0.5 PP.\",\r\n\t\tshortDesc: \"Pressure, and this Pokemon uses 0.5 PP per move.\",\r\n\t\tname: \"Royal Aura\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tthis.add('-ability', pokemon, 'Royal Aura');\r\n\t\t},\r\n\t\tonDeductPP(target, source) {\r\n\t\t\tif (target.isAlly(source)) return;\r\n\t\t\treturn 1;\r\n\t\t},\r\n\t\tonTryMove(pokemon, target, move) {\r\n\t\t\tconst moveData = pokemon.getMoveData(move.id);\r\n\t\t\tif (!moveData || moveData.pp < 0.5) return;\r\n\t\t\t// Lost 1 PP due to move usage, restore 0.5 PP to make it so that only 0.5 PP\r\n\t\t\t// would be used.\r\n\t\t\tmoveData.pp += 0.5;\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Segmr\r\n\tskilldrain: {\r\n\t\tdesc: \"While this Pokemon is active, no moves will trigger their secondary effects, and moves that cause the user to switch out will no longer do so.\",\r\n\t\tshortDesc: \"While active: no secondary effects, moves can't switch out.\",\r\n\t\tname: \"Skill Drain\",\r\n\t\tonAnyModifyMove(move) {\r\n\t\t\tdelete move.secondaries;\r\n\t\t},\r\n\t\t// afterSecondarySelf and switch nullifying handled in ssb/scripts.ts\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// sejesensei\r\n\ttrashconsumer: {\r\n\t\tdesc: \"This Pokemon is immune to Poison-type moves and restores 1/4 of its maximum HP, rounded down, when hit by a Poison-type move. Pokemon making contact with this Pokemon lose 1/8 of their maximum HP, rounded down.\",\r\n\t\tshortDesc: \"Poison Absorb + Rough Skin\",\r\n\t\tname: \"Trash Consumer\",\r\n\t\tonTryHit(target, source, move) {\r\n\t\t\tif (target !== source && move.type === 'Poison') {\r\n\t\t\t\tif (!this.heal(target.baseMaxhp / 4)) {\r\n\t\t\t\t\tthis.add('-immune', target, '[from] ability: Trash Consumer');\r\n\t\t\t\t}\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonDamagingHitOrder: 1,\r\n\t\tonDamagingHit(damage, target, source, move) {\r\n\t\t\tif (this.checkMoveMakesContact(move, source, target, true)) {\r\n\t\t\t\tthis.damage(source.baseMaxhp / 8, source, target);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Shadecession\r\n\tshadydeal: {\r\n\t\tdesc: \"On switch-in, this Pokemon boosts a random stat other than Special Attack by 1 stage and gains 2 random type immunities that are displayed to the opponent.\",\r\n\t\tshortDesc: \"On switch-in, gains random +1 to non-SpA, 2 random immunities.\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tconst stats: BoostID[] = [];\r\n\t\t\tlet stat: BoostID;\r\n\t\t\tfor (stat in pokemon.boosts) {\r\n\t\t\t\tconst noBoost: string[] = ['accuracy', 'evasion', 'spa'];\r\n\t\t\t\tif (!noBoost.includes(stat) && pokemon.boosts[stat] < 6) {\r\n\t\t\t\t\tstats.push(stat);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (stats.length) {\r\n\t\t\t\tconst randomStat = this.sample(stats);\r\n\t\t\t\tconst boost: SparseBoostsTable = {};\r\n\t\t\t\tboost[randomStat] = 1;\r\n\t\t\t\tthis.boost(boost);\r\n\t\t\t}\r\n\t\t\tif (this.effectState.immunities) return;\r\n\t\t\tconst typeList = this.dex.types.names();\r\n\t\t\tconst firstTypeIndex = this.random(typeList.length);\r\n\t\t\tconst secondType = this.sample(typeList.slice(0, firstTypeIndex).concat(typeList.slice(firstTypeIndex + 1)));\r\n\t\t\tthis.effectState.immunities = [typeList[firstTypeIndex], secondType];\r\n\t\t\tthis.add('-start', pokemon, `${this.effectState.immunities[0]} Immunity`, '[silent]');\r\n\t\t\tthis.add('-start', pokemon, `${this.effectState.immunities[1]} Immunity`, '[silent]');\r\n\t\t\tthis.add(\"-message\", `${pokemon.name} is now immune to ${this.effectState.immunities[0]} and ${this.effectState.immunities[1]} type attacks!`);\r\n\t\t},\r\n\t\tonTryHit(target, source, move) {\r\n\t\t\tif (target !== source && this.effectState.immunities?.includes(move.type)) {\r\n\t\t\t\tthis.add('-immune', target, '[from] ability: Shady Deal');\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonEnd(pokemon) {\r\n\t\t\tif (!this.effectState.immunities) return;\r\n\t\t\tthis.add('-end', pokemon, `${this.effectState.immunities[0]} Immunity`, '[silent]');\r\n\t\t\tthis.add('-end', pokemon, `${this.effectState.immunities[1]} Immunity`, '[silent]');\r\n\t\t\tdelete this.effectState.immunities;\r\n\t\t},\r\n\t\tname: \"Shady Deal\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Soft Flex\r\n\teyeofthestorm: {\r\n\t\tname: \"Eye of the Storm\",\r\n\t\tdesc: \"On switch-in, this Pokemon summons Rain Dance and Tempest Terrain. While Tempest Terrain is active, Electric-type Pokemon are healed by 1/16 of their maximum HP, rounded down, at the end of each turn, and Flying- and Steel-type Pokemon lose 1/16 of their maximum HP, rounded down, at the end of each turn. If the Flying- or Steel-type Pokemon is also Electric-type, they only receive the healing.\",\r\n\t\tshortDesc: \"5 turns: Rain, +1/16 HP/turn to Elec, -1/16/turn to Fly/Steel.\",\r\n\t\tonStart(source) {\r\n\t\t\tthis.field.setWeather('raindance', source);\r\n\t\t\tthis.field.setTerrain('tempestterrain', source);\r\n\t\t},\r\n\t},\r\n\t// Spandan\r\n\thackedcorrosion: {\r\n\t\tdesc: \"This Pokemon ignores other Pokemon's stat stages when taking or doing damage. This Pokemon can poison or badly poison Pokemon regardless of their typing.\",\r\n\t\tshortDesc: \"Unaware + Corrosion.\",\r\n\t\tonAnyModifyBoost(boosts, pokemon) {\r\n\t\t\tconst unawareUser = this.effectState.target;\r\n\t\t\tif (unawareUser === pokemon) return;\r\n\t\t\tif (unawareUser === this.activePokemon && pokemon === this.activeTarget) {\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['evasion'] = 0;\r\n\t\t\t}\r\n\t\t\tif (pokemon === this.activePokemon && unawareUser === this.activeTarget) {\r\n\t\t\t\tboosts['atk'] = 0;\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spa'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['accuracy'] = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Hacked Corrosion\",\r\n\t},\r\n\r\n\t// Struchni\r\n\toveraskedclause: {\r\n\t\tdesc: \"If this Pokemon is an Aggron and is hit by a move that is not very effective, this Pokemon becomes Aggron-Mega and its Attack is boosted by 1 stage.\",\r\n\t\tshortDesc: \"Aggron: If hit by resisted move, Mega Evolve and gain +1 Atk.\",\r\n\t\tname: \"Overasked Clause\",\r\n\t\tisPermanent: true,\r\n\t\tonHit(target, source, move) {\r\n\t\t\tif (target.getMoveHitData(move).typeMod < 0) {\r\n\t\t\t\tif (!target.hp) return;\r\n\t\t\t\tif (target.species.id.includes('aggron') && !target.illusion && !target.transformed) {\r\n\t\t\t\t\tthis.boost({atk: 1}, target);\r\n\t\t\t\t\tif (target.species.name !== 'Aggron') return;\r\n\t\t\t\t\tthis.actions.runMegaEvo(target);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Teclis\r\n\tfieryfur: {\r\n\t\tname: \"Fiery Fur\",\r\n\t\tdesc: \"If this Pokemon is at full HP, damage taken from attacks is halved.\",\r\n\t\tonSourceModifyDamage(damage, source, target, move) {\r\n\t\t\tif (target.hp >= target.maxhp) {\r\n\t\t\t\tthis.debug('Fiery Fur weaken');\r\n\t\t\t\treturn this.chainModify(0.5);\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\r\n\t// temp\r\n\tchargedup: {\r\n\t\tdesc: \"If this Pokemon has a negative stat boost at -2 or lower, this Pokemon's negative stat boosts are cleared.\",\r\n\t\tshortDesc: \"Resets negative stat boosts if there is one at -2 or lower.\",\r\n\t\tname: \"Charged Up\",\r\n\t\tonUpdate(pokemon) {\r\n\t\t\tlet activate = false;\r\n\t\t\tconst boosts: SparseBoostsTable = {};\r\n\t\t\tlet i: BoostID;\r\n\t\t\tfor (i in pokemon.boosts) {\r\n\t\t\t\tif (pokemon.boosts[i] <= -2) {\r\n\t\t\t\t\tactivate = true;\r\n\t\t\t\t\tboosts[i] = 0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (activate) {\r\n\t\t\t\tpokemon.setBoost(boosts);\r\n\t\t\t\tthis.add('-activate', pokemon, 'ability: Charged Up');\r\n\t\t\t\tthis.add('-clearnegativeboost', pokemon);\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// tiki\r\n\ttruegrit: {\r\n\t\tdesc: \"This Pokemon receives 1/2 damage from special attacks. This Pokemon ignores other Pokemon's Attack, Special Attack, and accuracy stat stages when taking damage, and ignores other Pokemon's Defense, Special Defense, and evasiveness stat stages when dealing damage.\",\r\n\t\tshortDesc: \"Takes 1/2 damage from special moves and ignores boosts.\",\r\n\t\tname: \"True Grit\",\r\n\t\tonSourceModifyDamage(damage, source, target, move) {\r\n\t\t\tif (move.category === 'Special') {\r\n\t\t\t\treturn this.chainModify(0.5);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonAnyModifyBoost(boosts, pokemon) {\r\n\t\t\tconst unawareUser = this.effectState.target;\r\n\t\t\tif (unawareUser === pokemon) return;\r\n\t\t\tif (unawareUser === this.activePokemon && pokemon === this.activeTarget) {\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['evasion'] = 0;\r\n\t\t\t}\r\n\t\t\tif (pokemon === this.activePokemon && unawareUser === this.activeTarget) {\r\n\t\t\t\tboosts['atk'] = 0;\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spa'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['accuracy'] = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Trickster\r\n\ttrillionageroots: {\r\n\t\tdesc: \"This Pokemon applies Leech Seed to the opposing Pokemon when hit with an attacking move. If this Pokemon is at full HP, it survives one hit with at least 1 HP. OHKO moves fail when used against this Pokemon.\",\r\n\t\tshortDesc: \"Sturdy + apply Leech Seed when hit by foe.\",\r\n\t\tonTryHit(pokemon, target, move) {\r\n\t\t\tif (move.ohko) {\r\n\t\t\t\tthis.add('-immune', pokemon, '[from] ability: Trillionage Roots');\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonDamagePriority: -100,\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (target.hp === target.maxhp && damage >= target.hp && effect && effect.effectType === 'Move') {\r\n\t\t\t\tthis.add('-ability', target, 'Trillionage Roots');\r\n\t\t\t\treturn target.hp - 1;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonDamagingHit(damage, target, source, move) {\r\n\t\t\tif (source.volatiles['leechseed']) return;\r\n\t\t\tif (!move.flags['futuremove']) {\r\n\t\t\t\tsource.addVolatile('leechseed', this.effectState.target);\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Trillionage Roots\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Volco\r\n\tspeedrunning: {\r\n\t\tdesc: \"This Pokemon's Special Attack is raised by 1 stage when another Pokemon faints. Moves used by this Pokemon that are 60 Base Power or lower gain an additional 25 Base Power. No moves can defrost a frozen Pokemon while this Pokemon is active. However, using a move that would defrost will still go through freeze.\",\r\n\t\tshortDesc: \"Soul Heart + Weak moves get +25 BP. Moves can't defrost. Defrost moves go thru frz.\",\r\n\t\tonAnyFaintPriority: 1,\r\n\t\tonAnyFaint() {\r\n\t\t\tthis.boost({spa: 1}, this.effectState.target);\r\n\t\t},\r\n\t\tonAnyModifyMove(move, pokemon) {\r\n\t\t\tif (move.thawsTarget) {\r\n\t\t\t\tdelete move.thawsTarget;\r\n\t\t\t}\r\n\t\t\tif (move.flags[\"defrost\"]) {\r\n\t\t\t\tdelete move.flags[\"defrost\"];\r\n\t\t\t}\r\n\t\t},\r\n\t\tonBasePowerPriority: 21,\r\n\t\tonBasePower(basePower, pokemon, target, move) {\r\n\t\t\tif (move.basePower <= 60) return basePower + 25;\r\n\t\t},\r\n\t\tname: \"Speedrunning\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// Vexen\r\n\taquilasblessing: {\r\n\t\tdesc: \"This Pokemon's attacks with secondary effects have their power multiplied by 1.3, but the secondary effects are removed. If this Pokemon gets hit by a damaging Fire type move, its Defense and Special Defense get raised by 1 stage.\",\r\n\t\tshortDesc: \"Sheer Force + when hit with Fire move: +1 Def/SpD.\",\r\n\t\tonModifyMove(move, pokemon) {\r\n\t\t\tif (move.secondaries) {\r\n\t\t\t\tdelete move.secondaries;\r\n\t\t\t\t// Technically not a secondary effect, but it is negated\r\n\t\t\t\tif (move.id === 'clangoroussoulblaze') delete move.selfBoost;\r\n\t\t\t\t// Actual negation of `AfterMoveSecondary` effects implemented in scripts.js\r\n\t\t\t\tmove.hasSheerForce = true;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonBasePowerPriority: 21,\r\n\t\tonBasePower(basePower, pokemon, target, move) {\r\n\t\t\tif (move.hasSheerForce) return this.chainModify([5325, 4096]);\r\n\t\t},\r\n\t\tonDamagingHit(damage, target, source, move) {\r\n\t\t\tif (move.type === 'Fire') {\r\n\t\t\t\tthis.boost({def: 1, spd: 1});\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Aquila's Blessing\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// vooper\r\n\tqigong: {\r\n\t\tdesc: \"This Pokemon's Defense is doubled, and it receives 1/2 damage from special attacks.\",\r\n\t\tonModifyDefPriority: 6,\r\n\t\tonModifyDef(def) {\r\n\t\t\treturn this.chainModify(2);\r\n\t\t},\r\n\t\tonSourceModifyDamage(damage, source, target, move) {\r\n\t\t\tif (move.category === 'Special') {\r\n\t\t\t\treturn this.chainModify(0.5);\r\n\t\t\t}\r\n\t\t},\r\n\t\tname: \"Qi-Gong\",\r\n\t\tgen: 8,\r\n\t},\r\n\r\n\t// yuki\r\n\tcombattraining: {\r\n\t\tdesc: \"If this Pokemon is a Cosplay Pikachu forme, the first hit it takes in battle deals 0 neutral damage. Confusion damage also breaks the immunity.\",\r\n\t\tshortDesc: \"(Pikachu-Cosplay only) First hit deals 0 damage.\",\r\n\t\tisPermanent: true,\r\n\t\tonDamagePriority: 1,\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tconst cosplayFormes = [\r\n\t\t\t\t'pikachucosplay', 'pikachuphd', 'pikachulibre', 'pikachupopstar', 'pikachurockstar', 'pikachubelle',\r\n\t\t\t];\r\n\t\t\tif (\r\n\t\t\t\teffect?.effectType === 'Move' &&\r\n\t\t\t\tcosplayFormes.includes(target.species.id) && !target.transformed &&\r\n\t\t\t\t!this.effectState.busted\r\n\t\t\t) {\r\n\t\t\t\tthis.add('-activate', target, 'ability: Combat Training');\r\n\t\t\t\tthis.effectState.busted = true;\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\t\t},\r\n\t\tonCriticalHit(target, source, move) {\r\n\t\t\tif (!target) return;\r\n\t\t\tconst cosplayFormes = [\r\n\t\t\t\t'pikachucosplay', 'pikachuphd', 'pikachulibre', 'pikachupopstar', 'pikachurockstar', 'pikachubelle',\r\n\t\t\t];\r\n\t\t\tif (!cosplayFormes.includes(target.species.id) || target.transformed) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);\r\n\t\t\tif (hitSub) return;\r\n\r\n\t\t\tif (!target.runImmunity(move.type)) return;\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\tonEffectiveness(typeMod, target, type, move) {\r\n\t\t\tif (!target) return;\r\n\t\t\tconst cosplayFormes = [\r\n\t\t\t\t'pikachucosplay', 'pikachuphd', 'pikachulibre', 'pikachupopstar', 'pikachurockstar', 'pikachubelle',\r\n\t\t\t];\r\n\t\t\tif (!cosplayFormes.includes(target.species.id) || target.transformed) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tconst hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'] && !(move.infiltrates && this.gen >= 6);\r\n\t\t\tif (hitSub) return;\r\n\r\n\t\t\tif (!target.runImmunity(move.type)) return;\r\n\t\t\treturn 0;\r\n\t\t},\r\n\t\tname: \"Combat Training\",\r\n\t\tgen: 8,\r\n\t},\r\n\t// Modified Illusion to support SSB volatiles\r\n\tillusion: {\r\n\t\tinherit: true,\r\n\t\tonEnd(pokemon) {\r\n\t\t\tif (pokemon.illusion) {\r\n\t\t\t\tthis.debug('illusion cleared');\r\n\t\t\t\tlet disguisedAs = this.toID(pokemon.illusion.name);\r\n\t\t\t\tpokemon.illusion = null;\r\n\t\t\t\tconst details = pokemon.species.name + (pokemon.level === 100 ? '' : ', L' + pokemon.level) +\r\n\t\t\t\t\t(pokemon.gender === '' ? '' : ', ' + pokemon.gender) + (pokemon.set.shiny ? ', shiny' : '');\r\n\t\t\t\tthis.add('replace', pokemon, details);\r\n\t\t\t\tthis.add('-end', pokemon, 'Illusion');\r\n\t\t\t\t// Handle users whose names match a species\r\n\t\t\t\tif (this.dex.species.get(disguisedAs).exists) disguisedAs += 'user';\r\n\t\t\t\tif (pokemon.volatiles[disguisedAs]) {\r\n\t\t\t\t\tpokemon.removeVolatile(disguisedAs);\r\n\t\t\t\t}\r\n\t\t\t\tif (!pokemon.volatiles[this.toID(pokemon.name)]) {\r\n\t\t\t\t\tconst status = this.dex.conditions.get(this.toID(pokemon.name));\r\n\t\t\t\t\tif (status?.exists) {\r\n\t\t\t\t\t\tpokemon.addVolatile(this.toID(pokemon.name), pokemon);\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},\r\n\r\n\t// Modified various abilities to support Alpha's move & pilo's abiility\r\n\tdeltastream: {\r\n\t\tinherit: true,\r\n\t\tonAnySetWeather(target, source, weather) {\r\n\t\t\tif (this.field.getWeather().id === 'deltastream' && !STRONG_WEATHERS.includes(weather.id)) return false;\r\n\t\t},\r\n\t},\r\n\tdesolateland: {\r\n\t\tinherit: true,\r\n\t\tonAnySetWeather(target, source, weather) {\r\n\t\t\tif (this.field.getWeather().id === 'desolateland' && !STRONG_WEATHERS.includes(weather.id)) return false;\r\n\t\t},\r\n\t},\r\n\tprimordialsea: {\r\n\t\tinherit: true,\r\n\t\tonAnySetWeather(target, source, weather) {\r\n\t\t\tif (this.field.getWeather().id === 'primordialsea' && !STRONG_WEATHERS.includes(weather.id)) return false;\r\n\t\t},\r\n\t},\r\n\tforecast: {\r\n\t\tinherit: true,\r\n\t\tonUpdate(pokemon) {\r\n\t\t\tif (pokemon.baseSpecies.baseSpecies !== 'Castform' || pokemon.transformed) return;\r\n\t\t\tlet forme = null;\r\n\t\t\tswitch (pokemon.effectiveWeather()) {\r\n\t\t\tcase 'sunnyday':\r\n\t\t\tcase 'desolateland':\r\n\t\t\t\tif (pokemon.species.id !== 'castformsunny') forme = 'Castform-Sunny';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'raindance':\r\n\t\t\tcase 'primordialsea':\r\n\t\t\t\tif (pokemon.species.id !== 'castformrainy') forme = 'Castform-Rainy';\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'winterhail':\r\n\t\t\tcase 'heavyhailstorm':\r\n\t\t\tcase 'hail':\r\n\t\t\t\tif (pokemon.species.id !== 'castformsnowy') forme = 'Castform-Snowy';\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tif (pokemon.species.id !== 'castform') forme = 'Castform';\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tif (pokemon.isActive && forme) {\r\n\t\t\t\tpokemon.formeChange(forme, this.effect, false, '[msg]');\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\ticebody: {\r\n\t\tinherit: true,\r\n\t\tdesc: \"If Hail or Heavy Hailstorm is active, this Pokemon restores 1/16 of its maximum HP, rounded down, at the end of each turn. This Pokemon takes no damage from Hail or Heavy Hailstorm.\",\r\n\t\tshortDesc: \"Hail-like weather active: heals 1/16 max HP each turn; immunity to Hail-like weather.\",\r\n\t\tonWeather(target, source, effect) {\r\n\t\t\tif (['heavyhailstorm', 'hail', 'winterhail'].includes(effect.id)) {\r\n\t\t\t\tthis.heal(target.baseMaxhp / 16);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonImmunity(type, pokemon) {\r\n\t\t\tif (['heavyhailstorm', 'hail', 'winterhail'].includes(type)) return false;\r\n\t\t},\r\n\t},\r\n\ticeface: {\r\n\t\tinherit: true,\r\n\t\tdesc: \"If this Pokemon is an Eiscue, the first physical hit it takes in battle deals 0 neutral damage. Its ice face is then broken and it changes forme to Noice Face. Eiscue regains its Ice Face forme when Hail or Heavy Hailstorm begins or when Eiscue switches in while Hail or Heavy Hailstorm is active. Confusion damage also breaks the ice face.\",\r\n\t\tshortDesc: \"If Eiscue, first physical hit taken deals 0 damage. Effect is restored in Hail-like weather.\",\r\n\t\tonStart(pokemon) {\r\n\t\t\tif (this.field.isWeather(['heavyhailstorm', 'hail', 'winterhail']) &&\r\n\t\t\t\tpokemon.species.id === 'eiscuenoice' && !pokemon.transformed) {\r\n\t\t\t\tthis.add('-activate', pokemon, 'ability: Ice Face');\r\n\t\t\t\tthis.effectState.busted = false;\r\n\t\t\t\tpokemon.formeChange('Eiscue', this.effect, true);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonWeatherChange() {\r\n\t\t\tconst pokemon = this.effectState.target;\r\n\t\t\tif (this.field.isWeather(['heavyhailstorm', 'hail', 'winterhail']) &&\r\n\t\t\t\tpokemon.species.id === 'eiscuenoice' && !pokemon.transformed) {\r\n\t\t\t\tthis.add('-activate', pokemon, 'ability: Ice Face');\r\n\t\t\t\tthis.effectState.busted = false;\r\n\t\t\t\tpokemon.formeChange('Eiscue', this.effect, true);\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tslushrush: {\r\n\t\tinherit: true,\r\n\t\tshortDesc: \"If a Hail-like weather is active, this Pokemon's Speed is doubled.\",\r\n\t\tonModifySpe(spe, pokemon) {\r\n\t\t\tif (this.field.isWeather(['heavyhailstorm', 'hail', 'winterhail'])) {\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\tsnowcloak: {\r\n\t\tinherit: true,\r\n\t\tdesc: \"If Heavy Hailstorm, Winter Hail, or Hail is active, this Pokemon's evasiveness is multiplied by 1.25. This Pokemon takes no damage from Heavy Hailstorm or Hail.\",\r\n\t\tshortDesc: \"If a Hail-like weather is active, 1.25x evasion; immunity to Hail-like weathers.\",\r\n\t\tonImmunity(type, pokemon) {\r\n\t\t\tif (['heavyhailstorm', 'hail', 'winterhail'].includes(type)) return false;\r\n\t\t},\r\n\t\tonModifyAccuracy(accuracy) {\r\n\t\t\tif (typeof accuracy !== 'number') return;\r\n\t\t\tif (this.field.isWeather(['heavyhailstorm', 'hail', 'winterhail'])) {\r\n\t\t\t\tthis.debug('Snow Cloak - decreasing accuracy');\r\n\t\t\t\treturn accuracy * 0.8;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\t// Modified Magic Guard for Alpha\r\n\tmagicguard: {\r\n\t\tinherit: true,\r\n\t\tshortDesc: \"This Pokemon can only be damaged by direct attacks and Heavy Hailstorm.\",\r\n\t\tonDamage(damage, target, source, effect) {\r\n\t\t\tif (effect.id === 'heavyhailstorm') return;\r\n\t\t\tif (effect.effectType !== 'Move') {\r\n\t\t\t\tif (effect.effectType === 'Ability') this.add('-activate', source, 'ability: ' + effect.name);\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\t// Modified Unaware for Blaz's move\r\n\tunaware: {\r\n\t\tinherit: true,\r\n\t\tonAnyModifyBoost(boosts, pokemon) {\r\n\t\t\tconst unawareUser = this.effectState.target;\r\n\t\t\tif (unawareUser === pokemon) return;\r\n\t\t\tif (unawareUser === this.activePokemon && pokemon === this.activeTarget) {\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['evasion'] = 0;\r\n\t\t\t}\r\n\t\t\tif (pokemon === this.activePokemon && unawareUser === this.activeTarget) {\r\n\t\t\t\tboosts['atk'] = 0;\r\n\t\t\t\tboosts['def'] = 0;\r\n\t\t\t\tboosts['spa'] = 0;\r\n\t\t\t\tboosts['spd'] = 0;\r\n\t\t\t\tboosts['accuracy'] = 0;\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n\t// Modified Stakeout for Hubriz to have a failsafe\r\n\tstakeout: {\r\n\t\tinherit: true,\r\n\t\tonModifyAtkPriority: 5,\r\n\t\tonModifyAtk(atk, attacker, defender) {\r\n\t\t\tif (!defender?.activeTurns) {\r\n\t\t\t\tthis.debug('Stakeout boost');\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t\tonModifySpAPriority: 5,\r\n\t\tonModifySpA(atk, attacker, defender) {\r\n\t\t\tif (!defender?.activeTurns) {\r\n\t\t\t\tthis.debug('Stakeout boost');\r\n\t\t\t\treturn this.chainModify(2);\r\n\t\t\t}\r\n\t\t},\r\n\t},\r\n};\r\n"], "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA8B;AAC9B,wBAAsB;AAGtB,MAAM,kBAAkB,CAAC,gBAAgB,iBAAiB,eAAe,kBAAkB,cAAc,YAAY;AAO9G,SAAS,UAAU,SAAiB,SAAkB,QAAgB,gBAAgB,OAAO;AACnG,MAAI,QAAQ;AAAa;AACzB,QAAM,MAAkB;AAAA,IACvB,IAAI,OAAO,KAAK,MAAM;AAAA,IACtB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,EACzB;AACA,QAAM,MAAkB;AAAA,IACvB,IAAI,OAAO,KAAK,MAAM;AAAA,IACtB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,IACxB,KAAK,OAAO,KAAK,OAAO;AAAA,EACzB;AACA,UAAQ,IAAI,MAAM;AAClB,UAAQ,IAAI,MAAM;AAClB,MAAI,OAAO;AAAQ,YAAQ,IAAI,SAAS,MAAM,QAAQ,OAAO,MAAM,IAAI,QAAQ,OAAO,OAAO,MAAM,IAAI,OAAO;AAC9G,QAAM,WAAW,QA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