oakdex-pokedex 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +27 -0
- data/data/schemas/ability.json +68 -0
- data/data/schemas/egg_group.json +59 -0
- data/data/schemas/generation.json +78 -0
- data/data/schemas/move.json +283 -0
- data/data/schemas/nature.json +83 -0
- data/data/schemas/pokemon.json +2584 -0
- data/data/schemas/region.json +1039 -0
- data/data/schemas/type.json +97 -0
- data/lib/oakdex/pokedex.rb +1 -0
- data/lib/oakdex/pokedex/base.rb +10 -0
- data/lib/oakdex/pokedex/invalid_pokemon_error.rb +7 -0
- data/lib/oakdex/pokedex/pokemon.rb +10 -0
- data/lib/oakdex/pokedex/pokemon_importer.rb +57 -0
- data/lib/oakdex/pokedex/version.rb +1 -1
- metadata +29 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 50c5be80f51553b2c8104322cecfb88f829320e0
|
4
|
+
data.tar.gz: cc2631831b1dadc993a3573a51097d67665dad5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fd626cd878bda1df2a8d7a48f97fe5a08868ad06d63d20500a8548329a2f33cf162bb5bb01669ee648a5e75d7a0517e4a22423650f06d0591dabed69cfa510e
|
7
|
+
data.tar.gz: cb833d3f266d37e88fc9f620b327798c72023a106f34ca721e813e4463976fb53c738af780370e048708fe9da228c2a2a06dc5249fdf393c9f2c6fb89a8e7ffb
|
data/README.md
CHANGED
@@ -135,6 +135,33 @@ console.log(moves.length); // 26
|
|
135
135
|
```
|
136
136
|
|
137
137
|
|
138
|
+
### Add custom Pokemon / Fakemon
|
139
|
+
|
140
|
+
You can add your own Pokémon and it will be checked if it is valid. You can and should add them as a batch as evolutions need to present at the same time.
|
141
|
+
|
142
|
+
Fakemon need to have a national_id that is greater than 10000.
|
143
|
+
|
144
|
+
Checkout [the fakemon examples](fixtures).
|
145
|
+
|
146
|
+
```rb
|
147
|
+
fakemon_stage1 = File.read('my_fakemon1.json')
|
148
|
+
fakemon_stage2 = File.read('my_fakemon2.json')
|
149
|
+
|
150
|
+
Oakdex::Pokedex::Pokemon.import!([fakemon_stage1, fakemon_stage2])
|
151
|
+
|
152
|
+
Oakdex::Pokedex::Pokemon.find('My Fakemon')
|
153
|
+
```
|
154
|
+
|
155
|
+
```js
|
156
|
+
fakemonStage1 = fs.readFileSync('./fixtures/my_fakemon1.json', 'utf8')
|
157
|
+
fakemonStage2 = fs.readFileSync('./fixtures/my_fakemon2.json', 'utf8')
|
158
|
+
|
159
|
+
oakdexPokedex.importPokemon([fakemonStage1, fakemonStage2])
|
160
|
+
|
161
|
+
oakdexPokedex.findPokemon('My Fakemon')
|
162
|
+
```
|
163
|
+
|
164
|
+
|
138
165
|
### Schemas
|
139
166
|
|
140
167
|
If you want to know what the structure of the given data is, checkout the following documentations:
|
@@ -0,0 +1,68 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"title": "Ability",
|
5
|
+
"definitions": {
|
6
|
+
"translations": {
|
7
|
+
"type": "object",
|
8
|
+
"properties": {
|
9
|
+
"cz": {
|
10
|
+
"type": "string"
|
11
|
+
},
|
12
|
+
"dk": {
|
13
|
+
"type": "string"
|
14
|
+
},
|
15
|
+
"fr": {
|
16
|
+
"type": "string"
|
17
|
+
},
|
18
|
+
"de": {
|
19
|
+
"type": "string"
|
20
|
+
},
|
21
|
+
"gr": {
|
22
|
+
"type": "string"
|
23
|
+
},
|
24
|
+
"it": {
|
25
|
+
"type": "string"
|
26
|
+
},
|
27
|
+
"pl": {
|
28
|
+
"type": "string"
|
29
|
+
},
|
30
|
+
"tr": {
|
31
|
+
"type": "string"
|
32
|
+
},
|
33
|
+
"en": {
|
34
|
+
"type": "string"
|
35
|
+
},
|
36
|
+
"jp": {
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"es": {
|
40
|
+
"type": "string"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"required": [
|
44
|
+
"en",
|
45
|
+
"de"
|
46
|
+
],
|
47
|
+
"additionalProperties": false
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"properties": {
|
51
|
+
"index_number": {
|
52
|
+
"type": "integer",
|
53
|
+
"minimum": 1
|
54
|
+
},
|
55
|
+
"names": {
|
56
|
+
"$ref": "#/definitions/translations"
|
57
|
+
},
|
58
|
+
"descriptions": {
|
59
|
+
"$ref": "#/definitions/translations"
|
60
|
+
}
|
61
|
+
},
|
62
|
+
"required": [
|
63
|
+
"index_number",
|
64
|
+
"names",
|
65
|
+
"descriptions"
|
66
|
+
],
|
67
|
+
"additionalProperties": false
|
68
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"title": "Egg Group",
|
5
|
+
"definitions": {
|
6
|
+
"translations": {
|
7
|
+
"type": "object",
|
8
|
+
"properties": {
|
9
|
+
"cz": {
|
10
|
+
"type": "string"
|
11
|
+
},
|
12
|
+
"dk": {
|
13
|
+
"type": "string"
|
14
|
+
},
|
15
|
+
"fr": {
|
16
|
+
"type": "string"
|
17
|
+
},
|
18
|
+
"de": {
|
19
|
+
"type": "string"
|
20
|
+
},
|
21
|
+
"gr": {
|
22
|
+
"type": "string"
|
23
|
+
},
|
24
|
+
"it": {
|
25
|
+
"type": "string"
|
26
|
+
},
|
27
|
+
"pl": {
|
28
|
+
"type": "string"
|
29
|
+
},
|
30
|
+
"tr": {
|
31
|
+
"type": "string"
|
32
|
+
},
|
33
|
+
"en": {
|
34
|
+
"type": "string"
|
35
|
+
},
|
36
|
+
"jp": {
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"es": {
|
40
|
+
"type": "string"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"required": [
|
44
|
+
"en",
|
45
|
+
"de"
|
46
|
+
],
|
47
|
+
"additionalProperties": false
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"properties": {
|
51
|
+
"names": {
|
52
|
+
"$ref": "#/definitions/translations"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"required": [
|
56
|
+
"names"
|
57
|
+
],
|
58
|
+
"additionalProperties": false
|
59
|
+
}
|
@@ -0,0 +1,78 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"title": "Generation",
|
5
|
+
"definitions": {
|
6
|
+
"translations": {
|
7
|
+
"type": "object",
|
8
|
+
"properties": {
|
9
|
+
"cz": {
|
10
|
+
"type": "string"
|
11
|
+
},
|
12
|
+
"dk": {
|
13
|
+
"type": "string"
|
14
|
+
},
|
15
|
+
"fr": {
|
16
|
+
"type": "string"
|
17
|
+
},
|
18
|
+
"de": {
|
19
|
+
"type": "string"
|
20
|
+
},
|
21
|
+
"gr": {
|
22
|
+
"type": "string"
|
23
|
+
},
|
24
|
+
"it": {
|
25
|
+
"type": "string"
|
26
|
+
},
|
27
|
+
"pl": {
|
28
|
+
"type": "string"
|
29
|
+
},
|
30
|
+
"tr": {
|
31
|
+
"type": "string"
|
32
|
+
},
|
33
|
+
"en": {
|
34
|
+
"type": "string"
|
35
|
+
},
|
36
|
+
"jp": {
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"es": {
|
40
|
+
"type": "string"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"required": [
|
44
|
+
"en",
|
45
|
+
"de"
|
46
|
+
],
|
47
|
+
"additionalProperties": false
|
48
|
+
}
|
49
|
+
},
|
50
|
+
"properties": {
|
51
|
+
"number": {
|
52
|
+
"type": "integer",
|
53
|
+
"minimum": 1,
|
54
|
+
"maximum": 7
|
55
|
+
},
|
56
|
+
"names": {
|
57
|
+
"$ref": "#/definitions/translations"
|
58
|
+
},
|
59
|
+
"dex_name": {
|
60
|
+
"type": "string"
|
61
|
+
},
|
62
|
+
"games": {
|
63
|
+
"type": "array",
|
64
|
+
"minItems": 1,
|
65
|
+
"maxItems": 5,
|
66
|
+
"items": {
|
67
|
+
"$ref": "#/definitions/translations"
|
68
|
+
}
|
69
|
+
}
|
70
|
+
},
|
71
|
+
"required": [
|
72
|
+
"number",
|
73
|
+
"names",
|
74
|
+
"dex_name",
|
75
|
+
"games"
|
76
|
+
],
|
77
|
+
"additionalProperties": false
|
78
|
+
}
|
@@ -0,0 +1,283 @@
|
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type": "object",
|
4
|
+
"title": "Move",
|
5
|
+
"definitions": {
|
6
|
+
"translations": {
|
7
|
+
"type": "object",
|
8
|
+
"properties": {
|
9
|
+
"cz": {
|
10
|
+
"type": "string"
|
11
|
+
},
|
12
|
+
"dk": {
|
13
|
+
"type": "string"
|
14
|
+
},
|
15
|
+
"fr": {
|
16
|
+
"type": "string"
|
17
|
+
},
|
18
|
+
"de": {
|
19
|
+
"type": "string"
|
20
|
+
},
|
21
|
+
"gr": {
|
22
|
+
"type": "string"
|
23
|
+
},
|
24
|
+
"it": {
|
25
|
+
"type": "string"
|
26
|
+
},
|
27
|
+
"pl": {
|
28
|
+
"type": "string"
|
29
|
+
},
|
30
|
+
"tr": {
|
31
|
+
"type": "string"
|
32
|
+
},
|
33
|
+
"en": {
|
34
|
+
"type": "string"
|
35
|
+
},
|
36
|
+
"jp": {
|
37
|
+
"type": "string"
|
38
|
+
},
|
39
|
+
"es": {
|
40
|
+
"type": "string"
|
41
|
+
}
|
42
|
+
},
|
43
|
+
"required": [
|
44
|
+
"en",
|
45
|
+
"de"
|
46
|
+
],
|
47
|
+
"additionalProperties": false
|
48
|
+
},
|
49
|
+
"type": {
|
50
|
+
"type": "string",
|
51
|
+
"enum": [
|
52
|
+
"Normal",
|
53
|
+
"Fighting",
|
54
|
+
"Flying",
|
55
|
+
"Poison",
|
56
|
+
"Ground",
|
57
|
+
"Rock",
|
58
|
+
"Bug",
|
59
|
+
"Ghost",
|
60
|
+
"Steel",
|
61
|
+
"Fire",
|
62
|
+
"Water",
|
63
|
+
"Grass",
|
64
|
+
"Electric",
|
65
|
+
"Psychic",
|
66
|
+
"Ice",
|
67
|
+
"Dragon",
|
68
|
+
"Dark",
|
69
|
+
"Fairy"
|
70
|
+
]
|
71
|
+
}
|
72
|
+
},
|
73
|
+
"properties": {
|
74
|
+
"names": {
|
75
|
+
"$ref": "#/definitions/translations"
|
76
|
+
},
|
77
|
+
"pokedex_entries": {
|
78
|
+
"type": "object",
|
79
|
+
"patternProperties": {
|
80
|
+
"Red|Blue|Yellow|Gold|Silver|Crystal|Ruby|Sapphire|Emerald|FireRed|LeafGreen|Diamond|Pearl|Platinum|HeartGold|SoulSilver|Black|White|Black 2|White 2|X|Y|Omega Ruby|Alpha Sapphire|Sun|Moon|Ultra Sun|Ultra Moon": {
|
81
|
+
"$ref": "#/definitions/translations"
|
82
|
+
}
|
83
|
+
},
|
84
|
+
"additionalProperties": false
|
85
|
+
},
|
86
|
+
"index_number": {
|
87
|
+
"type": "integer",
|
88
|
+
"minimum": 0
|
89
|
+
},
|
90
|
+
"pp": {
|
91
|
+
"type": "integer",
|
92
|
+
"minimum": 0,
|
93
|
+
"maximum": 40
|
94
|
+
},
|
95
|
+
"max_pp": {
|
96
|
+
"type": "integer",
|
97
|
+
"minimum": 0,
|
98
|
+
"maximum": 64
|
99
|
+
},
|
100
|
+
"power": {
|
101
|
+
"type": "integer",
|
102
|
+
"minimum": 0,
|
103
|
+
"maximum": 250
|
104
|
+
},
|
105
|
+
"accuracy": {
|
106
|
+
"type": "integer",
|
107
|
+
"minimum": 0,
|
108
|
+
"maximum": 100
|
109
|
+
},
|
110
|
+
"type": {
|
111
|
+
"$ref": "#/definitions/type"
|
112
|
+
},
|
113
|
+
"category": {
|
114
|
+
"type": "string",
|
115
|
+
"enum" : ["physical", "status", "special", "varies"]
|
116
|
+
},
|
117
|
+
"priority": {
|
118
|
+
"type": "integer",
|
119
|
+
"minimum": -7,
|
120
|
+
"maximum": 7
|
121
|
+
},
|
122
|
+
"target": {
|
123
|
+
"type": "string",
|
124
|
+
"enum" : [
|
125
|
+
"target_adjacent_single",
|
126
|
+
"target_adjacent_user_single",
|
127
|
+
"target_user_or_adjacent_user",
|
128
|
+
"user",
|
129
|
+
"all_users",
|
130
|
+
"all_adjacent",
|
131
|
+
"adjacent_foes_all",
|
132
|
+
"all_except_user",
|
133
|
+
"all_foes",
|
134
|
+
"all",
|
135
|
+
"user_and_random_adjacent_foe"
|
136
|
+
]
|
137
|
+
},
|
138
|
+
"critical_hit": {
|
139
|
+
"type": "integer",
|
140
|
+
"minimum": 0,
|
141
|
+
"maximum": 2
|
142
|
+
},
|
143
|
+
"makes_contact": {
|
144
|
+
"type": "boolean"
|
145
|
+
},
|
146
|
+
"affected_by_protect": {
|
147
|
+
"type": "boolean"
|
148
|
+
},
|
149
|
+
"affected_by_magic_coat": {
|
150
|
+
"type": "boolean"
|
151
|
+
},
|
152
|
+
"affected_by_snatch": {
|
153
|
+
"type": "boolean"
|
154
|
+
},
|
155
|
+
"affected_by_mirror_move": {
|
156
|
+
"type": "boolean"
|
157
|
+
},
|
158
|
+
"affected_by_kings_rock": {
|
159
|
+
"type": "boolean"
|
160
|
+
},
|
161
|
+
"in_battle_properties": {
|
162
|
+
"type": "object",
|
163
|
+
"properties": {
|
164
|
+
"increased_critical_hit_ratio": {
|
165
|
+
"type": "boolean"
|
166
|
+
},
|
167
|
+
"status_conditions": {
|
168
|
+
"type": "array",
|
169
|
+
"maxItems": 5,
|
170
|
+
"items": {
|
171
|
+
"type": "object",
|
172
|
+
"properties": {
|
173
|
+
"condition": {
|
174
|
+
"type": "string",
|
175
|
+
"enum": [
|
176
|
+
"burn",
|
177
|
+
"freeze",
|
178
|
+
"paralysis",
|
179
|
+
"poison",
|
180
|
+
"badly_poisoned",
|
181
|
+
"sleep"
|
182
|
+
]
|
183
|
+
},
|
184
|
+
"probability": {
|
185
|
+
"type": "integer",
|
186
|
+
"minimum": 0,
|
187
|
+
"maximum": 100
|
188
|
+
}
|
189
|
+
},
|
190
|
+
"required": [
|
191
|
+
"condition",
|
192
|
+
"probability"
|
193
|
+
],
|
194
|
+
"additionalProperties": false
|
195
|
+
}
|
196
|
+
}
|
197
|
+
},
|
198
|
+
"additionalProperties": false
|
199
|
+
},
|
200
|
+
"stat_modifiers": {
|
201
|
+
"type": "array",
|
202
|
+
"maxItems": 5,
|
203
|
+
"items": {
|
204
|
+
"type": "object",
|
205
|
+
"properties": {
|
206
|
+
"stat": {
|
207
|
+
"type": "string",
|
208
|
+
"enum": ["random", "atk", "def", "speed", "sp_atk", "sp_def", "accuracy", "evasion", "critital_hit"]
|
209
|
+
},
|
210
|
+
"change_by": {
|
211
|
+
"type": "integer",
|
212
|
+
"minimum": -12,
|
213
|
+
"maximum": 12
|
214
|
+
},
|
215
|
+
"affects_user": {
|
216
|
+
"type": "boolean"
|
217
|
+
}
|
218
|
+
},
|
219
|
+
"required": [
|
220
|
+
"stat",
|
221
|
+
"change_by"
|
222
|
+
],
|
223
|
+
"additionalProperties": false
|
224
|
+
}
|
225
|
+
},
|
226
|
+
"contests": {
|
227
|
+
"type": "array",
|
228
|
+
"maxItems": 3,
|
229
|
+
"items": {
|
230
|
+
"type": "object",
|
231
|
+
"properties": {
|
232
|
+
"contest": {
|
233
|
+
"type": "string",
|
234
|
+
"enum": ["Contests", "Super Contests", "Contest Spectaculars"]
|
235
|
+
},
|
236
|
+
"condition": {
|
237
|
+
"type": "string",
|
238
|
+
"enum": ["Tough", "Cute", "Clever", "Cool", "Beautiful"]
|
239
|
+
},
|
240
|
+
"appeal": {
|
241
|
+
"type": "integer",
|
242
|
+
"minimum": 0,
|
243
|
+
"maximum": 8
|
244
|
+
},
|
245
|
+
"jam": {
|
246
|
+
"type": "integer",
|
247
|
+
"minimum": 0,
|
248
|
+
"maximum": 5
|
249
|
+
}
|
250
|
+
},
|
251
|
+
"required": [
|
252
|
+
"contest",
|
253
|
+
"condition",
|
254
|
+
"appeal",
|
255
|
+
"jam"
|
256
|
+
],
|
257
|
+
"additionalProperties": false
|
258
|
+
}
|
259
|
+
}
|
260
|
+
},
|
261
|
+
"required": [
|
262
|
+
"index_number",
|
263
|
+
"pp",
|
264
|
+
"max_pp",
|
265
|
+
"power",
|
266
|
+
"accuracy",
|
267
|
+
"type",
|
268
|
+
"category",
|
269
|
+
"priority",
|
270
|
+
"target",
|
271
|
+
"critical_hit",
|
272
|
+
"makes_contact",
|
273
|
+
"affected_by_protect",
|
274
|
+
"affected_by_magic_coat",
|
275
|
+
"affected_by_snatch",
|
276
|
+
"affected_by_mirror_move",
|
277
|
+
"affected_by_kings_rock",
|
278
|
+
"names",
|
279
|
+
"pokedex_entries",
|
280
|
+
"contests"
|
281
|
+
],
|
282
|
+
"additionalProperties": false
|
283
|
+
}
|