Question: C Program Simple RPG Battle: To start, you and the enemy both have 100 hit points. You as the player also have health potions. You
C Program Simple RPG Battle:
To start, you and the enemy both have 100 hit points. You as the player also have health potions. You will provide a menu that asks you the action you wish to take. Each action should have its ownfunction to implement the action. The actions I want you to implement include:
Attack: you need to pass in the enemys hit points, reduce them in the function by 20 damage points, and return the enemies remaining hit points. Also, have some text output letting the user know that the player attacked the enemy for 20 damage, and also output how many hit points the enemy has after the attack.
Heal: You, as the player, have the option the heal. So, you need to pass in your own hit points to the function. Inside of the function, you need increase your hit points by 60. Then you need to return your how much health you have back to the main program. As before have some text output letting the user know that you healed yourself for 60hit points, and then output how many total hit points the user has after they healed themselves.
Retreat: If you choose this option, then you run away ending the program. I want you to write a function stating how cowardly your character is and give a little narrative to their shameful flee.
After the user makes their action, the enemy will always attack the user for 30 damage. Make sure you do this in a function, so youll have to input the users hit points and return how many they have left after the attack. Remember to output some text letting the user know whats happening similarly to the attack function mentioned above.
Once the user has won, lost, or retreated, give some text output stating what happened and exit the program.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
