mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
ESLint has a whole new config format, so I figure it's a good time to make the config system saner. - First, we no longer have separate eslint-no-types configs. Lint performance shouldn't be enough of a problem to justify the relevant maintenance complexity. - Second, our base config should work out-of-the-box now. `npx eslint` will work as expected, without any CLI flags. You should still use `npm run lint` which adds the `--cached` flag for performance. - Third, whatever updates I did fixed style linting, which apparently has been bugged for quite some time, considering all the obvious mixed-tabs-and-spaces issues I found in the upgrade. Also here are some changes to our style rules. In particular: - Curly brackets (for objects etc) now have spaces inside them. Sorry for the huge change. ESLint doesn't support our old style, and most projects use Prettier style, so we might as well match them in this way. See https://github.com/eslint-stylistic/eslint-stylistic/issues/415 - String + number concatenation is no longer allowed. We now consistently use template strings for this.
442 lines
14 KiB
TypeScript
442 lines
14 KiB
TypeScript
export const Items: import('../../../sim/dex-items').ModdedItemDataTable = {
|
|
adamantorb: {
|
|
inherit: true,
|
|
onBasePower(basePower, user, target, move) {
|
|
if (move && user.species.name === 'Dialga' && (move.type === 'Steel' || move.type === 'Dragon')) {
|
|
return this.chainModify(1.2);
|
|
}
|
|
},
|
|
},
|
|
bigroot: {
|
|
inherit: true,
|
|
onTryHeal(damage, target, source, effect) {
|
|
const heals = ['drain', 'leechseed', 'ingrain', 'aquaring'];
|
|
if (heals.includes(effect.id)) {
|
|
return Math.floor(damage * 1.3);
|
|
}
|
|
},
|
|
},
|
|
blacksludge: {
|
|
inherit: true,
|
|
onResidualOrder: 10,
|
|
onResidualSubOrder: 4,
|
|
},
|
|
brightpowder: {
|
|
inherit: true,
|
|
onModifyAccuracyPriority: 5,
|
|
onModifyAccuracy(accuracy) {
|
|
if (typeof accuracy !== 'number') return;
|
|
this.debug('brightpowder - decreasing accuracy');
|
|
return accuracy * 0.9;
|
|
},
|
|
},
|
|
choiceband: {
|
|
inherit: true,
|
|
onStart() {},
|
|
onModifyMove() {},
|
|
onAfterMove(pokemon) {
|
|
pokemon.addVolatile('choicelock');
|
|
},
|
|
},
|
|
choicescarf: {
|
|
inherit: true,
|
|
onStart() {},
|
|
onModifyMove() {},
|
|
onAfterMove(pokemon) {
|
|
pokemon.addVolatile('choicelock');
|
|
},
|
|
},
|
|
choicespecs: {
|
|
inherit: true,
|
|
onStart() {},
|
|
onModifyMove() {},
|
|
onAfterMove(pokemon) {
|
|
pokemon.addVolatile('choicelock');
|
|
},
|
|
},
|
|
chopleberry: {
|
|
inherit: true,
|
|
onSourceModifyDamage(damage, source, target, move) {
|
|
if (move.causedCrashDamage) return damage;
|
|
if (move.type === 'Fighting' && target.getMoveHitData(move).typeMod > 0) {
|
|
const hitSub = target.volatiles['substitute'] && !move.flags['bypasssub'];
|
|
if (hitSub) return;
|
|
|
|
if (target.eatItem()) {
|
|
this.debug('-50% reduction');
|
|
this.add('-enditem', target, this.effect, '[weaken]');
|
|
return this.chainModify(0.5);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
custapberry: {
|
|
inherit: true,
|
|
onFractionalPriority() {},
|
|
onBeforeTurn(pokemon) {
|
|
if (pokemon.hp <= pokemon.maxhp / 4 || (pokemon.hp <= pokemon.maxhp / 2 && pokemon.ability === 'gluttony')) {
|
|
const action = this.queue.willMove(pokemon);
|
|
if (!action) return;
|
|
this.queue.insertChoice({
|
|
choice: 'event',
|
|
event: 'Custap',
|
|
priority: action.priority + 0.1,
|
|
pokemon: action.pokemon,
|
|
move: action.move,
|
|
targetLoc: action.targetLoc,
|
|
});
|
|
}
|
|
},
|
|
onCustap(pokemon) {
|
|
const action = this.queue.willMove(pokemon);
|
|
this.debug(`custap action: ${action?.moveid}`);
|
|
if (action && pokemon.eatItem()) {
|
|
this.queue.cancelAction(pokemon);
|
|
this.add('-message', "Custap Berry activated.");
|
|
this.runAction(action);
|
|
}
|
|
},
|
|
},
|
|
deepseascale: {
|
|
inherit: true,
|
|
onModifySpD(spd, pokemon) {
|
|
if (pokemon.species.name === 'Clamperl') {
|
|
return this.chainModify(2);
|
|
}
|
|
},
|
|
},
|
|
deepseatooth: {
|
|
inherit: true,
|
|
onModifySpA(spa, pokemon) {
|
|
if (pokemon.species.name === 'Clamperl') {
|
|
return this.chainModify(2);
|
|
}
|
|
},
|
|
},
|
|
dracoplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
dreadplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
earthplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
fastball: {
|
|
inherit: true,
|
|
isNonstandard: null,
|
|
},
|
|
fistplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
flameorb: {
|
|
inherit: true,
|
|
onResidualOrder: 10,
|
|
onResidualSubOrder: 20,
|
|
},
|
|
flameplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
focussash: {
|
|
inherit: true,
|
|
onDamage() { },
|
|
onTryHit(target, source, move) {
|
|
if (target !== source && target.hp === target.maxhp) {
|
|
target.addVolatile('focussash');
|
|
}
|
|
},
|
|
condition: {
|
|
duration: 1,
|
|
onDamage(damage, target, source, effect) {
|
|
if (effect && effect.effectType === 'Move' && damage >= target.hp) {
|
|
this.effectState.activated = true;
|
|
return target.hp - 1;
|
|
}
|
|
},
|
|
onAfterMoveSecondary(target) {
|
|
if (this.effectState.activated) target.useItem();
|
|
target.removeVolatile('focussash');
|
|
},
|
|
},
|
|
},
|
|
griseousorb: {
|
|
inherit: true,
|
|
onBasePower(basePower, user, target, move) {
|
|
if (user.species.num === 487 && (move.type === 'Ghost' || move.type === 'Dragon')) {
|
|
return this.chainModify(1.2);
|
|
}
|
|
},
|
|
},
|
|
heavyball: {
|
|
inherit: true,
|
|
isNonstandard: null,
|
|
},
|
|
icicleplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
insectplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
ironball: {
|
|
inherit: true,
|
|
onEffectiveness() {},
|
|
},
|
|
ironplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
kingsrock: {
|
|
inherit: true,
|
|
onModifyMove(move) {
|
|
const affectedByKingsRock = [
|
|
'aerialace', 'aeroblast', 'aircutter', 'airslash', 'aquajet', 'aquatail', 'armthrust', 'assurance', 'attackorder', 'aurasphere', 'avalanche', 'barrage', 'beatup', 'bide', 'bind', 'blastburn', 'bonerush', 'bonemerang', 'bounce', 'bravebird', 'brickbreak', 'brine', 'bugbite', 'bulletpunch', 'bulletseed', 'chargebeam', 'clamp', 'closecombat', 'cometpunch', 'crabhammer', 'crosschop', 'crosspoison', 'crushgrip', 'cut', 'darkpulse', 'dig', 'discharge', 'dive', 'doublehit', 'doublekick', 'doubleslap', 'doubleedge', 'dracometeor', 'dragonbreath', 'dragonclaw', 'dragonpulse', 'dragonrage', 'dragonrush', 'drainpunch', 'drillpeck', 'earthpower', 'earthquake', 'eggbomb', 'endeavor', 'eruption', 'explosion', 'extremespeed', 'falseswipe', 'feintattack', 'firefang', 'firespin', 'flail', 'flashcannon', 'fly', 'forcepalm', 'frenzyplant', 'frustration', 'furyattack', 'furycutter', 'furyswipes', 'gigaimpact', 'grassknot', 'gunkshot', 'gust', 'gyroball', 'hammerarm', 'headsmash', 'hiddenpower', 'highjumpkick', 'hornattack', 'hydrocannon', 'hydropump', 'hyperbeam', 'iceball', 'icefang', 'iceshard', 'iciclespear', 'ironhead', 'judgment', 'jumpkick', 'karatechop', 'lastresort', 'lavaplume', 'leafblade', 'leafstorm', 'lowkick', 'machpunch', 'magicalleaf', 'magmastorm', 'magnetbomb', 'magnitude', 'megakick', 'megapunch', 'megahorn', 'meteormash', 'mirrorshot', 'mudbomb', 'mudshot', 'muddywater', 'nightshade', 'nightslash', 'ominouswind', 'outrage', 'overheat', 'payday', 'payback', 'peck', 'petaldance', 'pinmissile', 'pluck', 'poisonjab', 'poisontail', 'pound', 'powergem', 'powerwhip', 'psychoboost', 'psychocut', 'psywave', 'punishment', 'quickattack', 'rage', 'rapidspin', 'razorleaf', 'razorwind', 'return', 'revenge', 'reversal', 'roaroftime', 'rockblast', 'rockclimb', 'rockthrow', 'rockwrecker', 'rollingkick', 'rollout', 'sandtomb', 'scratch', 'seedbomb', 'seedflare', 'seismictoss', 'selfdestruct', 'shadowclaw', 'shadowforce', 'shadowpunch', 'shadowsneak', 'shockwave', 'signalbeam', 'silverwind', 'skullbash', 'skyattack', 'skyuppercut', 'slam', 'slash', 'snore', 'solarbeam', 'sonicboom', 'spacialrend', 'spikecannon', 'spitup', 'steelwing', 'stoneedge', 'strength', 'struggle', 'submission', 'suckerpunch', 'surf', 'swift', 'tackle', 'takedown', 'thrash', 'thunderfang', 'triplekick', 'trumpcard', 'twister', 'uturn', 'uproar', 'vacuumwave', 'visegrip', 'vinewhip', 'vitalthrow', 'volttackle', 'wakeupslap', 'watergun', 'waterpulse', 'waterfall', 'weatherball', 'whirlpool', 'wingattack', 'woodhammer', 'wrap', 'wringout', 'xscissor', 'zenheadbutt',
|
|
];
|
|
if (affectedByKingsRock.includes(move.id)) {
|
|
if (!move.secondaries) move.secondaries = [];
|
|
move.secondaries.push({
|
|
chance: 10,
|
|
volatileStatus: 'flinch',
|
|
});
|
|
}
|
|
},
|
|
},
|
|
laxincense: {
|
|
inherit: true,
|
|
onModifyAccuracyPriority: 5,
|
|
onModifyAccuracy(accuracy) {
|
|
if (typeof accuracy !== 'number') return;
|
|
this.debug('lax incense - decreasing accuracy');
|
|
return accuracy * 0.9;
|
|
},
|
|
},
|
|
leftovers: {
|
|
inherit: true,
|
|
onResidualOrder: 10,
|
|
onResidualSubOrder: 4,
|
|
},
|
|
levelball: {
|
|
inherit: true,
|
|
isNonstandard: null,
|
|
},
|
|
lifeorb: {
|
|
inherit: true,
|
|
onModifyDamage() {},
|
|
onAfterMoveSecondarySelf() {},
|
|
onBasePower(basePower, user, target) {
|
|
if (!target.volatiles['substitute']) {
|
|
user.addVolatile('lifeorb');
|
|
}
|
|
return basePower;
|
|
},
|
|
onModifyDamagePhase2(damage, source, target, move) {
|
|
if (!move.flags['futuremove']) return damage * 1.3;
|
|
},
|
|
condition: {
|
|
duration: 1,
|
|
onAfterMoveSecondarySelf(source, target, move) {
|
|
if (move && move.effectType === 'Move' && source?.volatiles['lifeorb']) {
|
|
this.damage(source.baseMaxhp / 10, source, source, this.dex.items.get('lifeorb'));
|
|
source.removeVolatile('lifeorb');
|
|
}
|
|
},
|
|
},
|
|
},
|
|
lightball: {
|
|
inherit: true,
|
|
onModifyAtk() {},
|
|
onModifySpA() {},
|
|
onBasePower(basePower, pokemon) {
|
|
if (pokemon.species.name === 'Pikachu') {
|
|
return this.chainModify(2);
|
|
}
|
|
},
|
|
},
|
|
loveball: {
|
|
inherit: true,
|
|
isNonstandard: null,
|
|
},
|
|
luckypunch: {
|
|
inherit: true,
|
|
onModifyCritRatio(critRatio, user) {
|
|
if (user.species.name === 'Chansey') {
|
|
return critRatio + 2;
|
|
}
|
|
},
|
|
},
|
|
lureball: {
|
|
inherit: true,
|
|
isNonstandard: null,
|
|
},
|
|
lustrousorb: {
|
|
inherit: true,
|
|
onBasePower(basePower, user, target, move) {
|
|
if (move && user.species.name === 'Palkia' && (move.type === 'Water' || move.type === 'Dragon')) {
|
|
return this.chainModify(1.2);
|
|
}
|
|
},
|
|
},
|
|
meadowplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
mentalherb: {
|
|
inherit: true,
|
|
fling: {
|
|
basePower: 10,
|
|
effect(pokemon) {
|
|
if (pokemon.removeVolatile('attract')) {
|
|
this.add('-end', pokemon, 'move: Attract', '[from] item: Mental Herb');
|
|
}
|
|
},
|
|
},
|
|
onUpdate(pokemon) {
|
|
if (pokemon.volatiles['attract'] && pokemon.useItem()) {
|
|
pokemon.removeVolatile('attract');
|
|
this.add('-end', pokemon, 'move: Attract', '[from] item: Mental Herb');
|
|
}
|
|
},
|
|
},
|
|
metronome: {
|
|
inherit: true,
|
|
condition: {
|
|
onStart(pokemon) {
|
|
this.effectState.numConsecutive = 0;
|
|
this.effectState.lastMove = '';
|
|
},
|
|
onTryMovePriority: -2,
|
|
onTryMove(pokemon, target, move) {
|
|
if (!pokemon.hasItem('metronome')) {
|
|
pokemon.removeVolatile('metronome');
|
|
return;
|
|
}
|
|
if (this.effectState.lastMove === move.id && pokemon.moveLastTurnResult) {
|
|
this.effectState.numConsecutive++;
|
|
} else {
|
|
this.effectState.numConsecutive = 0;
|
|
}
|
|
this.effectState.lastMove = move.id;
|
|
},
|
|
onModifyDamagePhase2(damage, source, target, move) {
|
|
return damage * (1 + (this.effectState.numConsecutive / 10));
|
|
},
|
|
},
|
|
},
|
|
micleberry: {
|
|
inherit: true,
|
|
condition: {
|
|
duration: 2,
|
|
onSourceModifyAccuracyPriority: 3,
|
|
onSourceModifyAccuracy(accuracy, target, source) {
|
|
this.add('-enditem', source, 'Micle Berry');
|
|
source.removeVolatile('micleberry');
|
|
if (typeof accuracy === 'number') {
|
|
return accuracy * 1.2;
|
|
}
|
|
},
|
|
},
|
|
},
|
|
mindplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
moonball: {
|
|
inherit: true,
|
|
isNonstandard: null,
|
|
},
|
|
razorfang: {
|
|
inherit: true,
|
|
onModifyMove(move) {
|
|
const affectedByRazorFang = [
|
|
'aerialace', 'aeroblast', 'aircutter', 'airslash', 'aquajet', 'aquatail', 'armthrust', 'assurance', 'attackorder', 'aurasphere', 'avalanche', 'barrage', 'beatup', 'bide', 'bind', 'blastburn', 'bonerush', 'bonemerang', 'bounce', 'bravebird', 'brickbreak', 'brine', 'bugbite', 'bulletpunch', 'bulletseed', 'chargebeam', 'clamp', 'closecombat', 'cometpunch', 'crabhammer', 'crosschop', 'crosspoison', 'crushgrip', 'cut', 'darkpulse', 'dig', 'discharge', 'dive', 'doublehit', 'doublekick', 'doubleslap', 'doubleedge', 'dracometeor', 'dragonbreath', 'dragonclaw', 'dragonpulse', 'dragonrage', 'dragonrush', 'drainpunch', 'drillpeck', 'earthpower', 'earthquake', 'eggbomb', 'endeavor', 'eruption', 'explosion', 'extremespeed', 'falseswipe', 'feintattack', 'firefang', 'firespin', 'flail', 'flashcannon', 'fly', 'forcepalm', 'frenzyplant', 'frustration', 'furyattack', 'furycutter', 'furyswipes', 'gigaimpact', 'grassknot', 'gunkshot', 'gust', 'gyroball', 'hammerarm', 'headsmash', 'hiddenpower', 'highjumpkick', 'hornattack', 'hydrocannon', 'hydropump', 'hyperbeam', 'iceball', 'icefang', 'iceshard', 'iciclespear', 'ironhead', 'judgment', 'jumpkick', 'karatechop', 'lastresort', 'lavaplume', 'leafblade', 'leafstorm', 'lowkick', 'machpunch', 'magicalleaf', 'magmastorm', 'magnetbomb', 'magnitude', 'megakick', 'megapunch', 'megahorn', 'meteormash', 'mirrorshot', 'mudbomb', 'mudshot', 'muddywater', 'nightshade', 'nightslash', 'ominouswind', 'outrage', 'overheat', 'payday', 'payback', 'peck', 'petaldance', 'pinmissile', 'pluck', 'poisonjab', 'poisontail', 'pound', 'powergem', 'powerwhip', 'psychoboost', 'psychocut', 'psywave', 'punishment', 'quickattack', 'rage', 'rapidspin', 'razorleaf', 'razorwind', 'return', 'revenge', 'reversal', 'roaroftime', 'rockblast', 'rockclimb', 'rockthrow', 'rockwrecker', 'rollingkick', 'rollout', 'sandtomb', 'scratch', 'seedbomb', 'seedflare', 'seismictoss', 'selfdestruct', 'shadowclaw', 'shadowforce', 'shadowpunch', 'shadowsneak', 'shockwave', 'signalbeam', 'silverwind', 'skullbash', 'skyattack', 'skyuppercut', 'slam', 'slash', 'snore', 'solarbeam', 'sonicboom', 'spacialrend', 'spikecannon', 'spitup', 'steelwing', 'stoneedge', 'strength', 'struggle', 'submission', 'suckerpunch', 'surf', 'swift', 'tackle', 'takedown', 'thrash', 'thunderfang', 'triplekick', 'trumpcard', 'twister', 'uturn', 'uproar', 'vacuumwave', 'visegrip', 'vinewhip', 'vitalthrow', 'volttackle', 'wakeupslap', 'watergun', 'waterpulse', 'waterfall', 'weatherball', 'whirlpool', 'wingattack', 'woodhammer', 'wrap', 'wringout', 'xscissor', 'zenheadbutt',
|
|
];
|
|
if (affectedByRazorFang.includes(move.id)) {
|
|
if (!move.secondaries) move.secondaries = [];
|
|
move.secondaries.push({
|
|
chance: 10,
|
|
volatileStatus: 'flinch',
|
|
});
|
|
}
|
|
},
|
|
},
|
|
skyplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
splashplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
spookyplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
sportball: {
|
|
inherit: true,
|
|
isNonstandard: null,
|
|
},
|
|
stick: {
|
|
inherit: true,
|
|
onModifyCritRatio(critRatio, user) {
|
|
if (user.species.id === 'farfetchd') {
|
|
return critRatio + 2;
|
|
}
|
|
},
|
|
},
|
|
stickybarb: {
|
|
inherit: true,
|
|
onResidualOrder: 10,
|
|
onResidualSubOrder: 20,
|
|
},
|
|
stoneplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
thickclub: {
|
|
inherit: true,
|
|
onModifyAtk(atk, pokemon) {
|
|
if (pokemon.species.name === 'Cubone' || pokemon.species.name === 'Marowak') {
|
|
return this.chainModify(2);
|
|
}
|
|
},
|
|
},
|
|
toxicorb: {
|
|
inherit: true,
|
|
onResidualOrder: 10,
|
|
onResidualSubOrder: 20,
|
|
},
|
|
toxicplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
widelens: {
|
|
inherit: true,
|
|
onSourceModifyAccuracyPriority: 4,
|
|
onSourceModifyAccuracy(accuracy) {
|
|
if (typeof accuracy === 'number') {
|
|
return accuracy * 1.1;
|
|
}
|
|
},
|
|
},
|
|
zapplate: {
|
|
inherit: true,
|
|
onTakeItem: true,
|
|
},
|
|
zoomlens: {
|
|
inherit: true,
|
|
onSourceModifyAccuracyPriority: 4,
|
|
onSourceModifyAccuracy(accuracy, target) {
|
|
if (typeof accuracy === 'number' && !this.queue.willMove(target)) {
|
|
this.debug('Zoom Lens boosting accuracy');
|
|
return accuracy * 1.2;
|
|
}
|
|
},
|
|
},
|
|
};
|