Advertisement
Guest User

Game freak wrote this.

a guest
Oct 22nd, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. signed int wild_pokemon_rand_grass()
  2. {
  3. unsigned int v0; // r1@1
  4. signed int result; // r0@2
  5.  
  6. v0 = (unsigned __int16)Random() % 0x64u & 0xFF;
  7. if ( v0 > 0x13 )
  8. {
  9. if ( ((v0 - 20) & 0xFF) > 0x13 )
  10. {
  11. if ( ((v0 - 40) & 0xFF) > 9 )
  12. {
  13. if ( ((v0 - 50) & 0xFF) > 9 )
  14. {
  15. if ( ((v0 - 60) & 0xFF) > 9 )
  16. {
  17. if ( ((v0 - 70) & 0xFF) > 9 )
  18. {
  19. if ( ((v0 - 80) & 0xFF) > 4 )
  20. {
  21. if ( ((v0 - 85) & 0xFF) > 4 )
  22. {
  23. if ( ((v0 - 90) & 0xFF) > 3 )
  24. {
  25. if ( ((v0 - 94) & 0xFF) > 3 )
  26. {
  27. if ( v0 == 98 )
  28. result = 10;
  29. else
  30. result = 11;
  31. }
  32. else
  33. {
  34. result = 9;
  35. }
  36. }
  37. else
  38. {
  39. result = 8;
  40. }
  41. }
  42. else
  43. {
  44. result = 7;
  45. }
  46. }
  47. else
  48. {
  49. result = 6;
  50. }
  51. }
  52. else
  53. {
  54. result = 5;
  55. }
  56. }
  57. else
  58. {
  59. result = 4;
  60. }
  61. }
  62. else
  63. {
  64. result = 3;
  65. }
  66. }
  67. else
  68. {
  69. result = 2;
  70. }
  71. }
  72. else
  73. {
  74. result = 1;
  75. }
  76. }
  77. else
  78. {
  79. result = 0;
  80. }
  81. return result;
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement