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.
67 lines
2.0 KiB
TypeScript
67 lines
2.0 KiB
TypeScript
export const Moves: import('../../../sim/dex-moves').ModdedMoveDataTable = {
|
|
// Belly Drum no longer boosts attack by 2 stages if under 50% health.
|
|
bellydrum: {
|
|
inherit: true,
|
|
onHit(target) {
|
|
if (target.boosts.atk >= 6 || target.hp <= target.maxhp / 2) {
|
|
return false;
|
|
}
|
|
this.directDamage(target.maxhp / 2);
|
|
const originalStage = target.boosts.atk;
|
|
let currentStage = originalStage;
|
|
let boosts = 0;
|
|
let loopStage = 0;
|
|
while (currentStage < 6) {
|
|
loopStage = currentStage;
|
|
currentStage++;
|
|
if (currentStage < 6) currentStage++;
|
|
target.boosts.atk = loopStage;
|
|
if (target.getStat('atk', false, true) < 999) {
|
|
target.boosts.atk = currentStage;
|
|
continue;
|
|
}
|
|
target.boosts.atk = currentStage - 1;
|
|
break;
|
|
}
|
|
boosts = target.boosts.atk - originalStage;
|
|
target.boosts.atk = originalStage;
|
|
this.boost({ atk: boosts });
|
|
},
|
|
},
|
|
destinybond: {
|
|
inherit: true,
|
|
onPrepareHit(pokemon) {
|
|
if (pokemon.side.pokemonLeft === 1) {
|
|
this.hint("In Pokemon Stadium 2, Destiny Bond fails if it is being used by your last Pokemon.");
|
|
return false;
|
|
}
|
|
},
|
|
},
|
|
/**
|
|
* In Stadium 2, moves which affect the stat stages of a Pokemon, such as moves which boost ones own stats,
|
|
* lower the targets stats, or Haze, causes the afflicted stat to be re-calculated without factoring in
|
|
* status aliments, thus if a Pokemon is burned or paralyzed and either active Pokemon uses Haze, then their
|
|
* attack and speed are re-calculated while ignoring their status ailments, so their attack would go from 50% to normal
|
|
*/
|
|
haze: {
|
|
inherit: true,
|
|
onHitField() {
|
|
this.add('-clearallboost');
|
|
for (const pokemon of this.getAllActive()) {
|
|
pokemon.clearBoosts();
|
|
pokemon.removeVolatile('brnattackdrop');
|
|
pokemon.removeVolatile('parspeeddrop');
|
|
}
|
|
},
|
|
},
|
|
perishsong: {
|
|
inherit: true,
|
|
onPrepareHit(pokemon) {
|
|
if (pokemon.side.pokemonLeft === 1) {
|
|
this.hint("In Pokemon Stadium 2, Perish Song fails if it is being used by your last Pokemon.");
|
|
return false;
|
|
}
|
|
},
|
|
},
|
|
};
|