Spaces:
Running
Running
{ | |
"version": 3, | |
"sources": ["../../../../data/mods/gen8linked/scripts.ts"], | |
"sourcesContent": ["export const Scripts: ModdedBattleScriptsData = {\n\tinherit: 'gen8',\n\tgen: 8,\n\tgetActionSpeed(action) {\n\t\tif (action.choice === 'move') {\n\t\t\tlet move = action.move;\n\t\t\tif (action.zmove) {\n\t\t\t\tconst zMoveName = this.actions.getZMove(action.move, action.pokemon, true);\n\t\t\t\tif (zMoveName) {\n\t\t\t\t\tconst zMove = this.dex.getActiveMove(zMoveName);\n\t\t\t\t\tif (zMove.exists && zMove.isZ) {\n\t\t\t\t\t\tmove = zMove;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (action.maxMove) {\n\t\t\t\tconst maxMoveName = this.actions.getMaxMove(action.maxMove, action.pokemon);\n\t\t\t\tif (maxMoveName) {\n\t\t\t\t\tconst maxMove = this.actions.getActiveMaxMove(action.move, action.pokemon);\n\t\t\t\t\tif (maxMove.exists && maxMove.isMax) {\n\t\t\t\t\t\tmove = maxMove;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// take priority from the base move, so abilities like Prankster only apply once\n\t\t\t// (instead of compounding every time `getActionSpeed` is called)\n\t\t\tlet priority = this.dex.moves.get(move.id).priority;\n\t\t\t// Grassy Glide priority\n\t\t\tpriority = this.singleEvent('ModifyPriority', move, null, action.pokemon, null, null, priority);\n\t\t\tpriority = this.runEvent('ModifyPriority', action.pokemon, null, move, priority);\n\t\t\t// Linked mod\n\t\t\tconst linkedMoves: [string, string] = action.pokemon.getLinkedMoves();\n\t\t\tlet linkIndex = -1;\n\t\t\tif (linkedMoves.length && !move.isZ && !move.isMax && (linkIndex = linkedMoves.indexOf(this.toID(action.move))) >= 0) {\n\t\t\t\tconst linkedActions = action.linked || linkedMoves.map(moveid => this.dex.getActiveMove(moveid));\n\t\t\t\tconst altMove = linkedActions[1 - linkIndex];\n\t\t\t\tconst thisPriority = this.runEvent('ModifyPriority', action.pokemon, null, linkedActions[linkIndex], priority);\n\t\t\t\tconst thatPriority = this.runEvent('ModifyPriority', action.pokemon, null, altMove, altMove.priority);\n\t\t\t\tpriority = Math.min(thisPriority, thatPriority);\n\t\t\t\taction.priority = priority + action.fractionalPriority;\n\t\t\t\tif (this.gen > 5) {\n\t\t\t\t\t// Gen 6+: Quick Guard blocks moves with artificially enhanced priority.\n\t\t\t\t\t// This also applies to Psychic Terrain.\n\t\t\t\t\tlinkedActions[linkIndex].priority = priority;\n\t\t\t\t\taltMove.priority = priority;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taction.priority = priority + action.fractionalPriority;\n\t\t\t\t// In Gen 6, Quick Guard blocks moves with artificially enhanced priority.\n\t\t\t\tif (this.gen > 5) action.move.priority = priority;\n\t\t\t}\n\t\t}\n\n\t\tif (!action.pokemon) {\n\t\t\taction.speed = 1;\n\t\t} else {\n\t\t\taction.speed = action.pokemon.getActionSpeed();\n\t\t}\n\t},\n\trunAction(action) {\n\t\tconst pokemonOriginalHP = action.pokemon?.hp;\n\t\tlet residualPokemon: (readonly [Pokemon, number])[] = [];\n\t\t// returns whether or not we ended in a callback\n\t\tswitch (action.choice) {\n\t\tcase 'start': {\n\t\t\tfor (const side of this.sides) {\n\t\t\t\tif (side.pokemonLeft) side.pokemonLeft = side.pokemon.length;\n\t\t\t}\n\n\t\t\tthis.add('start');\n\n\t\t\tif (this.format.onBattleStart) this.format.onBattleStart.call(this);\n\t\t\tfor (const rule of this.ruleTable.keys()) {\n\t\t\t\tif ('+*-!'.includes(rule.charAt(0))) continue;\n\t\t\t\tconst subFormat = this.dex.formats.get(rule);\n\t\t\t\tif (subFormat.onBattleStart) subFormat.onBattleStart.call(this);\n\t\t\t}\n\n\t\t\tfor (const side of this.sides) {\n\t\t\t\tfor (let i = 0; i < side.active.length; i++) {\n\t\t\t\t\tif (!side.pokemonLeft) {\n\t\t\t\t\t\t// forfeited before starting\n\t\t\t\t\t\tside.active[i] = side.pokemon[i];\n\t\t\t\t\t\tside.active[i].fainted = true;\n\t\t\t\t\t\tside.active[i].hp = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.actions.switchIn(side.pokemon[i], i);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const pokemon of this.getAllPokemon()) {\n\t\t\t\tthis.singleEvent('Start', this.dex.conditions.getByID(pokemon.species.id), pokemon.speciesState, pokemon);\n\t\t\t}\n\t\t\tthis.midTurn = true;\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'move':\n\t\t\tif (!action.pokemon.isActive) return false;\n\t\t\tif (action.pokemon.fainted) return false;\n\t\t\t// Linked moves\n\t\t\t// @ts-expect-error modded\n\t\t\tif (action.linked) {\n\t\t\t\t// @ts-expect-error modded\n\t\t\t\tconst linkedMoves: ActiveMove[] = action.linked;\n\t\t\t\tfor (let i = linkedMoves.length - 1; i >= 0; i--) {\n\t\t\t\t\tconst validTarget = this.validTargetLoc(action.targetLoc, action.pokemon, linkedMoves[i].target);\n\t\t\t\t\tconst targetLoc = validTarget ? action.targetLoc : 0;\n\t\t\t\t\tconst pseudoAction: Action = {\n\t\t\t\t\t\tchoice: 'move', priority: action.priority, speed: action.speed, pokemon: action.pokemon,\n\t\t\t\t\t\ttargetLoc, moveid: linkedMoves[i].id, move: linkedMoves[i], mega: action.mega,\n\t\t\t\t\t\torder: action.order, fractionalPriority: action.fractionalPriority, originalTarget: action.originalTarget,\n\t\t\t\t\t};\n\t\t\t\t\tthis.queue.unshift(pseudoAction);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.actions.runMove(action.move, action.pokemon, action.targetLoc, {\n\t\t\t\tsourceEffect: action.sourceEffect, zMove: action.zmove,\n\t\t\t\tmaxMove: action.maxMove, originalTarget: action.originalTarget,\n\t\t\t});\n\t\t\tbreak;\n\t\tcase 'megaEvo':\n\t\t\tthis.actions.runMegaEvo(action.pokemon);\n\t\t\tbreak;\n\t\tcase 'runDynamax':\n\t\t\taction.pokemon.addVolatile('dynamax');\n\t\t\taction.pokemon.side.dynamaxUsed = true;\n\t\t\tif (action.pokemon.side.allySide) action.pokemon.side.allySide.dynamaxUsed = true;\n\t\t\tbreak;\n\t\tcase 'beforeTurnMove': {\n\t\t\tif (!action.pokemon.isActive) return false;\n\t\t\tif (action.pokemon.fainted) return false;\n\t\t\tthis.debug('before turn callback: ' + action.move.id);\n\t\t\tconst target = this.getTarget(action.pokemon, action.move, action.targetLoc);\n\t\t\tif (!target) return false;\n\t\t\tif (!action.move.beforeTurnCallback) throw new Error(`beforeTurnMove has no beforeTurnCallback`);\n\t\t\taction.move.beforeTurnCallback.call(this, action.pokemon, target);\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'event':\n\t\t\tthis.runEvent(action.event!, action.pokemon);\n\t\t\tbreak;\n\t\tcase 'team':\n\t\t\tif (action.index === 0) {\n\t\t\t\taction.pokemon.side.pokemon = [];\n\t\t\t}\n\t\t\taction.pokemon.side.pokemon.push(action.pokemon);\n\t\t\taction.pokemon.position = action.index;\n\t\t\t// we return here because the update event would crash since there are no active pokemon yet\n\t\t\treturn;\n\n\t\tcase 'pass':\n\t\t\treturn;\n\t\tcase 'instaswitch':\n\t\tcase 'switch':\n\t\t\tif (action.choice === 'switch' && action.pokemon.status) {\n\t\t\t\tthis.singleEvent('CheckShow', this.dex.abilities.getByID('naturalcure' as ID), null, action.pokemon);\n\t\t\t}\n\t\t\tif (this.actions.switchIn(action.target, action.pokemon.position, action.sourceEffect) === 'pursuitfaint') {\n\t\t\t\t// a pokemon fainted from Pursuit before it could switch\n\t\t\t\tif (this.gen <= 4) {\n\t\t\t\t\t// in gen 2-4, the switch still happens\n\t\t\t\t\tthis.hint(\"Previously chosen switches continue in Gen 2-4 after a Pursuit target faints.\");\n\t\t\t\t\taction.priority = -101;\n\t\t\t\t\tthis.queue.unshift(action);\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\t// in gen 5+, the switch is cancelled\n\t\t\t\t\tthis.hint(\"A Pokemon can't switch between when it runs out of HP and when it faints\");\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'runSwitch':\n\t\t\tthis.actions.runSwitch(action.pokemon);\n\t\t\tbreak;\n\t\tcase 'shift':\n\t\t\tif (!action.pokemon.isActive) return false;\n\t\t\tif (action.pokemon.fainted) return false;\n\t\t\tthis.swapPosition(action.pokemon, 1);\n\t\t\tbreak;\n\n\t\tcase 'beforeTurn':\n\t\t\tthis.eachEvent('BeforeTurn');\n\t\t\tbreak;\n\t\tcase 'residual':\n\t\t\tthis.add('');\n\t\t\tthis.clearActiveMove(true);\n\t\t\tthis.updateSpeed();\n\t\t\tresidualPokemon = this.getAllActive().map(pokemon => [pokemon, pokemon.getUndynamaxedHP()] as const);\n\t\t\tthis.fieldEvent('Residual');\n\t\t\tthis.add('upkeep');\n\t\t\tbreak;\n\t\t}\n\n\t\t// phazing (Roar, etc)\n\t\tfor (const side of this.sides) {\n\t\t\tfor (const pokemon of side.active) {\n\t\t\t\tif (pokemon.forceSwitchFlag) {\n\t\t\t\t\tif (pokemon.hp) this.actions.dragIn(pokemon.side, pokemon.position);\n\t\t\t\t\tpokemon.forceSwitchFlag = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.clearActiveMove();\n\n\t\t// fainting\n\n\t\tthis.faintMessages();\n\t\tif (this.ended) return true;\n\n\t\t// switching (fainted pokemon, U-turn, Baton Pass, etc)\n\n\t\tif (!this.queue.peek() || (this.gen <= 3 && ['move', 'residual'].includes(this.queue.peek()!.choice))) {\n\t\t\t// in gen 3 or earlier, switching in fainted pokemon is done after\n\t\t\t// every move, rather than only at the end of the turn.\n\t\t\tthis.checkFainted();\n\t\t} else if (action.choice === 'megaEvo' && this.gen === 7) {\n\t\t\tthis.eachEvent('Update');\n\t\t\t// In Gen 7, the action order is recalculated for a Pok\u00E9mon that mega evolves.\n\t\t\tfor (const [i, queuedAction] of this.queue.list.entries()) {\n\t\t\t\tif (queuedAction.pokemon === action.pokemon && queuedAction.choice === 'move') {\n\t\t\t\t\tthis.queue.list.splice(i, 1);\n\t\t\t\t\tqueuedAction.mega = 'done';\n\t\t\t\t\tthis.queue.insertChoice(queuedAction, true);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t} else if (this.queue.peek()?.choice === 'instaswitch') {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (this.gen >= 5) {\n\t\t\tthis.eachEvent('Update');\n\t\t\tfor (const [pokemon, originalHP] of residualPokemon) {\n\t\t\t\tconst maxhp = pokemon.getUndynamaxedHP(pokemon.maxhp);\n\t\t\t\tif (pokemon.hp && pokemon.getUndynamaxedHP() <= maxhp / 2 && originalHP > maxhp / 2) {\n\t\t\t\t\tthis.runEvent('EmergencyExit', pokemon);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (action.choice === 'runSwitch') {\n\t\t\tconst pokemon = action.pokemon;\n\t\t\tif (pokemon.hp && pokemon.hp <= pokemon.maxhp / 2 && pokemonOriginalHP! > pokemon.maxhp / 2) {\n\t\t\t\tthis.runEvent('EmergencyExit', pokemon);\n\t\t\t}\n\t\t}\n\n\t\tconst switches = this.sides.map(\n\t\t\tside => side.active.some(pokemon => pokemon && !!pokemon.switchFlag)\n\t\t);\n\n\t\tfor (let i = 0; i < this.sides.length; i++) {\n\t\t\tif (switches[i] && !this.canSwitch(this.sides[i])) {\n\t\t\t\tfor (const pokemon of this.sides[i].active) {\n\t\t\t\t\tpokemon.switchFlag = false;\n\t\t\t\t}\n\t\t\t\tswitches[i] = false;\n\t\t\t} else if (switches[i]) {\n\t\t\t\tfor (const pokemon of this.sides[i].active) {\n\t\t\t\t\tif (pokemon.switchFlag && !pokemon.skipBeforeSwitchOutEventFlag) {\n\t\t\t\t\t\tthis.runEvent('BeforeSwitchOut', pokemon);\n\t\t\t\t\t\tpokemon.skipBeforeSwitchOutEventFlag = true;\n\t\t\t\t\t\tthis.faintMessages(); // Pokemon may have fainted in BeforeSwitchOut\n\t\t\t\t\t\tif (this.ended) return true;\n\t\t\t\t\t\tif (pokemon.fainted) {\n\t\t\t\t\t\t\tswitches[i] = this.sides[i].active.some(sidePokemon => sidePokemon && !!sidePokemon.switchFlag);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const playerSwitch of switches) {\n\t\t\tif (playerSwitch) {\n\t\t\t\tthis.makeRequest('switch');\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (this.gen < 5) this.eachEvent('Update');\n\n\t\tif (this.gen >= 8 && this.queue.peek()?.choice === 'move') {\n\t\t\t// In gen 8, speed is updated dynamically so update the queue's speed properties and sort it.\n\t\t\tthis.updateSpeed();\n\t\t\tfor (const queueAction of this.queue.list) {\n\t\t\t\tif (queueAction.pokemon) this.getActionSpeed(queueAction);\n\t\t\t}\n\t\t\tthis.queue.sort();\n\t\t}\n\n\t\treturn false;\n\t},\n\tactions: {\n\t\trunMove(moveOrMoveName, pokemon, targetLoc, options) {\n\t\t\tpokemon.activeMoveActions++;\n\t\t\tconst zMove = options?.zMove;\n\t\t\tconst maxMove = options?.maxMove;\n\t\t\tconst externalMove = options?.externalMove;\n\t\t\tconst originalTarget = options?.originalTarget;\n\t\t\tlet sourceEffect = options?.sourceEffect;\n\t\t\tlet target = this.battle.getTarget(pokemon, maxMove || zMove || moveOrMoveName, targetLoc, originalTarget);\n\t\t\tlet baseMove = this.dex.getActiveMove(moveOrMoveName);\n\t\t\tconst priority = baseMove.priority;\n\t\t\tconst pranksterBoosted = baseMove.pranksterBoosted;\n\t\t\tif (baseMove.id !== 'struggle' && !zMove && !maxMove && !externalMove) {\n\t\t\t\tconst changedMove = this.battle.runEvent('OverrideAction', pokemon, target, baseMove);\n\t\t\t\tif (changedMove && changedMove !== true) {\n\t\t\t\t\tbaseMove = this.dex.getActiveMove(changedMove);\n\t\t\t\t\tbaseMove.priority = priority;\n\t\t\t\t\tif (pranksterBoosted) baseMove.pranksterBoosted = pranksterBoosted;\n\t\t\t\t\ttarget = this.battle.getRandomTarget(pokemon, baseMove);\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet move = baseMove;\n\t\t\tif (zMove) {\n\t\t\t\tmove = this.getActiveZMove(baseMove, pokemon);\n\t\t\t} else if (maxMove) {\n\t\t\t\tmove = this.getActiveMaxMove(baseMove, pokemon);\n\t\t\t}\n\n\t\t\tmove.isExternal = externalMove;\n\n\t\t\tthis.battle.setActiveMove(move, pokemon, target);\n\n\t\t\t/* if (pokemon.moveThisTurn) {\n\t\t\t\t// THIS IS PURELY A SANITY CHECK\n\t\t\t\t// DO NOT TAKE ADVANTAGE OF THIS TO PREVENT A POKEMON FROM MOVING;\n\t\t\t\t// USE this.queue.cancelMove INSTEAD\n\t\t\t\tthis.debug(`${pokemon.id} INCONSISTENT STATE, ALREADY MOVED: ${pokemon.moveThisTurn}`);\n\t\t\t\tthis.clearActiveMove(true);\n\t\t\t\treturn;\n\t\t\t\t} */\n\t\t\tconst willTryMove = this.battle.runEvent('BeforeMove', pokemon, target, move);\n\t\t\tif (!willTryMove) {\n\t\t\t\tif (pokemon.volatiles['twoturnmove']?.move === move.id) {\n\t\t\t\t\tpokemon.removeVolatile('twoturnmove');\n\t\t\t\t}\n\t\t\t\tthis.battle.runEvent('MoveAborted', pokemon, target, move);\n\t\t\t\tthis.battle.clearActiveMove(true);\n\t\t\t\t// The event 'BeforeMove' could have returned false or null\n\t\t\t\t// false indicates that this counts as a move failing for the purpose of calculating Stomping Tantrum's base power\n\t\t\t\t// null indicates the opposite, as the Pokemon didn't have an option to choose anything\n\t\t\t\tpokemon.moveThisTurnResult = willTryMove;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (move.beforeMoveCallback) {\n\t\t\t\tif (move.beforeMoveCallback.call(this.battle, pokemon, target, move)) {\n\t\t\t\t\tthis.battle.clearActiveMove(true);\n\t\t\t\t\tpokemon.moveThisTurnResult = false;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpokemon.lastDamage = 0;\n\t\t\tlet lockedMove;\n\t\t\tif (!externalMove) {\n\t\t\t\tlockedMove = this.battle.runEvent('LockMove', pokemon);\n\t\t\t\tif (lockedMove === true) lockedMove = false;\n\t\t\t\tif (!lockedMove) {\n\t\t\t\t\tif (!pokemon.deductPP(baseMove, null, target) && (move.id !== 'struggle')) {\n\t\t\t\t\t\tthis.battle.add('cant', pokemon, 'nopp', move);\n\t\t\t\t\t\tconst gameConsole = [\n\t\t\t\t\t\t\tnull, 'Game Boy', 'Game Boy Color', 'Game Boy Advance', 'DS', 'DS', '3DS', '3DS',\n\t\t\t\t\t\t][this.battle.gen] || 'Switch';\n\t\t\t\t\t\tthis.battle.hint(`This is not a bug, this is really how it works on the ${gameConsole}; try it yourself if you don't believe us.`);\n\t\t\t\t\t\tthis.battle.clearActiveMove(true);\n\t\t\t\t\t\tpokemon.moveThisTurnResult = false;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tsourceEffect = this.dex.conditions.get('lockedmove');\n\t\t\t\t}\n\t\t\t\tpokemon.moveUsed(move, targetLoc);\n\t\t\t}\n\n\t\t\t// Dancer Petal Dance hack\n\t\t\t// TODO: implement properly\n\t\t\tconst noLock = externalMove && !pokemon.volatiles.lockedmove;\n\n\t\t\tif (zMove) {\n\t\t\t\tif (pokemon.illusion) {\n\t\t\t\t\tthis.battle.singleEvent('End', this.dex.abilities.get('Illusion'), pokemon.abilityState, pokemon);\n\t\t\t\t}\n\t\t\t\tthis.battle.add('-zpower', pokemon);\n\t\t\t\tpokemon.side.zMoveUsed = true;\n\t\t\t}\n\t\t\tconst moveDidSomething = this.useMove(baseMove, pokemon, { target, sourceEffect, zMove, maxMove });\n\t\t\tthis.battle.lastSuccessfulMoveThisTurn = moveDidSomething ? this.battle.activeMove && this.battle.activeMove.id : null;\n\t\t\tif (this.battle.activeMove) move = this.battle.activeMove;\n\t\t\tthis.battle.singleEvent('AfterMove', move, null, pokemon, target, move);\n\t\t\tthis.battle.runEvent('AfterMove', pokemon, target, move);\n\n\t\t\t// Dancer's activation order is completely different from any other event, so it's handled separately\n\t\t\tif (move.flags['dance'] && moveDidSomething && !move.isExternal) {\n\t\t\t\tconst dancers = [];\n\t\t\t\tfor (const currentPoke of this.battle.getAllActive()) {\n\t\t\t\t\tif (pokemon === currentPoke) continue;\n\t\t\t\t\tif (currentPoke.hasAbility('dancer') && !currentPoke.isSemiInvulnerable()) {\n\t\t\t\t\t\tdancers.push(currentPoke);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Dancer activates in order of lowest speed stat to highest\n\t\t\t\t// Note that the speed stat used is after any volatile replacements like Speed Swap,\n\t\t\t\t// but before any multipliers like Agility or Choice Scarf\n\t\t\t\t// Ties go to whichever Pokemon has had the ability for the least amount of time\n\t\t\t\tdancers.sort((a, b) => -(b.storedStats['spe'] - a.storedStats['spe']) ||\n\t\t\t\t\tb.abilityState.effectOrder - a.abilityState.effectOrder);\n\t\t\t\tfor (const dancer of dancers) {\n\t\t\t\t\tif (this.battle.faintMessages()) break;\n\t\t\t\t\tif (dancer.fainted) continue;\n\t\t\t\t\tthis.battle.add('-activate', dancer, 'ability: Dancer');\n\t\t\t\t\tconst dancersTarget = !target!.isAlly(dancer) && pokemon.isAlly(dancer) ? target! : pokemon;\n\t\t\t\t\tthis.runMove(move.id, dancer, dancer.getLocOf(dancersTarget),\n\t\t\t\t\t\t{ sourceEffect: this.dex.abilities.get('dancer'), externalMove: true });\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (noLock && pokemon.volatiles['lockedmove']) delete pokemon.volatiles['lockedmove'];\n\t\t\tthis.battle.faintMessages();\n\t\t\tthis.battle.checkWin();\n\t\t},\n\t},\n\tqueue: {\n\t\tresolveAction(action, midTurn = false) {\n\t\t\tif (!action) throw new Error(`Action not passed to resolveAction`);\n\t\t\tif (action.choice === 'pass') return [];\n\t\t\tconst actions = [action];\n\n\t\t\tif (!action.side && action.pokemon) action.side = action.pokemon.side;\n\t\t\tif (!action.move && action.moveid) action.move = this.battle.dex.getActiveMove(action.moveid);\n\t\t\tif (!action.order) {\n\t\t\t\tconst orders: { [choice: string]: number } = {\n\t\t\t\t\tteam: 1,\n\t\t\t\t\tstart: 2,\n\t\t\t\t\tinstaswitch: 3,\n\t\t\t\t\tbeforeTurn: 4,\n\t\t\t\t\tbeforeTurnMove: 5,\n\n\t\t\t\t\trunUnnerve: 100,\n\t\t\t\t\trunSwitch: 101,\n\t\t\t\t\t// runPrimal: 102, (deprecated)\n\t\t\t\t\tswitch: 103,\n\t\t\t\t\tmegaEvo: 104,\n\t\t\t\t\trunDynamax: 105,\n\n\t\t\t\t\tshift: 200,\n\t\t\t\t\t// default is 200 (for moves)\n\n\t\t\t\t\tresidual: 300,\n\t\t\t\t};\n\t\t\t\tif (action.choice in orders) {\n\t\t\t\t\taction.order = orders[action.choice];\n\t\t\t\t} else {\n\t\t\t\t\taction.order = 200;\n\t\t\t\t\tif (!['move', 'event'].includes(action.choice)) {\n\t\t\t\t\t\tthrow new Error(`Unexpected orderless action ${action.choice}`);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!midTurn) {\n\t\t\t\tif (action.choice === 'move') {\n\t\t\t\t\tif (!action.maxMove && !action.zmove && action.move.beforeTurnCallback) {\n\t\t\t\t\t\tactions.unshift(...this.resolveAction({\n\t\t\t\t\t\t\tchoice: 'beforeTurnMove', pokemon: action.pokemon, move: action.move, targetLoc: action.targetLoc,\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t\tif (action.mega && !action.pokemon.isSkyDropped()) {\n\t\t\t\t\t\tactions.unshift(...this.resolveAction({\n\t\t\t\t\t\t\tchoice: 'megaEvo',\n\t\t\t\t\t\t\tpokemon: action.pokemon,\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t\tif (action.maxMove && !action.pokemon.volatiles['dynamax']) {\n\t\t\t\t\t\tactions.unshift(...this.resolveAction({\n\t\t\t\t\t\t\tchoice: 'runDynamax',\n\t\t\t\t\t\t\tpokemon: action.pokemon,\n\t\t\t\t\t\t}));\n\t\t\t\t\t}\n\t\t\t\t\taction.fractionalPriority = this.battle.runEvent('FractionalPriority', action.pokemon, null, action.move, 0);\n\t\t\t\t\tconst linkedMoves: [string, string] = action.pokemon.getLinkedMoves();\n\t\t\t\t\tif (\n\t\t\t\t\t\tlinkedMoves.length &&\n\t\t\t\t\t\t!(action.pokemon.getItem().isChoice || action.pokemon.hasAbility('gorillatactics')) &&\n\t\t\t\t\t\t!action.zmove && !action.maxMove\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst decisionMove = this.battle.toID(action.move);\n\t\t\t\t\t\tif (linkedMoves.includes(decisionMove)) {\n\t\t\t\t\t\t\taction.linked = linkedMoves.map(moveid => this.battle.dex.getActiveMove(moveid));\n\t\t\t\t\t\t\tconst linkedOtherMove = action.linked[1 - linkedMoves.indexOf(decisionMove)];\n\t\t\t\t\t\t\tif (linkedOtherMove.beforeTurnCallback) {\n\t\t\t\t\t\t\t\tthis.addChoice({\n\t\t\t\t\t\t\t\t\tchoice: 'beforeTurnMove',\n\t\t\t\t\t\t\t\t\tpokemon: action.pokemon,\n\t\t\t\t\t\t\t\t\tmove: linkedOtherMove,\n\t\t\t\t\t\t\t\t\ttargetLoc: action.targetLoc,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (['switch', 'instaswitch'].includes(action.choice)) {\n\t\t\t\t\tif (typeof action.pokemon.switchFlag === 'string') {\n\t\t\t\t\t\taction.sourceEffect = this.battle.dex.moves.get(action.pokemon.switchFlag as ID) as any;\n\t\t\t\t\t}\n\t\t\t\t\taction.pokemon.switchFlag = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst deferPriority = this.battle.gen === 7 && action.mega && action.mega !== 'done';\n\t\t\tif (action.move) {\n\t\t\t\tlet target = null;\n\t\t\t\taction.move = this.battle.dex.getActiveMove(action.move);\n\n\t\t\t\tif (!action.targetLoc) {\n\t\t\t\t\ttarget = this.battle.getRandomTarget(action.pokemon, action.move);\n\t\t\t\t\t// TODO: what actually happens here?\n\t\t\t\t\tif (target) action.targetLoc = action.pokemon.getLocOf(target);\n\t\t\t\t}\n\t\t\t\taction.originalTarget = action.pokemon.getAtLoc(action.targetLoc);\n\t\t\t}\n\t\t\tif (!deferPriority) this.battle.getActionSpeed(action);\n\t\t\treturn actions as any;\n\t\t},\n\t},\n\tpokemon: {\n\t\tmoveUsed(move, targetLoc) {\n\t\t\tif (!this.moveThisTurn) this.m.lastMoveAbsolute = move;\n\t\t\tthis.lastMove = move;\n\t\t\tthis.moveThisTurn = move.id;\n\t\t\tthis.lastMoveTargetLoc = targetLoc;\n\t\t},\n\t\tgetLinkedMoves(ignoreDisabled) {\n\t\t\tconst linkedMoves = this.moveSlots.slice(0, 2);\n\t\t\tif (linkedMoves.length !== 2 || linkedMoves[0].pp <= 0 || linkedMoves[1].pp <= 0) return [];\n\t\t\tconst ret = [linkedMoves[0].id, linkedMoves[1].id];\n\t\t\tif (ignoreDisabled) return ret;\n\t\t\tif (!this.ateBerry && ret.includes('belch' as ID)) return [];\n\t\t\tif (this.hasItem('assaultvest') &&\n\t\t\t\t(this.battle.dex.moves.get(ret[0]).category === 'Status' || this.battle.dex.moves.get(ret[1]).category === 'Status')) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn ret;\n\t\t},\n\t\thasLinkedMove(moveid) {\n\t\t\t// @ts-expect-error modded\n\t\t\tconst linkedMoves: ID[] = this.getLinkedMoves(true);\n\t\t\tif (!linkedMoves.length) return false;\n\t\t\treturn linkedMoves.some(x => x === moveid);\n\t\t},\n\t},\n};\n"], | |
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAA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