Spaces:
Running
Running
{ | |
"version": 3, | |
"sources": ["../../../../data/mods/gen2/scripts.ts"], | |
"sourcesContent": ["/**\n * Gen 2 scripts.\n */\n\nexport const Scripts: ModdedBattleScriptsData = {\n\tinherit: 'gen3',\n\tgen: 2,\n\tpokemon: {\n\t\tinherit: true,\n\t\tgetStat(statName, unboosted, unmodified, fastReturn) {\n\t\t\t// @ts-expect-error type checking prevents 'hp' from being passed, but we're paranoid\n\t\t\tif (statName === 'hp') throw new Error(\"Please read `maxhp` directly\");\n\n\t\t\t// base stat\n\t\t\tlet stat = this.storedStats[statName];\n\n\t\t\t// Stat boosts.\n\t\t\tif (!unboosted) {\n\t\t\t\tlet boost = this.boosts[statName];\n\t\t\t\tif (boost > 6) boost = 6;\n\t\t\t\tif (boost < -6) boost = -6;\n\t\t\t\tif (boost >= 0) {\n\t\t\t\t\tconst boostTable = [1, 1.5, 2, 2.5, 3, 3.5, 4];\n\t\t\t\t\tstat = Math.floor(stat * boostTable[boost]);\n\t\t\t\t} else {\n\t\t\t\t\tconst numerators = [100, 66, 50, 40, 33, 28, 25];\n\t\t\t\t\tstat = Math.floor(stat * numerators[-boost] / 100);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.status === 'par' && statName === 'spe') {\n\t\t\t\tstat = Math.floor(stat / 4);\n\t\t\t}\n\n\t\t\tif (!unmodified) {\n\t\t\t\t// Burn attack drop is checked when you get the attack stat upon switch in and used until switch out.\n\t\t\t\tif (this.status === 'brn' && statName === 'atk') {\n\t\t\t\t\tstat = Math.floor(stat / 2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Gen 2 caps stats at 999 and min is 1.\n\t\t\tstat = this.battle.clampIntRange(stat, 1, 999);\n\t\t\tif (fastReturn) return stat;\n\n\t\t\t// Screens\n\t\t\tif (!unboosted) {\n\t\t\t\tif (\n\t\t\t\t\t(statName === 'def' && this.side.sideConditions['reflect']) ||\n\t\t\t\t\t(statName === 'spd' && this.side.sideConditions['lightscreen'])\n\t\t\t\t) {\n\t\t\t\t\tstat *= 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Handle boosting items\n\t\t\tif (\n\t\t\t\t(['Cubone', 'Marowak'].includes(this.baseSpecies.name) && this.item === 'thickclub' && statName === 'atk') ||\n\t\t\t\t(this.baseSpecies.name === 'Pikachu' && this.item === 'lightball' && statName === 'spa')\n\t\t\t) {\n\t\t\t\tstat *= 2;\n\t\t\t} else if (this.baseSpecies.name === 'Ditto' && this.item === 'metalpowder' && ['def', 'spd'].includes(statName)) {\n\t\t\t\tstat = Math.floor(stat * 1.5);\n\t\t\t}\n\n\t\t\treturn stat;\n\t\t},\n\t\tboostBy(boost) {\n\t\t\tlet delta = 0;\n\t\t\tlet i: BoostID;\n\t\t\tfor (i in boost) {\n\t\t\t\tdelta = boost[i]!;\n\t\t\t\tif (delta > 0 && this.getStat(i as StatIDExceptHP, false, true) === 999) {\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthis.boosts[i] += delta;\n\t\t\t\tif (this.boosts[i] > 6) {\n\t\t\t\t\tdelta -= this.boosts[i] - 6;\n\t\t\t\t\tthis.boosts[i] = 6;\n\t\t\t\t}\n\t\t\t\tif (this.boosts[i] < -6) {\n\t\t\t\t\tdelta -= this.boosts[i] - (-6);\n\t\t\t\t\tthis.boosts[i] = -6;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn delta;\n\t\t},\n\t},\n\tactions: {\n\t\tinherit: true,\n\t\trunMove(moveOrMoveName, pokemon, targetLoc, options) {\n\t\t\tlet move = this.dex.getActiveMove(moveOrMoveName);\n\t\t\tlet target = this.battle.getTarget(pokemon, move, targetLoc);\n\t\t\tif (!options?.sourceEffect && move.id !== 'struggle') {\n\t\t\t\tconst changedMove = this.battle.runEvent('OverrideAction', pokemon, target, move);\n\t\t\t\tif (changedMove && changedMove !== true) {\n\t\t\t\t\tmove = this.dex.getActiveMove(changedMove);\n\t\t\t\t\ttarget = this.battle.getRandomTarget(pokemon, move);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!target && target !== false) target = this.battle.getRandomTarget(pokemon, move);\n\n\t\t\tthis.battle.setActiveMove(move, pokemon, target);\n\n\t\t\tif (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.battle.queue.cancelMove INSTEAD\n\t\t\t\tthis.battle.debug(`${pokemon.fullname} INCONSISTENT STATE, ALREADY MOVED: ${pokemon.moveThisTurn}`);\n\t\t\t\tthis.battle.clearActiveMove(true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (!this.battle.runEvent('BeforeMove', pokemon, target, move)) {\n\t\t\t\tthis.battle.runEvent('MoveAborted', pokemon, target, move);\n\t\t\t\tthis.battle.clearActiveMove(true);\n\t\t\t\t// This is only run for sleep and fully paralysed.\n\t\t\t\tthis.battle.runEvent('AfterMoveSelf', pokemon, target, move);\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\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpokemon.lastDamage = 0;\n\t\t\tlet lockedMove = this.battle.runEvent('LockMove', pokemon);\n\t\t\tif (lockedMove === true) lockedMove = false;\n\t\t\tif (!lockedMove) {\n\t\t\t\tif (!pokemon.deductPP(move, null, target) && (move.id !== 'struggle')) {\n\t\t\t\t\tthis.battle.add('cant', pokemon, 'nopp', move);\n\t\t\t\t\tthis.battle.clearActiveMove(true);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpokemon.moveUsed(move);\n\t\t\tthis.battle.actions.useMove(move, pokemon, { target, sourceEffect: options?.sourceEffect });\n\t\t\tthis.battle.singleEvent('AfterMove', move, null, pokemon, target, move);\n\t\t\tif (!move.selfSwitch && pokemon.side.foe.active[0].hp) this.battle.runEvent('AfterMoveSelf', pokemon, target, move);\n\t\t},\n\t\ttryMoveHit(target, pokemon, move) {\n\t\t\tconst positiveBoostTable = [1, 1.33, 1.66, 2, 2.33, 2.66, 3];\n\t\t\tconst negativeBoostTable = [1, 0.75, 0.6, 0.5, 0.43, 0.36, 0.33];\n\t\t\tconst doSelfDestruct = true;\n\t\t\tlet damage: number | false | undefined = 0;\n\n\t\t\tif (move.selfdestruct && doSelfDestruct) {\n\t\t\t\tthis.battle.faint(pokemon, pokemon, move);\n\t\t\t}\n\n\t\t\tlet hitResult = this.battle.singleEvent('PrepareHit', move, {}, target, pokemon, move);\n\t\t\tif (!hitResult) {\n\t\t\t\tif (hitResult === false) this.battle.add('-fail', target);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tthis.battle.runEvent('PrepareHit', pokemon, target, move);\n\n\t\t\tif (!this.battle.singleEvent('Try', move, null, pokemon, target, move)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (move.target === 'all' || move.target === 'foeSide' || move.target === 'allySide' || move.target === 'allyTeam') {\n\t\t\t\tif (move.target === 'all') {\n\t\t\t\t\thitResult = this.battle.runEvent('TryHitField', target, pokemon, move);\n\t\t\t\t} else {\n\t\t\t\t\thitResult = this.battle.runEvent('TryHitSide', target, pokemon, move);\n\t\t\t\t}\n\t\t\t\tif (!hitResult) {\n\t\t\t\t\tif (hitResult === false) {\n\t\t\t\t\t\tthis.battle.add('-fail', pokemon);\n\t\t\t\t\t\tthis.battle.attrLastMove('[still]');\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn this.moveHit(target, pokemon, move);\n\t\t\t}\n\n\t\t\thitResult = this.battle.runEvent('Invulnerability', target, pokemon, move);\n\t\t\tif (hitResult === false) {\n\t\t\t\tthis.battle.attrLastMove('[miss]');\n\t\t\t\tthis.battle.add('-miss', pokemon);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (move.ignoreImmunity === undefined) {\n\t\t\t\tmove.ignoreImmunity = (move.category === 'Status');\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\t(!move.ignoreImmunity || (move.ignoreImmunity !== true && !move.ignoreImmunity[move.type])) &&\n\t\t\t\t!target.runImmunity(move.type, true)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thitResult = this.battle.singleEvent('TryImmunity', move, {}, target, pokemon, move);\n\t\t\tif (hitResult === false) {\n\t\t\t\tthis.battle.add('-immune', target);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\thitResult = this.battle.runEvent('TryHit', target, pokemon, move);\n\t\t\tif (!hitResult) {\n\t\t\t\tif (hitResult === false) this.battle.add('-fail', target);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tlet accuracy = move.accuracy;\n\t\t\tif (move.alwaysHit) {\n\t\t\t\taccuracy = true;\n\t\t\t} else {\n\t\t\t\taccuracy = this.battle.runEvent('Accuracy', target, pokemon, move, accuracy);\n\t\t\t}\n\t\t\t// Now, let's calculate the accuracy.\n\t\t\tif (accuracy !== true) {\n\t\t\t\taccuracy = Math.floor(accuracy * 255 / 100);\n\t\t\t\tif (move.ohko) {\n\t\t\t\t\tif (pokemon.level >= target.level) {\n\t\t\t\t\t\taccuracy += (pokemon.level - target.level) * 2;\n\t\t\t\t\t\taccuracy = Math.min(accuracy, 255);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.battle.add('-immune', target, '[ohko]');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!move.ignoreAccuracy) {\n\t\t\t\t\tif (pokemon.boosts.accuracy > 0) {\n\t\t\t\t\t\taccuracy *= positiveBoostTable[pokemon.boosts.accuracy];\n\t\t\t\t\t} else {\n\t\t\t\t\t\taccuracy *= negativeBoostTable[-pokemon.boosts.accuracy];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!move.ignoreEvasion) {\n\t\t\t\t\tif (target.boosts.evasion > 0 && !move.ignorePositiveEvasion) {\n\t\t\t\t\t\taccuracy *= negativeBoostTable[target.boosts.evasion];\n\t\t\t\t\t} else if (target.boosts.evasion < 0) {\n\t\t\t\t\t\taccuracy *= positiveBoostTable[-target.boosts.evasion];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taccuracy = Math.min(Math.floor(accuracy), 255);\n\t\t\t\taccuracy = Math.max(accuracy, 1);\n\t\t\t} else {\n\t\t\t\taccuracy = this.battle.runEvent('Accuracy', target, pokemon, move, accuracy);\n\t\t\t}\n\t\t\taccuracy = this.battle.runEvent('ModifyAccuracy', target, pokemon, move, accuracy);\n\t\t\tif (accuracy !== true) accuracy = Math.max(accuracy, 0);\n\t\t\tif (move.alwaysHit) {\n\t\t\t\taccuracy = true;\n\t\t\t} else {\n\t\t\t\taccuracy = this.battle.runEvent('Accuracy', target, pokemon, move, accuracy);\n\t\t\t}\n\t\t\tif (accuracy !== true && accuracy !== 255 && !this.battle.randomChance(accuracy, 256)) {\n\t\t\t\tthis.battle.attrLastMove('[miss]');\n\t\t\t\tthis.battle.add('-miss', pokemon);\n\t\t\t\tdamage = false;\n\t\t\t\treturn damage;\n\t\t\t}\n\t\t\tmove.totalDamage = 0;\n\t\t\tpokemon.lastDamage = 0;\n\t\t\tif (move.multihit) {\n\t\t\t\tlet hits = move.multihit;\n\t\t\t\tif (Array.isArray(hits)) {\n\t\t\t\t\tif (hits[0] === 2 && hits[1] === 5) {\n\t\t\t\t\t\thits = this.battle.sample([2, 2, 2, 3, 3, 3, 4, 5]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\thits = this.battle.random(hits[0], hits[1] + 1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\thits = Math.floor(hits);\n\t\t\t\tlet nullDamage = true;\n\t\t\t\tlet moveDamage: number | undefined | false;\n\n\t\t\t\tconst isSleepUsable = move.sleepUsable || this.dex.moves.get(move.sourceEffect).sleepUsable;\n\t\t\t\tlet i: number;\n\t\t\t\tfor (i = 0; i < hits && target.hp && pokemon.hp; i++) {\n\t\t\t\t\tif (pokemon.status === 'slp' && !isSleepUsable) break;\n\t\t\t\t\tmove.hit = i + 1;\n\t\t\t\t\tif (move.hit === hits) move.lastHit = true;\n\t\t\t\t\tmoveDamage = this.moveHit(target, pokemon, move);\n\t\t\t\t\tif (moveDamage === false) break;\n\t\t\t\t\tif (nullDamage && (moveDamage || moveDamage === 0 || moveDamage === undefined)) nullDamage = false;\n\t\t\t\t\tdamage = (moveDamage || 0);\n\t\t\t\t\tmove.totalDamage += damage;\n\t\t\t\t\tthis.battle.eachEvent('Update');\n\t\t\t\t}\n\t\t\t\tif (i === 0) return 1;\n\t\t\t\tif (nullDamage) damage = false;\n\t\t\t\tthis.battle.add('-hitcount', target, i);\n\t\t\t} else {\n\t\t\t\tdamage = this.moveHit(target, pokemon, move);\n\t\t\t\tmove.totalDamage = damage;\n\t\t\t}\n\t\t\tif (move.category !== 'Status') {\n\t\t\t\ttarget.gotAttacked(move, damage, pokemon);\n\t\t\t}\n\t\t\tif (move.ohko) this.battle.add('-ohko');\n\n\t\t\tif (!move.negateSecondary) {\n\t\t\t\tthis.battle.singleEvent('AfterMoveSecondary', move, null, target, pokemon, move);\n\t\t\t\tthis.battle.runEvent('AfterMoveSecondary', target, pokemon, move);\n\t\t\t}\n\n\t\t\tif (move.recoil && move.totalDamage) {\n\t\t\t\tthis.battle.damage(this.calcRecoilDamage(move.totalDamage, move, pokemon), pokemon, target, 'recoil');\n\t\t\t}\n\t\t\treturn damage;\n\t\t},\n\t\tmoveHit(target, pokemon, move, moveData, isSecondary, isSelf) {\n\t\t\tlet damage: number | false | null | undefined = undefined;\n\t\t\tmove = this.dex.getActiveMove(move);\n\n\t\t\tif (!moveData) moveData = move;\n\t\t\tlet hitResult: boolean | number | null = true;\n\n\t\t\tif (move.target === 'all' && !isSelf) {\n\t\t\t\thitResult = this.battle.singleEvent('TryHitField', moveData, {}, target, pokemon, move);\n\t\t\t} else if ((move.target === 'foeSide' || move.target === 'allySide') && !isSelf) {\n\t\t\t\thitResult = this.battle.singleEvent('TryHitSide', moveData, {}, (target ? target.side : null), pokemon, move);\n\t\t\t} else if (target) {\n\t\t\t\thitResult = this.battle.singleEvent('TryHit', moveData, {}, target, pokemon, move);\n\t\t\t}\n\t\t\tif (!hitResult) {\n\t\t\t\tif (hitResult === false) this.battle.add('-fail', target);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (target && !isSecondary && !isSelf) {\n\t\t\t\thitResult = this.battle.runEvent('TryPrimaryHit', target, pokemon, moveData);\n\t\t\t\tif (hitResult === 0) {\n\t\t\t\t\t// special Substitute flag\n\t\t\t\t\thitResult = true;\n\t\t\t\t\ttarget = null;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (target && isSecondary && !moveData.self) {\n\t\t\t\thitResult = true;\n\t\t\t}\n\t\t\tif (!hitResult) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (target) {\n\t\t\t\tlet didSomething: boolean | number | null = false;\n\t\t\t\tdamage = this.getDamage(pokemon, target, moveData);\n\n\t\t\t\tif ((damage || damage === 0) && !target.fainted) {\n\t\t\t\t\tdamage = this.battle.damage(damage, target, pokemon, move);\n\t\t\t\t\tif (!(damage || damage === 0)) {\n\t\t\t\t\t\tthis.battle.debug('damage interrupted');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tdidSomething = true;\n\t\t\t\t}\n\t\t\t\tif (damage === false || damage === null) {\n\t\t\t\t\tif (damage === false && !isSecondary && !isSelf) {\n\t\t\t\t\t\tthis.battle.add('-fail', target);\n\t\t\t\t\t}\n\t\t\t\t\tthis.battle.debug('damage calculation interrupted');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (moveData.boosts && !target.fainted) {\n\t\t\t\t\tif (\n\t\t\t\t\t\tpokemon.volatiles['lockon'] && target === pokemon.volatiles['lockon'].source &&\n\t\t\t\t\t\ttarget.isSemiInvulnerable() && !isSelf\n\t\t\t\t\t) {\n\t\t\t\t\t\tif (!isSecondary) this.battle.add('-fail', target);\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\thitResult = this.battle.boost(moveData.boosts, target, pokemon, move);\n\t\t\t\t\tdidSomething = didSomething || hitResult;\n\t\t\t\t}\n\t\t\t\tif (moveData.heal && !target.fainted) {\n\t\t\t\t\tconst d = target.heal(Math.round(target.maxhp * moveData.heal[0] / moveData.heal[1]));\n\t\t\t\t\tif (!d && d !== 0) {\n\t\t\t\t\t\tthis.battle.add('-fail', target);\n\t\t\t\t\t\tthis.battle.debug('heal interrupted');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tthis.battle.add('-heal', target, target.getHealth);\n\t\t\t\t\tdidSomething = true;\n\t\t\t\t}\n\t\t\t\tif (moveData.status) {\n\t\t\t\t\thitResult = target.trySetStatus(moveData.status, pokemon, move);\n\t\t\t\t\tif (!hitResult && move.status) return hitResult;\n\t\t\t\t\tdidSomething = didSomething || hitResult;\n\t\t\t\t}\n\t\t\t\tif (moveData.forceStatus) {\n\t\t\t\t\thitResult = target.setStatus(moveData.forceStatus, pokemon, move);\n\t\t\t\t\tdidSomething = didSomething || hitResult;\n\t\t\t\t}\n\t\t\t\tif (moveData.volatileStatus) {\n\t\t\t\t\thitResult = target.addVolatile(moveData.volatileStatus, pokemon, move);\n\t\t\t\t\tdidSomething = didSomething || hitResult;\n\t\t\t\t}\n\t\t\t\tif (moveData.sideCondition) {\n\t\t\t\t\thitResult = target.side.addSideCondition(moveData.sideCondition, pokemon, move);\n\t\t\t\t\tdidSomething = didSomething || hitResult;\n\t\t\t\t}\n\t\t\t\tif (moveData.weather) {\n\t\t\t\t\thitResult = this.battle.field.setWeather(moveData.weather, pokemon, move);\n\t\t\t\t\tdidSomething = didSomething || hitResult;\n\t\t\t\t}\n\t\t\t\tif (moveData.pseudoWeather) {\n\t\t\t\t\thitResult = this.battle.field.addPseudoWeather(moveData.pseudoWeather, pokemon, move);\n\t\t\t\t\tdidSomething = didSomething || hitResult;\n\t\t\t\t}\n\t\t\t\tif (moveData.forceSwitch) {\n\t\t\t\t\tif (this.battle.canSwitch(target.side)) didSomething = true; // at least defer the fail message to later\n\t\t\t\t}\n\t\t\t\tif (moveData.selfSwitch) {\n\t\t\t\t\tif (this.battle.canSwitch(pokemon.side)) didSomething = true; // at least defer the fail message to later\n\t\t\t\t}\n\t\t\t\t// Hit events\n\t\t\t\t// These are like the TryHit events, except we don't need a FieldHit event.\n\t\t\t\t// Scroll up for the TryHit event documentation, and just ignore the \"Try\" part. ;)\n\t\t\t\thitResult = null;\n\t\t\t\tif (move.target === 'all' && !isSelf) {\n\t\t\t\t\tif (moveData.onHitField) hitResult = this.battle.singleEvent('HitField', moveData, {}, target, pokemon, move);\n\t\t\t\t} else if ((move.target === 'foeSide' || move.target === 'allySide') && !isSelf) {\n\t\t\t\t\tif (moveData.onHitSide) hitResult = this.battle.singleEvent('HitSide', moveData, {}, target.side, pokemon, move);\n\t\t\t\t} else {\n\t\t\t\t\tif (moveData.onHit) hitResult = this.battle.singleEvent('Hit', moveData, {}, target, pokemon, move);\n\t\t\t\t\tif (!isSelf && !isSecondary) {\n\t\t\t\t\t\tthis.battle.runEvent('Hit', target, pokemon, move);\n\t\t\t\t\t}\n\t\t\t\t\tif (moveData.onAfterHit) hitResult = this.battle.singleEvent('AfterHit', moveData, {}, target, pokemon, move);\n\t\t\t\t}\n\n\t\t\t\tif (!hitResult && !didSomething && !moveData.self && !moveData.selfdestruct) {\n\t\t\t\t\tif (!isSelf && !isSecondary) {\n\t\t\t\t\t\tif (hitResult === false || didSomething === false) this.battle.add('-fail', target);\n\t\t\t\t\t}\n\t\t\t\t\tthis.battle.debug('move failed because it did nothing');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (moveData.self) {\n\t\t\t\t// This is done solely to mimic in-game RNG behaviour. All self drops have a 100% chance of happening but still grab a random number.\n\t\t\t\tif (!isSecondary && moveData.self.boosts) this.battle.random(100);\n\t\t\t\tthis.moveHit(pokemon, pokemon, move, moveData.self, isSecondary, true);\n\t\t\t}\n\t\t\t// Secondary effects don't happen if the target faints from the attack\n\t\t\tif (target?.hp && moveData.secondaries && this.battle.runEvent('TrySecondaryHit', target, pokemon, moveData)) {\n\t\t\t\tfor (const secondary of moveData.secondaries) {\n\t\t\t\t\t// We check here whether to negate the probable secondary status if it's burn or freeze.\n\t\t\t\t\t// In the game, this is checked and if true, the random number generator is not called.\n\t\t\t\t\t// That means that a move that does not share the type of the target can status it.\n\t\t\t\t\t// This means tri-attack can burn fire-types and freeze ice-types.\n\t\t\t\t\t// Unlike gen 1, though, paralysis works for all unless the target is immune to direct move (ie. ground-types and t-wave).\n\t\t\t\t\tif (secondary.status && ['brn', 'frz'].includes(secondary.status) && target.hasType(move.type)) {\n\t\t\t\t\t\tthis.battle.debug('Target immune to [' + secondary.status + ']');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// A sleeping or frozen target cannot be flinched in Gen 2; King's Rock is exempt\n\t\t\t\t\tif (secondary.volatileStatus === 'flinch' && ['slp', 'frz'].includes(target.status) && !secondary.kingsrock) {\n\t\t\t\t\t\tthis.battle.debug('Cannot flinch a sleeping or frozen target');\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t// Multi-hit moves only roll for status once\n\t\t\t\t\tif (!move.multihit || move.lastHit) {\n\t\t\t\t\t\tconst effectChance = Math.floor((secondary.chance || 100) * 255 / 100);\n\t\t\t\t\t\tif (typeof secondary.chance === 'undefined' || this.battle.randomChance(effectChance, 256)) {\n\t\t\t\t\t\t\tthis.moveHit(target, pokemon, move, secondary, true, isSelf);\n\t\t\t\t\t\t} else if (effectChance === 255) {\n\t\t\t\t\t\t\tthis.battle.hint(\"In Gen 2, moves with a 100% secondary effect chance will not trigger in 1/256 uses.\");\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\tif (target && target.hp > 0 && pokemon.hp > 0 && moveData.forceSwitch && this.battle.canSwitch(target.side)) {\n\t\t\t\thitResult = this.battle.runEvent('DragOut', target, pokemon, move);\n\t\t\t\tif (hitResult) {\n\t\t\t\t\tthis.dragIn(target.side, target.position);\n\t\t\t\t} else if (hitResult === false) {\n\t\t\t\t\tthis.battle.add('-fail', target);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (move.selfSwitch && pokemon.hp) {\n\t\t\t\tpokemon.switchFlag = move.id;\n\t\t\t}\n\t\t\treturn damage;\n\t\t},\n\t\tgetDamage(source, target, move, suppressMessages) {\n\t\t\t// First of all, we get the move.\n\t\t\tif (typeof move === 'string') {\n\t\t\t\tmove = this.dex.getActiveMove(move);\n\t\t\t} else if (typeof move === 'number') {\n\t\t\t\tmove = {\n\t\t\t\t\tbasePower: move,\n\t\t\t\t\ttype: '???',\n\t\t\t\t\tcategory: 'Physical',\n\t\t\t\t\twillCrit: false,\n\t\t\t\t\tflags: {},\n\t\t\t\t} as unknown as ActiveMove;\n\t\t\t}\n\n\t\t\t// Let's test for immunities.\n\t\t\tif (!move.ignoreImmunity || (move.ignoreImmunity !== true && !move.ignoreImmunity[move.type])) {\n\t\t\t\tif (!target.runImmunity(move.type, true)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Is it an OHKO move?\n\t\t\tif (move.ohko) {\n\t\t\t\treturn target.maxhp;\n\t\t\t}\n\n\t\t\t// We edit the damage through move's damage callback\n\t\t\tif (move.damageCallback) {\n\t\t\t\treturn move.damageCallback.call(this.battle, source, target);\n\t\t\t}\n\n\t\t\t// We take damage from damage=level moves\n\t\t\tif (move.damage === 'level') {\n\t\t\t\treturn source.level;\n\t\t\t}\n\n\t\t\t// If there's a fix move damage, we run it\n\t\t\tif (move.damage) {\n\t\t\t\treturn move.damage;\n\t\t\t}\n\n\t\t\t// We check the category and typing to calculate later on the damage\n\t\t\tmove.category = this.battle.getCategory(move);\n\t\t\t// '???' is typeless damage: used for Struggle and Confusion etc\n\t\t\tif (!move.type) move.type = '???';\n\t\t\tconst type = move.type;\n\n\t\t\t// We get the base power and apply basePowerCallback if necessary\n\t\t\tlet basePower: number | false | null | undefined = move.basePower;\n\t\t\tif (move.basePowerCallback) {\n\t\t\t\tbasePower = move.basePowerCallback.call(this.battle, source, target, move);\n\t\t\t}\n\n\t\t\t// We check for Base Power\n\t\t\tif (!basePower) {\n\t\t\t\tif (basePower === 0) return; // Returning undefined means not dealing damage\n\t\t\t\treturn basePower;\n\t\t\t}\n\t\t\tbasePower = this.battle.clampIntRange(basePower, 1);\n\n\t\t\t// Checking for the move's Critical Hit ratio\n\t\t\tlet critRatio = this.battle.runEvent('ModifyCritRatio', source, target, move, move.critRatio || 0);\n\t\t\tcritRatio = this.battle.clampIntRange(critRatio, 0, 5);\n\t\t\tconst critMult = [0, 17, 32, 64, 85, 128];\n\t\t\tlet isCrit = move.willCrit || false;\n\t\t\tif (typeof move.willCrit === 'undefined') {\n\t\t\t\tif (critRatio) {\n\t\t\t\t\tisCrit = this.battle.random(256) < critMult[critRatio];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isCrit && this.battle.runEvent('CriticalHit', target, null, move)) {\n\t\t\t\ttarget.getMoveHitData(move).crit = true;\n\t\t\t}\n\n\t\t\t// Happens after crit calculation\n\t\t\tif (basePower) {\n\t\t\t\t// confusion damage\n\t\t\t\tif (move.isConfusionSelfHit) {\n\t\t\t\t\tmove.type = move.baseMoveType!;\n\t\t\t\t\tbasePower = this.battle.runEvent('BasePower', source, target, move, basePower, true);\n\t\t\t\t\tmove.type = '???';\n\t\t\t\t} else {\n\t\t\t\t\tbasePower = this.battle.runEvent('BasePower', source, target, move, basePower, true);\n\t\t\t\t}\n\t\t\t\tif (basePower && move.basePowerModifier) {\n\t\t\t\t\tbasePower *= move.basePowerModifier;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!basePower) return 0;\n\t\t\tbasePower = this.battle.clampIntRange(basePower, 1);\n\n\t\t\t// We now check for attacker and defender\n\t\t\tlet level = source.level;\n\n\t\t\t// Using Beat Up\n\t\t\tif (move.allies) {\n\t\t\t\tthis.battle.add('-activate', source, 'move: Beat Up', '[of] ' + move.allies[0].name);\n\t\t\t\tlevel = move.allies[0].level;\n\t\t\t}\n\n\t\t\tconst attacker = move.overrideOffensivePokemon === 'target' ? target : source;\n\t\t\tconst defender = move.overrideDefensivePokemon === 'source' ? source : target;\n\n\t\t\tconst isPhysical = move.category === 'Physical';\n\t\t\tconst atkType: StatIDExceptHP = move.overrideOffensiveStat || (isPhysical ? 'atk' : 'spa');\n\t\t\tconst defType: StatIDExceptHP = move.overrideDefensiveStat || (isPhysical ? 'def' : 'spd');\n\n\t\t\tlet unboosted = false;\n\t\t\tlet noburndrop = false;\n\n\t\t\tif (isCrit) {\n\t\t\t\tif (!suppressMessages) this.battle.add('-crit', target);\n\t\t\t\t// Stat level modifications are ignored if they are neutral to or favour the defender.\n\t\t\t\t// Reflect and Light Screen defensive boosts are only ignored if stat level modifications were also ignored as a result of that.\n\t\t\t\tif (attacker.boosts[atkType] <= defender.boosts[defType]) {\n\t\t\t\t\tunboosted = true;\n\t\t\t\t\tnoburndrop = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet attack = attacker.getStat(atkType, unboosted, noburndrop);\n\t\t\tlet defense = defender.getStat(defType, unboosted);\n\n\t\t\t// Using Beat Up\n\t\t\tif (move.allies) {\n\t\t\t\tattack = move.allies[0].species.baseStats.atk;\n\t\t\t\tmove.allies.shift();\n\t\t\t\tdefense = defender.species.baseStats.def;\n\t\t\t}\n\n\t\t\t// Moves that ignore offense and defense respectively.\n\t\t\tif (move.ignoreOffensive) {\n\t\t\t\tthis.battle.debug('Negating (sp)atk boost/penalty.');\n\t\t\t\t// The attack drop from the burn is only applied when attacker's attack level is higher than defender's defense level.\n\t\t\t\tattack = attacker.getStat(atkType, true, true);\n\t\t\t}\n\n\t\t\tif (move.ignoreDefensive) {\n\t\t\t\tthis.battle.debug('Negating (sp)def boost/penalty.');\n\t\t\t\tdefense = target.getStat(defType, true, true);\n\t\t\t}\n\n\t\t\tif (move.id === 'present') {\n\t\t\t\tconst typeIndexes: { [k: string]: number } = {\n\t\t\t\t\tNormal: 0, Fighting: 1, Flying: 2, Poison: 3, Ground: 4, Rock: 5, Bug: 7, Ghost: 8, Steel: 9,\n\t\t\t\t\tFire: 20, Water: 21, Grass: 22, Electric: 23, Psychic: 24, Ice: 25, Dragon: 26, Dark: 27,\n\t\t\t\t};\n\t\t\t\tattack = 10;\n\n\t\t\t\tconst attackerLastType = attacker.getTypes().slice(-1)[0];\n\t\t\t\tconst defenderLastType = defender.getTypes().slice(-1)[0];\n\n\t\t\t\tdefense = typeIndexes[attackerLastType] || 1;\n\t\t\t\tlevel = typeIndexes[defenderLastType] || 1;\n\t\t\t\tthis.battle.hint(\"Gen 2 Present has a glitched damage calculation using the secondary types of the Pokemon for the Attacker's Level and Defender's Defense.\", true);\n\t\t\t}\n\n\t\t\t// When either attack or defense are higher than 256, they are both divided by 4 and modded by 256.\n\t\t\t// This is what causes the rollover bugs.\n\t\t\tif (attack >= 256 || defense >= 256) {\n\t\t\t\tif (attack >= 1024 || defense >= 1024) {\n\t\t\t\t\tthis.battle.hint(\"In Gen 2, a stat will roll over to a small number if it is larger than 1024.\");\n\t\t\t\t}\n\t\t\t\tattack = this.battle.clampIntRange(Math.floor(attack / 4) % 256, 1);\n\t\t\t\tdefense = this.battle.clampIntRange(Math.floor(defense / 4) % 256, 1);\n\t\t\t}\n\n\t\t\t// Self destruct moves halve defense at this point.\n\t\t\tif (move.selfdestruct && defType === 'def') {\n\t\t\t\tdefense = this.battle.clampIntRange(Math.floor(defense / 2), 1);\n\t\t\t}\n\n\t\t\t// Let's go with the calculation now that we have what we need.\n\t\t\t// We do it step by step just like the game does.\n\t\t\tlet damage = level * 2;\n\t\t\tdamage = Math.floor(damage / 5);\n\t\t\tdamage += 2;\n\t\t\tdamage *= basePower;\n\t\t\tdamage *= attack;\n\t\t\tdamage = Math.floor(damage / defense);\n\t\t\tdamage = Math.floor(damage / 50);\n\t\t\tif (isCrit) damage *= 2;\n\t\t\tdamage = Math.floor(this.battle.runEvent('ModifyDamage', attacker, defender, move, damage));\n\t\t\tdamage = this.battle.clampIntRange(damage, 1, 997);\n\t\t\tdamage += 2;\n\n\t\t\t// Weather modifiers\n\t\t\tif (\n\t\t\t\t(type === 'Water' && this.battle.field.isWeather('raindance')) ||\n\t\t\t\t(type === 'Fire' && this.battle.field.isWeather('sunnyday'))\n\t\t\t) {\n\t\t\t\tdamage = Math.floor(damage * 1.5);\n\t\t\t} else if (\n\t\t\t\t((type === 'Fire' || move.id === 'solarbeam') && this.battle.field.isWeather('raindance')) ||\n\t\t\t\t(type === 'Water' && this.battle.field.isWeather('sunnyday'))\n\t\t\t) {\n\t\t\t\tdamage = Math.floor(damage / 2);\n\t\t\t}\n\n\t\t\t// STAB damage bonus, the \"???\" type never gets STAB\n\t\t\tif (type !== '???' && source.hasType(type)) {\n\t\t\t\tdamage += Math.floor(damage / 2);\n\t\t\t}\n\n\t\t\t// Type effectiveness\n\t\t\tconst totalTypeMod = target.runEffectiveness(move);\n\t\t\t// Super effective attack\n\t\t\tif (totalTypeMod > 0) {\n\t\t\t\tif (!suppressMessages) this.battle.add('-supereffective', target);\n\t\t\t\tdamage *= 2;\n\t\t\t\tif (totalTypeMod >= 2) {\n\t\t\t\t\tdamage *= 2;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Resisted attack\n\t\t\tif (totalTypeMod < 0) {\n\t\t\t\tif (!suppressMessages) this.battle.add('-resisted', target);\n\t\t\t\tdamage = Math.floor(damage / 2);\n\t\t\t\tif (totalTypeMod <= -2) {\n\t\t\t\t\tdamage = Math.floor(damage / 2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Apply random factor if damage is greater than 1, except for Flail and Reversal\n\t\t\tif (!move.noDamageVariance && damage > 1) {\n\t\t\t\tdamage *= this.battle.random(217, 256);\n\t\t\t\tdamage = Math.floor(damage / 255);\n\t\t\t}\n\n\t\t\t// If damage is less than 1, we return 1\n\t\t\tif (basePower && !Math.floor(damage)) {\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t// We are done, this is the final damage\n\t\t\treturn damage;\n\t\t},\n\t},\n};\n"], | |
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAM,UAAmC;AAAA,EAC/C,SAAS;AAAA,EACT,KAAK;AAAA,EACL,SAAS;AAAA,IACR,SAAS;AAAA,IACT,QAAQ,UAAU,WAAW,YAAY,YAAY;AAEpD,UAAI,aAAa;AAAM,cAAM,IAAI,MAAM,8BAA8B;AAGrE,UAAI,OAAO,KAAK,YAAY,QAAQ;AAGpC,UAAI,CAAC,WAAW;AACf,YAAI,QAAQ,KAAK,OAAO,QAAQ;AAChC,YAAI,QAAQ;AAAG,kBAAQ;AACvB,YAAI,QAAQ;AAAI,kBAAQ;AACxB,YAAI,SAAS,GAAG;AACf,gBAAM,aAAa,CAAC,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAC7C,iBAAO,KAAK,MAAM,OAAO,WAAW,KAAK,CAAC;AAAA,QAC3C,OAAO;AACN,gBAAM,aAAa,CAAC,KAAK,IAAI,IAAI,IAAI,IAAI,IAAI,EAAE;AAC/C,iBAAO,KAAK,MAAM,OAAO,WAAW,CAAC,KAAK,IAAI,GAAG;AAAA,QAClD;AAAA,MACD;AAEA,UAAI,KAAK,WAAW,SAAS,aAAa,OAAO;AAChD,eAAO,KAAK,MAAM,OAAO,CAAC;AAAA,MAC3B;AAEA,UAAI,CAAC,YAAY;AAEhB,YAAI,KAAK,WAAW,SAAS,aAAa,OAAO;AAChD,iBAAO,KAAK,MAAM,OAAO,CAAC;AAAA,QAC3B;AA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