Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE HELP sample of the output below 1 You are provided with Main.java that is a client for this program. 2 **You will create THREE
PLEASE HELP
1 You are provided with Main.java that is a client for this program. 2 **You will create THREE files-- GameCharacter.java, Shieldmaiden.java, and Dragon.java** 4 5 **First:** You must Create an interface called GameCharacter WITH JUST PROTOTYPES, NO IMPLEMENTATIONS 6 7 A GameCharacter has a few functions associated with it 8 9 1) takeHit: decreases the character's health. It should return an int representing damage taken (hit points) 10 11 2) heal: increases the character's health. Should return an int representing amount healed (i.e. hit points) 12 3) getHealth: returns the total current health the character has (i.e. hit points) 14 15 4) isAlive: determines if the character is dead. Should return true if the character is alive, and false if it is dead. 17 **Second: ** Then create two classes. One should be named Dragon, and the other should be named Shieldmaiden (i.e. warrior) that IMPLEMENT Game Character. Give them each private variables for health. The constructor should take in an initial amount to set health to. 18 19 **Third:** Implement the interface functions for these two classes (Dragon and Shieldmaiden). To make the game more interesting, the dragon's takeHit should hurt the dragon a random number from 10 to 20 inclusive and the Shieldmaiden's takeHit should hurt the shieldmaiden a random number from 15 to 25 inclusive. Furthermore, the dragon's heal should only heal the dragon a random number from 1 to 10 inclusive but the Shieldmaiden's heal should heal the Shieldmaiden a random number from 8 to 20 inclusive. A character is dead when they get negative health. 20 21 **Fourth:** There are unit tests that check for all of these requirements. Try your best to pass all the test cases ! 22 24 23 A sample output of this game is below (note all the writing is supplied by Main.java) 25 **Jenny the Dragon and Joan of Arc meet a dusty mountaintop overlooking a villa \*\* 26 \*\* Joans Hit Points: 100 Dragon's Hit Points: 100 \*\* 27 Dragon Attacks! Joan takes: 23 Damage! 28 Joan Heals! 16 health restored 29 \*\* Joans Hit Points: 93 Dragon's Hit Points: 100 \*\* 30 Dragon Attacks! Joan takes: 18 Damage! 31 Joan Heals! 13 health restored 32 \*\* Joans Hit Points: 88 Dragon's Hit Points: 100 \*\* 33 Joan Attacks! Dragon takes: 16 Damage! 34 Dragon Heals! 9 health restored 35 \*\* Joans Hit Points: 88 Dragon's Hit Points: 93 \*\* 36 Joan Attacks! Dragon takes: 15 Damage! 37 Dragon Heals! 6 health restored 38 \*\* Joans Hit Points: 88 Dragon's Hit Points: 84 \*\* 39 Dragon Attacks! Joan takes: 18 Damage! 10 Joan Heals! 20 health restored #1 \*\* Joans Hit Points: 90 Dragon's Hit Points: 84 \*\* 12 Dragon Attacks! Joan takes: 20 Damage! 73 Joan Heals! 14 health restored 14 \*\* Joans Hit Points: 84 Dragon's Hit Points: 84 \*\* 75 Joan Attacks! Dragon takes: 17 Damage sample of the output below
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started