about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--source/main.c67
1 files changed, 66 insertions, 1 deletions
diff --git a/source/main.c b/source/main.c index eb5072e..64e6cba 100644 --- a/source/main.c +++ b/source/main.c
@@ -376,6 +376,36 @@ void* extractor(void* userdata)
376 "spDefense", 376 "spDefense",
377 __builtin_bswap32(pki->spDefense)); 377 __builtin_bswap32(pki->spDefense));
378 378
379 cJSON_AddNumberToObject(
380 jPoke,
381 "coolness",
382 __builtin_bswap32(pki->cool));
383
384 cJSON_AddNumberToObject(
385 jPoke,
386 "beauty",
387 __builtin_bswap32(pki->beauty));
388
389 cJSON_AddNumberToObject(
390 jPoke,
391 "cuteness",
392 __builtin_bswap32(pki->cute));
393
394 cJSON_AddNumberToObject(
395 jPoke,
396 "smartness",
397 __builtin_bswap32(pki->smart));
398
399 cJSON_AddNumberToObject(
400 jPoke,
401 "toughness",
402 __builtin_bswap32(pki->tough));
403
404 cJSON_AddNumberToObject(
405 jPoke,
406 "sheen",
407 __builtin_bswap32(pki->sheen));
408
379 cJSON_AddItemToObject( 409 cJSON_AddItemToObject(
380 jPoke, 410 jPoke,
381 "key", 411 "key",
@@ -437,10 +467,45 @@ void* extractor(void* userdata)
437 "metLocation", 467 "metLocation",
438 pki->metLocation); 468 pki->metLocation);
439 469
470 cJSON_AddBoolToObject(
471 jPoke,
472 "shiny",
473 pki->shiny);
474
475 cJSON_AddNumberToObject(
476 jPoke,
477 "nature",
478 pki->nature);
479
480 if (pki->gender == 0)
481 {
482 cJSON_AddStringToObject(jPoke, "gender", "male");
483 } else if (pki->gender == 1)
484 {
485 cJSON_AddStringToObject(jPoke, "gender", "female");
486 } else if (pki->gender == 2)
487 {
488 cJSON_AddStringToObject(jPoke, "gender", "genderless");
489 }
490
491 cJSON_AddBoolToObject(
492 jPoke,
493 "secondAbility",
494 pki->altAbility);
495
496 // Handle Unown form.
497 if (pki->species == 201)
498 {
499 cJSON_AddNumberToObject(
500 jPoke,
501 "unownLetter",
502 pki->unownLetter);
503 }
504
440 cJSON_AddItemToArray(jParty, jPoke); 505 cJSON_AddItemToArray(jParty, jPoke);
441 } 506 }
442 507
443 cJSON_AddItemToObject(root, "party", jParty); 508 cJSON_AddItemToObject(root, "pokemon", jParty);
444 509
445 char *rendered = cJSON_Print(root); 510 char *rendered = cJSON_Print(root);
446 printf("%s\n", rendered); 511 printf("%s\n", rendered);