Question: In this assignment, you will refactor the adventure game that you coded in Assignment 2; more specifically, you will write and use a number of

In this assignment, you will refactor the adventure game that you coded in Assignment 2; more specifically, you will write and use a number of custom Java classes. Store your updated Adventure Game code in a file named AdventureGameFinal.java. Store your classes in the files Player.java, Enemy.java, and Weapon.java.

The focus of this assignment is: (1) defining classes; and (2) using objects.

New Features

You will add three new features to the original game.

1. Improved Pacing (Note: this is a featured that you implemented in Assignment 3) Improve the pacing of the game by prompting the player to hit a key after each minion (i.e. Goblin/Skeleton) fight. So when the player battles multiple minions, instead of simulating all the fights and printing all the outputs together, the first fight will be simulated and its results printed, but then the user will be prompted to hit the Enter key to continue to the next fight.

2. A New, Powerful Weapon In addition to the option of choosing a Healing Potion or a Ring of Strength, present the player with a third option: Staff of Power. Weapon Name: Staff of Power Damage: 5 - 9

3. Variable Number of Goblins/Skeletons The number of goblins will be a random number in the range 2 - 5. The number of skeletons will be a random number in the range 3 - 7.

In this assignment, you will refactor the adventure game that you coded

in Assignment 2; more specifically, you will write and use a number

of custom Java classes. Store your updated Adventure Game code in a

SAMPLE OUTPUT OF THE PROGRAM TO BE CREATED: https://www.dropbox.com/s/waim49doggw9zq8/Assignment5-Fall2017-SampleOutput.pdf?dl=0

ORIGINAL AdventureGame SOLUTION: https://paper.dropbox.com/doc/original-AdventureGame-Solution-uxP2gYG8z2Naraz18OB1j?_tk=share_copylink

Player o Attributes name (String) hitPoints (int) strength (int) weapon (Weapon) o Methods Player (name, hitPoints, strength, _weapon) This method is the only constructor of the Player class. Pass to this method a String for the name, an int for the initial hit points, an int for the strength attribute, a reference to a Weapon object for the player's weapon. getName ) getHitPoints increaseHitPoints(_pointInerease) decreaseHitPoints(_pointDecrease) This method should return the name as a String. This method should return the number of hit points. This method will add the number of points passed to the hit points. This method will subtract the number of points passed from the hit points. get strength ( This method should return the value of the strength attribute. increaseStrengthstrengthIncrease) This method will add the passed value to the player's strength attribute setheapon (_weapon) This method will set the player's weapon to be the Weapon object that is passed to the method. attack ( enemy) This method will simulate an attack against the Enemy object that is passed to the method. battleMinion ( enemy) This method will simulate a battle against the Enemy object that is passed to the method, where that object is a goblin or skeleton. battleWizard (_enemy) This method will simulate a battle against the Enemy object that is passed to the method, where that object is a wizard. iDefeated) This method will return true if the player's hit points value is o or less; otherwise, it will return false

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!