Commit 23b3e678 authored by Aaron Sturtevant's avatar Aaron Sturtevant

commiting

parent 4ce54cd2
#include <iomanip>
#include <iostream>
#include <stdlib.h>
......@@ -10,11 +11,11 @@ class Dungeon {
int monsterRoll;
int roomCounter = 1;
int rollRoom(int seed);
void dungeonOutput(int encounterNum);
monsterResponse(int encounterNum, string response);
getBoss(int floorNum);
bossResponse(int floorNum, string response);
int rollRoom();
void getMonster(int encounterNum);
void monsterResponse(int encounterNum, string response);
void getBoss(int floorNum);
void bossResponse(int floorNum, string response);
......
......@@ -3,13 +3,18 @@
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include "Player.h"
#include "Boss.h"
#include "Monster.h"
#include "Inventory.h"
#include "Dungeon.h"
using namespace std;
int main() {
Dungeon *dungeonPtr = new Dungeon;
Player *playerPtr = new Player;
Items *itemPtr = new Item;
Inventory *inventoryPtr = new Inventory;
Monster *monsterPtr = new Monster;
Boss *bossPtr = new Boss;
bool playerWon = false;
......@@ -37,7 +42,7 @@ int main() {
while(dungeonPtr.floorNum <= 3) {
string *response = new string;
playerWon = false;
dungeon.roomEncounter = dungeon.rollRoom(seed);
dungeon.roomEncounter = dungeon.rollRoom();
if(dungeonPtr.roomCounter % 5 == 0) {
dungeon.getBoss(dungeonPtr.floorNum);
......@@ -49,7 +54,7 @@ int main() {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
playerWon = true;
dungeonPtr.floorNum++;
monsterPtr.giveItems(dungeonPtr.floorNum, itemPtr);
monsterPtr.giveItems(dungeonPtr.floorNum, inventoryPtr);
} else {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
}
......@@ -73,11 +78,11 @@ int main() {
cin >> response;
if((response == 'Fight') || (response == 'Talk') {
if(dungeon.compareStats(playerPtr, monsterPtr, dungeon.roomEncounter)) {
dungeonPtr.monsterResponse(dungeonPtr.floorNum, playerWon);
dungeonPtr.monsterResponse(dungeonPtr.encounterNum, playerWon);
playerWon = true;
monsterPtr.giveItems(dungeonPtr.encounterNum, itemPtr);
monsterPtr.giveItems(dungeonPtr.encounterNum, inventoryPtr);
} else {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
dungeonPtr.bossResponse(dungeonPtr.encounterNum, playerWon);
}
} else {
......@@ -92,7 +97,8 @@ int main() {
dungeon.roomCounter++;
}
delete response;
}
......@@ -100,6 +106,7 @@ int main() {
dungeon.getBoss(dungeonPtr.floorNum);
do {
string *response = new string;
cout << "How do you respond? (Fight, Talk, Or Flee): ";
cin >> response;
if((response == 'Fight') || (response == 'Talk') {
......@@ -108,7 +115,7 @@ int main() {
playerWon = true;
playerVictory = true;
dungeonPtr.floorNum++;
monsterPtr.giveItems(dungeonPtr.floorNum, itemPtr);
monsterPtr.giveItems(dungeonPtr.floorNum, inventoryPtr);
} else {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
}
......@@ -118,11 +125,18 @@ int main() {
playerWon = true;
dungeon.floorNum--;
}
delete response;
} while (playerWon == false;);
}
cout << "You win!";
delete monsterPtr;
delete dungeonPtr;
delete bossPtr;
delete inventoryPtr;
delete playerPtr;
return 0;
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment