A Pokemon damage calculator.
import { sulcalc, Field, Generation, Move, Pokemon, Weather } from "sulcalc";
const attacker = new Pokemon({
name: "Moltres",
item: "Charcoal",
gen: Generation.GSC
});
const defender = new Pokemon({
name: "Snorlax",
item: "Leftovers",
gen: Generation.GSC
});
const move = new Move({
name: "Fire Blast",
gen: Generation.GSC
});
const field = new Field({
weather: Weather.SUN,
gen: Generation.GSC
});
sulcalc(attacker, defender, move, field).summary;
// 'Charcoal Moltres Fire Blast vs. Leftovers Snorlax in Sun: 237 - 279 (45.3 - 53.3%) -- 0.3% chance to 2HKO after Leftovers'
- Install Node.js if you haven't done so already.
- Run
npm ci
in the root directory of the repository. - Be sure to run
npm run setup
before running other tasks.
npm run start
to start a local server that will serve the app.- After a while it will finish building and provide a link in the console.
npm run build:app
to build the web app.npm run build:lib
to bundle just the API together.- All builds are put in the
/dist
folder.
npm run test
to run the unit tests.npm run lint
to run TSLint and Prettier.npm run style:fix
to autoformat with Prettier.- These should all be run automatically before commits.