Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1. (Magician.java, Healer.java, Fighter.java, HeroTester.java) You have been asked to create a new training program for the holographic simulator. The simulation is a bit

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Question 1. (Magician.java, Healer.java, Fighter.java, HeroTester.java) You have been asked to create a new training program for the holographic simulator. The simulation is a bit unusual in that it is designed to simulate a 20th century Earth game called Dungeons and Dragons. Your commanding officer thinks this training simulation will be more fun and engaging than the standard simulations that the crew has been using previous. To create the simulation, consider the abstract "hero" class and the three subclasses shown below. Hero -health -name Heroiname string) Ideal Damage() int +take Damage (damage int) thealadhealth iint) #getlealth()int cetName() String + is Dead() boolean +toString() 1 String Magician Fighter Healer manat int 1 Strength int dexterity int Magician 1) aange) int Fighter) dalaman Healer holant LA Hero -health name + Hero (nane String) +deal Danage 11 int take Danage damage int) thealadditcaith! Ant) get Health : int get Nam : String + Dead(): boolean Losting string A Magician Pighter an int -strength int - dexterity int Magician) #dealan int lightning() int getManant adanan ! int) tot String lighter dealangin Berkait gott enght) ist adastrength todastrength ant) .tostringi string Healer healint getbexterity in addexterity addexterity int) toateng Istring Review the hero class to see how it works (it's in the project/package for you already). Your job is to implement the following subclasses (that will be used in the training simulation). Each of the subclasses has an extra data! field that relates to their specific hero talent. Some help with these special talents and other methods are below. Fighter: -The fighter has an extra data field called Strength and a method called Berserk. When the fighter calls Berserk they do damage equal to 1/3 of their existing health BUT they lose 1/4 of their existing health (round to integer values). Using Berserk costs one Strength point. When a fighter is constructed they have 3 strength points. -the dealDamage() method for the fighter does between 7 and 10 points of damage Magician: -The magician has an extra data field called Mana and a method called Lightning. When the magician calls Lightning the damage they inflict is quadruple what it would have been otherwise. Call the existing dealDamage function and quadruple the value before dealing it to the enemy. Using Lightning costs 1 Mana point and a magician has 4 Mana points to start with -the dealDamage() method for the magician does between 4 and 6 points of damage Healer -The healer has an extra data field called Dexterity and a method called Heal. When the healer calls Heal each LIVING member of the party receives between 5 and 10 health points (not to pass 100) and each receives one point back to their special skill (dexterity, mana or strength). Calling Heal costs 2 Dexterity points and a healer starts with 4 Dexterity. Hint: The heal method determines how many points are restored to each party member's health. Let your main method do the actual work of healing the surviving heroes. the dealDamage() method for the Healer does between 3 and 5 points of damage If your hero is out of special skill points they can only call the base dealDamage() method (i.e., they cannot use their special skill). Once a hero is dead, they can't do anything... because they're dead. In addition to any extra accessors and mutators you should override the toString method for easy printing of the hero state. Write JavaDocs for each of the three subclasses (not the tester). Your command officer does realize that your regular duties might leave you short on time. As a result, they have given you three options for testing the work you completed above. Option 1: (for almost full tester marks) Write a hard-coded tester that does the following: Create an array of three heroes (one of each subclass type) Show that each of the methods works for each hero Create at least one Borg object and have one of your heroes battle the Borg, show at least a couple of interactions. Option 2: (for full tester marks) Write a tester that does the following: Create an array of three heroes (one of each subclass type) Create an array of 10 Borg (already in the project/package) Wage an epic battle between the groups o Heroes attack first in sequence (i.e., hero[0] attacks first, then hero(1) and so on) They attack the Borgin sequence (each hero attacks the first Borg in the array until it is vanquished and then they move onto the next) o Borg attack next in order (Borgo, then Borg 1 and so on) but they attack a random hero. . If a hero dies it cannot attack nor be attacked any further, skip it in the rotation. Same for ex-Borg. At any point, if all the heroes have met their doom, the Borg win. If any of the heroes live and the Borg are all dispatched, then yayl. Your tester should keep you updated on how the battle is progressing by telling you how many Borg are left, what is the state of your heroes after the round, who has died (if anyone) and when there is a win condition. Heroes have a 40% chance of using their special skill. The other 60% is regular damage. If a hero tries to use their special skill but they have no special skill points left, they simply do regular damage. If you're stuck, try a battle between 1 hero and 1 Borg to get the mechanics figured out, then move onto the arrays. Question 1. (Magician.java, Healer.java, Fighter.java, HeroTester.java) You have been asked to create a new training program for the holographic simulator. The simulation is a bit unusual in that it is designed to simulate a 20th century Earth game called Dungeons and Dragons. Your commanding officer thinks this training simulation will be more fun and engaging than the standard simulations that the crew has been using previous. To create the simulation, consider the abstract "hero" class and the three subclasses shown below. Hero -health -name Heroiname string) Ideal Damage() int +take Damage (damage int) thealadhealth iint) #getlealth()int cetName() String + is Dead() boolean +toString() 1 String Magician Fighter Healer manat int 1 Strength int dexterity int Magician 1) aange) int Fighter) dalaman Healer holant LA Hero -health name + Hero (nane String) +deal Danage 11 int take Danage damage int) thealadditcaith! Ant) get Health : int get Nam : String + Dead(): boolean Losting string A Magician Pighter an int -strength int - dexterity int Magician) #dealan int lightning() int getManant adanan ! int) tot String lighter dealangin Berkait gott enght) ist adastrength todastrength ant) .tostringi string Healer healint getbexterity in addexterity addexterity int) toateng Istring Review the hero class to see how it works (it's in the project/package for you already). Your job is to implement the following subclasses (that will be used in the training simulation). Each of the subclasses has an extra data! field that relates to their specific hero talent. Some help with these special talents and other methods are below. Fighter: -The fighter has an extra data field called Strength and a method called Berserk. When the fighter calls Berserk they do damage equal to 1/3 of their existing health BUT they lose 1/4 of their existing health (round to integer values). Using Berserk costs one Strength point. When a fighter is constructed they have 3 strength points. -the dealDamage() method for the fighter does between 7 and 10 points of damage Magician: -The magician has an extra data field called Mana and a method called Lightning. When the magician calls Lightning the damage they inflict is quadruple what it would have been otherwise. Call the existing dealDamage function and quadruple the value before dealing it to the enemy. Using Lightning costs 1 Mana point and a magician has 4 Mana points to start with -the dealDamage() method for the magician does between 4 and 6 points of damage Healer -The healer has an extra data field called Dexterity and a method called Heal. When the healer calls Heal each LIVING member of the party receives between 5 and 10 health points (not to pass 100) and each receives one point back to their special skill (dexterity, mana or strength). Calling Heal costs 2 Dexterity points and a healer starts with 4 Dexterity. Hint: The heal method determines how many points are restored to each party member's health. Let your main method do the actual work of healing the surviving heroes. the dealDamage() method for the Healer does between 3 and 5 points of damage If your hero is out of special skill points they can only call the base dealDamage() method (i.e., they cannot use their special skill). Once a hero is dead, they can't do anything... because they're dead. In addition to any extra accessors and mutators you should override the toString method for easy printing of the hero state. Write JavaDocs for each of the three subclasses (not the tester). Your command officer does realize that your regular duties might leave you short on time. As a result, they have given you three options for testing the work you completed above. Option 1: (for almost full tester marks) Write a hard-coded tester that does the following: Create an array of three heroes (one of each subclass type) Show that each of the methods works for each hero Create at least one Borg object and have one of your heroes battle the Borg, show at least a couple of interactions. Option 2: (for full tester marks) Write a tester that does the following: Create an array of three heroes (one of each subclass type) Create an array of 10 Borg (already in the project/package) Wage an epic battle between the groups o Heroes attack first in sequence (i.e., hero[0] attacks first, then hero(1) and so on) They attack the Borgin sequence (each hero attacks the first Borg in the array until it is vanquished and then they move onto the next) o Borg attack next in order (Borgo, then Borg 1 and so on) but they attack a random hero. . If a hero dies it cannot attack nor be attacked any further, skip it in the rotation. Same for ex-Borg. At any point, if all the heroes have met their doom, the Borg win. If any of the heroes live and the Borg are all dispatched, then yayl. Your tester should keep you updated on how the battle is progressing by telling you how many Borg are left, what is the state of your heroes after the round, who has died (if anyone) and when there is a win condition. Heroes have a 40% chance of using their special skill. The other 60% is regular damage. If a hero tries to use their special skill but they have no special skill points left, they simply do regular damage. If you're stuck, try a battle between 1 hero and 1 Borg to get the mechanics figured out, then move onto the arrays

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced Database Systems For Integration Of Media And User Environments 98

Authors: Yahiko Kambayashi, Akifumi Makinouchi, Shunsuke Uemura, Katsumi Tanaka, Yoshifumi Masunaga

1st Edition

9810234368, 978-9810234362

More Books

Students also viewed these Databases questions

Question

1+6+11+16++(5n4)=2n(5n3)

Answered: 1 week ago

Question

Determine miller indices of plane A Z a/2 X a/2 a/2 Y

Answered: 1 week ago

Question

Why do mergers and acquisitions have such an impact on employees?

Answered: 1 week ago

Question

2. Describe the functions of communication

Answered: 1 week ago