So for my final class project I decided I want to make a very basic combat simulation based VERY loosely on 5e D&D. However I'm running into issues in my brain regarding logic and how to actually code this correctly.
int main()
{
cout << "Welcome to the D&D simple combat processor!" << endl;
cout << "To begin, please enter the following info about your character." << endl;
player_info;
}
void player_info
{
//Character HP Entry and Validation
cout << "Character HP: ";
cin >> p_hp >> endl;
while(p_hp < 1)
{
cout << "Sorry, that is an invalid entry. Try again." << endl;
cin >> p_hp >> endl;
}
//Character AC Entry and Validation
cout << "Character AC(Armor Class): ";
cin >> p_ac >> endl;
while(p_ac < 10)
{
cout << "Sorry, that is an invalid entry. Try again." << endl;
cin >> p_ac >> endl;
}
cout << "Character Proficiency Modifier: " << endl;
cin >> p_profmod >> endl;
while(p_profmod < 1 || p_profmod > 10)
{
cout << "Sorry, that is an invalid entry. Try again." << endl;
cin >> p_profmod >> endl;
}
}
************************************
Essentially what I need to do after speaking with my professor is this:
-Take input from the user regarding their character.
-Store the info on a file.
-Have 3 Structures, each one containing the data of a different enemy.
-Make a menu asking which enemy they user wants to fight.
-Running a function that simulates combat between the player character and the chosen enemy.