{ "version": 3, "sources": ["../../../../../data/mods/partnersincrime/scripts.ts"], "sourcesContent": ["export const Scripts: ModdedBattleScriptsData = {\r\n\tgen: 9,\r\n\tinherit: 'gen9',\r\n\tnextTurn() {\r\n\t\tthis.turn++;\r\n\t\tthis.lastSuccessfulMoveThisTurn = null;\r\n\r\n\t\t// Partners in Crime moveSlot updating\r\n\t\t// Must be highest priority so imprison doesn't lag behind.\r\n\t\tfor (const side of this.sides) {\r\n\t\t\tfor (const pokemon of side.active) {\r\n\t\t\t\tpokemon.moveSlots = pokemon.moveSlots.filter(move => pokemon.m.curMoves.includes(move.id));\r\n\t\t\t\tpokemon.m.curMoves = this.dex.deepClone(pokemon.moves);\r\n\t\t\t\tconst ally = side.active.find(mon => mon && mon !== pokemon && !mon.fainted);\r\n\t\t\t\tlet allyMoves = ally ? this.dex.deepClone(ally.moveSlots) : [];\r\n\t\t\t\tif (ally) {\r\n\t\t\t\t\t// @ts-ignore\r\n\t\t\t\t\tallyMoves = allyMoves.filter(move => !pokemon.moves.includes(move.id) && ally.m.curMoves.includes(move.id));\r\n\t\t\t\t\tfor (const aMove of allyMoves) {\r\n\t\t\t\t\t\taMove.pp = this.clampIntRange(aMove.maxpp - (pokemon.m.trackPP.get(aMove.id) || 0), 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tpokemon.moveSlots = pokemon.moveSlots.concat(allyMoves);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst dynamaxEnding: Pokemon[] = [];\r\n\t\tfor (const pokemon of this.getAllActive()) {\r\n\t\t\tif (pokemon.volatiles['dynamax']?.turns === 3) {\r\n\t\t\t\tdynamaxEnding.push(pokemon);\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (dynamaxEnding.length > 1) {\r\n\t\t\tthis.updateSpeed();\r\n\t\t\tthis.speedSort(dynamaxEnding);\r\n\t\t}\r\n\t\tfor (const pokemon of dynamaxEnding) {\r\n\t\t\tpokemon.removeVolatile('dynamax');\r\n\t\t}\r\n\r\n\t\t// Gen 1 partial trapping ends when either Pokemon or a switch in faints to residual damage\r\n\t\tif (this.gen === 1) {\r\n\t\t\tfor (const pokemon of this.getAllActive()) {\r\n\t\t\t\tif (pokemon.volatiles['partialtrappinglock']) {\r\n\t\t\t\t\tconst target = pokemon.volatiles['partialtrappinglock'].locked;\r\n\t\t\t\t\tif (target.hp <= 0 || !target.volatiles['partiallytrapped']) {\r\n\t\t\t\t\t\tdelete pokemon.volatiles['partialtrappinglock'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (pokemon.volatiles['partiallytrapped']) {\r\n\t\t\t\t\tconst source = pokemon.volatiles['partiallytrapped'].source;\r\n\t\t\t\t\tif (source.hp <= 0 || !source.volatiles['partialtrappinglock']) {\r\n\t\t\t\t\t\tdelete pokemon.volatiles['partiallytrapped'];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tconst trappedBySide: boolean[] = [];\r\n\t\tconst stalenessBySide: ('internal' | 'external' | undefined)[] = [];\r\n\t\tfor (const side of this.sides) {\r\n\t\t\tlet sideTrapped = true;\r\n\t\t\tlet sideStaleness: 'internal' | 'external' | undefined;\r\n\t\t\tfor (const pokemon of side.active) {\r\n\t\t\t\tif (!pokemon) continue;\r\n\t\t\t\tpokemon.moveThisTurn = '';\r\n\t\t\t\tpokemon.newlySwitched = false;\r\n\t\t\t\tpokemon.moveLastTurnResult = pokemon.moveThisTurnResult;\r\n\t\t\t\tpokemon.moveThisTurnResult = undefined;\r\n\t\t\t\tif (this.turn !== 1) {\r\n\t\t\t\t\tpokemon.usedItemThisTurn = false;\r\n\t\t\t\t\tpokemon.statsRaisedThisTurn = false;\r\n\t\t\t\t\tpokemon.statsLoweredThisTurn = false;\r\n\t\t\t\t\t// It shouldn't be possible in a normal battle for a Pokemon to be damaged before turn 1's move selection\r\n\t\t\t\t\t// However, this could be potentially relevant in certain OMs\r\n\t\t\t\t\tpokemon.hurtThisTurn = null;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpokemon.maybeDisabled = false;\r\n\t\t\t\tfor (const moveSlot of pokemon.moveSlots) {\r\n\t\t\t\t\tmoveSlot.disabled = false;\r\n\t\t\t\t\tmoveSlot.disabledSource = '';\r\n\t\t\t\t}\r\n\t\t\t\tthis.runEvent('DisableMove', pokemon);\r\n\t\t\t\tfor (const moveSlot of pokemon.moveSlots) {\r\n\t\t\t\t\tthis.singleEvent('DisableMove', this.dex.getActiveMove(moveSlot.id), null, pokemon);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// If it was an illusion, it's not any more\r\n\t\t\t\tif (pokemon.getLastAttackedBy() && this.gen >= 7) pokemon.knownType = true;\r\n\r\n\t\t\t\tfor (let i = pokemon.attackedBy.length - 1; i >= 0; i--) {\r\n\t\t\t\t\tconst attack = pokemon.attackedBy[i];\r\n\t\t\t\t\tif (attack.source.isActive) {\r\n\t\t\t\t\t\tattack.thisTurn = false;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tpokemon.attackedBy.splice(pokemon.attackedBy.indexOf(attack), 1);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (this.gen >= 7) {\r\n\t\t\t\t\t// In Gen 7, the real type of every Pokemon is visible to all players via the bottom screen while making choices\r\n\t\t\t\t\tconst seenPokemon = pokemon.illusion || pokemon;\r\n\t\t\t\t\tconst realTypeString = seenPokemon.getTypes(true).join('/');\r\n\t\t\t\t\tif (realTypeString !== seenPokemon.apparentType) {\r\n\t\t\t\t\t\tthis.add('-start', pokemon, 'typechange', realTypeString, '[silent]');\r\n\t\t\t\t\t\tseenPokemon.apparentType = realTypeString;\r\n\t\t\t\t\t\tif (pokemon.addedType) {\r\n\t\t\t\t\t\t\t// The typechange message removes the added type, so put it back\r\n\t\t\t\t\t\t\tthis.add('-start', pokemon, 'typeadd', pokemon.addedType, '[silent]');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tpokemon.trapped = pokemon.maybeTrapped = false;\r\n\t\t\t\tthis.runEvent('TrapPokemon', pokemon);\r\n\t\t\t\tif (!pokemon.knownType || this.dex.getImmunity('trapped', pokemon)) {\r\n\t\t\t\t\tthis.runEvent('MaybeTrapPokemon', pokemon);\r\n\t\t\t\t}\r\n\t\t\t\t// canceling switches would leak information\r\n\t\t\t\t// if a foe might have a trapping ability\r\n\t\t\t\tif (this.gen > 2) {\r\n\t\t\t\t\tfor (const source of pokemon.foes()) {\r\n\t\t\t\t\t\tconst species = (source.illusion || source).species;\r\n\t\t\t\t\t\tif (!species.abilities) continue;\r\n\t\t\t\t\t\tfor (const abilitySlot in species.abilities) {\r\n\t\t\t\t\t\t\tconst abilityName = species.abilities[abilitySlot as keyof Species['abilities']];\r\n\t\t\t\t\t\t\tif (abilityName === source.ability) {\r\n\t\t\t\t\t\t\t\t// pokemon event was already run above so we don't need\r\n\t\t\t\t\t\t\t\t// to run it again.\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst ruleTable = this.ruleTable;\r\n\t\t\t\t\t\t\tif ((ruleTable.has('+hackmons') || !ruleTable.has('obtainableabilities')) && !this.format.team) {\r\n\t\t\t\t\t\t\t\t// hackmons format\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t} else if (abilitySlot === 'H' && species.unreleasedHidden) {\r\n\t\t\t\t\t\t\t\t// unreleased hidden ability\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tconst ability = this.dex.abilities.get(abilityName);\r\n\t\t\t\t\t\t\tif (ruleTable.has('-ability:' + ability.id)) continue;\r\n\t\t\t\t\t\t\tif (pokemon.knownType && !this.dex.getImmunity('trapped', pokemon)) continue;\r\n\t\t\t\t\t\t\tthis.singleEvent('FoeMaybeTrapPokemon', ability, {}, pokemon, source);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (pokemon.fainted) continue;\r\n\r\n\t\t\t\tsideTrapped = sideTrapped && pokemon.trapped;\r\n\t\t\t\tconst staleness = pokemon.volatileStaleness || pokemon.staleness;\r\n\t\t\t\tif (staleness) sideStaleness = sideStaleness === 'external' ? sideStaleness : staleness;\r\n\t\t\t\tpokemon.activeTurns++;\r\n\t\t\t}\r\n\t\t\ttrappedBySide.push(sideTrapped);\r\n\t\t\tstalenessBySide.push(sideStaleness);\r\n\t\t\tside.faintedLastTurn = side.faintedThisTurn;\r\n\t\t\tside.faintedThisTurn = null;\r\n\t\t}\r\n\r\n\t\tif (this.maybeTriggerEndlessBattleClause(trappedBySide, stalenessBySide)) return;\r\n\r\n\t\tif (this.gameType === 'triples' && this.sides.every(side => side.pokemonLeft === 1)) {\r\n\t\t\t// If both sides have one Pokemon left in triples and they are not adjacent, they are both moved to the center.\r\n\t\t\tconst actives = this.getAllActive();\r\n\t\t\tif (actives.length > 1 && !actives[0].isAdjacent(actives[1])) {\r\n\t\t\t\tthis.swapPosition(actives[0], 1, '[silent]');\r\n\t\t\t\tthis.swapPosition(actives[1], 1, '[silent]');\r\n\t\t\t\tthis.add('-center');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.add('turn', this.turn);\r\n\t\tif (this.gameType === 'multi') {\r\n\t\t\tfor (const side of this.sides) {\r\n\t\t\t\tif (side.canDynamaxNow()) {\r\n\t\t\t\t\tif (this.turn === 1) {\r\n\t\t\t\t\t\tthis.addSplit(side.id, ['-candynamax', side.id]);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.add('-candynamax', side.id);\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\tif (this.gen === 2) this.quickClawRoll = this.randomChance(60, 256);\r\n\t\tif (this.gen === 3) this.quickClawRoll = this.randomChance(1, 5);\r\n\r\n\t\t// Crazyhouse Progress checker because sidebars has trouble keeping track of Pokemon.\r\n\t\t// Please remove me once there is client support.\r\n\t\tif (this.ruleTable.has('crazyhouserule')) {\r\n\t\t\tfor (const side of this.sides) {\r\n\t\t\t\tlet buf = `raw|${side.name}'s team:
`;\r\n\t\t\t\tfor (const pokemon of side.pokemon) {\r\n\t\t\t\t\tif (!buf.endsWith('
')) buf += '/​';\r\n\t\t\t\t\tif (pokemon.fainted) {\r\n\t\t\t\t\t\tbuf += ``;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tbuf += ``;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.add(`${buf}`);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tthis.makeRequest('move');\r\n\t},\r\n\tactions: {\r\n\t\trunSwitch(pokemon) {\r\n\t\t\tthis.battle.runEvent('Swap', pokemon);\r\n\r\n\t\t\tif (this.battle.gen >= 5) {\r\n\t\t\t\tthis.battle.runEvent('SwitchIn', pokemon);\r\n\t\t\t}\r\n\r\n\t\t\tthis.battle.runEvent('EntryHazard', pokemon);\r\n\r\n\t\t\tif (this.battle.gen <= 4) {\r\n\t\t\t\tthis.battle.runEvent('SwitchIn', pokemon);\r\n\t\t\t}\r\n\r\n\t\t\tconst ally = pokemon.side.active.find(mon => mon && mon !== pokemon && !mon.fainted);\r\n\r\n\t\t\tif (this.battle.gen <= 2 && !pokemon.side.faintedThisTurn && pokemon.draggedIn !== this.battle.turn) {\r\n\t\t\t\tthis.battle.runEvent('AfterSwitchInSelf', pokemon);\r\n\t\t\t}\r\n\t\t\tif (!pokemon.hp) return false;\r\n\t\t\tpokemon.isStarted = true;\r\n\t\t\tif (!pokemon.fainted) {\r\n\t\t\t\tthis.battle.singleEvent('Start', pokemon.getAbility(), pokemon.abilityState, pokemon);\r\n\t\t\t\t// Start innates\r\n\t\t\t\tlet status;\r\n\t\t\t\tif (pokemon.m.startVolatile && pokemon.m.innate) {\r\n\t\t\t\t\tstatus = this.battle.dex.conditions.get(pokemon.m.innate);\r\n\t\t\t\t\tthis.battle.singleEvent('Start', status, pokemon.volatiles[status.id], pokemon);\r\n\t\t\t\t\tpokemon.m.startVolatile = false;\r\n\t\t\t\t}\r\n\t\t\t\tif (ally && ally.m.startVolatile && ally.m.innate) {\r\n\t\t\t\t\tstatus = this.battle.dex.conditions.get(ally.m.innate);\r\n\t\t\t\t\tthis.battle.singleEvent('Start', status, ally.volatiles[status.id], ally);\r\n\t\t\t\t\tally.m.startVolatile = false;\r\n\t\t\t\t}\r\n\t\t\t\t// pic end\r\n\t\t\t\tthis.battle.singleEvent('Start', pokemon.getItem(), pokemon.itemState, pokemon);\r\n\t\t\t}\r\n\t\t\tif (this.battle.gen === 4) {\r\n\t\t\t\tfor (const foeActive of pokemon.foes()) {\r\n\t\t\t\t\tfoeActive.removeVolatile('substitutebroken');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tpokemon.draggedIn = null;\r\n\t\t\treturn true;\r\n\t\t},\r\n\t},\r\n\tpokemon: {\r\n\t\tsetAbility(ability, source, isFromFormeChange) {\r\n\t\t\tif (!this.hp) return false;\r\n\t\t\tconst BAD_ABILITIES = ['trace', 'imposter', 'neutralizinggas', 'illusion', 'wanderingspirit'];\r\n\t\t\tif (typeof ability === 'string') ability = this.battle.dex.abilities.get(ability);\r\n\t\t\tconst oldAbility = this.ability;\r\n\t\t\tif (!isFromFormeChange) {\r\n\t\t\t\tif (ability.isPermanent || this.getAbility().isPermanent) return false;\r\n\t\t\t}\r\n\t\t\tif (!this.battle.runEvent('SetAbility', this, source, this.battle.effect, ability)) return false;\r\n\t\t\tthis.battle.singleEvent('End', this.battle.dex.abilities.get(oldAbility), this.abilityState, this, source);\r\n\t\t\tconst ally = this.side.active.find(mon => mon && mon !== this && !mon.fainted);\r\n\t\t\tif (ally?.m.innate) {\r\n\t\t\t\tally.removeVolatile(ally.m.innate);\r\n\t\t\t\tdelete ally.m.innate;\r\n\t\t\t}\r\n\t\t\tif (this.battle.effect && this.battle.effect.effectType === 'Move' && !isFromFormeChange) {\r\n\t\t\t\tthis.battle.add('-endability', this, this.battle.dex.abilities.get(oldAbility), '[from] move: ' +\r\n\t\t\t\t\tthis.battle.dex.moves.get(this.battle.effect.id));\r\n\t\t\t}\r\n\t\t\tthis.ability = ability.id;\r\n\t\t\tthis.abilityState = {id: ability.id, target: this};\r\n\t\t\tif (ability.id && this.battle.gen > 3) {\r\n\t\t\t\tthis.battle.singleEvent('Start', ability, this.abilityState, this, source);\r\n\t\t\t\tif (ally && ally.ability !== this.ability) {\r\n\t\t\t\t\tif (!this.m.innate) {\r\n\t\t\t\t\t\tthis.m.innate = 'ability:' + ally.getAbility().id;\r\n\t\t\t\t\t\tthis.addVolatile(this.m.innate);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (!BAD_ABILITIES.includes(ability.id)) {\r\n\t\t\t\t\t\tally.m.innate = 'ability:' + ability.id;\r\n\t\t\t\t\t\tally.addVolatile(ally.m.innate);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Entrainment\r\n\t\t\tif (this.m.innate && this.m.innate.endsWith(ability.id)) {\r\n\t\t\t\tthis.removeVolatile(this.m.innate);\r\n\t\t\t\tdelete this.m.innate;\r\n\t\t\t}\r\n\t\t\tthis.abilityOrder = this.battle.abilityOrder++;\r\n\t\t\treturn oldAbility;\r\n\t\t},\r\n\t\thasAbility(ability) {\r\n\t\t\tif (this.ignoringAbility()) return false;\r\n\t\t\tconst ownAbility = this.ability;\r\n\t\t\tconst ally = this.side.active.find(mon => mon && mon !== this && !mon.fainted);\r\n\t\t\tconst allyAbility = ally ? ally.ability : \"\";\r\n\t\t\tif (!Array.isArray(ability)) {\r\n\t\t\t\tif (ownAbility === this.battle.toID(ability) || allyAbility === this.battle.toID(ability)) return true;\r\n\t\t\t} else {\r\n\t\t\t\t if (ability.map(this.battle.toID).includes(ownAbility) || ability.map(this.battle.toID).includes(allyAbility)) {\r\n\t\t\t\t\t return true;\r\n\t\t\t\t }\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t},\r\n\t\ttransformInto(pokemon, effect) {\r\n\t\t\tconst species = pokemon.species;\r\n\t\t\tif (pokemon.fainted || pokemon.illusion || (pokemon.volatiles['substitute'] && this.battle.gen >= 5) ||\r\n\t\t\t\t(pokemon.transformed && this.battle.gen >= 2) || (this.transformed && this.battle.gen >= 5) ||\r\n\t\t\t\tspecies.name === 'Eternatus-Eternamax') {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (this.battle.dex.currentMod === 'gen1stadium' && (\r\n\t\t\t\tspecies.name === 'Ditto' ||\r\n\t\t\t\t(this.species.name === 'Ditto' && pokemon.moves.includes('transform'))\r\n\t\t\t)) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif (!this.setSpecies(species, effect, true)) return false;\r\n\r\n\t\t\tthis.transformed = true;\r\n\t\t\tthis.weighthg = pokemon.weighthg;\r\n\r\n\t\t\tconst types = pokemon.getTypes(true);\r\n\t\t\tthis.setType(pokemon.volatiles['roost'] ? pokemon.volatiles['roost'].typeWas : types, true);\r\n\t\t\tthis.addedType = pokemon.addedType;\r\n\t\t\tthis.knownType = this.isAlly(pokemon) && pokemon.knownType;\r\n\t\t\tthis.apparentType = pokemon.apparentType;\r\n\r\n\t\t\tlet statName: StatIDExceptHP;\r\n\t\t\tfor (statName in this.storedStats) {\r\n\t\t\t\tthis.storedStats[statName] = pokemon.storedStats[statName];\r\n\t\t\t\tif (this.modifiedStats) this.modifiedStats[statName] = pokemon.modifiedStats![statName]; // Gen 1: Copy modified stats.\r\n\t\t\t}\r\n\t\t\tthis.moveSlots = [];\r\n\t\t\tthis.set.ivs = (this.battle.gen >= 5 ? this.set.ivs : pokemon.set.ivs);\r\n\t\t\tthis.hpType = (this.battle.gen >= 5 ? this.hpType : pokemon.hpType);\r\n\t\t\tthis.hpPower = (this.battle.gen >= 5 ? this.hpPower : pokemon.hpPower);\r\n\t\t\tfor (const moveSlot of pokemon.moveSlots) {\r\n\t\t\t\tlet moveName = moveSlot.move;\r\n\t\t\t\tif (!pokemon.m.curMoves.includes(moveSlot.id)) continue;\r\n\t\t\t\tif (moveSlot.id === 'hiddenpower') {\r\n\t\t\t\t\tmoveName = 'Hidden Power ' + this.hpType;\r\n\t\t\t\t}\r\n\t\t\t\tthis.moveSlots.push({\r\n\t\t\t\t\tmove: moveName,\r\n\t\t\t\t\tid: moveSlot.id,\r\n\t\t\t\t\tpp: moveSlot.maxpp === 1 ? 1 : 5,\r\n\t\t\t\t\tmaxpp: this.battle.gen >= 5 ? (moveSlot.maxpp === 1 ? 1 : 5) : moveSlot.maxpp,\r\n\t\t\t\t\ttarget: moveSlot.target,\r\n\t\t\t\t\tdisabled: false,\r\n\t\t\t\t\tused: false,\r\n\t\t\t\t\tvirtual: true,\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\tthis.m.curMoves = pokemon.m.curMoves;\r\n\t\t\tlet boostName: BoostID;\r\n\t\t\tfor (boostName in pokemon.boosts) {\r\n\t\t\t\tthis.boosts[boostName] = pokemon.boosts[boostName];\r\n\t\t\t}\r\n\t\t\tif (this.battle.gen >= 6) {\r\n\t\t\t\tconst volatilesToCopy = ['focusenergy', 'gmaxchistrike', 'laserfocus'];\r\n\t\t\t\tfor (const volatile of volatilesToCopy) {\r\n\t\t\t\t\tif (pokemon.volatiles[volatile]) {\r\n\t\t\t\t\t\tthis.addVolatile(volatile);\r\n\t\t\t\t\t\tif (volatile === 'gmaxchistrike') this.volatiles[volatile].layers = pokemon.volatiles[volatile].layers;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.removeVolatile(volatile);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (effect) {\r\n\t\t\t\tthis.battle.add('-transform', this, pokemon, '[from] ' + effect.fullname);\r\n\t\t\t} else {\r\n\t\t\t\tthis.battle.add('-transform', this, pokemon);\r\n\t\t\t}\r\n\t\t\tif (this.battle.gen > 2) this.setAbility(pokemon.ability, this, true);\r\n\r\n\t\t\t// Change formes based on held items (for Transform)\r\n\t\t\t// Only ever relevant in Generation 4 since Generation 3 didn't have item-based forme changes\r\n\t\t\tif (this.battle.gen === 4) {\r\n\t\t\t\tif (this.species.num === 487) {\r\n\t\t\t\t\t// Giratina formes\r\n\t\t\t\t\tif (this.species.name === 'Giratina' && this.item === 'griseousorb') {\r\n\t\t\t\t\t\tthis.formeChange('Giratina-Origin');\r\n\t\t\t\t\t} else if (this.species.name === 'Giratina-Origin' && this.item !== 'griseousorb') {\r\n\t\t\t\t\t\tthis.formeChange('Giratina');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (this.species.num === 493) {\r\n\t\t\t\t\t// Arceus formes\r\n\t\t\t\t\tconst item = this.getItem();\r\n\t\t\t\t\tconst targetForme = (item?.onPlate ? 'Arceus-' + item.onPlate : 'Arceus');\r\n\t\t\t\t\tif (this.species.name !== targetForme) {\r\n\t\t\t\t\t\tthis.formeChange(targetForme);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t},\r\n\t\tdeductPP(move, amount, target) {\r\n\t\t\tconst gen = this.battle.gen;\r\n\t\t\tmove = this.battle.dex.moves.get(move);\r\n\t\t\tconst ppData = this.getMoveData(move);\r\n\t\t\tif (!ppData) return 0;\r\n\t\t\tppData.used = true;\r\n\t\t\tif (!ppData.pp && gen > 1) return 0;\r\n\r\n\t\t\tif (!amount) amount = 1;\r\n\t\t\tppData.pp -= amount;\r\n\t\t\tif (ppData.pp < 0 && gen > 1) {\r\n\t\t\t\tamount += ppData.pp;\r\n\t\t\t\tppData.pp = 0;\r\n\t\t\t}\r\n\t\t\tif (!this.m.curMoves.includes(move.id)) {\r\n\t\t\t\tthis.m.trackPP.set(move.id, (this.m.trackPP.get(move.id) || 0) + amount);\r\n\t\t\t}\r\n\t\t\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