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 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
#include <iostream>
#include <string>
#include <ctime>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
// Classes
#include "Character.h"
#include "Dice.h"
#include "Enemies.h"
#include "Stats.h"
#include "Dungeon.h"
#include "Chests.h"
using namespace std;
// This Version To Have Skeletons, Stats and Classes!
int main()
{
char name[30];
char dice;
int mainHP;
int mainATK;
string mainName;
/*
string step;
string ans;
string move = "still";
int atk = 0;
int hp = 0;
int pos = 0;
int numseed = 0;
int gamrand;
int gam;
int skelehp = 0;
int skeleatk = 0;
int bosshp = 500;
int bossatk = 9;
int charP = 9;
int bossP = 9;
float charLife = 0;
float bossStr = 0;
int chests [numseed];
srand(time(NULL)); */
//Character Constructor
Character Info;
// Character Building
// First Convo
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
cout << "Welcome Young Warrior To The 20 Step Dungeon!" << endl;
cout << "Before We Start... What's Your Name?" << endl;
cin.getline (name,30);
mainName.assign(name);
// Dice Object Construction
Dice Random;
// HP Sats
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
cout << "Press R For Your Health Points!" << endl;
cin >> dice;
if (dice != 'r' && dice != 'R') {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
cout << "You've Failed Already.... NEXT!!!" << endl;
return 0;
}
else {
mainHP = Random.Hundred();
dice = 'a';
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);
cout << "Your Health Points Are: " << mainHP << endl;
// Atk Stats
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10);
cout << "Press R For Your Attack Points!" << endl;
cin >> dice;
if (dice != 'r' && dice != 'R') {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
cout << "You've Failed Already.... NEXT!!!" << endl;
return 0;
}
else {
mainATK = Random.Hundred();
dice = 'a';
}
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 11);
cout << "Your Attack Points Are: " << mainATK << endl;
// Pass Name/mainHP/mainATK Into Class
Info.Player(mainName,mainHP,mainATK);
cout << "Overall " << Info.getName << " Your Health Points Are " << Info.getHP << " And Your Attack Points are " << Info.getATK << "!" << endl;
// Dungeon Constructor
Dungeon Dung;
// Start Of Dungeon
while (Dung.Pos <= 30) {
Dung.Walk();
if (Dung.Step != 'e' && Dung.Step != 'E' && Dung.Step != 'd') {
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 12);
cout << "You've Failed Already... You Fell Into a Spiky AF Pit!" << endl;
system("pause");
return 0;
}
}
return 0;
}
/*
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15);
The different color codes are
0 BLACK
1 BLUE
2 GREEN
3 CYAN
4 RED
5 MAGENTA
6 BROWN
7 LIGHTGRAY
8 DARKGRAY
9 LIGHTBLUE
10 LIGHTGREEN
11 LIGHTCYAN
12 LIGHTRED
13 LIGHTMAGENTA
14 YELLOW
15 WHITE
cin.getline (name,20);
*/
|