Mandrew

Wurmple Evolution Program version 1.2

May 11th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.18 KB | None | 0 0
  1. /**
  2.  Wurmple Evolution Calculator
  3.  
  4.  Wurmple uses a unique method of evolution which involves performing bitwise
  5.  and modulo operations on the Pokémon's PID value. The widely-held theory on the
  6.  calculation used by the game was
  7.  
  8.     (PID & 0xFFFF % 10 <= 4) ? Silcoon : Cascoon
  9.  
  10.  but this turned out to be incorrect thanks to Pokécheck administrator Bond697's
  11.  work on the subject, who turned up the equation
  12.  
  13.     (PID >> 0x10 % 10 <= 4) ? Silcoon : Cascoon
  14.  
  15.  Several test cases with 5th generation Wurmples have lent credence to the new
  16.  equation, which this program implements in a friendly command interface. As of
  17.  11 May 2012, this program remains untested for Wurmple evolution in any games
  18.  prior to Black and White.
  19. */
  20.  
  21. #include <iostream>
  22. using namespace std;
  23.  
  24. class EvolutionFlag {
  25. private:
  26.     unsigned char EvolutionTest;
  27.     string SilcoonOrCascoon;
  28.  
  29. public:
  30.     EvolutionFlag(uint32_t PID)
  31.     {
  32.         unsigned char EvolutionTest = (PID >> 0x10) % 0xA;
  33.         if (EvolutionTest <= 4)
  34.             SilcoonOrCascoon = "Silcoon";
  35.         else
  36.             SilcoonOrCascoon = "Cascoon";
  37.     }
  38.  
  39.     string GetEvo() {
  40.         return SilcoonOrCascoon;
  41.     }
  42. };
  43.  
  44.  
  45. int main()
  46. {
  47.     cout << "Wurmple Evolution Calculator \n";
  48.     cout << "ver. 1.2 by M.andrew 2012 \n";
  49.     cout << "Discovery of mechanism: Bond697 \n\n";
  50.  
  51.     while (1) {
  52.         unsigned char PIDFormat;
  53.         do {
  54.             cout << "Which PID format?\n";
  55.             cout << "\t0 for hex\n\t1 for decimal\n\tCtrl-C at any time quits the program\n\n";
  56.             cout << "Eh? ";
  57.             cin >> PIDFormat;
  58.         } while (PIDFormat != 0 || PIDFormat != 1);
  59.  
  60.         uint32_t WurmplePID;
  61.         switch (PIDFormat)
  62.         {
  63.             case 0:
  64.                 cout << "Specify PID of Wurmple (hex, do NOT prefix with 0x): ";
  65.                 cin >> hex >> WurmplePID;
  66.                 break;
  67.             case 1:
  68.                 cout << "Specify PID of Wurmple (dec): ";
  69.                 cin >> WurmplePID;
  70.                 break;
  71.         }
  72.  
  73.         EvolutionFlag NewEvo(WurmplePID);
  74.         cout << "\n\nYour Wurmple will evolve into " + NewEvo.GetEvo() + "!\n\n";
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment