pokemon_app.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. #include "pokemon_app.h"
  2. struct pokemon_lut pokemon_table[] = {
  3. {"Bulbasaur", &I_bulbasaur, 0x99, 0x16, 0x03, 1, 45, 49, 49, 45, 65},
  4. {"Ivysaur", &I_ivysaur, 0x09, 0x16, 0x03, 1, 60, 62, 63, 60, 80},
  5. {"Venusaur", &I_venusaur, 0x9A, 0x16, 0x03, 1, 80, 82, 83, 80, 100},
  6. {"Charmander", &I_charmander, 0xB0, 0x14, 0xFF, 1, 39, 52, 43, 65, 50},
  7. {"Charmeleon", &I_charmeleon, 0xB2, 0x14, 0xFF, 1, 58, 64, 58, 80, 65},
  8. {"Charizard", &I_charizard, 0xB4, 0x14, 0x02, 1, 78, 84, 78, 100, 85},
  9. {"Squirtle", &I_squirtle, 0xB1, 0x15, 0xFF, 1, 44, 48, 65, 43, 50},
  10. {"Wartortle", &I_wartortle, 0xB3, 0x15, 0xFF, 1, 59, 63, 80, 58, 65},
  11. {"Blastoise", &I_blastoise, 0x1C, 0x15, 0xFF, 1, 79, 83, 100, 78, 85},
  12. {"Caterpie", &I_caterpie, 0x7B, 0x07, 0xFF, 2, 45, 30, 35, 45, 20},
  13. {"Metapod", &I_metapod, 0x7C, 0x07, 0xFF, 2, 50, 20, 55, 30, 25},
  14. {"Butterfree", &I_butterfree, 0x7D, 0x07, 0x02, 2, 60, 45, 50, 70, 80},
  15. {"Weedle", &I_weedle, 0x70, 0x07, 0x03, 2, 40, 35, 30, 50, 20},
  16. {"Kakuna", &I_kakuna, 0x71, 0x07, 0x03, 2, 45, 25, 50, 35, 25},
  17. {"Beedrill", &I_beedrill, 0x72, 0x07, 0x03, 2, 65, 80, 40, 75, 45},
  18. {"Pidgey", &I_pidgey, 0x24, 0x00, 0x02, 1, 40, 45, 40, 56, 35},
  19. {"Pidgeotto", &I_pidgeotto, 0x96, 0x00, 0x02, 1, 63, 60, 55, 71, 50},
  20. {"Pidgeot", &I_pidgeot, 0x97, 0x00, 0x02, 1, 83, 80, 75, 91, 70},
  21. {"Rattata", &I_rattata, 0xA5, 0x00, 0xFF, 2, 30, 56, 35, 72, 25},
  22. {"Raticate", &I_raticate, 0xA6, 0x00, 0xFF, 2, 55, 81, 60, 97, 50},
  23. {"Spearow", &I_spearow, 0x05, 0x00, 0x02, 2, 40, 60, 30, 70, 31},
  24. {"Fearow", &I_fearow, 0x23, 0x00, 0x02, 2, 65, 90, 65, 100, 61},
  25. {"Ekans", &I_ekans, 0x6C, 0x03, 0xFF, 2, 35, 60, 44, 55, 40},
  26. {"Arbok", &I_arbok, 0x2D, 0x03, 0xFF, 2, 60, 85, 69, 80, 65},
  27. {"Pikachu", &I_pikachu, 0x54, 0x17, 0xFF, 2, 35, 55, 30, 90, 50},
  28. {"Raichu", &I_raichu, 0x55, 0x17, 0xFF, 2, 60, 90, 55, 100, 90},
  29. {"Sandshrew", &I_sandshrew, 0x60, 0x04, 0xFF, 2, 50, 75, 85, 40, 30},
  30. {"Sandslash", &I_sandslash, 0x61, 0x04, 0xFF, 2, 75, 100, 110, 65, 55},
  31. {"Nidoran♀", &I_nidoranf, 0x0F, 0x03, 0xFF, 1, 55, 47, 52, 41, 40},
  32. {"Nidorina", &I_nidorina, 0xA8, 0x03, 0xFF, 1, 70, 62, 67, 56, 55},
  33. {"Nidoqueen", &I_nidoqueen, 0x10, 0x03, 0x04, 1, 90, 82, 87, 76, 75},
  34. {"Nidoran♂", &I_nidoranm, 0x03, 0x03, 0xFF, 1, 46, 57, 40, 50, 40},
  35. {"Nidorino", &I_nidorino, 0xA7, 0x03, 0xFF, 1, 61, 72, 57, 65, 55},
  36. {"Nidoking", &I_nidoking, 0x07, 0x03, 0x04, 1, 81, 92, 77, 85, 75},
  37. {"Clefairy", &I_clefairy, 0x04, 0x00, 0xFF, 3, 70, 45, 48, 35, 60},
  38. {"Clefable", &I_clefable, 0x8E, 0x00, 0xFF, 3, 95, 70, 73, 60, 85},
  39. {"Vulpix", &I_vulpix, 0x52, 0x14, 0xFF, 2, 38, 41, 40, 65, 65},
  40. {"Ninetales", &I_ninetales, 0x53, 0x14, 0xFF, 2, 73, 76, 75, 100, 100},
  41. {"Jigglypuff", &I_jigglypuff, 0x64, 0x00, 0xFF, 3, 115, 45, 20, 20, 25},
  42. {"Wigglytuff", &I_wigglytuff, 0x65, 0x00, 0xFF, 3, 140, 70, 45, 45, 50},
  43. {"Zubat", &I_zubat, 0x6B, 0x03, 0x02, 2, 40, 45, 35, 55, 40},
  44. {"Golbat", &I_golbat, 0x82, 0x03, 0x02, 2, 75, 80, 70, 90, 75},
  45. {"Oddish", &I_oddish, 0xB9, 0x16, 0x03, 1, 45, 50, 55, 30, 75},
  46. {"Gloom", &I_gloom, 0xBA, 0x16, 0x03, 1, 60, 65, 70, 40, 85},
  47. {"Vileplume", &I_vileplume, 0xBB, 0x16, 0x03, 1, 75, 80, 85, 50, 100},
  48. {"Paras", &I_paras, 0x6D, 0x07, 0x16, 2, 35, 70, 55, 25, 55},
  49. {"Parasect", &I_parasect, 0x2E, 0x07, 0x16, 2, 60, 95, 80, 30, 80},
  50. {"Venonat", &I_venonat, 0x41, 0x07, 0x03, 2, 60, 55, 50, 45, 40},
  51. {"Venomoth", &I_venomoth, 0x77, 0x07, 0x03, 2, 70, 65, 60, 90, 90},
  52. {"Diglett", &I_diglett, 0x3B, 0x04, 0xFF, 2, 10, 55, 25, 95, 45},
  53. {"Dugtrio", &I_dugtrio, 0x76, 0x04, 0xFF, 2, 35, 80, 50, 120, 70},
  54. {"Meowth", &I_meowth, 0x4D, 0x00, 0xFF, 2, 40, 45, 35, 90, 40},
  55. {"Persian", &I_persian, 0x90, 0x00, 0xFF, 2, 65, 70, 60, 115, 65},
  56. {"Psyduck", &I_psyduck, 0x2F, 0x15, 0xFF, 2, 50, 52, 48, 55, 50},
  57. {"Golduck", &I_golduck, 0x80, 0x15, 0xFF, 2, 80, 82, 78, 85, 80},
  58. {"Mankey", &I_mankey, 0x39, 0x01, 0xFF, 2, 40, 80, 35, 70, 35},
  59. {"Primeape", &I_primeape, 0x75, 0x01, 0xFF, 2, 65, 105, 60, 95, 60},
  60. {"Growlithe", &I_growlithe, 0x21, 0x14, 0xFF, 0, 55, 70, 45, 60, 50},
  61. {"Arcanine", &I_arcanine, 0x14, 0x14, 0xFF, 0, 90, 110, 80, 95, 80},
  62. {"Poliwag", &I_poliwag, 0x47, 0x15, 0xFF, 1, 40, 50, 40, 90, 40},
  63. {"Poliwhirl", &I_poliwhirl, 0x6E, 0x15, 0xFF, 1, 65, 65, 65, 90, 50},
  64. {"Poliwrath", &I_poliwrath, 0x6F, 0x15, 0x01, 1, 90, 85, 95, 70, 70},
  65. {"Abra", &I_abra, 0x94, 0x18, 0xFF, 1, 25, 20, 15, 90, 105},
  66. {"Kadabra", &I_kadabra, 0x26, 0x18, 0xFF, 1, 40, 35, 30, 105, 120},
  67. {"Alakazam", &I_alakazam, 0x95, 0x18, 0xFF, 1, 55, 50, 45, 120, 135},
  68. {"Machop", &I_machop, 0x6A, 0x01, 0xFF, 1, 70, 80, 50, 35, 35},
  69. {"Machoke", &I_machoke, 0x29, 0x01, 0xFF, 1, 80, 100, 70, 45, 50},
  70. {"Machamp", &I_machamp, 0x7E, 0x01, 0xFF, 1, 90, 130, 80, 55, 65},
  71. {"Bellsprout", &I_bellsprout, 0xBC, 0x16, 0x03, 1, 50, 75, 35, 40, 70},
  72. {"Weepinbell", &I_weepinbell, 0xBD, 0x16, 0x03, 1, 65, 90, 50, 55, 85},
  73. {"Victreebel", &I_victreebel, 0xBE, 0x16, 0x03, 1, 80, 105, 65, 70, 100},
  74. {"Tentacool", &I_tentacool, 0x18, 0x15, 0x03, 0, 40, 40, 35, 70, 100},
  75. {"Tentacruel", &I_tentacruel, 0x9B, 0x15, 0x03, 0, 80, 70, 65, 100, 120},
  76. {"Geodude", &I_geodude, 0xA9, 0x05, 0x04, 1, 40, 80, 100, 20, 30},
  77. {"Graveler", &I_graveler, 0x27, 0x05, 0x04, 1, 55, 95, 115, 35, 45},
  78. {"Golem", &I_golem, 0x31, 0x05, 0x04, 1, 80, 110, 130, 45, 55},
  79. {"Ponyta", &I_ponyta, 0xA3, 0x14, 0xFF, 2, 50, 85, 55, 90, 65},
  80. {"Rapidash", &I_rapidash, 0xA4, 0x14, 0xFF, 2, 65, 100, 70, 105, 80},
  81. {"Slowpoke", &I_slowpoke, 0x25, 0x15, 0x18, 2, 90, 65, 65, 15, 40},
  82. {"Slowbro", &I_slowbro, 0x08, 0x15, 0x18, 2, 95, 75, 110, 30, 80},
  83. {"Magnemite", &I_magnemite, 0xAD, 0x17, 0xFF, 2, 25, 35, 70, 45, 95},
  84. {"Magneton", &I_magneton, 0x36, 0x17, 0xFF, 2, 50, 60, 95, 70, 120},
  85. {"Farfetch'd", &I_farfetchd, 0x40, 0x00, 0x02, 2, 52, 65, 55, 60, 58},
  86. {"Doduo", &I_doduo, 0x46, 0x00, 0x02, 2, 35, 85, 45, 75, 35},
  87. {"Dodrio", &I_dodrio, 0x74, 0x00, 0x02, 2, 60, 110, 70, 100, 60},
  88. {"Seel", &I_seel, 0x3A, 0x15, 0xFF, 2, 65, 45, 55, 45, 70},
  89. {"Dewgong", &I_dewgong, 0x78, 0x15, 0x19, 2, 90, 70, 80, 70, 95},
  90. {"Grimer", &I_grimer, 0x0D, 0x03, 0xFF, 2, 80, 80, 50, 25, 40},
  91. {"Muk", &I_muk, 0x88, 0x03, 0xFF, 2, 105, 105, 75, 50, 65},
  92. {"Shellder", &I_shellder, 0x17, 0x15, 0xFF, 0, 30, 65, 100, 40, 45},
  93. {"Cloyster", &I_cloyster, 0x8B, 0x15, 0x19, 0, 50, 95, 180, 70, 85},
  94. {"Gastly", &I_gastly, 0x19, 0x08, 0x03, 1, 30, 35, 30, 80, 100},
  95. {"Haunter", &I_haunter, 0x93, 0x08, 0x03, 1, 45, 50, 45, 95, 115},
  96. {"Gengar", &I_gengar, 0x0E, 0x08, 0x03, 1, 60, 65, 60, 110, 130},
  97. {"Onix", &I_onix, 0x22, 0x05, 0x04, 2, 35, 45, 160, 70, 30},
  98. {"Drowzee", &I_drowzee, 0x30, 0x18, 0xFF, 2, 60, 48, 45, 42, 90},
  99. {"Hypno", &I_hypno, 0x81, 0x18, 0xFF, 2, 85, 73, 70, 67, 115},
  100. {"Krabby", &I_krabby, 0x4E, 0x15, 0xFF, 2, 30, 105, 90, 50, 25},
  101. {"Kingler", &I_kingler, 0x8A, 0x15, 0xFF, 2, 55, 130, 115, 75, 50},
  102. {"Voltorb", &I_voltorb, 0x06, 0x17, 0xFF, 2, 40, 30, 50, 100, 55},
  103. {"Electrode", &I_electrode, 0x8D, 0x17, 0xFF, 2, 60, 50, 70, 140, 80},
  104. {"Exeggcute", &I_exeggcute, 0x0C, 0x16, 0x18, 0, 60, 40, 80, 40, 60},
  105. {"Exeggutor", &I_exeggutor, 0x0A, 0x16, 0x18, 0, 95, 95, 85, 55, 125},
  106. {"Cubone", &I_cubone, 0x11, 0x04, 0xFF, 2, 50, 50, 95, 35, 40},
  107. {"Marowak", &I_marowak, 0x91, 0x04, 0xFF, 2, 60, 80, 110, 45, 50},
  108. {"Hitmonlee", &I_hitmonlee, 0x2B, 0x01, 0xFF, 2, 50, 120, 53, 87, 35},
  109. {"Hitmonchan", &I_hitmonchan, 0x2C, 0x01, 0xFF, 2, 50, 105, 79, 76, 35},
  110. {"Lickitung", &I_lickitung, 0x0B, 0x00, 0xFF, 2, 90, 55, 75, 30, 60},
  111. {"Koffing", &I_koffing, 0x37, 0x03, 0xFF, 2, 40, 65, 95, 35, 60},
  112. {"Weezing", &I_weezing, 0x8F, 0x03, 0xFF, 2, 65, 90, 120, 60, 85},
  113. {"Rhyhorn", &I_rhyhorn, 0x12, 0x04, 0x05, 0, 80, 85, 95, 25, 30},
  114. {"Rhydon", &I_rhydon, 0x01, 0x04, 0x05, 0, 105, 130, 120, 40, 45},
  115. {"Chansey", &I_chansey, 0x28, 0x00, 0xFF, 3, 250, 5, 5, 50, 105},
  116. {"Tangela", &I_tangela, 0x1E, 0x16, 0xFF, 2, 65, 55, 115, 60, 100},
  117. {"Kangaskhan", &I_kangaskhan, 0x02, 0x00, 0xFF, 2, 105, 95, 80, 90, 40},
  118. {"Horsea", &I_horsea, 0x5C, 0x15, 0xFF, 2, 30, 40, 70, 60, 70},
  119. {"Seadra", &I_seadra, 0x5D, 0x15, 0xFF, 2, 55, 65, 95, 85, 95},
  120. {"Goldeen", &I_goldeen, 0x9D, 0x15, 0xFF, 2, 45, 67, 60, 63, 50},
  121. {"Seaking", &I_seaking, 0x9E, 0x15, 0xFF, 2, 80, 92, 65, 68, 80},
  122. {"Staryu", &I_staryu, 0x1B, 0x15, 0xFF, 0, 30, 45, 55, 85, 70},
  123. {"Starmie", &I_starmie, 0x98, 0x15, 0x18, 0, 60, 75, 85, 115, 100},
  124. {"Mr. Mime", &I_mr_mime, 0x2A, 0x18, 0xFF, 2, 40, 45, 65, 90, 100},
  125. {"Scyther", &I_scyther, 0x1A, 0x07, 0x02, 2, 70, 110, 80, 105, 55},
  126. {"Jynx", &I_jynx, 0x48, 0x19, 0x18, 2, 65, 50, 35, 95, 95},
  127. {"Electabuzz", &I_electabuzz, 0x35, 0x17, 0xFF, 2, 65, 83, 57, 105, 85},
  128. {"Magmar", &I_magmar, 0x33, 0x14, 0xFF, 2, 65, 95, 57, 93, 85},
  129. {"Pinsir", &I_pinsir, 0x1D, 0x07, 0xFF, 0, 65, 125, 100, 85, 55},
  130. {"Tauros", &I_tauros, 0x3C, 0x00, 0xFF, 0, 75, 100, 95, 110, 70},
  131. {"Magikarp", &I_magikarp, 0x85, 0x15, 0xFF, 0, 20, 10, 55, 80, 20},
  132. {"Gyarados", &I_gyarados, 0x16, 0x15, 0x02, 0, 95, 125, 79, 81, 100},
  133. {"Lapras", &I_lapras, 0x13, 0x15, 0x19, 0, 130, 85, 80, 60, 95},
  134. {"Ditto", &I_ditto, 0x4C, 0x00, 0xFF, 2, 48, 48, 48, 48, 48},
  135. {"Eevee", &I_eevee, 0x66, 0x00, 0xFF, 2, 55, 55, 50, 55, 65},
  136. {"Vaporeon", &I_vaporeon, 0x69, 0x15, 0xFF, 2, 130, 65, 60, 65, 110},
  137. {"Jolteon", &I_jolteon, 0x68, 0x17, 0xFF, 2, 65, 65, 60, 130, 110},
  138. {"Flareon", &I_flareon, 0x67, 0x14, 0xFF, 2, 65, 130, 60, 65, 110},
  139. {"Porygon", &I_porygon, 0xAA, 0x00, 0xFF, 2, 65, 60, 70, 40, 75},
  140. {"Omanyte", &I_omanyte, 0x62, 0x05, 0x15, 2, 35, 40, 100, 35, 90},
  141. {"Omastar", &I_omastar, 0x63, 0x05, 0x15, 2, 70, 60, 125, 55, 115},
  142. {"Kabuto", &I_kabuto, 0x5A, 0x05, 0x15, 2, 30, 80, 90, 55, 45},
  143. {"Kabutops", &I_kabutops, 0x5B, 0x05, 0x15, 2, 60, 115, 105, 80, 70},
  144. {"Aerodactyl", &I_aerodactyl, 0xAB, 0x05, 0x02, 0, 80, 105, 65, 130, 60},
  145. {"Snorlax", &I_snorlax, 0x84, 0x00, 0xFF, 0, 160, 110, 65, 30, 65},
  146. {"Articuno", &I_articuno, 0x4A, 0x19, 0x02, 0, 90, 85, 100, 85, 125},
  147. {"Zapdos", &I_zapdos, 0x4B, 0x17, 0x02, 0, 90, 90, 85, 100, 125},
  148. {"Moltres", &I_moltres, 0x49, 0x14, 0x02, 0, 90, 100, 90, 90, 125},
  149. {"Dratini", &I_dratini, 0x58, 0x1A, 0xFF, 0, 41, 64, 45, 50, 50},
  150. {"Dragonair", &I_dragonair, 0x59, 0x1A, 0xFF, 0, 61, 84, 65, 70, 70},
  151. {"Dragonite", &I_dragonite, 0x42, 0x1A, 0x02, 0, 91, 134, 95, 80, 100},
  152. {"Mewtwo", &I_mewtwo, 0x83, 0x18, 0xFF, 0, 106, 110, 90, 130, 154},
  153. {"Mew", &I_mew, 0x15, 0x18, 0xFF, 1, 100, 100, 100, 100, 100},
  154. {},
  155. };
  156. struct pokemon_mv move_table[] = {
  157. {"No Move", 0x00},
  158. {"Absorb", 0x47},
  159. {"Acid Armor", 0x97},
  160. {"Acid", 0x33},
  161. {"Agility", 0x61},
  162. {"Amnesia", 0x85},
  163. {"Aurora Beam", 0x3E},
  164. {"Barrage", 0x8C},
  165. {"Barrier", 0x70},
  166. {"Bide", 0x75},
  167. {"Bind", 0x14},
  168. {"Bite", 0x2C},
  169. {"Blizzard", 0x3B},
  170. {"Body Slam", 0x22},
  171. {"Bone Club", 0x7D},
  172. {"Boomerang", 0x9B},
  173. {"Bubblebeam", 0x3D},
  174. {"Bubble", 0x91},
  175. {"Clamp", 0x80},
  176. {"Comet Punch", 0x04},
  177. {"Confuse Ray", 0x6D},
  178. {"Confusion", 0x5D},
  179. {"Constrict", 0x84},
  180. {"Conversion", 0xA0},
  181. {"Counter", 0x44},
  182. {"Crabhammer", 0x98},
  183. {"Cut", 0x0F},
  184. {"Defense Curl", 0x6F},
  185. {"Dig", 0x5B},
  186. {"Disable", 0x32},
  187. {"Dizzy Punch", 0x92},
  188. {"Doubleslap", 0x03},
  189. {"Double Kick", 0x18},
  190. {"Double Team", 0x68},
  191. {"Double-Edge", 0x26},
  192. {"Dragon Rage", 0x52},
  193. {"Dream Eater", 0x8A},
  194. {"Drill Peck", 0x41},
  195. {"Earthquake", 0x59},
  196. {"Egg Bomb", 0x79},
  197. {"Ember", 0x34},
  198. {"Explosion", 0x99},
  199. {"Fire Blast", 0x7E},
  200. {"Fire Punch", 0x07},
  201. {"Fire Spin", 0x53},
  202. {"Fissure", 0x5A},
  203. {"Flamethrower", 0x35},
  204. {"Flash", 0x94},
  205. {"Fly", 0x13},
  206. {"Focus Energy", 0x74},
  207. {"Fury Attack", 0x1F},
  208. {"Fury Swipes", 0x9A},
  209. {"Glare", 0x89},
  210. {"Growl", 0x2D},
  211. {"Growth", 0x4A},
  212. {"Guillotine", 0x0C},
  213. {"Gust", 0x10},
  214. {"Harden", 0x6A},
  215. {"Haze", 0x72},
  216. {"Headbutt", 0x1D},
  217. {"Hi Jump Kick", 0x88},
  218. {"Horn Attack", 0x1E},
  219. {"Horn Drill", 0x20},
  220. {"Hydro Pump", 0x38},
  221. {"Hyper Beam", 0x3F},
  222. {"Hyper Fang", 0x9E},
  223. {"Hypnosis", 0x5F},
  224. {"Ice Beam", 0x3A},
  225. {"Ice Punch", 0x08},
  226. {"Jump Kick", 0x1A},
  227. {"Karate Chop", 0x02},
  228. {"Kinesis", 0x86},
  229. {"Leech Life", 0x8D},
  230. {"Leech Seed", 0x49},
  231. {"Leer", 0x2B},
  232. {"Lick", 0x7A},
  233. {"Light Screen", 0x71},
  234. {"Lovely Kiss", 0x8E},
  235. {"Low Kick", 0x43},
  236. {"Meditate", 0x60},
  237. {"Mega Drain", 0x48},
  238. {"Mega Kick", 0x19},
  239. {"Mega Punch", 0x05},
  240. {"Metronome", 0x76},
  241. {"Mimic", 0x66},
  242. {"Minimize", 0x6B},
  243. {"Mirror Move", 0x77},
  244. {"Mist", 0x36},
  245. {"Night Shade", 0x65},
  246. {"Pay Day", 0x06},
  247. {"Peck", 0x40},
  248. {"Petal Dance", 0x50},
  249. {"Pin Missile", 0x2A},
  250. {"Poisonpowder", 0x4D},
  251. {"Poison Gas", 0x8B},
  252. {"Poison Sting", 0x28},
  253. {"Pound", 0x01},
  254. {"Psybeam", 0x3C},
  255. {"Psychic", 0x5E},
  256. {"Psywave", 0x95},
  257. {"Quick Attack", 0x62},
  258. {"Rage", 0x63},
  259. {"Razor Leaf", 0x4B},
  260. {"Razor Wind", 0x0D},
  261. {"Recover", 0x69},
  262. {"Reflect", 0x73},
  263. {"Rest", 0x9C},
  264. {"Roar", 0x2E},
  265. {"Rock Slide", 0x9D},
  266. {"Rock Throw", 0x58},
  267. {"Rolling Kick", 0x1B},
  268. {"Sand Attack", 0x1C},
  269. {"Scratch", 0x0A},
  270. {"Screech", 0x67},
  271. {"Seismic Toss", 0x45},
  272. {"Selfdestruct", 0x78},
  273. {"Sharpen", 0x9F},
  274. {"Sing", 0x2F},
  275. {"Skull Bash", 0x82},
  276. {"Sky Attack", 0x8F},
  277. {"Slam", 0x15},
  278. {"Slash", 0xA3},
  279. {"Sleep Powder", 0x4F},
  280. {"Sludge", 0x7C},
  281. {"Smog", 0x7B},
  282. {"Smokescreen", 0x6C},
  283. {"Softboiled", 0x87},
  284. {"Solar Beam", 0x4C},
  285. {"Sonicboom", 0x31},
  286. {"Spike Cannon", 0x83},
  287. {"Splash", 0x96},
  288. {"Spore", 0x93},
  289. {"Stomp", 0x17},
  290. {"Strength", 0x46},
  291. {"String Shot", 0x51},
  292. {"Struggle", 0xA5},
  293. {"Stun Spore", 0x4E},
  294. {"Submission", 0x42},
  295. {"Substitute", 0xA4},
  296. {"Supersonic", 0x30},
  297. {"Super Fang", 0xA2},
  298. {"Surf", 0x39},
  299. {"Swift", 0x81},
  300. {"Swords Dance", 0x0E},
  301. {"Tackle", 0x21},
  302. {"Tail Whip", 0x27},
  303. {"Take Down", 0x24},
  304. {"Teleport", 0x64},
  305. {"Thrash", 0x25},
  306. {"Thunderbolt", 0x55},
  307. {"Thunderpunch", 0x09},
  308. {"Thundershock", 0x54},
  309. {"Thunder Wave", 0x56},
  310. {"Thunder", 0x57},
  311. {"Toxic", 0x5C},
  312. {"Transform", 0x90},
  313. {"Tri Attack", 0xA1},
  314. {"Twineedle", 0x29},
  315. {"Vicegrip", 0x0B},
  316. {"Vine Whip", 0x16},
  317. {"Waterfall", 0x7F},
  318. {"Water Gun", 0x37},
  319. {"Whirlwind", 0x12},
  320. {"Wing Attack", 0x11},
  321. {"Withdraw", 0x6E},
  322. {"Wrap", 0x23},
  323. };
  324. uint32_t pokemon_exit_confirm_view(void* context) {
  325. UNUSED(context);
  326. return AppViewExitConfirm;
  327. }
  328. App* pokemon_alloc() {
  329. App* app = (App*)malloc(sizeof(App));
  330. // Gui
  331. app->gui = (Gui*)furi_record_open(RECORD_GUI);
  332. // View dispatcher
  333. app->view_dispatcher = view_dispatcher_alloc();
  334. view_dispatcher_enable_queue(app->view_dispatcher);
  335. view_dispatcher_set_event_callback_context(app->view_dispatcher, app);
  336. view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
  337. // Start Index first pokemon
  338. app->current_pokemon = 0;
  339. // Select Pokemon View
  340. app->select_pokemon = select_pokemon_alloc(app);
  341. view_set_previous_callback(select_pokemon_get_view(app), pokemon_exit_confirm_view);
  342. view_dispatcher_add_view(
  343. app->view_dispatcher, AppViewSelectPokemon, select_pokemon_get_view(app));
  344. // Start Index first level
  345. app->current_level = 3;
  346. // Select Level View
  347. app->select_level = select_level_alloc(app);
  348. view_set_previous_callback(select_level_get_view(app), pokemon_exit_confirm_view);
  349. view_dispatcher_add_view(
  350. app->view_dispatcher, AppViewSelectLevel, select_level_get_view(app));
  351. // Start Index first stat
  352. app->current_stats = 0;
  353. // Select Level View
  354. app->select_stats = select_stats_alloc(app);
  355. view_set_previous_callback(select_stats_get_view(app), pokemon_exit_confirm_view);
  356. view_dispatcher_add_view(
  357. app->view_dispatcher, AppViewSelectStats, select_stats_get_view(app));
  358. // Start Index first move
  359. app->current_move = 0;
  360. // Select Move View
  361. app->select_move1 = select_move1_alloc(app);
  362. view_set_previous_callback(select_move1_get_view(app), pokemon_exit_confirm_view);
  363. view_dispatcher_add_view(
  364. app->view_dispatcher, AppViewSelectMove1, select_move1_get_view(app));
  365. // Start Index first move
  366. app->current_move = 0;
  367. // Select Move View
  368. app->select_move2 = select_move2_alloc(app);
  369. view_set_previous_callback(select_move1_get_view(app), pokemon_exit_confirm_view);
  370. view_dispatcher_add_view(
  371. app->view_dispatcher, AppViewSelectMove2, select_move2_get_view(app));
  372. // Start Index first move
  373. app->current_move = 0;
  374. // Select Move View
  375. app->select_move3 = select_move3_alloc(app);
  376. view_set_previous_callback(select_move3_get_view(app), pokemon_exit_confirm_view);
  377. view_dispatcher_add_view(
  378. app->view_dispatcher, AppViewSelectMove3, select_move3_get_view(app));
  379. // Start Index first move
  380. app->current_move = 0;
  381. // Select Move View
  382. app->select_move4 = select_move4_alloc(app);
  383. view_set_previous_callback(select_move4_get_view(app), pokemon_exit_confirm_view);
  384. view_dispatcher_add_view(
  385. app->view_dispatcher, AppViewSelectMove4, select_move4_get_view(app));
  386. // Trade View
  387. app->trade = trade_alloc(app);
  388. view_set_previous_callback(trade_get_view(app), pokemon_exit_confirm_view);
  389. view_dispatcher_add_view(app->view_dispatcher, AppViewTrade, trade_get_view(app));
  390. view_dispatcher_switch_to_view(app->view_dispatcher, AppViewSelectPokemon);
  391. return app;
  392. }
  393. void free_app(App* app) {
  394. furi_assert(app);
  395. // Free views
  396. view_dispatcher_remove_view(app->view_dispatcher, AppViewSelectPokemon);
  397. select_pokemon_free(app);
  398. view_dispatcher_remove_view(app->view_dispatcher, AppViewSelectLevel);
  399. select_level_free(app);
  400. view_dispatcher_remove_view(app->view_dispatcher, AppViewSelectStats);
  401. select_stats_free(app);
  402. view_dispatcher_remove_view(app->view_dispatcher, AppViewSelectMove1);
  403. select_move1_free(app);
  404. view_dispatcher_remove_view(app->view_dispatcher, AppViewSelectMove2);
  405. select_move2_free(app);
  406. view_dispatcher_remove_view(app->view_dispatcher, AppViewSelectMove3);
  407. select_move3_free(app);
  408. view_dispatcher_remove_view(app->view_dispatcher, AppViewSelectMove4);
  409. select_move4_free(app);
  410. view_dispatcher_remove_view(app->view_dispatcher, AppViewTrade);
  411. trade_free(app);
  412. // Close records
  413. furi_record_close(RECORD_GUI);
  414. app->gui = NULL;
  415. // Free rest
  416. free(app);
  417. }
  418. extern "C" int32_t pokemon_app(void* p) {
  419. UNUSED(p);
  420. //FURI_LOG_D(TAG, "init scene");
  421. App* app = (App*)pokemon_alloc();
  422. furi_hal_light_set(LightRed, 0x00);
  423. furi_hal_light_set(LightGreen, 0x00);
  424. furi_hal_light_set(LightBlue, 0x00);
  425. //switch view and run dispatcher
  426. view_dispatcher_run(app->view_dispatcher);
  427. // Free resources
  428. free_app(app);
  429. furi_record_close(RECORD_GUI);
  430. return 0;
  431. }