Commit 86e1f43f authored by Aaron Sturtevant's avatar Aaron Sturtevant

commiting

parent 23b3e678
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include "Player.h"
#include "Boss.h"
#include "Inventory.h"
#include "Monster.h"
using namespace std; using namespace std;
int Dungeon::rollRoom() { int Dungeon::rollRoom() {
...@@ -12,14 +16,26 @@ using namespace std; ...@@ -12,14 +16,26 @@ using namespace std;
Monster.summon(encounterNum); Monster.summon(encounterNum);
} }
void Dungeon::monsterResponse(int encounterNum, string response) { void Dungeon::monsterResponse(int encounterNum, bool playerWon) {
Monster.monsterResponse(encounterNum, response); Monster.monsterResponse(encounterNum, playerWon);
} }
void Dungeon::getBoss(int floorNum) { void Dungeon::getBoss(int floorNum) {
Monster.summonBoss(floorNum); Boss.summonBoss(floorNum);
} }
void Dungeon::bossResponse(int floorNum, string response) { void Dungeon::bossResponse(int floorNum, bool playerWon) {
Monster.bossResponse(floorNum, respose); Boss.bossResponse(floorNum, response);
} }
\ No newline at end of file
void giveItems(int floorNum, Inventory inventory) {
Boss.giveItems(floorNum, inventory);
}
void giveBossItems(int encounterNum, Inventory inventory) {
Boss.giveItems(floorNum, inventory);
}
void giveMonsterItems(int encounterNum, Inventory inventory) {
Boss.giveItems(encounterNum, inventory);
}
...@@ -2,6 +2,10 @@ ...@@ -2,6 +2,10 @@
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <stdlib.h> #include <stdlib.h>
#include "Player.h"
#include "Boss.h"
#include "Inventory.h"
#include "Monster.h"
using namespace std; using namespace std;
class Dungeon { class Dungeon {
...@@ -16,7 +20,7 @@ class Dungeon { ...@@ -16,7 +20,7 @@ class Dungeon {
void monsterResponse(int encounterNum, string response); void monsterResponse(int encounterNum, string response);
void getBoss(int floorNum); void getBoss(int floorNum);
void bossResponse(int floorNum, string response); void bossResponse(int floorNum, string response);
void giveBossItems(int floorNum, Inventory inventory);
void giveMonsterItems(int encounterNum, Inventory inventory);
}; };
...@@ -50,11 +50,11 @@ int main() { ...@@ -50,11 +50,11 @@ int main() {
cout << "How do you respond? (Fight, Talk, Or Flee): "; cout << "How do you respond? (Fight, Talk, Or Flee): ";
cin >> response; cin >> response;
if((response == 'Fight') || (response == 'Talk') { if((response == 'Fight') || (response == 'Talk') {
if(dungeon.compareStats(playerPtr, dungeon.floorNum)) { if(dungeon.compareStats(playerPtr, dungeon.floorNum, response)) {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
playerWon = true; playerWon = true;
dungeonPtr.floorNum++; dungeonPtr.floorNum++;
monsterPtr.giveItems(dungeonPtr.floorNum, inventoryPtr); monsterPtr.giveBossItems(dungeonPtr.floorNum, inventoryPtr);
} else { } else {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
} }
...@@ -77,10 +77,10 @@ int main() { ...@@ -77,10 +77,10 @@ int main() {
cout << "How do you respond? (Fight, Talk, Or Flee): "; cout << "How do you respond? (Fight, Talk, Or Flee): ";
cin >> response; cin >> response;
if((response == 'Fight') || (response == 'Talk') { if((response == 'Fight') || (response == 'Talk') {
if(dungeon.compareStats(playerPtr, monsterPtr, dungeon.roomEncounter)) { if(dungeon.compareStats(playerPtr, monsterPtr, dungeon.roomEncounter, response)) {
dungeonPtr.monsterResponse(dungeonPtr.encounterNum, playerWon); dungeonPtr.monsterResponse(dungeonPtr.encounterNum, playerWon);
playerWon = true; playerWon = true;
monsterPtr.giveItems(dungeonPtr.encounterNum, inventoryPtr); monsterPtr.giveMonsterItems(dungeonPtr.encounterNum, inventoryPtr);
} else { } else {
dungeonPtr.bossResponse(dungeonPtr.encounterNum, playerWon); dungeonPtr.bossResponse(dungeonPtr.encounterNum, playerWon);
} }
...@@ -110,12 +110,11 @@ int main() { ...@@ -110,12 +110,11 @@ int main() {
cout << "How do you respond? (Fight, Talk, Or Flee): "; cout << "How do you respond? (Fight, Talk, Or Flee): ";
cin >> response; cin >> response;
if((response == 'Fight') || (response == 'Talk') { if((response == 'Fight') || (response == 'Talk') {
if(dungeon.compareStats(playerPtr, dungeon.floorNum)) { if(dungeon.compareStats(playerPtr, dungeon.floorNum, response)) {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
playerWon = true; playerWon = true;
playerVictory = true; playerVictory = true;
dungeonPtr.floorNum++; dungeonPtr.floorNum++;
monsterPtr.giveItems(dungeonPtr.floorNum, inventoryPtr);
} else { } else {
dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon);
} }
......
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