Help me create this program

Create a small game using C++ that has you fight one monster. Your fight must be turn based at least 5 turns. You must track your HP and the monster’s HP. After each hit you must report what both of your HP is. You must be able to apply one healing potion per turn on your character which can recover any amount you want.
Each hit to the enemy must take points off and once the monster is defeated all your points must be restored and you are declared the winner. After enemy is defeated you must also display the hit sequence and health at each turn based operation back to the screen.

Requirement breakdown:
Create a player
Create a monster
Store HP of both monster and player
Subtract HP from player
Add HP to player
Subtract HP from monster
Must be turn based (after you take a hit you deliver a hit and vice versa) up to 5 turns
Report HP of both the player and monster after each hit
Must be *able* to apply a healing potion on your turn – but are not required (must at least ask)
Each hit the enemy takes off HP (No misses when enemy attacks) and vice versa
Restore player health after enemy is defeated


Your program must contain the following:
Variables
At least one struct to hold the player or monster
Array to hold Hit Sequence (or Vector) (May need two)
Text File
Method For Removing / Adding HP


My intro to c++ professor just told us to copy stuff down, and never really taught as everything.. I've been watching tutorials online trying to catch up.

Can somebody help me finish this program? Please make it as simple as possible.. this is what I have so far.. and I have no idea how to finish it...

#include <iostream>
#include <string>
using namespace std;

struct Benedict {
int BenedictHP;
int BenedictAttack;
int BenedictDefence;

}

struct Bigfoot {
int BigfootHP;
int BigfootAttack;
int BigfootDefence;

int main() {
int BenedictHP;
int BenedictAttack;
int BenedictDefence;
int BigfootHP;
int BigfootAttack;
int BigfootDefence;

int BenedictHP = 100;
int BenedictAttack = 20;
int BenedictDefence = 10;
int BigfootHP = 100;
int BigfootAttack = 10;
int BigfootDefence = 5;

}

Last edited on
PM me and I can teach you how to complete this program.
I recently did a similar code for a little text RPG I did. I took out the fight sequence for you; hopefully it helps you get an idea of how you could structure yours?
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
#include <iostream>
#include <string>
#include <stdlib.h>

using namespace std;

int main(){
  //Seed random number generator
  srand(time(0));
  
  int life = 100;
  int enemy_life = 50;
  bool ans = 0;
  
  cout << "Tearing its way up from the cellar of the store, a feral MUTANT appears!\n";
        
    while(enemy_life > 0&&life > 0){
      cout << "\nWhat will you do?\n0. Fight!\n1. Defend. (0/1)\n";
      cin >> ans;
      if(ans == 0){
        cout << "\nThe MUTANT attacks...\n";
          int chance = rand() % 100;
          if(chance < 50){
            life = life - 15;
            cout << "You're hit!\n";
            cout << "LIFE: " << life << endl;
          }else{
            cout << "You manage to dodge!\n";
            cout << "LIFE: " << life << endl;
          }
            enemy_life = enemy_life - 10;
            cout << "You attack the MUTANT! It snarls at you in anger.\n";
            cout << "ENEMY LIFE: " << enemy_life << endl;
      }else{
            cout << "\nThe MUTANT attacks...\n";
            cout << "You defend yourself!\n";
            cout << "LIFE: " << life << endl;
      }
    }
    cout << "Final Life: " << life << endl;
    cout << endl;
  }
Topic archived. No new replies allowed.