const moves = Dex.moves.all();
const points: {[k: string]: number} = {};
for (const move of moves) {
if (move.category === 'Status') continue;
if (move.isZ || move.isMax) continue;
if (move.isNonstandard === 'CAP') continue;
let power = move.basePower;
const powerx2 = power * 2;
const powerMapper: {[k: string]: number} = {
// real power of some moves, emitted here
};
if (move.id in powerMapper) power = powerMapper[move.id];
if (move.ohko) power = 250;
if (move.multihit) {
if (['tripleaxel', 'triplekick'].includes(move.id)) power *= 6;
else if (typeof move.multihit === 'number') power *= move.multihit;
else power *= 3.1;
}
if (move.willCrit) power *= 1.5;
/**
* ,60] | (60, 80) | [80, 100] | (100, 120) | [120, 150] | (150,
* 0 | 0.5 | 1 | 1.5 | 2 | 2.5
*/
if (power <= 60 && power > 0) points[move.id] = 0;
else if (power < 80) points[move.id] = 0.5;
else if (power <= 100) points[move.id] = 1;
else if (power < 120) points[move.id] = 1.5;
else if (power <= 150) points[move.id] = 2;
else points[move.id] = 2.5;
if ((move.priority > 0 && move.id !== 'bide') || move.id === 'grassyglide') points[move.id] += 0.5;
if (move.flags.heal) points[move.id] += 0.5;
if (move.flags.recharge) points[move.id] -= 0.5;
if (move.ignoreAbility) points[move.id] += 0.5;
if (move.selfSwitch) points[move.id] += 0.5;
if (move.volatileStatus === 'partiallytrapped') points[move.id] += 0.5;
if (move.id === 'triplearrows') points[move.id] += 0.5;
const secondary = move.secondary;
if (secondary && secondary.chance && (secondary.chance >= 30 || secondary.status === 'slp')) {
const isVeryUsefulSecondary = ['acidspray', 'direclaw', 'luminacrash'].includes(move.id) || secondary.status === 'slp';
const isUsefulSecondary = isVeryUsefulSecondary || secondary.boosts || secondary.self || secondary.status || secondary.volatileStatus;
if (isVeryUsefulSecondary) points[move.id] += 0.5;
if (isUsefulSecondary && (power >= 80 && power < 120 || secondary.chance >= 50 || isVeryUsefulSecondary)) points[move.id] += 0.5;
}
const self = move.self;
if (self) {
const isVeryUsefulSelf = self.sideCondition;
const isUsefulSelf = isVeryUsefulSelf || self.boosts && Object.values(self.boosts).some(value => value > 0);
if (isVeryUsefulSelf) points[move.id] += 0.5;
if (isUsefulSelf && (power >= 80 || isVeryUsefulSelf)) points[move.id] += 0.5;
}
const otherVeryUseful = [
'ceaselessedge', 'endeavor', 'stoneaxe', 'lastrespects', 'naturesmadness', 'powertrip', 'ragefist', 'ruination',
'sappyseed', 'storedpower', 'superfang',
];
const otherUseful = otherVeryUseful.concat([
'barbbarrage', 'bodypress', 'buzzybuzz', 'collisioncourse', 'comeuppance', 'coreenforcer', 'counter', 'electrodrift',
'electroshot', 'infernalparade', 'hex', 'knockoff', 'metalburst', 'mirrorcoat', 'mortalspin', 'psychicnoise',
'rapidspin', 'saltcure', 'sparklyswirl', 'spectralthief', 'thousandarrows', 'venoshock',
]);
const otherUseless = [
'belch', 'burnup', 'doubleshock', 'dreameater', 'flail', 'focuspunch', 'freezeshock', 'iceburn',
'lastresort', 'reversal', 'shelltrap', 'skullbash', 'skyattack', 'sparklingaria', 'steelroller', 'synchronoise',
];
if (otherVeryUseful.includes(move.id)) points[move.id] += 0.5;
if (otherUseful.includes(move.id)) points[move.id] += 0.5;
if (otherUseless.includes(move.id)) points[move.id] -= 0.5;
points[move.id] = Math.max(0.5, points[move.id]);
points[move.id] = Math.min(2.5, points[move.id]);
}