when i use this (lets say...
DPOHealth = 1 and
GPOHealth = 1
then, i get to this list and it displays both of them. The thing is... if i press 1 at the prompt, it will use DPO AND GPO.
and if i press 3 (supposed to be GPO) it wont do anything.
thanks for the help
DPOHealth = 1 and
GPOHealth = 1
then, i get to this list and it displays both of them. The thing is... if i press 1 at the prompt, it will use DPO AND GPO.
and if i press 3 (supposed to be GPO) it wont do anything.
thanks for the help
Code:
bool AlchemyList()
{
if (DPOHealth>0)
{
cout<<"1. Deluted Potion Of Health(";
cout<<DPOHealth;
cout<<")\n";
}
if (WPOHealth>0)
{
cout<<"3. Weak Potion Of Health(";
cout<<WPOHealth;
cout<<")\n";
}
if (GPOHealth>0)
{
cout<<"4. Good Potion Of Health(";
cout<<GPOHealth;
cout<<")\n";
}
if (SPOHealth>0)
{
cout<<"5. Strong Potion Of Health(";
cout<<SPOHealth;
cout<<")\n";
}
if (PPOHealth>0)
{
cout<<"6. Pure Potion Of Health(";
cout<<PPOHealth;
cout<<")\n";
}
int AlchemyListChoice;
cin>>AlchemyListChoice;
switch (AlchemyListChoice)
{
case 1:
{
if (DPOHealth>0)
{
cout<<"You use your DPO HEALTH\n";
cout<<"5 health has been restored\n";
DPOHealth=DPOHealth-1;
Restore5PersonsHealth();
cout<<"You health now is ";
ShowWhatIsHealth();
cout<<"\n";
}
}
case 2:
{
if (WPOHealth>0)
{
cout<<"You use your WPO HEALTH\n";
cout<<"10 health has been restored\n";
WPOHealth=WPOHealth-1;
Restore10PersonsHealth();
cout<<"You health now is ";
ShowWhatIsHealth();
cout<<"\n";
}
}
case 3:
{
if (GPOHealth>0)
{
cout<<"You use your GPO HEALTH\n";
cout<<"25 health has been restored\n";
GPOHealth=GPOHealth-1;
Restore25PersonsHealth();
cout<<"You health now is ";
ShowWhatIsHealth();
cout<<"\n";
}
}
case 4:
{
if (SPOHealth>0)
{
cout<<"You use your SPO HEALTH\n";
cout<<"50 health has been restored\n";
SPOHealth=SPOHealth-1;
Restore50PersonsHealth();
cout<<"You health now is ";
ShowWhatIsHealth();
cout<<"\n";
}
}
case 5:
{
if (PPOHealth>0)
{
cout<<"You use your DPO HEALTH\n";
cout<<"Full health has been restored\n";
PPOHealth=PPOHealth-1;
RestoreFullPersonsHealth2();
cout<<"You health now is ";
ShowWhatIsHealth();
cout<<"\n";
}
}
}
}
Comment