Pokemon have particular characteristics, such as natures, abilities, typing, and moves. This project focuses on the typing aspect of Pokemon, and how particular typing of Pokemon can be effective against another.
Pokemon can have up to 2 different types, such as “Water” and “Flying”. By using the existing type list of all Pokemon, This project aims determine how effective it is against another. As an example, a Pokemon that is “Water” and “Flying” is incredibly ineffective against Pokemon of the “Electric” typing. This project aims to calculate effectiveness and reveal the results to the user.
import poketype from 'poketype'
const { ほのお, くさ } = poketype.Types // English type names are supported
const フシギダネ = poketype.createPokemon(くさ)
const ひのこ = ほのお
const effectiveness = poketype.calcEffectiveness(ひのこ, フシギダネ)
console.log(effectiveness.message) // 'こうかは ばつぐんだ!'
MIT by @hakobe