Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given abstract Character class file : Solution Description Download the abstract class Character java. Implement all the missing methods of the abstract class, as wel
Given abstract Character class file :
Solution Description Download the abstract class Character java. Implement all the missing methods of the abstract class, as wel as implementing the subclasses Fighter.java, Rogue,java, Wizard.java, and Cleric.java. You will need to create these other classes from scratch Character.java A character has several instance variables relating to the characters stats. They are: 1 name 2. level 3. 4 stats (strength, dexterity, intelligence and wisdom) 4. health 5. isDead Implement the getter and setter methods that have been partially provided Two constructors 1. Assigning String name, int level, int strength, int dexterity, int intelligence, int wisdom. The health variable should start equal to five times the character level, and should never go above that. If the health variable ever goes below 0, isDead should be set to true and the health variable be reset to 0. 2. Only taking in a name and a seed, sets the level to one, sets health to 5, and randomly sets the other non-health stats to a number between 1 and 6 inclusive) by using a Random object using the given seed. Make sure that you generate the other stats in order using this Random object (l.e. strength, then dexterity,then intelligence, then wisdom). You do not have to use explicit constructor invocation (aka constructor delegation) for this. Fighter.java . This class should extend Character and implement all of its abstract methods. . Implement the attack(Character c) method. The attack method of Fighter should decrement the health of the parameter character by 10 plus the fighter's strength variable. If the character's isDead variable is true, this method should do nothing besides printing "Cannot attack a dead character" to the console Implement the Leve Up)method. This method should increase the character's eve by 1, reset the health to it's maximum (5 times the level), increase strength by 2, and all other stats by 1 .a toString) method that returns a string with format Level (evel) fighter named (name) with (strength) strength, (dexterity) dexterity, (intelligence) intelligence, and (wisdom) wisdom." Implement 2 constructors coorresponding with each of the constructors of the superclass. Solution Description Download the abstract class Character java. Implement all the missing methods of the abstract class, as wel as implementing the subclasses Fighter.java, Rogue,java, Wizard.java, and Cleric.java. You will need to create these other classes from scratch Character.java A character has several instance variables relating to the characters stats. They are: 1 name 2. level 3. 4 stats (strength, dexterity, intelligence and wisdom) 4. health 5. isDead Implement the getter and setter methods that have been partially provided Two constructors 1. Assigning String name, int level, int strength, int dexterity, int intelligence, int wisdom. The health variable should start equal to five times the character level, and should never go above that. If the health variable ever goes below 0, isDead should be set to true and the health variable be reset to 0. 2. Only taking in a name and a seed, sets the level to one, sets health to 5, and randomly sets the other non-health stats to a number between 1 and 6 inclusive) by using a Random object using the given seed. Make sure that you generate the other stats in order using this Random object (l.e. strength, then dexterity,then intelligence, then wisdom). You do not have to use explicit constructor invocation (aka constructor delegation) for this. Fighter.java . This class should extend Character and implement all of its abstract methods. . Implement the attack(Character c) method. The attack method of Fighter should decrement the health of the parameter character by 10 plus the fighter's strength variable. If the character's isDead variable is true, this method should do nothing besides printing "Cannot attack a dead character" to the console Implement the Leve Up)method. This method should increase the character's eve by 1, reset the health to it's maximum (5 times the level), increase strength by 2, and all other stats by 1 .a toString) method that returns a string with format Level (evel) fighter named (name) with (strength) strength, (dexterity) dexterity, (intelligence) intelligence, and (wisdom) wisdom." Implement 2 constructors coorresponding with each of the constructors of the superclassStep 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