why wont my cout words come up?

The place they won't come up is in the end, whenever the player uses a potion, in the script i'm going to show. So basically you just need to read it. If it helps you could compile it then get to that part. Yes I realize 'a' and stuff aren't filled in, I'm not that far yet.




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#include <cstdlib>
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char *argv[])
{
    //integers and all that
    bool nameConfirm, battleMode, confirm;
    confirm = false;
    string playerName, playerWeapon, playerArmorName, enemArmorName, enemName, enemWeapon;
    char yesOrNo, battleCommand;
    char gameEnder;
    int playerHealthCurrent, playerHealthTotal, playerWeaponDmg, playerArmor;
    int enemWeaponDmg, kills, enemHealthTotal, enemHealthCurrent, enemArmor, potions, potionHeal;
    potionHeal = 15;
    //getName
    cout << "***Welcome to Creature-Slayer 1--Gladiator***\n\n\n";
    cout << "Who are you?(first name only, hit enter when finished)\n";
    cout << "I am: ";
    cin >> playerName;
    cout << playerName << ", eh?(y/n)";
    //confirm it
    do{
    cin >> yesOrNo;
    switch(yesOrNo)
    {
    case 'y':
         cout << "Very well.\n";
         nameConfirm = true;
         break;
    case 'n':
         cout << "Then restart the program!(type something then hit enter to end)";
         cin >> gameEnder;
         return 0;
    default:
         cout << "Type y(yes) or n(no) then hit enter.\n(y/n)";         
             
         
         
         }
         }
         while (nameConfirm == false);
    //game explanation     
    cout << playerName << ", you've lived your life full of crime. Now you must fight as a gladiator. You will battle others, to the death. If you win you may take their weapons or equipment, then continue back to the cells to ready yourself for the next fight. This is now your life. There's no leaving, you battle endlessly. Good luck, gladiator.\n\n";
    //tutorial begin
    cout << "WELCOME TO THE TUTORIAL. AS A BEGINNER, YOUR ARMOR IS NOT THAT GOOD. ALSO, YOUR DAMAGE IS LOW BECAUSE YOU HAVE NO WEAPON. IN THIS TUTORIAL YOU WILL BATTLE YOUR FIRST MONSTER. TO ATTACK, YOU CLICK (A). THIS WILL TELL YOU WHAT HAPPENED, HOW \nMUCH YOU HIT, HOW MUCH THE ENEMY HIT. FOR THIS PRACTICE, YOUR ENEMY WILL BE A \nRAT.\n";                  
    cout << "So, you wanna play?(y/n)";
    //do they??? 
     do{
    cin >> yesOrNo;
    switch(yesOrNo)
    {
    case 'y':
         cout << "Very well.\n\n\n";
         confirm = true;
         break;
    case 'n':
         cout << "Then quit the program!(type something then hit enter to end)";
         cin >> gameEnder;
         return 0;
    default:
         cout << "Type y(yes) or n(no) then hit enter.\n(y/n)";
         }
         }         
         while (confirm == false);
    confirm = true;
    
    //First  Battle Mode
    battleMode = true;
    //Player Initilization
    playerHealthCurrent = 25;
    playerHealthTotal = 25;     
    playerWeapon = "fists";
    playerArmorName = "Beginners Cloth";
    playerArmor = 0;
    playerWeaponDmg = (rand() % 4);
    potions = 1;
    //Enemy Initilization     
    enemName = "rat";
    enemHealthCurrent = 3;
    enemHealthTotal = 3;
    enemWeapon = "claws";
    enemArmorName = "pelt";
    enemArmor = 0;
    enemWeaponDmg = (rand() % 4);
    //Start The Battle!!!!
    do{
     cout << "Enemy: " << enemName << "|Hit Points: " << enemHealthCurrent << "/" << enemHealthTotal;
     cout << "|Armor: " << enemArmorName << "|Weapon: " << enemWeapon;
     cout << "\n----------------------------------------------------------";
     cout << "\n" << playerName << "|Hit Points: " << playerHealthCurrent << "/" << playerHealthTotal;
     cout << "|Armor: " << playerArmorName << "|Weapon: " << playerWeapon << "|Potions: " << potions;
     cout << "\n(a)ttack\n(d)rink potion\n(q)uit game\n";
     cin >> battleCommand;
    //battle command     
         switch(battleCommand)
    {
    case 'a':
        
         break;
    case 'd': 
         if( potions = 0 ) {
            cout << "You have no potions!\n";
            }
         else if( potions > 0 ) {
            cout << "The potion heals 15 hit points.\n";
            playerHealthCurrent + potionHeal;
            if( playerHealthCurrent > playerHealthTotal ) {
            playerHealthCurrent = playerHealthTotal;     
                               } }
    case 'q':
         cout << "Good bye then.(type something then hit enter to end)";
         cin >> gameEnder;
         return 0;
    default:
         cout << "Type y(yes) or n(no) then hit enter.\n(y/n)";
         }
     
     
     
     
     
     
     }while(enemHealthCurrent > 0 );       
    
    
    
    
    
    cin >> gameEnder;
    return 0;
}
if( potions = 0 )

Did you mean

if( potions == 0 )?
if( potions = 0 )
= is assignation
== is comparison
Topic archived. No new replies allowed.