PokéTypes
🔥 💧 🍃
A module that exposes all Pokémon types and
— their weaknesses, strengths and immunities.
Install
yarn
$ yarn add poke-types
npm
$ npm install --save poke-types
Usage
const abilityEffectiveness = { } const attack = { return ` used ! 💥 `} const pikachu = name: 'Pikachu' type: 'electric' abilities: thunderbolt: name: 'Thunderbolt' type: 'electric' targetpikachuabilitiesability const gyarados = name: 'Gyarados' type: 'water' 'flying' console// Pikachu used Thunderbolt!// 💥// It's super effective!
API
.effectiveness: Object
noEffect | weak | notVeryEffective | normal | superEffective | ultra |
---|---|---|---|---|---|
0 | 0.25 | 0.5 | 1 | 2 | 4 |
.types: string[]
normal | fire | water | electric | grass | ice | fighting | poison | ground |
---|---|---|---|---|---|---|---|---|
flying | psychic | bug | rock | ghost | dragon | dark | steel | fairy |
.getTypeWeaknesses(type: string, ?secondType: string): Object
type
type name to get weaknesses for
secondType
the second type to get dual type weaknesses for
pokeTypes// { normal: 1, fire: 2, water: 0.5, ... }pokeTypes// { normal: 1, fire: 1, water: 2, ... }
.getTypeStrengths(type: string): Object
type:
type name to get type strengths for.
pokeTypes// { normal: 1, fire: 1, water: 2, ... }pokeType// { normal: 2, fire: 1, water: 1, ... }
License
MIT @ Frederik Bosch