1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
string a,b,c,class,save;
int savedata, orc, wizard, mage, goblin, knight;
int main () {
cout << "Load a save (Y/N)?";
getline(cin, save);
if (save == Y) {
ret = savedata; }
else
cout << "To start let's get some information about you.";
cout << " Are you an Orc, Wizard, Goblin, Mage, or knight? (Orcs have no starting weapon and are the strongest, Knights have swords and are the 2nd strongest character" << endl;
cout << "Wizards have a medium magic level and average combat skills. They start with a staff. Goblins are quick but they have a knife and low health with low magic." << endl << "And Mages have a staff and high magic but medium-low health.";
getline(cin, class);
if (class == Orc) {
cout << "Welcome to the world Orc. You have 200 health and no magic.";
ret == orc; }
if (class == Wizard) {
cout << "Welcome to the world Wizard. You have 100 health and 50 magic.";
ret == wizard; }
if (class == Mage) {
cout << "Welcome to the world Mage. You have 50 health and 100 magic.";
ret == mage; }
if (class == Goblin) {
cout << "Welcome to the world Goblin. You have 70 health and 40 magic.";
ret == goblin; }
if (class == Knight) {
cout << "Welcome to the world Knight. You have 150 health and no magic. You also have a sword";
ret == knight; }
int savedata () {
open (class.txt app:end);
if (class.txt == orc) {
cout << "You are an Orc."; }
}
|