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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
|
// tut22.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <cstdlib>
#include <string>
#include <ctime>
#include <cmath>
using namespace std;
class character
{
public:
character(int Starthp, int Startdamege, int StartAgilety, int StartStreght, int Startintelect, int Startxp)
{
int hp = Starthp;
int damege = Startdamege;
int Agilety = StartAgilety;
int Streght = StartStreght;
int Intelect = Startintelect;
int xp = Startxp;
}
int AddStats()
{
hp = 10;
damege = 10;
Agilety = 10;
Streght = 10;
Intelect = 10;
xp = 0;
return 0;
}
void LvLup(){
}
void ShowStats(){
AddStats();
cout << "Your HP is: " << hp << endl;
cout << "Your Damege is: " << damege << endl;
cout << "Your Agilety is: " << Agilety << endl;
cout << "Your Streght is: " << Streght << endl;
cout << "Your Intelect is: " << Intelect << endl;
cout << "Your XP is: " << xp << endl;
}
private:
int hp;
int damege;
int Agilety;
int Streght;
int Intelect;
int xp;
};
//Meny Funksjon
void Meny()
{
int StatsMeny = 1;
int ShopMeny = 2;
int FightMeny = 3;
int MenyValg;
cout << "[1] Show Stats: " << endl;
cout << "[2] Buy Items: " << endl;
cout << "[3] Go Fight some Monsters: " << endl;
cout << "[4] Exit" << endl;
cout << "Enter a Option: ";
cin >> MenyValg;
// IF Statments For Meny Valg\Input
if (MenyValg == StatsMeny){
cout << "Stats:\n" << endl;
character User1(10,10,10,10,10,0);
User1.ShowStats();
}
if (MenyValg == ShopMeny){
cout << "Freeky D`s Shop of Everything:\n" << endl;
}
if (MenyValg == FightMeny){
cout << "Fight!\n" << endl;
}
} //Slutt På Meny
int main()
{
system("COLOR 20");
cout << "Welcome to DUNGION Console!\n\n" << endl;
character User1(10,10,10,10,10,0);
Meny();
system("PAUSE");
return 0;
}
|