Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Snow "bunnyboi" Pawson's game version 0.1
- // Copyright April 15 2008(tax day '08) under the GPL
- // TODO: Just about everything
- // DONE Use strings instead of char
- // Make the monster/user fighting sub routine
- // Make the upgrade armor/weapon sub routine
- // Make the lvl up sub routine
- // Clean up the code!!!
- #include <iostream>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <string>
- using namespace std;
- int main ()
- {
- // your stats
- int mp;
- int hp;
- int dmg;
- int dfc;
- int lvl;
- int mny;
- int exp;
- // monster stats
- int m_hp;
- int m_mp;
- int m_dmg;
- int m_dfc;
- int m_lvl;
- int m_exp;
- int m_mny;
- // menu option container
- string option;
- // intialize random number
- srand ( time(NULL) );
- // generate random numbers for character
- mp = rand() % 9 + 1;
- hp = rand() % 9 + 1;
- dmg = rand() % 9 + 1;
- dfc = rand() % 9 + 1;
- lvl = 1;
- mny = rand() % 999 + 1;
- exp = 0;
- // generate random numbers for monsters
- m_mp = rand() % 9 + 1;
- m_hp = rand() % 9 + 1;
- m_dmg = rand() % 9 + 1;
- m_dfc = rand() % 9 + 1;
- m_lvl = 1 + lvl;
- m_mny = rand() % 999 + 1 * m_exp / lvl;
- m_exp = rand() % 9 + lvl;
- cout << "Main menu \n";
- cout << "Choose one of the following options\n";
- cout << "Current stats\n";
- cout << "Fight a monster \n";
- cout << "Heal life and mana\n";
- cout << "Level up \n";
- cout << "upgrade Armor \n";
- cout << "upgrade Weapon\n";
- cout << "Quit\n";
- cin >> option;
- cout << option << "\n";
- if (option == "Fight")
- cout << "You choose to fight a monster\n";
- else if (option == "Current")
- {cout << "You chose to list your current stats\n";
- cout << "Your current hp is " << hp << " and your mp is " << mp << "\n";
- cout << " your exp is " << exp << " your level is " << lvl << "\n";
- cout << " your gold is " << mny << " your weapon's damage is " << dmg << " and your defence is " << dfc << "\n";}
- else if (option == "Level")
- cout << "You chose to lvl up\n";
- else if (option == "Armor")
- cout << "You chose to upgrade your \n";
- else if (option == "Weapon")
- cout << "You chose to upgrade your weapon\n";
- else if (option == "Heal")
- cout << "You choe to heal your life and mana\n";
- else if (option == "Quit")
- cout << "You chose to quit\n";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment