Question: Programming a little dragon-fighting game in C 13. (60 Points) C Write a program for a simple computer game according to the following information. When

Programming a little dragon-fighting game in C

Programming a little dragon-fighting game in C 13. (60 Points) C Write

13. (60 Points) C Write a program for a simple computer game according to the following information. When run, the game should show the following intro "You are a brave warrior and have lost your way through the mystic mountains. You are in dire need of shelter from the storm that threatens to kill you Suddenly, you see a cave in the distance and rush inside to save yourself Just as you start to warm up, you realize that you are not alone in the cave. You discover that you are in the dragon's lair! The dragon is happy to see that dinner has arrived You only have one choice. Defeat the dragon or die." At this point, the user can chose between two weapons to attack the dragon: a magic arrow or an ice spear. The weapons have the following statistics: Range of possible damage Chance of a successful attack Magic Arrow 20 60 75% Ice Spear 50 100 50% After selecting a weapon, the program will determine if the user's attack is successful. If it is, the program will select an amount of damage from the possible range of damage for that weapon and inflict that damage to the dragon. Both the user's character and the dragon begin with 250 health points. If the dragon is still alive, the dragon then attacks according to the following stats. Again, the program must first determine if the attack is successful, then how much damage is given. Range of possible damage Chance of a successful attack Dragon's Fire 40-60 15% If the user's character is still alive after the dragon's attack, they get to choose their weapon again for the next attack. The program continues to run until either the user's character or the dragon is dead. Tip: Assume that the rand() function will produce a uniform distribution of numbers. 13. (60 Points) C Write a program for a simple computer game according to the following information. When run, the game should show the following intro "You are a brave warrior and have lost your way through the mystic mountains. You are in dire need of shelter from the storm that threatens to kill you Suddenly, you see a cave in the distance and rush inside to save yourself Just as you start to warm up, you realize that you are not alone in the cave. You discover that you are in the dragon's lair! The dragon is happy to see that dinner has arrived You only have one choice. Defeat the dragon or die." At this point, the user can chose between two weapons to attack the dragon: a magic arrow or an ice spear. The weapons have the following statistics: Range of possible damage Chance of a successful attack Magic Arrow 20 60 75% Ice Spear 50 100 50% After selecting a weapon, the program will determine if the user's attack is successful. If it is, the program will select an amount of damage from the possible range of damage for that weapon and inflict that damage to the dragon. Both the user's character and the dragon begin with 250 health points. If the dragon is still alive, the dragon then attacks according to the following stats. Again, the program must first determine if the attack is successful, then how much damage is given. Range of possible damage Chance of a successful attack Dragon's Fire 40-60 15% If the user's character is still alive after the dragon's attack, they get to choose their weapon again for the next attack. The program continues to run until either the user's character or the dragon is dead. Tip: Assume that the rand() function will produce a uniform distribution of numbers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!