This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Pokémon Gen. V Base Stats Structure

By: a guest on May 2nd, 2011  |  syntax: C++  |  size: 3.04 KB  |  views: 163  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. typedef unsigned char char_t;
  2. typedef unsigned short short_t;
  3.  
  4.  
  5. enum Type { NORMAL = 0x00, FIGHTING = 0x01, FLYING = 0x02, POISON = 0x03,
  6.   GROUND = 0x04, ROCK = 0x05, BUG = 0x06, GHOST = 0x07, STEEL = 0x08, FIRE = 0x09,
  7.   WATER = 0x0A, GRASS = 0x0B, ELECTRIC = 0x0C, PSYCHIC = 0x0D, ICE = 0x0E, DRAGON = 0x0F,
  8.   DARK = 0x10 };
  9.  
  10. #pragma pack(1)
  11. struct BaseStats
  12. {
  13.   char_t base_hp; //#0
  14.   char_t base_atk;
  15.   char_t base_def;
  16.   char_t base_spd;
  17.   char_t base_spatk;
  18.   char_t base_spdef;
  19.  
  20.   char_t type1;
  21.   char_t type2;
  22.  
  23.   char_t catch_rate; //#8
  24.  
  25.   //#9 = stage of evolution (Legendaries get 3, Pokémon not part of an evolution line get 2)
  26.   //1 = not evolved, 2 = evolved once (or doesn't evolve), 3 = evolved twice (or legendary)
  27.   char_t evolution_stage;
  28.  
  29.   //#10 - 11 = EV yield
  30.   union
  31.   {
  32.     struct
  33.     {
  34.       //byte 1
  35.       size_t ev_hp : 2;
  36.       size_t ev_atk : 2;
  37.       size_t ev_def : 2;
  38.       size_t ev_spd : 2;
  39.       //byte 2
  40.       size_t ev_spatk : 2;
  41.       size_t ev_spdef : 2;
  42.       size_t ev_padding : 4;
  43.       //item1
  44.       size_t ev_extra : 16;
  45.     };
  46.     struct
  47.     {
  48.       short ev_data;
  49.       short_t item1;
  50.     };
  51.   };
  52.  
  53.   //#12 - 13 = held item 1 (little endian)
  54.   //#14 - 15 = held item 2
  55.   short_t item2;
  56.  
  57.   //#16 - 17 = Dream World item (Pokémon will be holding this item when brought from the Dream world)
  58.   short_t item_special;
  59.  
  60.   enum GENDER { GENDERLESS = 0xFF }; //The rest are a female percentage out of 254
  61.   //#18 = gender ratio
  62.   char_t gender;
  63.   //#19 = base egg cycles
  64.   char_t egg_cycles;
  65.   //#20 = base happiness
  66.   char_t base_happy;
  67.  
  68.  
  69.   enum GROWTH { ERRATIC = 1, FAST = 4, MED_FAST = 0, MED_SLOW = 3, SLOW = 5, FLUCTUATING = 2 };
  70.   //Lv. 100 Exp.: Erratic = 600,000; Fast = 800,000; Med. Fast = 1,000,000;
  71.   //              Med. Slow = 1,059,860; Slow = 1,250,000; Fluctuating = 1,640,000
  72.   //#21 = experience growth
  73.   char_t growth;
  74.  
  75.   enum EGG_GROUP { MONSTER = 0x01, WATER_1 = 0x02, BUG = 0x03, FLYING = 0x04, GROUND = 0x05, FAIRY = 0x06, PLANT = 0x07,
  76.     HUMAN_SHAPE = 0x08, WATER_3 = 0x09, MINERAL = 0x0A, INDETERMINATE = 0x0B, WATER_2 = 0x0C, DITTO = 0x0D, DRAGON = 0x0E };
  77.   //The rest cannot breed
  78.  
  79.   //#22 = egg group 1
  80.   //#23 = egg group 2
  81.   char_t egg_group1;
  82.   char_t egg_group2;
  83.  
  84.   //#24 = ability 1
  85.   //#25 = ability 2
  86.   //#26 = special ability (Dream World ability)
  87.   char_t ability1;
  88.   char_t ability2;
  89.   char_t ability_special;
  90.  
  91.   //#27 = 0, 60, 90, 120 or 150 (not sure why)
  92.   char_t _3;
  93.  
  94.   //#28 - 29 = index of alternate form list (starting from 1 = Bulbasaur)
  95.   //This is strictly for Pokémon where base stat data changes in other forms
  96.   short_t form_index;
  97.  
  98.   //#30 - 31 = Something related to alternate forms (0 for Pokémon without alternate forms)
  99.   short_t form_thing;
  100.  
  101.   //32 = the number of forms this Pokémon has (1 for Pokémon without alternate forms)
  102.   char_t form_num;
  103.  
  104.   //33 = bitfields of some sort
  105.   char_t _8;
  106.  
  107.   //#34 = base exp
  108.   char_t base_exp;
  109.  
  110.   //#35 - 59 = ?
  111.   char_t _5[25];
  112. };
  113. #pragma pack()
clone this paste RAW Paste Data