diff --git a/Dungeon.cpp b/Dungeon.cpp index 3ca47f3314df483363c7098f4b59f726ed8041ad..f30c619452acd3138348a6d2f3d8fb9469c04a17 100644 --- a/Dungeon.cpp +++ b/Dungeon.cpp @@ -1,6 +1,10 @@ #include #include #include +#include "Player.h" +#include "Boss.h" +#include "Inventory.h" +#include "Monster.h" using namespace std; int Dungeon::rollRoom() { @@ -12,14 +16,26 @@ using namespace std; Monster.summon(encounterNum); } - void Dungeon::monsterResponse(int encounterNum, string response) { - Monster.monsterResponse(encounterNum, response); + void Dungeon::monsterResponse(int encounterNum, bool playerWon) { + Monster.monsterResponse(encounterNum, playerWon); } void Dungeon::getBoss(int floorNum) { - Monster.summonBoss(floorNum); + Boss.summonBoss(floorNum); } - void Dungeon::bossResponse(int floorNum, string response) { - Monster.bossResponse(floorNum, respose); - } \ No newline at end of file + void Dungeon::bossResponse(int floorNum, bool playerWon) { + Boss.bossResponse(floorNum, response); + } + + 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); + } diff --git a/Dungeon.h b/Dungeon.h index 4e80a3605335c8a4532f94e1c2dc6a001bd4438c..060f5e92d52b2312a589c6dfebe98009c698f9d2 100644 --- a/Dungeon.h +++ b/Dungeon.h @@ -2,6 +2,10 @@ #include #include #include +#include "Player.h" +#include "Boss.h" +#include "Inventory.h" +#include "Monster.h" using namespace std; class Dungeon { @@ -16,7 +20,7 @@ class Dungeon { void monsterResponse(int encounterNum, string response); void getBoss(int floorNum); void bossResponse(int floorNum, string response); + void giveBossItems(int floorNum, Inventory inventory); + void giveMonsterItems(int encounterNum, Inventory inventory); - - }; diff --git a/main.cpp b/main.cpp index 0c59abeb556f106c1151f0cf277eb7aec62c4d8d..e8a0bce908020bdb107571bbc08a45605f130feb 100644 --- a/main.cpp +++ b/main.cpp @@ -50,11 +50,11 @@ int main() { cout << "How do you respond? (Fight, Talk, Or Flee): "; cin >> response; if((response == 'Fight') || (response == 'Talk') { - if(dungeon.compareStats(playerPtr, dungeon.floorNum)) { + if(dungeon.compareStats(playerPtr, dungeon.floorNum, response)) { dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); playerWon = true; dungeonPtr.floorNum++; - monsterPtr.giveItems(dungeonPtr.floorNum, inventoryPtr); + monsterPtr.giveBossItems(dungeonPtr.floorNum, inventoryPtr); } else { dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); } @@ -77,10 +77,10 @@ int main() { cout << "How do you respond? (Fight, Talk, Or Flee): "; cin >> response; 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); playerWon = true; - monsterPtr.giveItems(dungeonPtr.encounterNum, inventoryPtr); + monsterPtr.giveMonsterItems(dungeonPtr.encounterNum, inventoryPtr); } else { dungeonPtr.bossResponse(dungeonPtr.encounterNum, playerWon); } @@ -110,12 +110,11 @@ int main() { cout << "How do you respond? (Fight, Talk, Or Flee): "; cin >> response; if((response == 'Fight') || (response == 'Talk') { - if(dungeon.compareStats(playerPtr, dungeon.floorNum)) { + if(dungeon.compareStats(playerPtr, dungeon.floorNum, response)) { dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); playerWon = true; playerVictory = true; dungeonPtr.floorNum++; - monsterPtr.giveItems(dungeonPtr.floorNum, inventoryPtr); } else { dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); }