Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- Wurmple Evolution Calculator
- Wurmple uses a unique method of evolution which involves performing bitwise
- and modulo operations on the Pokémon's PID value. The widely-held theory on the
- calculation used by the game was
- (PID & 0xFFFF % 10 <= 4) ? Silcoon : Cascoon
- but this turned out to be incorrect thanks to Pokécheck administrator Bond697's
- work on the subject, who turned up the equation
- (PID >> 0x10 % 10 <= 4) ? Silcoon : Cascoon
- Several test cases with 5th generation Wurmples have lent credence to the new
- equation, which this program implements in a friendly command interface. As of
- 11 May 2012, this program remains untested for Wurmple evolution in any games
- prior to Black and White.
- */
- #include <iostream>
- #include <stdint.h>
- using namespace std;
- class EvolutionFlag {
- private:
- unsigned char EvolutionTest;
- string SilcoonOrCascoon;
- public:
- EvolutionFlag(uint32_t PID)
- {
- unsigned char EvolutionTest = (PID >> 0x10) % 0xA;
- if (EvolutionTest <= 4)
- SilcoonOrCascoon = "Silcoon";
- else
- SilcoonOrCascoon = "Cascoon";
- }
- string GetEvo() {
- return SilcoonOrCascoon;
- }
- };
- int main()
- {
- cout << "Wurmple Evolution Calculator \n";
- cout << "ver. 1.5 by M.andrew 2013 \n";
- cout << "Discovery of mechanism: Bond697 \n\n";
- unsigned int PIDFormat;
- while (1) {
- do {
- PIDFormat == 0;
- cout << "Which PID format?\n";
- cout << "\t0 for hex\n\t1 for decimal\n\tCtrl-C at any time quits the program\n\n";
- cout << "Eh? ";
- while (cin >> PIDFormat)
- {
- if (PIDFormat > 1)
- {
- cout << "\n***ERROR!***\nYou have entered a value besides 0 or 1.\n";
- continue;
- }
- }
- } while ((PIDFormat != 0) && (PIDFormat != 1));
- uint32_t WurmplePID;
- switch (PIDFormat)
- {
- case 0:
- cout << "Specify PID of Wurmple (hex): ";
- cin >> hex >> WurmplePID;
- break;
- case 1:
- cout << "Specify PID of Wurmple (dec): ";
- cin >> WurmplePID;
- break;
- }
- EvolutionFlag NewEvo(WurmplePID);
- cout << "\n\nFor a PID of 0x" << hex << WurmplePID <<
- ", your Wurmple will evolve into " + NewEvo.GetEvo() + "!\n\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment