1 unstable release
0.1.2 | Nov 21, 2022 |
---|---|
0.1.0 |
|
#504 in Games
12KB
190 lines
poke-type
A Pokemon type effectiveness calculator that accepts arbitrary type combinations.
This calculator currently supports only calculating defensive type effectiveness, but may be expanded to include offensive type coverage in the future. There may also be a GUI version of this calculator in the future.
Pokemon Scarlet and Violet
With the release of Pokemon Scarlet and Violet, it is now possible to have three types on a pokemon via Terastallising. I have struggled to find a type calculator that allows more than two types, so I decided to make my own.
Installation
Binaries are included under the releases tab, or you can install via cargo:
cargo install poke-type
Usage
The calculator accepts a list of at least one type, separated by spaces with case ignored, and outputs the effectiveness of each type against the given types, while ignoring duplicates.
poketype [TYPE 1] [TYPE 2]...[TYPE N]
For example, to calculate the effectiveness of a pokemon with the types Fire
and Flying
:
poketype fire flying
Output:
Pokemon typed as {Flying, Fire} will receive:
4x damage from [Rock]
2x damage from [Water, Electric]
1x damage from [Normal, Ice, Poison, Flying, Psychic, Ghost, Dragon, Dark]
0.5x damage from [Fire, Fighting, Steel, Fairy]
0.25x damage from [Grass, Bug]
0x damage from [Ground]
Terastallising
This calculator really shines when used with Terastallising, as it allows for three types on a pokemon.
For example, to calculate the effectiveness of a pokemon with the types Fire
, Flying
, but also with Dragon
:
poketype fire flying dragon
Output:
Pokemon typed as {Dragon, Fire, Flying} will receive:
4x damage from [Rock]
2x damage from [Ice, Dragon]
1x damage from [Normal, Water, Electric, Poison, Flying, Psychic, Ghost, Dark, Fairy]
0.5x damage from [Fighting, Steel]
0.25x damage from [Fire, Bug]
0.125x damage from [Grass]
0x damage from [Ground]
Arbitrary Number of Types
This calculator also supports any number of types, so you can calculate the effectiveness of an impossible pokemon with the types Fire
, Flying
, Dragon
, Fighting
, Bug
, Grass
, Ground
, Normal
, Water
, Electric
, Poison
, Psychic
, Ghost
, Dark
, Fairy
, Steel
, Ice
, Rock
:
poketype fire flying dragon fighting bug grass ground normal water electric poison psychic ghost dark fairy steel ice rock
Output:
Pokemon typed as {Ghost, Flying, Steel, Electric, Ground, Dragon, Water, Rock, Bug, Dark, Ice, Normal, Poison, Fighting, Psychic, Fairy, Fire, Grass} will receive:
2x damage from [Rock]
1x damage from [Fire, Water, Ice, Flying, Fairy]
0.5x damage from [Dark, Steel]
0.0625x damage from [Grass, Bug]
0x damage from [Normal, Electric, Fighting, Poison, Ground, Psychic, Ghost, Dragon]
Duplicate Types
When passing multiple instancess of the same type, the calculator will ignore the duplicates and only calculate the effectiveness of the type once.
poketype fire fire fire
Output:
Pokemon typed as {Fire} will receive:
2x damage from [Water, Ground, Rock]
1x damage from [Normal, Electric, Fighting, Poison, Flying, Psychic, Ghost, Dragon, Dark]
0.5x damage from [Fire, Grass, Ice, Bug, Steel, Fairy]
Dependencies
~1.2–1.8MB
~34K SLoC