Spaces:
Running
Running
{ | |
"version": 3, | |
"sources": ["../../../../data/mods/gen1stadium/scripts.ts"], | |
"sourcesContent": ["/**\n * Stadium mechanics inherit from gen 1 mechanics, but fixes some stuff.\n */\n\nconst SKIP_LASTDAMAGE = new Set([\n\t'confuseray', 'conversion', 'counter', 'focusenergy', 'glare', 'haze', 'leechseed', 'lightscreen',\n\t'mimic', 'mist', 'poisongas', 'poisonpowder', 'recover', 'reflect', 'rest', 'softboiled',\n\t'splash', 'stunspore', 'substitute', 'supersonic', 'teleport', 'thunderwave', 'toxic', 'transform',\n]);\n\nexport const Scripts: ModdedBattleScriptsData = {\n\tinherit: 'gen1',\n\tgen: 1,\n\t// BattlePokemon scripts. Stadium shares gen 1 code but it fixes some problems with it.\n\tpokemon: {\n\t\tinherit: true,\n\t\t// This is run on Stadium after boosts and status changes.\n\t\trecalculateStats() {\n\t\t\tlet statName: StatIDExceptHP;\n\t\t\tfor (statName in this.storedStats) {\n\t\t\t\tlet stat = this.species.baseStats[statName];\n\t\t\t\tstat = Math.floor(\n\t\t\t\t\tMath.floor(\n\t\t\t\t\t\t2 * stat + this.set.ivs[statName] + Math.floor(this.set.evs[statName] / 4)\n\t\t\t\t\t) * this.level / 100 + 5\n\t\t\t\t);\n\t\t\t\tthis.baseStoredStats[statName] = this.storedStats[statName] = Math.floor(stat);\n\t\t\t\tthis.modifiedStats![statName] = Math.floor(stat);\n\t\t\t\t// Re-apply drops, if necessary.\n\t\t\t\tif (this.status === 'par' && statName === 'spe') this.modifyStat!('spe', 0.25);\n\t\t\t\tif (this.status === 'brn' && statName === 'atk') this.modifyStat!('atk', 0.5);\n\t\t\t\tif (this.boosts[statName] !== 0) {\n\t\t\t\t\tif (this.boosts[statName] >= 0) {\n\t\t\t\t\t\tthis.modifyStat!(statName, [1, 1.5, 2, 2.5, 3, 3.5, 4][this.boosts[statName]]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.modifyStat!(statName, [100, 66, 50, 40, 33, 28, 25][-this.boosts[statName]] / 100);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (this.modifiedStats![statName] > 999) {\n\t\t\t\t\tthis.modifiedStats![statName] = 999;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t// Stadium's fixed boosting function.\n\t\tboostBy(boost) {\n\t\t\tlet changed = false;\n\t\t\tlet i: BoostID;\n\t\t\tfor (i in boost) {\n\t\t\t\tlet delta = boost[i];\n\t\t\t\tif (delta === undefined) continue;\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\tif (delta) changed = true;\n\t\t\t}\n\t\t\tthis.recalculateStats!();\n\t\t\treturn changed;\n\t\t},\n\t\t// Remove stat recalculation logic from gen 1\n\t\tclearBoosts() {\n\t\t\tlet i: BoostID;\n\t\t\tfor (i in this.boosts) {\n\t\t\t\tthis.boosts[i] = 0;\n\t\t\t}\n\t\t},\n\t},\n\tactions: {\n\t\tinherit: true,\n\t\trunMove(moveOrMoveName, pokemon, targetLoc, options) {\n\t\t\tlet sourceEffect = options?.sourceEffect;\n\t\t\tconst move = this.dex.getActiveMove(moveOrMoveName);\n\t\t\tconst target = this.battle.getTarget(pokemon, move, targetLoc);\n\t\t\tif (target?.subFainted) target.subFainted = null;\n\n\t\t\tthis.battle.setActiveMove(move, pokemon, target);\n\n\t\t\tif (pokemon.moveThisTurn || !this.battle.runEvent('BeforeMove', pokemon, target, move)) {\n\t\t\t\tthis.battle.debug(`${pokemon.fullname} move interrupted; movedThisTurn: ${pokemon.moveThisTurn}`);\n\t\t\t\tthis.battle.clearActiveMove(true);\n\t\t\t\t// This is only run for sleep\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\tlet lockedMove = this.battle.runEvent('LockMove', pokemon);\n\t\t\tif (lockedMove === true) lockedMove = false;\n\t\t\tif (\n\t\t\t\t!lockedMove &&\n\t\t\t\t(!pokemon.volatiles['partialtrappinglock'] || pokemon.volatiles['partialtrappinglock'].locked !== target)\n\t\t\t) {\n\t\t\t\tpokemon.deductPP(move, null, target);\n\t\t\t} else {\n\t\t\t\tsourceEffect = move;\n\t\t\t}\n\t\t\tthis.battle.actions.useMove(move, pokemon, { target, sourceEffect });\n\t\t},\n\t\t// This function deals with AfterMoveSelf events.\n\t\t// This leads with partial trapping moves shenanigans after the move has been used.\n\t\tuseMove(moveOrMoveName, pokemon, options) {\n\t\t\tlet sourceEffect = options?.sourceEffect;\n\t\t\tlet target = options?.target;\n\t\t\tconst moveResult = this.useMoveInner(moveOrMoveName, pokemon, { target, sourceEffect });\n\n\t\t\tif (!sourceEffect && this.battle.effect.id) sourceEffect = this.battle.effect;\n\t\t\tconst baseMove = this.battle.dex.moves.get(moveOrMoveName);\n\t\t\tlet move = this.battle.dex.getActiveMove(baseMove);\n\t\t\tif (target === undefined) target = this.battle.getRandomTarget(pokemon, move);\n\t\t\tif (move.target === 'self') {\n\t\t\t\ttarget = pokemon;\n\t\t\t}\n\t\t\tif (sourceEffect) move.sourceEffect = sourceEffect.id;\n\n\t\t\tthis.battle.singleEvent('ModifyMove', move, null, pokemon, target, move, move);\n\t\t\tif (baseMove.target !== move.target) {\n\t\t\t\t// Target changed in ModifyMove, so we must adjust it here\n\t\t\t\ttarget = this.battle.getRandomTarget(pokemon, move);\n\t\t\t}\n\t\t\tmove = this.battle.runEvent('ModifyMove', pokemon, target, move, move);\n\t\t\tif (baseMove.target !== move.target) {\n\t\t\t\t// Check again, this shouldn't ever happen on Gen 1.\n\t\t\t\ttarget = this.battle.getRandomTarget(pokemon, move);\n\t\t\t}\n\n\t\t\tif (move.id !== 'metronome') {\n\t\t\t\tif (move.id !== 'mirrormove' ||\n\t\t\t\t\t(!pokemon.side.foe.active[0]?.lastMove || pokemon.side.foe.active[0].lastMove?.id === 'mirrormove')) {\n\t\t\t\t\t// The move is our 'final' move (a failed Mirror Move, or any move that isn't Metronome or Mirror Move).\n\t\t\t\t\tpokemon.side.lastMove = move;\n\t\t\t\t\tpokemon.lastMove = move;\n\t\t\t\t\tthis.battle.singleEvent('AfterMove', move, null, pokemon, target, move);\n\n\t\t\t\t\t// If target fainted\n\t\t\t\t\tif (target && target.hp <= 0) {\n\t\t\t\t\t\tdelete pokemon.volatiles['partialtrappinglock'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.battle.runEvent('AfterMoveSelf', pokemon, target, move);\n\t\t\t\t\t}\n\t\t\t\t\tif (pokemon.volatiles['mustrecharge']) this.battle.add('-mustrecharge', pokemon);\n\n\t\t\t\t\t// For partial trapping moves, we are saving the target.\n\t\t\t\t\tif (move.volatileStatus === 'partiallytrapped' && target && target.hp > 0) {\n\t\t\t\t\t\t// It hit, so let's remove must recharge volatile. Yup, this happens on Stadium.\n\t\t\t\t\t\ttarget.removeVolatile('mustrecharge');\n\t\t\t\t\t\t// Let's check if the lock exists\n\t\t\t\t\t\tif (pokemon.volatiles['partialtrappinglock'] && target.volatiles['partiallytrapped']) {\n\t\t\t\t\t\t\t// Here the partialtrappinglock volatile has been already applied\n\t\t\t\t\t\t\tif (!pokemon.volatiles['partialtrappinglock'].locked) {\n\t\t\t\t\t\t\t\t// If it's the first hit, we save the target\n\t\t\t\t\t\t\t\tpokemon.volatiles['partialtrappinglock'].locked = target;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // If we move to here, the move failed and there's no partial trapping lock\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn moveResult;\n\t\t},\n\t\t// This is the function that actually uses the move, running ModifyMove events.\n\t\t// It uses the move and then deals with the effects after the move.\n\t\tuseMoveInner(moveOrMoveName, pokemon, options) {\n\t\t\tlet sourceEffect = options?.sourceEffect;\n\t\t\tlet target = options?.target;\n\t\t\tif (!sourceEffect && this.battle.effect.id) sourceEffect = this.battle.effect;\n\t\t\tconst baseMove = this.battle.dex.moves.get(moveOrMoveName);\n\t\t\tlet move = this.battle.dex.getActiveMove(baseMove);\n\t\t\tif (target === undefined) target = this.battle.getRandomTarget(pokemon, move);\n\t\t\tif (move.target === 'self') {\n\t\t\t\ttarget = pokemon;\n\t\t\t}\n\t\t\tif (sourceEffect) move.sourceEffect = sourceEffect.id;\n\n\t\t\tthis.battle.setActiveMove(move, pokemon, target);\n\n\t\t\tthis.battle.singleEvent('ModifyMove', move, null, pokemon, target, move, move);\n\t\t\tif (baseMove.target !== move.target) {\n\t\t\t\t// Target changed in ModifyMove, so we must adjust it here\n\t\t\t\ttarget = this.battle.getRandomTarget(pokemon, move);\n\t\t\t}\n\t\t\tmove = this.battle.runEvent('ModifyMove', pokemon, target, move, move);\n\t\t\tif (baseMove.target !== move.target) {\n\t\t\t\t// Check again, this shouldn't ever happen on Gen 1.\n\t\t\t\ttarget = this.battle.getRandomTarget(pokemon, move);\n\t\t\t\tthis.battle.debug('not a gen 1 mechanic');\n\t\t\t}\n\t\t\tif (!move) return false;\n\n\t\t\tlet attrs = '';\n\t\t\tif (pokemon.fainted) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tif (sourceEffect) attrs += `|[from]${this.battle.dex.conditions.get(sourceEffect)}`;\n\t\t\tthis.battle.addMove('move', pokemon, move.name, `${target}${attrs}`);\n\n\t\t\tif (!this.battle.singleEvent('Try', move, null, pokemon, target, move)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tif (!this.battle.singleEvent('TryMove', move, null, pokemon, target, move) ||\n\t\t\t\t!this.battle.runEvent('TryMove', pokemon, target, move)) {\n\t\t\t\treturn true;\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\tlet damage: number | undefined | false | '' = false;\n\t\t\tif (!target || target.fainted) {\n\t\t\t\tthis.battle.attrLastMove('[notarget]');\n\t\t\t\tthis.battle.add('-notarget');\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// Store 0 damage for last damage if the move is not in the array.\n\t\t\tif (!SKIP_LASTDAMAGE.has(move.id)) this.battle.lastDamage = 0;\n\n\t\t\tdamage = this.tryMoveHit(target, pokemon, move);\n\n\t\t\t// Go ahead with results of the used move.\n\t\t\tif (damage === false) {\n\t\t\t\tthis.battle.singleEvent('MoveFail', move, null, target, pokemon, move);\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (!move.negateSecondary) {\n\t\t\t\tthis.battle.singleEvent('AfterMoveSecondarySelf', move, null, pokemon, target, move);\n\t\t\t\tthis.battle.runEvent('AfterMoveSecondarySelf', pokemon, target, move);\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\ttryMoveHit(target, pokemon, move) {\n\t\t\tlet damage: number | false | undefined = 0;\n\n\t\t\t// First, check if the target is semi-invulnerable\n\t\t\tlet hitResult = 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\tif (move.selfdestruct) {\n\t\t\t\t\tthis.battle.faint(pokemon, pokemon, move);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Then, check if the Pokemon is immune to this move.\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\tif (move.selfdestruct) {\n\t\t\t\t\tthis.battle.faint(pokemon, pokemon, move);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\thitResult = this.battle.singleEvent('TryImmunity', move, null, 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\t// Now, let's calculate the accuracy.\n\t\t\tlet accuracy = move.accuracy;\n\n\t\t\t// Partial trapping moves: true accuracy while it lasts\n\t\t\tif (pokemon.volatiles['partialtrappinglock']) {\n\t\t\t\tif (move.volatileStatus === 'partiallytrapped' && target === pokemon.volatiles['partialtrappinglock'].locked) {\n\t\t\t\t\taccuracy = true;\n\t\t\t\t} else if (pokemon.volatiles['partialtrappinglock'].locked !== target) {\n\t\t\t\t\t// The target switched, therefor, you fail using wrap.\n\t\t\t\t\tdelete pokemon.volatiles['partialtrappinglock'];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// OHKO moves only have a chance to hit if the user is at least as fast as the target\n\t\t\tif (move.ohko) {\n\t\t\t\tif (target.speed > pokemon.speed) {\n\t\t\t\t\tthis.battle.add('-immune', target, '[ohko]');\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Calculate true accuracy for gen 1, which uses 0-255.\n\t\t\t// Stadium uses the Gen 2 boost table for accuracy and evasiveness, except for 1/3 instead of 0.33\n\t\t\tconst boostTable = [1 / 3, 0.36, 0.43, 0.5, 0.66, 0.75, 1, 1.33, 1.66, 2, 2.33, 2.66, 3];\n\t\t\tif (accuracy !== true) {\n\t\t\t\taccuracy = Math.floor(accuracy * 255 / 100);\n\t\t\t\t// Check also for accuracy modifiers.\n\t\t\t\tif (!move.ignoreAccuracy) {\n\t\t\t\t\taccuracy = Math.floor(accuracy * boostTable[pokemon.boosts.accuracy + 6]);\n\t\t\t\t}\n\t\t\t\tif (!move.ignoreEvasion) {\n\t\t\t\t\taccuracy = Math.floor(accuracy * boostTable[-target.boosts.evasion + 6]);\n\t\t\t\t}\n\t\t\t\taccuracy = Math.min(accuracy, 255);\n\t\t\t}\n\t\t\taccuracy = this.battle.runEvent('Accuracy', target, pokemon, move, accuracy);\n\n\t\t\t// Stadium fixes the 1/256 accuracy bug.\n\t\t\tif (accuracy !== true && !this.battle.randomChance(accuracy + 1, 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\tthis.battle.lastDamage = 0;\n\t\t\t}\n\n\t\t\t// If damage is 0 and not false it means it didn't miss, let's calc.\n\t\t\tif (damage !== false) {\n\t\t\t\tif (move.multihit) {\n\t\t\t\t\tlet hits = move.multihit;\n\t\t\t\t\tif (Array.isArray(hits)) {\n\t\t\t\t\t\t// Yes, it's hardcoded... meh\n\t\t\t\t\t\tif (hits[0] === 2 && hits[1] === 5) {\n\t\t\t\t\t\t\thits = this.battle.sample([2, 2, 2, 3, 3, 3, 4, 5]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\thits = this.battle.random(hits[0], hits[1] + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\thits = Math.floor(hits);\n\t\t\t\t\t// In gen 1, all the hits have the same damage for multihits move\n\t\t\t\t\tlet moveDamage: number | false | undefined = 0;\n\t\t\t\t\tlet i: number;\n\t\t\t\t\tfor (i = 0; i < hits && target.hp && pokemon.hp; i++) {\n\t\t\t\t\t\tmove.hit = i + 1;\n\t\t\t\t\t\tif (move.hit === hits) move.lastHit = true;\n\t\t\t\t\t\tmoveDamage = this.moveHit(target, pokemon, move);\n\t\t\t\t\t\tif (moveDamage === false) break;\n\t\t\t\t\t\tdamage = (moveDamage || 0);\n\t\t\t\t\t\t// Move damage is fixed to be the first move's damage\n\t\t\t\t\t\tif (i === 0) move.damage = damage;\n\t\t\t\t\t\tif (target.subFainted) {\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tmove.damage = null;\n\t\t\t\t\tif (i === 0) return 1;\n\t\t\t\t\tthis.battle.add('-hitcount', target, i);\n\t\t\t\t} else {\n\t\t\t\t\tdamage = this.moveHit(target, pokemon, move);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (move.category !== 'Status') target.gotAttacked(move, damage, pokemon);\n\n\t\t\tif (move.selfdestruct) {\n\t\t\t\tthis.battle.faint(pokemon, pokemon, move);\n\t\t\t}\n\n\t\t\t// The move missed.\n\t\t\tif (damage === false) {\n\t\t\t\t// Delete the partial trap lock if necessary.\n\t\t\t\tdelete pokemon.volatiles['partialtrappinglock'];\n\t\t\t\treturn false;\n\t\t\t}\n\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\treturn damage;\n\t\t},\n\t\tmoveHit(target, pokemon, moveOrMoveName, moveData, isSecondary, isSelf) {\n\t\t\tlet damage: number | false | null | undefined = 0;\n\t\t\tconst move = this.dex.getActiveMove(moveOrMoveName);\n\n\t\t\tif (!isSecondary && !isSelf) this.battle.setActiveMove(move, pokemon, target);\n\t\t\tlet hitResult: number | boolean = true;\n\t\t\tif (!moveData) moveData = move;\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 (target) {\n\t\t\t\thitResult = this.battle.singleEvent('TryHit', moveData, {}, target, pokemon, move);\n\n\t\t\t\t// Partial trapping moves still apply their volatile to Pok\u00E9mon behind a Sub\n\t\t\t\tconst targetHadSub = !!target.volatiles['substitute'];\n\t\t\t\tif (targetHadSub && moveData.volatileStatus && moveData.volatileStatus === 'partiallytrapped') {\n\t\t\t\t\ttarget.addVolatile(moveData.volatileStatus, pokemon, move);\n\t\t\t\t\tif (!pokemon.volatiles['partialtrappinglock'] || pokemon.volatiles['partialtrappinglock'].duration! > 1) {\n\t\t\t\t\t\ttarget.volatiles[moveData.volatileStatus].duration = 2;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!hitResult) {\n\t\t\t\t\tif (hitResult === false) this.battle.add('-fail', target);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t// Only run the hit events for the hit itself, not the secondary or self hits\n\t\t\t\tif (!isSelf && !isSecondary) {\n\t\t\t\t\thitResult = this.battle.runEvent('TryHit', target, pokemon, move);\n\t\t\t\t\tif (!hitResult) {\n\t\t\t\t\t\tif (hitResult === false) this.battle.add('-fail', target);\n\t\t\t\t\t\t// Special Substitute hit flag\n\t\t\t\t\t\tif (hitResult !== 0) {\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!this.battle.runEvent('TryFieldHit', target, pokemon, move)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} else if (isSecondary && !moveData.self) {\n\t\t\t\t\thitResult = this.battle.runEvent('TrySecondaryHit', target, pokemon, moveData);\n\t\t\t\t}\n\n\t\t\t\tif (hitResult === 0) {\n\t\t\t\t\ttarget = null;\n\t\t\t\t} else if (!hitResult) {\n\t\t\t\t\tif (hitResult === false) this.battle.add('-fail', target);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (target) {\n\t\t\t\tlet didSomething = false;\n\n\t\t\t\tdamage = this.getDamage(pokemon, target, moveData);\n\t\t\t\tif (damage && damage > target.hp) {\n\t\t\t\t\tdamage = target.hp;\n\t\t\t\t}\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)) return false;\n\t\t\t\t\tdidSomething = true;\n\t\t\t\t} else if (damage === false && typeof hitResult === 'undefined') {\n\t\t\t\t\tthis.battle.add('-fail', target);\n\t\t\t\t}\n\t\t\t\tif (damage === false || damage === null) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (moveData.boosts && !target.fainted) {\n\t\t\t\t\tthis.battle.boost(moveData.boosts, target, pokemon, move);\n\t\t\t\t}\n\t\t\t\tif (moveData.heal && !target.fainted) {\n\t\t\t\t\tconst d = target.heal(Math.floor(target.maxhp * moveData.heal[0] / moveData.heal[1]));\n\t\t\t\t\tif (!d) {\n\t\t\t\t\t\tthis.battle.add('-fail', target);\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\tif (!target.status) {\n\t\t\t\t\t\ttarget.setStatus(moveData.status, pokemon, move);\n\t\t\t\t\t\ttarget.recalculateStats!();\n\t\t\t\t\t} else if (!isSecondary) {\n\t\t\t\t\t\tif (target.status === moveData.status) {\n\t\t\t\t\t\t\tthis.battle.add('-fail', target, target.status);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.battle.add('-fail', target);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidSomething = true;\n\t\t\t\t}\n\t\t\t\tif (moveData.forceStatus) {\n\t\t\t\t\tif (target.setStatus(moveData.forceStatus, pokemon, move)) {\n\t\t\t\t\t\ttarget.recalculateStats!();\n\t\t\t\t\t\tdidSomething = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (moveData.volatileStatus) {\n\t\t\t\t\tif (target.addVolatile(moveData.volatileStatus, pokemon, move)) {\n\t\t\t\t\t\tdidSomething = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (moveData.sideCondition) {\n\t\t\t\t\tif (target.side.addSideCondition(moveData.sideCondition, pokemon, move)) {\n\t\t\t\t\t\tdidSomething = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (moveData.pseudoWeather) {\n\t\t\t\t\tif (this.battle.field.addPseudoWeather(moveData.pseudoWeather, pokemon, move)) {\n\t\t\t\t\t\tdidSomething = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Hit events\n\t\t\t\thitResult = this.battle.singleEvent('Hit', moveData, {}, target, pokemon, move);\n\t\t\t\tif (!isSelf && !isSecondary) {\n\t\t\t\t\tthis.battle.runEvent('Hit', target, pokemon, move);\n\t\t\t\t}\n\t\t\t\tif (!hitResult && !didSomething) {\n\t\t\t\t\tif (hitResult === false) this.battle.add('-fail', target);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Here's where self effects are applied.\n\t\t\tif (moveData.self) {\n\t\t\t\tthis.moveHit(pokemon, pokemon, move, moveData.self, isSecondary, true);\n\t\t\t}\n\n\t\t\t// Now we can save the partial trapping damage.\n\t\t\tif (pokemon.volatiles['partialtrappinglock']) {\n\t\t\t\tpokemon.volatiles['partialtrappinglock'].damage = this.battle.lastDamage;\n\t\t\t}\n\n\t\t\t// Apply move secondaries.\n\t\t\tif (moveData.secondaries && target && target.hp > 0) {\n\t\t\t\tfor (const secondary of moveData.secondaries) {\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\t// We check here whether to negate the probable secondary status if it's para, burn, or freeze.\n\t\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\t// That means that a move that does not share the type of the target can status it.\n\t\t\t\t\t\t// If a move that was not fire-type would exist on Gen 1, it could burn a Pok\u00E9mon.\n\t\t\t\t\t\tif (!(secondary.status && ['par', 'brn', 'frz'].includes(secondary.status) && target.hasType(move.type))) {\n\t\t\t\t\t\t\tconst effectChance = Math.floor((secondary.chance || 100) * 255 / 100);\n\t\t\t\t\t\t\tif (typeof secondary.chance === 'undefined' || this.battle.randomChance(effectChance + 1, 256)) {\n\t\t\t\t\t\t\t\tthis.moveHit(target, pokemon, move, secondary, true, isSelf);\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}\n\t\t\t}\n\t\t\tif (move.selfSwitch && pokemon.hp) {\n\t\t\t\tpokemon.switchFlag = move.selfSwitch === true ? true : this.dex.toID(move.selfSwitch);\n\t\t\t}\n\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 ActiveMove;\n\t\t\t}\n\n\t\t\t// Let's see if the target is immune to the move.\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 65535;\n\t\t\t}\n\n\t\t\t// We edit the damage through move's damage callback if necessary.\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 (seismic toss).\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 return that.\n\t\t\tif (move.damage) {\n\t\t\t\treturn move.damage;\n\t\t\t}\n\n\t\t\t// If it's the first hit on a Normal-type partially trap move, it hits Ghosts anyways but damage is 0.\n\t\t\tif (move.volatileStatus === 'partiallytrapped' && move.type === 'Normal' && target.hasType('Ghost')) {\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\t// Let's check if we are in middle of a partial trap sequence to return the previous damage.\n\t\t\tif (source.volatiles['partialtrappinglock'] && (target === source.volatiles['partialtrappinglock'].locked)) {\n\t\t\t\treturn source.volatiles['partialtrappinglock'].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\tif (!move.category) move.category = 'Physical';\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 = 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\t\t\tif (!basePower) {\n\t\t\t\treturn basePower === 0 ? undefined : 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 possibility. We check if it's a 100% crit move, otherwise we calculate the chance.\n\t\t\tlet isCrit = move.willCrit || false;\n\t\t\tif (!isCrit) {\n\t\t\t\t// In Stadium, the critical chance is based on speed.\n\t\t\t\t// First, we get the base speed and store it. Then we add 76. This is our current crit chance.\n\t\t\t\tlet critChance = source.species.baseStats['spe'] + 76;\n\n\t\t\t\t// Now we right logical shift it two places, essentially dividing by 4 and flooring it.\n\t\t\t\tcritChance >>= 2;\n\n\t\t\t\t// Now we check for focus energy volatile.\n\t\t\t\tif (source.volatiles['focusenergy']) {\n\t\t\t\t\t// If it exists, crit chance is multiplied by 4 and floored with a logical left shift.\n\t\t\t\t\tcritChance <<= 2;\n\t\t\t\t\t// Then we add 160.\n\t\t\t\t\tcritChance += 160;\n\t\t\t\t} else {\n\t\t\t\t\t// If it is not active, we left shift it by 1.\n\t\t\t\t\tcritChance <<= 1;\n\t\t\t\t}\n\n\t\t\t\t// Now we check for the move's critical hit ratio.\n\t\t\t\tif (move.critRatio === 2) {\n\t\t\t\t\t// High crit ratio, we multiply the result so far by 4.\n\t\t\t\t\tcritChance <<= 2;\n\t\t\t\t} else if (move.critRatio === 1) {\n\t\t\t\t\t// Normal hit ratio, we divide the crit chance by 2 and floor the result again.\n\t\t\t\t\tcritChance >>= 1;\n\t\t\t\t}\n\n\t\t\t\t// Now we make sure it's a number between 1 and 255.\n\t\t\t\tcritChance = this.battle.clampIntRange(critChance, 1, 255);\n\n\t\t\t\t// Last, we check deppending on ratio if the move critical hits or not.\n\t\t\t\t// We compare our critical hit chance against a random number between 0 and 255.\n\t\t\t\t// If the random number is lower, we get a critical hit. This means there is always a 1/255 chance of not hitting critically.\n\t\t\t\tif (critChance > 0) {\n\t\t\t\t\tisCrit = this.battle.randomChance(critChance, 256);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// There is a critical hit.\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\tbasePower = this.battle.runEvent('BasePower', source, target, move, basePower);\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 attacker's and defender's stats.\n\t\t\tlet level = source.level;\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 attack = attacker.getStat(atkType);\n\t\t\tlet defense = defender.getStat(defType);\n\n\t\t\t// In gen 1, screen effect is applied here.\n\t\t\tif ((defType === 'def' && defender.volatiles['reflect']) || (defType === 'spd' && defender.volatiles['lightscreen'])) {\n\t\t\t\tthis.battle.debug('Screen doubling (Sp)Def');\n\t\t\t\tdefense *= 2;\n\t\t\t\tdefense = this.battle.clampIntRange(defense, 1, 1998);\n\t\t\t}\n\n\t\t\t// In the event of a critical hit, the offense and defense changes are ignored.\n\t\t\t// This includes both boosts and screens.\n\t\t\t// Also, level is doubled in damage calculation.\n\t\t\tif (isCrit) {\n\t\t\t\tmove.ignoreOffensive = true;\n\t\t\t\tmove.ignoreDefensive = true;\n\t\t\t\tlevel *= 2;\n\t\t\t\tif (!suppressMessages) this.battle.add('-crit', target);\n\t\t\t}\n\n\t\t\tif (move.ignoreOffensive) {\n\t\t\t\tthis.battle.debug('Negating (sp)atk boost/penalty.');\n\t\t\t\tattack = attacker.getStat(atkType, 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);\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 moded 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\tattack = this.battle.clampIntRange(Math.floor(attack / 4) % 256, 1);\n\t\t\t\t// Defense isn't checked on the cartridge, but we don't want those / 0 bugs on the sim.\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 = this.battle.clampIntRange(Math.floor(damage / 50), 0, 997);\n\t\t\tdamage += 2;\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\t// In Gen 1, type effectiveness is applied against each of the target's types.\n\t\t\tfor (const targetType of target.types) {\n\t\t\t\tconst typeMod = this.battle.dex.getEffectiveness(type, targetType);\n\t\t\t\tif (typeMod > 0) {\n\t\t\t\t\t// Super effective against targetType\n\t\t\t\t\tdamage *= 20;\n\t\t\t\t\tdamage = Math.floor(damage / 10);\n\t\t\t\t}\n\t\t\t\tif (typeMod < 0) {\n\t\t\t\t\t// Not very effective against targetType\n\t\t\t\t\tdamage *= 5;\n\t\t\t\t\tdamage = Math.floor(damage / 10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst totalTypeMod = target.runEffectiveness(move);\n\t\t\tif (totalTypeMod > 0) {\n\t\t\t\tif (!suppressMessages) this.battle.add('-supereffective', target);\n\t\t\t}\n\t\t\tif (totalTypeMod < 0) {\n\t\t\t\tif (!suppressMessages) this.battle.add('-resisted', target);\n\t\t\t}\n\n\t\t\t// If damage becomes 0, the move is made to miss.\n\t\t\t// This occurs when damage was either 2 or 3 prior to applying STAB/Type matchup, and target is 4x resistant to the move.\n\t\t\tif (damage === 0) return damage;\n\n\t\t\t// Apply random factor if damage is greater than 1\n\t\t\tif (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// We are done, this is the final damage.\n\t\t\treturn Math.floor(damage);\n\t\t},\n\t},\n};\n"], | |
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;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