Skip to content

Instantly share code, notes, and snippets.

@agarie
Last active March 20, 2023 00:27
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save agarie/2620966 to your computer and use it in GitHub Desktop.
Save agarie/2620966 to your computer and use it in GitHub Desktop.
Pokémon type chart as a JSON.
{
"normal": {
"normal": 1,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 1,
"fighting": 1,
"poison": 1,
"ground": 1,
"flying": 1,
"psychic": 1,
"bug": 1,
"rock": 0.5,
"ghost": 0,
"dragon": 1,
"dark": 1,
"steel": 0.5
},
"fire": {
"normal": 1,
"fire": 0.5,
"water": 0.5,
"electric": 1,
"grass": 2,
"ice": 2,
"fighting": 1,
"poison": 1,
"ground": 1,
"flying": 1,
"psychic": 1,
"bug": 2,
"rock": 0.5,
"ghost": 1,
"dragon": 0.5,
"dark": 1,
"steel": 2
},
"water": {
"normal": 1,
"fire": 2,
"water": 0.5,
"electric": 1,
"grass": 0.5,
"ice": 1,
"fighting": 1,
"poison": 1,
"ground": 2,
"flying": 1,
"psychic": 1,
"bug": 1,
"rock": 2,
"ghost": 1,
"dragon": 0.5,
"dark": 1,
"steel": 1
},
"electric": {
"normal": 1,
"fire": 1,
"water": 2,
"electric": 0.5,
"grass": 0.5,
"ice": 1,
"fighting": 1,
"poison": 1,
"ground": 0,
"flying": 2,
"psychic": 1,
"bug": 1,
"rock": 1,
"ghost": 1,
"dragon": 0.5,
"dark": 1,
"steel": 1
},
"grass": {
"normal": 1,
"fire": 0.5,
"water": 2,
"electric": 1,
"grass": 0.5,
"ice": 1,
"fighting": 1,
"poison": 0.5,
"ground": 2,
"flying": 0.5,
"psychic": 1,
"bug": 0.5,
"rock": 2,
"ghost": 1,
"dragon": 0.5,
"dark": 1,
"steel": 0.5
},
"ice": {
"normal": 1,
"fire": 0.5,
"water": 0.5,
"electric": 1,
"grass": 2,
"ice": 0.5,
"fighting": 1,
"poison": 1,
"ground": 2,
"flying": 2,
"psychic": 1,
"bug": 1,
"rock": 1,
"ghost": 1,
"dragon": 2,
"dark": 1,
"steel": 0.5
},
"fighting": {
"normal": 2,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 2,
"fighting": 1,
"poison": 0.5,
"ground": 1,
"flying": 0.5,
"psychic": 0.5,
"bug": 0.5,
"rock": 2,
"ghost": 0,
"dragon": 1,
"dark": 2,
"steel": 2
},
"poison": {
"normal": 1,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 2,
"ice": 1,
"fighting": 1,
"poison": 0.5,
"ground": 0.5,
"flying": 1,
"psychic": 1,
"bug": 1,
"rock": 0.5,
"ghost": 0.5,
"dragon": 1,
"dark": 1,
"steel": 0
},
"ground": {
"normal": 1,
"fire": 2,
"water": 1,
"electric": 2,
"grass": 0.5,
"ice": 1,
"fighting": 1,
"poison": 2,
"ground": 1,
"flying": 0,
"psychic": 1,
"bug": 0.5,
"rock": 2,
"ghost": 1,
"dragon": 1,
"dark": 1,
"steel": 2
},
"flying": {
"normal": 1,
"fire": 1,
"water": 1,
"electric": 0.5,
"grass": 2,
"ice": 1,
"fighting": 2,
"poison": 1,
"ground": 1,
"flying": 1,
"psychic": 1,
"bug": 2,
"rock": 0.5,
"ghost": 1,
"dragon": 1,
"dark": 1,
"steel": 0.5
},
"psychic": {
"normal": 1,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 1,
"fighting": 2,
"poison": 2,
"ground": 1,
"flying": 1,
"psychic": 0.5,
"bug": 1,
"rock": 1,
"ghost": 1,
"dragon": 1,
"dark": 0,
"steel": 0.5
},
"bug": {
"normal": 1,
"fire": 0.5,
"water": 1,
"electric": 1,
"grass": 2,
"ice": 1,
"fighting": 0.5,
"poison": 0.5,
"ground": 1,
"flying": 0.5,
"psychic": 2,
"bug": 1,
"rock": 1,
"ghost": 0.5,
"dragon": 1,
"dark": 2,
"steel": 0.5
},
"rock": {
"normal": 1,
"fire": 2,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 2,
"fighting": 0.5,
"poison": 1,
"ground": 0.5,
"flying": 2,
"psychic": 1,
"bug": 2,
"rock": 1,
"ghost": 1,
"dragon": 1,
"dark": 1,
"steel": 0.5
},
"ghost": {
"normal": 0,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 1,
"fighting": 1,
"poison": 1,
"ground": 1,
"flying": 1,
"psychic": 2,
"bug": 1,
"rock": 1,
"ghost": 2,
"dragon": 1,
"dark": 0.5,
"steel": 0.5
},
"dragon": {
"normal": 1,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 1,
"fighting": 1,
"poison": 1,
"ground": 1,
"flying": 1,
"psychic": 1,
"bug": 1,
"rock": 1,
"ghost": 1,
"dragon": 2,
"dark": 1,
"steel": 0.5
},
"dark": {
"normal": 1,
"fire": 1,
"water": 1,
"electric": 1,
"grass": 1,
"ice": 1,
"fighting": 0.5,
"poison": 1,
"ground": 1,
"flying": 1,
"psychic": 2,
"bug": 1,
"rock": 1,
"ghost": 2,
"dragon": 1,
"dark": 0.5,
"steel": 0.5
},
"steel": {
"normal": 1,
"fire": 0.5,
"water": 0.5,
"electric": 0.5,
"grass": 1,
"ice": 2,
"fighting": 1,
"poison": 1,
"ground": 1,
"flying": 1,
"psychic": 1,
"bug": 1,
"rock": 2,
"ghost": 1,
"dragon": 1,
"dark": 1,
"steel": 0.5
}
}
@megahypercat
Copy link

Cool but how do I use it?

@agarie
Copy link
Author

agarie commented Dec 14, 2021

For example, if you wanna check the effectiveness of a ground move against an electric/water mon, you would use something like this:

var effectiveness = TYPE_CHART["ground"][TYPE_ORDER["electric"]] * TYPE_CHART["ground"][TYPE_ORDER["water"]];

This is a small data file I used long, long time ago when playing around with JS and Pokémon calculators. There's a lot that could be improved here.

@megahypercat
Copy link

Aha I see, thank you! I didnt really expect a response when I saw it was 10 years ago haha.
Im making my own little game so maybe I should do it like this.

@agarie
Copy link
Author

agarie commented Dec 15, 2021

Yeah, I was really surprised to see a comment here. lol

It's definitely better to rewrite this as a proper hash table, like TYPE_CHART = { "normal": { "normal": 1, "fire": 1, … }} so you don't need the auxiliary variables TYPES and TYPE_ORDER. I really cannot remember why I wrote it like this. D:

@agarie
Copy link
Author

agarie commented Dec 15, 2021

@megahypercat I ended up rewriting this thing as a proper JSON. I don't know what you wanna do with it, but please be aware this is super old, as there's no Fairy type in this chart and maybe some values are incorrect (Dark doesn't have 0.5 effectiveness against Steel anymore, etc). :D

@overneos
Copy link

thanks for updating it <3

@ainsleyrutterford
Copy link

Very useful. Made a JSON Gist with the inverse of this that shows the weaknesses of a type in the same format.

@Pablo-Donoso
Copy link

I love you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment