From 865375cce976dc5d684e21bceb6c4516de71bbfc Mon Sep 17 00:00:00 2001 From: overtired Date: Mon, 17 Apr 2023 16:49:46 +0300 Subject: [PATCH] Initial. --- .gitignore | 2 ++ main.cpp | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index fab7372..c84ca74 100644 --- a/.gitignore +++ b/.gitignore @@ -71,3 +71,5 @@ Thumbs.db *.dll *.exe +# Build dir +build/* diff --git a/main.cpp b/main.cpp index da8198b..b5d6d93 100644 --- a/main.cpp +++ b/main.cpp @@ -107,7 +107,7 @@ int main() { {"Exit of the dungeon", "You see some sunlight coming from the top. It's the exit!", {{"Exit the dungeon", "Move on"}, - {"You exit this damned dungeon. Good job.", "You wanted to stay here for longer, likely because you think your mission isn't over"}, + {"You exit this damned dungeon. Good job.", "You wanted to stay here for longer, likely because you think your mission isn't over."}, {{0, 0, 0, 0, 0, EXT}, {0, 0, 0, 0, 0, REG}}}}, }; int iShouldStop = 0; @@ -117,6 +117,7 @@ int main() { char inp[2]; int iInputIsCorrect = 1; int iXPFlag = 0; + int iTurns = 0; srand(time(0)); while (!iShouldStop) { @@ -127,7 +128,8 @@ int main() { if (iInputIsCorrect && !iXPFlag) { iRoomId = rand() % 6 + player.iKeys; room = vRooms[iRoomId]; - cout << noshowpos << player << endl; + cout << noshowpos << player << " [Turns: " << iTurns << "]" << endl; + iTurns++; cout << "> " << room.sName << "\n"; cout << "=> " << room.sDescription << "\n"; for (int i = 0; i < room.choices.vsNames.size(); i++) @@ -157,11 +159,16 @@ int main() { iEPDelta = min(0, iEPDelta); } - cout << showpos << "[" << iHPDelta << "hp]" << " "; - cout << showpos << "[" << iEPDelta << "ep]" << " "; - cout << showpos << "[" << iXPDelta << "xp]" << " "; + if (outcome.iPlayerHealthDelta) + cout << showpos << "[" << iHPDelta << "hp]" << " "; + if (outcome.iPlayerEnduranceDelta) + cout << showpos << "[" << iEPDelta << "ep]" << " "; + if (outcome.iPlayerXperienceDelta) + cout << showpos << "[" << iXPDelta << "xp]" << " "; if (outcome.iPlayerLevelDelta) cout << showpos << "[" << outcome.iPlayerLevelDelta << "lvl]"; + if (!outcome.iPlayerEnduranceDelta && !outcome.iPlayerHealthDelta && !outcome.iPlayerXperienceDelta) + cout << "[Nothing]"; } else { switch (outcome.eSpecial) { case TRS: @@ -250,7 +257,7 @@ int main() { player.iXperience += player.iLevel; } } else if (outcome.eSpecial == EXT) { - cout << "You exit the dungeon with " << player.iXperience << "xp. Congrats!" << endl; + cout << "You exit the dungeon with " << player.iXperience + player.iArmor * 50 + player.iWeapon * 50 << "xp. Congrats!" << endl; iShouldStop = 1; } cout << room.choices.vsDescriptions[i] << endl;