From c3b0e8347578d9a52bf5b4b2b13f0dc640edeeae Mon Sep 17 00:00:00 2001 From: Aaron S Date: Mon, 19 Mar 2018 15:56:02 +0000 Subject: [PATCH] commiting --- Boss.cpp | 36 ++++++++---- Boss.h | 7 ++- Dungeon.cpp | 21 ++++--- Dungeon.h | 5 +- Monster.cpp | 155 +++++++++++++++++++++++++++++++++++---------------- Monster.h | 6 +- Player.cpp | 48 +--------------- Player.h | 9 +++ Run.sh | 1 + main.cpp | 157 ++++++++++++++++++++++++++++------------------------ 10 files changed, 254 insertions(+), 191 deletions(-) create mode 100644 Run.sh diff --git a/Boss.cpp b/Boss.cpp index 2ca5499..f2287b4 100644 --- a/Boss.cpp +++ b/Boss.cpp @@ -19,16 +19,17 @@ void Boss::summonBoss(int floorNum) { switch(floorNum) { case 1: cout << "A Minotaur stands before you, Warhammer raised and nose pierced" << endl; - + break; case 2: cout << "The Pop-Culture representation of Death Itself stands before you, scythe poised and hungry" << endl; - + break; case 3: cout << "A Dragon stands before you. C'mon, you had to see this coming" << endl; - + break; case 4: cout << "A hooded figure stands before you, dice in one hand, and a rulebook in the other. " << endl << "You cannot escape the power of the Dungen Master." << endl; + break; } } @@ -47,7 +48,7 @@ int Boss::getFight(int floorNum) { return fight = 15; case 4: // Dungen Master - return fight = 20 + return fight = 20; } } @@ -65,61 +66,74 @@ int Boss::getTalk(int floorNum) { return talk = 20; case 4: // Dungen Master - return talk = 20 + return talk = 20; } } -void Boss::bossResponse(int floorNum, int playerWon) { +void Boss::bossResponse(int floorNum, bool playerWon) { if (playerWon == true) { switch(floorNum) { case 1: // Minotaur cout << "The Minotaur drops its hammer, a bellow escapes its lips as it falls to the floor. Defeated" << endl; + break; case 2: // Death cout << "Death drops its scythe, as it disappears into the Soul Realm. Defeated" << endl; + break; case 3: // Dragon cout << "The Dragon falls in a bout of flame, its fighting 'til its last breath. Defeated" << endl; + break; case 4: // Dungen Master cout << "\"How did you defeat me?\" The Dungen Master exclaims. \"I had everyting prepared with utmost care.\"" << endl << "\"Perfectly laid traps, well executed enemies, but somehow you still beat me.\"" << endl << "\"Take it then, if you are willing to endure the consequences. . .\"" << endl; + break; + } } else { switch(floorNum) { case 1: // Minotaur cout << "The Minotaur swings its hammer, it bellows with pleasure at your pain" << endl; + break; case 2: // Death cout << "Death brings your soul closer to the reaping" << endl; + break; case 3: // Dragon cout << "The Dragon lets loose a fountain of flame onto your sorry form" << endl; + break; case 4: // Dungen Master cout << "With a roll of the die and a smirk, you take damage" << endl; + break; } } } -void giveBossItems(int floorNum, Inventory inventory) { +void Boss::giveBossItems(int floorNum, Inventory inventory) { switch(floorNum) { case 1: // Minotaur - inventory.gainNewItem("Cow Hammer", 10, -5); + inventory.gainItem("Cow Hammer", 10, -5); + break; case 2: // Death - inventory.gainNewItem("Death Svythe", 7, 7); + inventory.gainItem("Death Svythe", 7, 7); + break; case 3: // Dragon - inventory.gainNewItem("Dragon Heart", 0, 10); + inventory.gainItem("Dragon Heart", 0, 10); + break; case 4: // Dungen Master - inventory.gainNewItem("Maguffin of Vague Desireability", 15, 15); + inventory.gainItem("Maguffin of Vague Desireability", 15, 15); + break; } } \ No newline at end of file diff --git a/Boss.h b/Boss.h index 035ec4f..14b6e51 100644 --- a/Boss.h +++ b/Boss.h @@ -13,6 +13,11 @@ #include #include +#include "Player.h" +#include "Boss.h" +#include "Monster.h" +#include "Inventory.h" +#include "Dungeon.h" using namespace std; class Boss { @@ -26,7 +31,7 @@ class Boss { // Other Functions void summonBoss(int floorNum); - void bossResponse(int floorNum, int playerWon); + void bossResponse(int floorNum, bool playerWon); void giveBossItems(int floorNum, Inventory inventory); }; diff --git a/Dungeon.cpp b/Dungeon.cpp index 6d90123..9b79f08 100644 --- a/Dungeon.cpp +++ b/Dungeon.cpp @@ -7,31 +7,34 @@ #include "Monster.h" using namespace std; + Monster monster; + Boss boss; + int Dungeon::rollRoom() { - int roll = rand() % 100 + 1; + int roll = rand() % 20 + 1; return roll; } void Dungeon::getMonster(int encounterNum) { - Monster.summon(encounterNum); + monster.summon(encounterNum); } void Dungeon::monsterResponse(int encounterNum, bool playerWon) { - Monster.monsterResponse(encounterNum, playerWon); + monster.monsterResponse(encounterNum, playerWon); } void Dungeon::getBoss(int floorNum) { - Boss.summonBoss(floorNum); + boss.summonBoss(floorNum); } void Dungeon::bossResponse(int floorNum, bool playerWon) { - Boss.bossResponse(floorNum, playerWon); + boss.bossResponse(floorNum, playerWon); } - void giveBossItems(int encounterNum, Inventory inventory) { - Boss.giveItems(floorNum, inventory); + void Dungeon::giveBossItems(int encounterNum, Inventory inventory) { + boss.giveBossItems(floorNum, inventory); } - void giveMonsterItems(int encounterNum, Inventory inventory) { - Monster.giveItems(encounterNum, inventory); + void Dungeon::giveMonsterItems(int encounterNum, Inventory inventory) { + monster.giveMonsterItems(encounterNum, inventory); } diff --git a/Dungeon.h b/Dungeon.h index 698994e..3361b2c 100644 --- a/Dungeon.h +++ b/Dungeon.h @@ -15,14 +15,13 @@ class Dungeon { public: int roomEncounter; int floorNum = 1; - int monsterRoll; int roomCounter = 1; int rollRoom(); void getMonster(int encounterNum); - void monsterResponse(int encounterNum, string response); + void monsterResponse(int encounterNum, bool playerWon); void getBoss(int floorNum); - void bossResponse(int floorNum, string response); + void bossResponse(int floorNum, bool plyarWon); void giveBossItems(int floorNum, Inventory inventory); void giveMonsterItems(int encounterNum, Inventory inventory); diff --git a/Monster.cpp b/Monster.cpp index cce0b7b..08976c6 100644 --- a/Monster.cpp +++ b/Monster.cpp @@ -16,69 +16,69 @@ using namespace std; -Monster::summon(int encounterNum) { +void Monster::summon(int encounterNum) { switch(encounterNum) { case 1: cout << "A Toilet stands before you, its porcelin shining in the dull light, containing questionable water" << endl; - + break; case 2: cout << "A Green Bar is before you, you're not sure why, but you feel like you've just solved a math problem" << endl; - + break; case 3: cout << "A Potato stands before you on a table, its eyes stare into your soul, or just behind you, it has a lazy eye" << endl; - + break; case 4: cout << "A German soldier of the Third Reich stands before you, arm straight in the air" << endl; - + break; case 5: cout << "A plate of Waffles sit on a table, nothing wrong here, just some Waffles, hangin' out, bein' Waffles" << endl; - + break; case 6: cout << "A Beautiful Girl is standing before you, wait what's that poking out of her skirt? Probably just a dagger." << endl; - + break; case 7: cout << "The Game Devs stand before you, they hope you're liking this game, they put some hard work into it. Heck, I had to create 150 Unique encounters" << endl; - + break; case 8: cout << "A Human stands before you, what? Not everything in this list is Shakespeare" << endl; - + break; case 9: cout << "The Ugliest thing you've ever seen stan--oh wait that's just a mirror. Fight me, I dare you" << endl; - + break; case 10: cout << "A Door hangs before you, the pressure to conform to society's unrealistic standard for doors was too much. It will be missed" << endl; - + break; case 11: cout << "A Princess stands before you, but she's not why you're here, don't get distracted by needless side-quests, you've got a job to do!" << endl; - + break; case 12: cout << "EA stands before you, you must pay $69.99 to access the rest of this game" << endl; - + break; case 13: cout << "A Ghost stands before you, wait, that's just Carl in a bedsheet" << endl; - + break; case 14: cout << "A Textbook lies before you, haunting you about what you should be studying instead of playing this game" << endl; - + break; case 15: cout << "A Hobo stands before you, asking for some change, loose change, clothes change, societal change, anything. The Hobo is pretty bored with current events" << endl; - + break; case 16: cout << "1 Direction stands before you, they deserve this, we won't tell anyone" << endl; - + break; case 17: cout << "A Doll stands before you, porcelain eyes staring into your soul" << endl; - + break; case 18: cout << "A Real Slim Shady Gentleman sits before you, he stands up at your approach" << endl; - + break; case 19: cout << "Depression hits you as soon as you enter the room, this will be an uphill battle" << endl; - + break; case 20: cout << "The Color Blue stands before you. . . I don’t know ok? I lost my sanity 10 encounters back so here. Fight against, Flee from, or Talk to the Color Blue" << endl; - + break; } } @@ -102,7 +102,7 @@ int Monster::getFight(int encounterNum) { return fight = 5; case 6: // Not so Obvious Trap - return fight = 5); + return fight = 5; case 7: // Game Devs return fight = 10; @@ -169,7 +169,7 @@ int Monster::getTalk(int encounterNum) { return talk = 15; case 6: // Not so Obvious Trap - return talk = 15); + return talk = 15; case 7: // Game Devs return talk = 10; @@ -212,71 +212,92 @@ int Monster::getTalk(int encounterNum) { case 20: // Blue return talk = 10; + } } -void Monster::giveItems(int encounterNum, Inventory inventory) { +void Monster::giveMonsterItems(int encounterNum, Inventory inventory) { switch(encounterNum) { case 1: // Toilet - inventory.gainNewItem("Porcelin Throne", 1, 1); + inventory.gainItem("Porcelin Throne", 1, 1); + break; case 2: // Green Bar - inventory.gainNewItem("Sense of Accomplishment", 2, -1); + inventory.gainItem("Sense of Accomplishment", 2, -1); + break; case 3: // Potato - inventory.gainNewItem("Eye of Potato", -1, 2); + inventory.gainItem("Eye of Potato", -1, 2); + break; case 4: // Nazi - inventory.gainNewItem("Nazi Uniform", 3, -10); + inventory.gainItem("Nazi Uniform", 3, -10); + break; case 5: // Waffles - inventory.gainNewItem("Syrup Bottle", -2, 3); + inventory.gainItem("Syrup Bottle", -2, 3); + break; case 6: // Not so Obvious Trap - inventory.gainNewItem("Mousetrap", 3, 1); + inventory.gainItem("Mousetrap", 3, 1); + break; case 7: // Game Devs - inventory.gainNewItem("Sanity", -2, 4); + inventory.gainItem("Sanity", -2, 4); + break; case 8: // Human - inventory.gainNewItem("The Right to Bear Arms", 5, -5); + inventory.gainItem("The Right to Bear Arms", 5, -5); + case 9: // Mirror - inventory.gainNewItem("Silver Mirror", -3, 4); + inventory.gainItem("Silver Mirror", -3, 4); + break; case 10: // Door - inventory.gainNewItem("Golden Key", -1, 3); + inventory.gainItem("Golden Key", -1, 3); + break; case 11: // Princess - inventory.gainNewItem("Regal Tiara", -3, 5); + inventory.gainItem("Regal Tiara", -3, 5); + break; case 12: // EA - inventory.gainNewItem("Deep Pockets", -3, 5); + inventory.gainItem("Deep Pockets", -3, 5); + break; case 13: // Ghost - inventory.gainNewItem("Sheet", 1, 2); + inventory.gainItem("Sheet", 1, 2); + break; case 14: // Textbook - inventory.gainNewItem("Textbook", 5, 0); + inventory.gainItem("Textbook", 5, 0); + break; case 15: // Hobo - inventory.gainNewItem("Rabies", 5, -5); + inventory.gainItem("Rabies", 5, -5); + break; case 16: // 1 Direction - inventory.gainNewItem("Boy-Band Hair", -3, 4); + inventory.gainItem("Boy-Band Hair", -3, 4); + break; case 17: // Doll - inventory.gainNewItem("Doll Eyes", 2, 2); + inventory.gainItem("Doll Eyes", 2, 2); + break; case 18: // Real Slim Shady - inventory.gainNewItem("Push Pin", 2, 2); + inventory.gainItem("Push Pin", 2, 2); + break; case 19: // Depression - inventory.gainNewItem("The Power of Positive Thinking", 5, 5); + inventory.gainItem("The Power of Positive Thinking", 5, 5); + break; case 20: // Blue - inventory.gainNewItem("Big Blue Bouncy Balls", 5, -2); + inventory.gainItem("Big Blue Bouncy Balls", 5, -2); + break; } } @@ -286,126 +307,166 @@ void Monster::monsterResponse(int encounterNum, int playerWon) { case 1: // Toilet cout << "You have successfully defeated the Toilet, better wash your clothes afterward though. . ." << endl; + break; case 2: // Green Bar cout << "You now feel doubly accomplished at the defeat of the Green Bar" << endl; + break; case 3: // Potato - cout << "You have defeated the potato, it wasn't that difficult, but y'know" << ednl; + cout << "You have defeated the potato, it wasn't that difficult, but y'know" << endl; + break; case 4: // Nazi cout << "You have defeated the Nazi. He deserved it anyways" << endl; + break; case 5: // Waffles cout << "They were just waffles. . . really. . . you monster" << endl; + break; case 6: // Not so Obvious Trap cout << "You have successfully defeated the woman, she blows you a kiss" << endl; + break; case 7: // Game Devs cout << "You have been allowed to defeat us" << endl; + break; case 8: // Human cout << "You have successfully defeated the human" << endl; + break; case 9: // Mirror cout << "Ok that was rude I'll be honest but wow, you kinda went overboard on that mirror" << endl; + break; case 10: // Door cout << "You have successfully escaped that situation" << endl; + break; case 11: // Princess cout << "You have successfully stayed on task" << endl; + break; case 12: // EA cout << "You have defeated EA for now, but they'll be back. They'll always be back" << endl; + break; case 13: // Ghost cout << "You have defeated Carl in a Sheet" << endl; + break; case 14: // Textbook cout << "You have defeated the shame of ignoring your studies" << endl; + break; case 15: // Hobo cout << "You have defeated the Hobo" << endl; + break; case 16: // 1 Direction cout << "You have defeated 1 Direction" << endl; + break; case 17: // Doll cout << "You have deafeated the doll" << endl; + break; case 18: // Real Slim Shady cout << "You have defeated the Real Slim Shady" << endl; + break; case 19: // Depression cout << "You have defeated depression. . . for now. . ." << endl; + break; case 20: // Blue cout << "The color Blue has been defeated" << endl; + break; } } else { switch(encounterNum) { case 1: // Toilet cout << "The stench is killing you, slowly, but still killing you" << endl; + break; case 2: // Green Bar cout << "the Math hurts your brain" << endl; + break; case 3: // Potato - cout << "You feel the Potato stare into your soul" << ednl; + cout << "You feel the Potato stare into your soul" << endl; + break; case 4: // Nazi cout << "The Nazi slaps you" << endl; + break; case 5: // Waffles cout << "The syrup saps your life, these are not normal waffles" << endl; + break; case 6: // Not so Obvious Trap cout << "She smacks you for peeking at her" << endl; + break; case 7: // Game Devs cout << "Why do you hate us?" << endl; + break; case 8: // Human cout << "The human hurts you, but on the inside" << endl; + break; case 9: // Mirror cout << "Stop hitting yourself, stop hitting yourself" << endl; + break; case 10: // Door cout << "Your sure the door looks at you as it hangs there" << endl; + break; case 11: // Princess cout << "The Princess distracts your life away" << endl; + break; case 12: // EA cout << "EA charges your life force instead" << endl; + break; case 13: // Ghost cout << "Carl almost scared you to death" << endl; + break; case 14: // Textbook - cout << "The books shames your health lower"" << endl; + cout << "The books shames your health lower" << endl; + break; case 15: // Hobo cout << "The Hobo changes your health value" << endl; + break; case 16: // 1 Direction cout << "1 Direction sings your life force down" << endl; + break; case 17: // Doll cout << "The Doll strikes you with its mind" << endl; + break; case 18: // Real Slim Shady cout << "The Real Slim Shady rips you a new one" << endl; + case 19: // Depression cout << "Depression strikes you" << endl; + break; case 20: // Blue cout << "The color Blue attacks you" << endl; + break; } } } \ No newline at end of file diff --git a/Monster.h b/Monster.h index 67bfb4b..2bf1022 100644 --- a/Monster.h +++ b/Monster.h @@ -14,6 +14,10 @@ #include "Item.h" #include #include +#include "Player.h" +#include "Boss.h" +#include "Inventory.h" +#include "Dungeon.h" using namespace std; class Monster { @@ -28,7 +32,7 @@ class Monster { // Other Functions void summon(int encounterNum); - void giveitems(int encounterNum, int Inventory inventory); + void giveMonsterItems(int encounterNum, Inventory inventory); void monsterResponse(int encounterNum, int playerWon); diff --git a/Player.cpp b/Player.cpp index 1ff6d66..23df204 100644 --- a/Player.cpp +++ b/Player.cpp @@ -9,7 +9,7 @@ * */ -#include "item.h" +#include "Item.h" #include "Player.h" #include #include @@ -17,8 +17,6 @@ using namespace std; void Player::setStats(int seed) { - - getline(cin,seed); srand(seed); // Set Fight Stat and Modifier @@ -33,49 +31,5 @@ void Player::setStats(int seed) { } -void check - -bool Player::checkVictory(bool playerWon) { - if (playerWon == true) { - cout << "Congratulations " << getPlayerName() << " you have retrieved the Maguffin of Vauge Desirability!" << endl; - } -} -// int main() { - -// // Declare Character Details -// int seed; -// char command; -// Player player; -// string name = player.getPlayerName(); - - -// // Set Stats -// player.setStats(seed); - -// // Enter Name -// cout << "Enter Player Name: "; -// getline(cin,name); -// player.setPlayerName(name); - -// int health = player.getHealth(); -// int fight = player.getFight(); -// int talk = player.getTalk(); - -// cout << name << "'s stats" << endl -// << "========================" << endl -// << "Health: " << health << endl -// << "Fight: " << fight + item.getEquippedFight() << endl -// << "Talk: " << talk + item.getEquippedTalk() << endl -// << "Item: " << item.getEquippedItemName() << endl; - -// cout << "Check inventory: i"; -// getline(cin,command); - -// if (command == 'i') { -// item.listInventory(); -// } - -// return 0; -// } diff --git a/Player.h b/Player.h index d063c62..992f65b 100644 --- a/Player.h +++ b/Player.h @@ -14,14 +14,23 @@ #include #include +#include "Boss.h" +#include "Monster.h" +#include "Inventory.h" +#include "Dungeon.h" using namespace std; class Player { private: int fight; int talk; + int fightModifier; + int talkModifier; + int finalFight; + int finalTalk; string playerName; public: + int inventoryIndex; int health = 100; // Get Functions diff --git a/Run.sh b/Run.sh new file mode 100644 index 0000000..9380118 --- /dev/null +++ b/Run.sh @@ -0,0 +1 @@ +g++ -std=c++11 Boss.cpp Dungeon.cpp Inventory.cpp Monster.cpp Player.cpp main.cpp && ./a.out \ No newline at end of file diff --git a/main.cpp b/main.cpp index 151ad47..151d426 100644 --- a/main.cpp +++ b/main.cpp @@ -12,7 +12,7 @@ using namespace std; void introMenu(); -void ingameMenu(); +void ingameMenu(Inventory); int main() { @@ -23,47 +23,57 @@ int main() { Boss *bossPtr = new Boss; bool playerWon = false; bool playerVictory = false; - + string name; + int seed; cout << "Enter a seed: "; cin >> seed; - + introMenu(); - player.setPlayerName(name); - player.setStats(seed); + cout << "Enter your name adventurer!" << endl; + cin >> name; + cin.ignore(1000, '\n'); - while (playerVictory == false){ + playerPtr->setPlayerName(name); + playerPtr->setStats(seed); + inventoryPtr->gainItem("Sword", 0, 0); + cout << "Player has been made" << endl; + ingameMenu(*inventoryPtr); + + do { //floor 1-3 - while(dungeonPtr.floorNum <= 3) { - string *response = new string; + do { + string response; playerWon = false; - dungeon.roomEncounter = dungeon.rollRoom(); - - if(dungeonPtr.roomCounter % 5 == 0) { - dungeon.getBoss(dungeonPtr.floorNum); + dungeonPtr->roomEncounter = dungeonPtr->rollRoom(); + + if(dungeonPtr->roomCounter % 5 == 0) { + cout << "You enter the room" << endl; + dungeonPtr->getBoss(dungeonPtr->floorNum); + do { cout << "How do you respond? (Fight, Talk, Or Flee): "; - cin >> response; + getline(cin, response); if(response == "Fight"){ - if(playerPtr.getFight() >= BossPtr.getFight(encounterNum)) { + if(playerPtr->getFight() >= bossPtr->getFight(dungeonPtr->floorNum)) { playerWon = true; - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); - dungeonPtr.floorNum++; - monsterPtr.giveBossItems(dungeonPtr.floorNum, inventoryPtr); + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); + dungeonPtr->floorNum++; + dungeonPtr->giveBossItems(dungeonPtr->floorNum, *inventoryPtr); } else { - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); - playerPtr.doDamage(); + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); + playerPtr->doDamage(); } } else if (response == "Talk") { - if(playerPtr.getFight() >= BossPtr.getTalk(encounterNum)) { + if(playerPtr->getFight() >= bossPtr->getTalk(dungeonPtr->floorNum)) { playerWon = true; - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); - dungeonPtr.floorNum++; - monsterPtr.giveBossItems(dungeonPtr.floorNum, inventoryPtr); + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); + dungeonPtr->floorNum++; + dungeonPtr->giveBossItems(dungeonPtr->floorNum, *inventoryPtr); } else { - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); } } else { cout << "You run crying out of the room. Shame haunts your footsteps" << endl; @@ -73,30 +83,31 @@ int main() { } while (playerWon == false); playerWon = false; - dungeon.roomCounter++; + dungeonPtr->roomCounter++; } else { - - dungeon.getMonster(dungeon.roomEncounter); + cout << "You enter the room" << endl; + dungeonPtr->getMonster(dungeonPtr->roomEncounter); do { cout << "How do you respond? (Fight, Talk, Or Flee): "; - cin >> response; + getline(cin, response); if(response == "Fight"){ - if(playerPtr.getFight() >= monsterPtr.getFight(encounterNum)) { + if(playerPtr->getFight() >= monsterPtr->getFight(dungeonPtr->roomEncounter)) { playerWon = true; - dungeonPtr.monsterResponse(dungeonPtr.encounterNum, playerWon); - monsterPtr.giveMonsterItems(dungeonPtr.encounterNum, inventoryPtr); + dungeonPtr->monsterResponse(dungeonPtr->roomEncounter, playerWon); + dungeonPtr->giveMonsterItems(dungeonPtr->roomEncounter, *inventoryPtr); } else { - dungeonPtr.monsterResponse(dungeonPtr.encounterNum, playerWon); + dungeonPtr->monsterResponse(dungeonPtr->roomEncounter, playerWon); + playerPtr->doDamage(); } } else if (response == "Talk") { - if(playerPtr.getFight() >= monsterPtr.getTalk(encounterNum)) { + if(playerPtr->getFight() >= monsterPtr->getTalk(dungeonPtr->roomEncounter)) { playerWon = true; - dungeonPtr.monsterResponse(dungeonPtr.encounterNum, playerWon); - dungeonPtr.floorNum++; - monsterPtr.giveMonsterItems(dungeonPtr.encounterNum, inventoryPtr); + dungeonPtr->monsterResponse(dungeonPtr->roomEncounter, playerWon); + dungeonPtr->giveMonsterItems(dungeonPtr->roomEncounter, *inventoryPtr); } else { - dungeonPtr.monsterResponse(dungeonPtr.encounterNum, playerWon); + dungeonPtr->monsterResponse(dungeonPtr->roomEncounter, playerWon); + playerPtr->doDamage(); } } else { cout << "You run crying out of the room. Shame haunts your footsteps" << endl; @@ -106,53 +117,53 @@ int main() { } while (playerWon == false); playerWon = false; - dungeon.roomCounter++; + dungeonPtr->roomCounter++; } - - delete response; - } + + } while(dungeonPtr->floorNum <= 3); //floor 4 - - dungeon.getBoss(dungeonPtr.floorNum); + cout << "You enter the room" << endl; + dungeonPtr->getBoss(dungeonPtr->floorNum); do { - string *response = new string; + string response; cout << "How do you respond? (Fight, Talk, Or Flee): "; - cin >> response; + getline(cin, response); if(response == "Fight"){ - if(playerPtr.getFight() >= BossPtr.getFight(encounterNum)) { + if(playerPtr->getFight() >= bossPtr->getFight(dungeonPtr->floorNum)) { playerWon = true; - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); - dungeonPtr.floorNum++; - monsterPtr.giveBossItems(dungeonPtr.floorNum, inventoryPtr); + playerVictory = true; + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); + bossPtr->giveBossItems(dungeonPtr->floorNum, *inventoryPtr); } else { - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); - playerPtr - } - } else if (response == "Talk") { - if(playerPtr.getFight() >= BossPtr.getTalk(encounterNum)) { - playerWon = true; - playerVictory = true; - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); - monsterPtr.giveBossItems(dungeonPtr.floorNum, inventoryPtr); - } else { - dungeonPtr.bossResponse(dungeonPtr.floorNum, playerWon); - } - } else { - cout << "You run crying out of the room. Shame haunts your footsteps" << endl; - playerWon = true; - } - delete response; - } while (playerWon == false); + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); + playerPtr->doDamage(); + } + } else if (response == "Talk") { + if(playerPtr->getFight() >= bossPtr->getTalk(dungeonPtr->floorNum)) { + playerWon = true; + playerVictory = true; + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); + bossPtr->giveBossItems(dungeonPtr->floorNum, *inventoryPtr); + } else { + dungeonPtr->bossResponse(dungeonPtr->floorNum, playerWon); + playerPtr->doDamage(); + } + } else { + cout << "You run crying out of the room. Shame haunts your footsteps" << endl; + playerWon = true; + } + }while (playerWon == false); - } + } while (playerVictory == false); - cout << "You win!"; + cout << "You win!" << endl; + cout << "Final Inventory" << endl; + ingameMenu(*inventoryPtr); delete monsterPtr; - delete dungeonPtr; delete bossPtr; delete inventoryPtr; delete playerPtr; @@ -166,7 +177,9 @@ void introMenu() { << " so good luck fighting, talking or fleeing like a little baby!" << endl; } -void ingameMenu() { +void ingameMenu(Inventory inventory) { + cout << "--------------------------------" << endl; + cout << "Inventory" << endl;; + inventory.listInventory(); cout << "--------------------------------" << endl; - cout << endl; } \ No newline at end of file -- GitLab