Who can help me with the following programming problem?

User Generated

Ohea2345

Programming

Description

Unformatted Attachment Preview

1.0 Description: This program simulates the battle between two character classes. In the HaveBattle class we are having a battle between a Mage and a Warrior. You are to write the supporting code using inheritance and a touch of polymorphism. 1.1 Characters There are two types of CharacterClasses, Warriors and Mages. Each CharacterClass has a currentHP, maxHP. Warriors also have an implicit armor that offsets 10 damage. CurrentHP is the amount of health the character currently has and the maximumHP is the amount of hit points a fully health character could have. All characters can deal damage (double dealDamage();) which calculated how much damage they will inflict on another player using their abilities and wepaons or spells. and they can receive damage (void receiveDamage(double amount);) A character is alive (boolean isAlive()) when the currentHp is greater than zero. A character can also heal (void addHealth(double newAmount)) this adds the amount of healing up to maximum HP. There are two types of Characters. Mages and Warriors. 1.1.1 Mage Mages have a spell book, and they also have mana (which is the amount of spell power they have). Mana can be between a minimum of 0 and a maximum of 100. They also regenerate mana (and hp's) if they do nothing at an amount (for the sake of this example we can fix this to 25 mana units and 10 hp's and will continue to accumulate as long as the magician rests (which they can do during a battle by doing nothing for a turn). Mages can add spells to their spell book (void addSpell(Spell newSpell)). They can also throw their spell book away and get a new one (void newSpellBook()). Most importantly when in battle and the dealDamage method is called it will returns how much damage is done to the enemy by the mage. In the case of the mage, the mage has three options firstly if the mage's mana is < 10 they will rest for the turn (which does/returns zero damage). If the mage is < 30 hp's they will stop and cast a random healing spell from their spell book. If they have no healing spells they should rest which will give them back 10 hps (as well as the mana regeneration) Else the mage will attack by selecting a random TargetedSpell spell from their spellbook and casting that return the damage it inflicts on the target. Note that while dealing damage the sound the spell makes is printed. 1.1.12 Warrior Warriors are simpler they can have up to 5 weapons and are born with a weapon in their hand. Like the mage they will deal damage but they are unencumbered by magic and have a simpler algorithm for fighting. Simply they pick a random weapon and try to kill the enemy with it. Again the sound the weapon makes is printed. 1.2 Effector All spells and weapons affect a character. They have a name, a minimum effect and a maximum effect. When an effect occurs it is randomly selected between minimum and maximum effect. All Effector's make a sound. 1.2.1 Spell Spells are a type of effector. There are two types of spells "HealingSpell" and "TargetedSpell" They define the different types of spells that can be cast. Each of these types have subclasses which are the Fireball, IceStorm and MinorHealing 1.2.1.1 TargetedSpell For the sake of the exercise there should be at least 2 types of TargetedSpells Fireball • • • • Mana Cost 15 Minimum Effect 40 Maximum Effect 50 Sound:Crackle Boom IceStorm • • • • Mana Cost 20 Minimum Effect 50 Maximum Effect 60 Sound:Chatter Boom 1.2.1.2 Healing For the sake of the exercise there should be at least 1 types of Healing Spell MinorHealing • • • • Mana Cost 20 Minimum Effect 40 Maximum Effect 40 Sound:Warble 1.2.2 Weapons Weapons are another type of effector. All weapons have a calculateDamage method to return the amount of damage the weapon did between minimum and maximum effect. For the sake of the exercise there should be at least two types of weapon. Axe • • • Minimum Effect 15 Maximum Effect 25 Sound:Clink Sword • • • Minimum Effect 1 Maximum Effect 50 Sound:Wosh 1.3 Spellbook The mage holds a spellbook which each page contains one spell. Spellbooks contain both targetedSpells and Healing spells. Spellbook has two methods (getTargetedSpells and getHealingSpells) which returns a list of all the spells of that type that are in the spell book. This is necessary so that the mage can choose from either offensive or defensive spells during the fight. To save you time this has been supplied to you below. 1.4 Log To keep a record of these epic battles there is a centralized logging program for your fight. This class will either output to the screen or to the disk depending on whether a method is called. This class is supplied to you in skeleton below with only the screen output working. You should extend this to allow the HaveBattle method call write to disk or write to screen methods. 2 Your Mission You are to take the description above and build the software to implement the code to run the battle. 2.1 Requirements Here are a list of requirements for your assignment. • • • • • • • • • • • • HaveBattle class must work. This is designed to use your code. You must use inheritance where appropriate Push as much code up the inheritance structure as possible. You must use abstract where appropriate You should write some testing to make sure your assignment works. You don't need to use junit however, whatever you write should do reasonable job of making sure your assignment works. A static method for generating a random number in a range is supplied in the effector class skeleton. Feel free to use it. Only import the needed classes in each class Jpg image of your inheritance diagram called inheritance.jpg included in the project txt file with your testing outline called testing.txt Class javadoc, Method javadoc, Instance javadoc and method body commenting 16 classes should be included in your workspace. Don't panic quite a few of them are only a few lines of code. Whatever you submit it should be compilable and runnable even if it doesn't do everything that is required. 2.2 Suggested Order This is a suggested approach to doing your assignment. 1. Create the packages (base package of unisa.pf.assign02. then subpackages base, characters, spells, 2. testing, util and weapons). 3. Draw up the inheritance structure using this document and supplied code to give you clues. 4. Put the supplied code into classes into the appropriate packages. 5. Get the code commented and tested 6. Create the missing files and get it to compile (even with empty classes). 7. Get the code commented and tested 8. Work on the log.java file (this will work independantly). 9. Get the code commented and tested 10. Write missing methods so that the HaveBattle class will compile. 11. Get the code commented and tested 12. Get the program so it will call dealDamage and receiveDamage. 13. Get the code commented and tested 14. Get the dealDamage and receiveDamage methods to work (trickiest part) 15. Get the code commented and tested 2.3 Testing You are to write a test outline of what you would test and how you would test it in your program. It is not necessary to code this just include a textfile (testing.txt). You should put in sections on each class and under each class each method and the test cases you would test. You do not need to do junit testing for this assignment (I think you have enough to do without writing all that). 3.0 Marking This assignment will be marked on the following independant criteria Number of Marks 10 10 5 15 15 10 20 15 Description Commenting Style Inheritance Diagram Inheritance Code Logging System Implementation Other Code doBattle and receiveDamage methods Testing Design If the code doesn't compile/work the maximum marks you can receive is 40% 4.0 Supplied Code Here is some code to get you going. You must use this code and you should also fully comment the code. 4.1 Spellbook.java (this code only needs commenting) package unisa.pf.assign02.spells; import java.util.Arrays; import java.util.LinkedList; public class SpellBook { LinkedList pages = new LinkedList(); public Spell[] getTargetedSpells() { LinkedList offensive = new LinkedList(); for (Spell i: pages) { if(i instanceof TargetedSpell) { offensive.add(i); } } Spell[] returnVal = new Spell[offensive.size()]; for(int i=0;iwith Weapon:Sword for 37.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 37 to 37. Remaining hp is 66 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 42.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 42 to 32. Remaining hp is 121 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 23.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 23 to 23. Remaining hp is 43 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 40.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 40 to 30. Remaining hp is 91 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 20.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 20 to 20. Remaining hp is 23 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 23 HP to 63 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(0) uses armor to reduce damage from 0 to 0. Remaining hp is 91 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 19 to 19. Remaining hp is 44 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 53.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 53 to 43. Remaining hp is 48 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 15.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 15 to 15. Remaining hp is 29 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(0) uses armor to reduce damage from 0 to 0. Remaining hp is 48 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 17.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 17 to 17. Remaining hp is 22 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 22 HP to 62 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(0) uses armor to reduce damage from 0 to 0. Remaining hp is 48 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 18 to 18. Remaining hp is 44 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 43 to 33. Remaining hp is 15 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 9.0 hp of damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage f rom 9 to 9. Remaining hp is 35 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(0) uses armor to reduce damage from 0 to 0. Remaining hp is 15 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 50.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 50 to 50. Remaining hp is 0 Warrior Ashen-Shugar Ver(0) Wins [[Warrior [weapons=[Axe [soundItMakes()=:Clink, getName()=Weapon:Axe, getM inimumImpact()=15.0, getMaximumImpact()=25.0], Sword [soundItMakes()=:Wosh , getName()=Weapon:Sword, getMinimumImpact()=1.0, getMaximumImpact()=50.0] , null, null, null], numberOfWeapons=2]]] **************************************************** ****** Round 2 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 48.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 48 to 38. Remaining hp is 202 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 20.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 20 to 20. Remaining hp is 100 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 56.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 56 to 46. Remaining hp is 156 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 20.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(1) uses armor to reduce damage from 20 to 20. Remaining hp is 80 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 44.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 44 to 34. Remaining hp is 122 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 18 to 18. Remaining hp is 62 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 43 to 33. Remaining hp is 89 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 22 to 22. Remaining hp is 40 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 43 to 33. Remaining hp is 56 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 18 to 18. Remaining hp is 22 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 22 HP to 62 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(1) uses armor to reduce damage from 0 to 0. Remaining hp is 56 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 32.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(1) uses armor to reduce damage from 32 to 32. Remaining hp is 30 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 41.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 41 to 31. Remaining hp is 25 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 22 to 22. Remaining hp is 8 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(1) uses armor to reduce damage from 0 to 0. Remaining hp is 25 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 22 to 22. Remaining hp is 0 Warrior Ashen-Shugar Ver(1) Wins [[Warrior [weapons=[Axe [soundItMakes()=:Clink, getName()=Weapon:Axe, getM inimumImpact()=15.0, getMaximumImpact()=25.0], Sword [soundItMakes()=:Wosh , getName()=Weapon:Sword, getMinimumImpact()=1.0, getMaximumImpact()=50.0] , null, null, null], numberOfWeapons=2]]] **************************************************** ****** Round 3 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 47.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 47 to 37. Remaining hp is 203 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 3.0 hp of damage:][Sound::Wosh]Macros the Black Ver(2) uses armor to reduce damage f rom 3 to 3. Remaining hp is 117 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 46.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 46 to 36. Remaining hp is 167 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 16.0 hp of damage:][Sound::Clink]Macros the Black Ver(2) uses armor to reduce damage from 16 to 16. Remaining hp is 101 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 59.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 59 to 49. Remaining hp is 118 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 8.0 hp of damage:][Sound::Wosh]Macros the Black Ver(2) uses armor to reduce damage f rom 8 to 8. Remaining hp is 93 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 55.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 55 to 45. Remaining hp is 73 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 26.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(2) uses armor to reduce damage from 26 to 26. Remaining hp is 67 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 57.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 57 to 47. Remaining hp is 26 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(2) uses armor to reduce damage from 19 to 19. Remaining hp is 48 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 55.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 55 to 45. Remaining hp is 0 [[Warrior Turn]][Warrior Action: Warrior has died and chooses to skip turn ] Macros the Black Ver(2) uses armor to reduce damage from 0 to 0. Remaining hp is 48 Mage Macros the Black Ver(2) Wins [[Mage [sb=SpellBook [Fireball [name=Spell:Fireball, manaCost=15.0, minimu mImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=2 0.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Mino r Healing, manaCost=10.0, minimumImpact=40.0, maximumImpact=40.0]], mana=0 .0, getName()=Macros the Black Ver(2), getHp()=48.0, getMaxHp()=120.0]]] **************************************************** ****** Round 4 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 52.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 52 to 42. Remaining hp is 198 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 14.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage from 14 to 14. Remaining hp is 106 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 45.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 45 to 35. Remaining hp is 163 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 10.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage from 10 to 10. Remaining hp is 96 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 59.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 59 to 49. Remaining hp is 114 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 3.0 hp of damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage f rom 3 to 3. Remaining hp is 93 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 43 to 33. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 23.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 23 to 23. Remaining hp is 70 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 45.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 45 to 35. Remaining hp is 46 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 26.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage from 26 to 26. Remaining hp is 44 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 50.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 50 to 40. Remaining hp is 6 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 25.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 25 to 25. Remaining hp is 19 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(3) uses armor to reduce damage from 0 to 0. Remaining hp is 6 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 15.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 15 to 15. Remaining hp is 14 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 14 HP to 54 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(3) uses armor to reduce damage from 0 to 0. Remaining hp is 6 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 16.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 16 to 16. Remaining hp is 38 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 50.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 50 to 40. Remaining hp is 0 [[Warrior Turn]][Warrior Action: Warrior has died and chooses to skip turn ] Macros the Black Ver(3) uses armor to reduce damage from 0 to 0. Remaining hp is 38 Mage Macros the Black Ver(3) Wins [[Mage [sb=SpellBook [Fireball [name=Spell:Fireball, manaCost=15.0, minimu mImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=2 0.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Mino r Healing, manaCost=10.0, minimumImpact=40.0, maximumImpact=40.0]], mana=0 .0, getName()=Macros the Black Ver(3), getHp()=38.0, getMaxHp()=120.0]]] **************************************************** ****** Round 5 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 53.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 53 to 43. Remaining hp is 197 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 49.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 49 to 49. Remaining hp is 71 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 47.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 47 to 37. Remaining hp is 160 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 42.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 42 to 42. Remaining hp is 29 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 29 HP to 69 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 160 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 50.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 50 to 50. Remaining hp is 19 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 19 HP to 59 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 160 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 22 to 22. Remaining hp is 37 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 41.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 41 to 31. Remaining hp is 129 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 20.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 20 to 20. Remaining hp is 17 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 17 HP to 57 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 129 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 18 to 18. Remaining hp is 39 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 58.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 58 to 48. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 25.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 25 to 25. Remaining hp is 14 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 18.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 18 to 18. Remaining hp is 6 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 6 HP to 4 6 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 19 to 19. Remaining hp is 27 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 27 HP to 67 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 24.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 24 to 24. Remaining hp is 43 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 15.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 15 to 15. Remaining hp is 38 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 47.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 47 to 37. Remaining hp is 44 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 17.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 17 to 17. Remaining hp is 21 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 21 HP to 61 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 44 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 15.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 15 to 15. Remaining hp is 46 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 44 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 10.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 10 to 10. Remaining hp is 46 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 45.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 45 to 35. Remaining hp is 9 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 24.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 24 to 24. Remaining hp is 22 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 22 HP to 62 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 9 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 1.0 hp of damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage f rom 1 to 1. Remaining hp is 61 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 9 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 19 to 19. Remaining hp is 52 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 49.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 49 to 39. Remaining hp is 0 [[Warrior Turn]][Warrior Action: Warrior has died and chooses to skip turn ] Macros the Black Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 52 Mage Macros the Black Ver(4) Wins [[Mage [sb=SpellBook [Fireball [name=Spell:Fireball, manaCost=15.0, minimu mImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=2 0.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Mino r Healing, manaCost=10.0, minimumImpact=40.0, maximumImpact=40.0]], mana=1 5.0, getName()=Macros the Black Ver(4), getHp()=52.0, getMaxHp()=120.0]]] **************************************************** Mage :3 Warrior :2 Killed Each Other :0 Debug Structure Code Below X Deal Damage [Warrior Action: Attacks ->with Weapon:Sword for 32.0 hp of damage:][Sound ::Wosh] X Receive Damage Mym uses armor to reduce damage from 999 to 989. Remaining hp is 10 W Receive Damage Jon-Tom uses armor to reduce damage from 999 to 999. Remaining hp is 0Magi cian Action: Mage has died and chooses to skip turn 1.0 Description: This program simulates the battle between two character classes. In the HaveBattle class we are having a battle between a Mage and a Warrior. You are to write the supporting code using inheritance and a touch of polymorphism. In eclipse!!! 1.1 Characters There are two types of CharacterClasses, Warriors and Mages. Each CharacterClass has a currentHP, maxHP. Warriors also have an implicit armor that offsets 10 damage. CurrentHP is the amount of health the character currently has and the maximumHP is the amount of hit points a fully health character could have. All characters can deal damage (double dealDamage();) which calculated how much damage they will inflict on another player using their abilities and wepaons or spells. and they can receive damage (void receiveDamage(double amount);) A character is alive (boolean isAlive()) when the currentHp is greater than zero. A character can also heal (void addHealth(double newAmount)) this adds the amount of healing up to maximum HP. There are two types of Characters. Mages and Warriors. 1.1.1 Mage Mages have a spell book, and they also have mana (which is the amount of spell power they have). Mana can be between a minimum of 0 and a maximum of 100. They also regenerate mana (and hp's) if they do nothing at an amount (for the sake of this example we can fix this to 25 mana units and 10 hp's and will continue to accumulate as long as the magician rests (which they can do during a battle by doing nothing for a turn). Mages can add spells to their spell book (void addSpell(Spell newSpell)). They can also throw their spell book away and get a new one (void newSpellBook()). Most importantly when in battle and the dealDamage method is called it will returns how much damage is done to the enemy by the mage. In the case of the mage, the mage has three options firstly if the mage's mana is < 10 they will rest for the turn (which does/returns zero damage). If the mage is < 30 hp's they will stop and cast a random healing spell from their spell book. If they have no healing spells they should rest which will give them back 10 hps (as well as the mana regeneration) Else the mage will attack by selecting a random TargetedSpell spell from their spellbook and casting that return the damage it inflicts on the target. Note that while dealing damage the sound the spell makes is printed. 1.1.12 Warrior Warriors are simpler they can have up to 5 weapons and are born with a weapon in their hand. Like the mage they will deal damage but they are unencumbered by magic and have a simpler algorithm for fighting. Simply they pick a random weapon and try to kill the enemy with it. Again the sound the weapon makes is printed. 1.2 Effector All spells and weapons affect a character. They have a name, a minimum effect and a maximum effect. When an effect occurs it is randomly selected between minimum and maximum effect. All Effector's make a sound. 1.2.1 Spell Spells are a type of effector. There are two types of spells "HealingSpell" and "TargetedSpell" They define the different types of spells that can be cast. Each of these types have subclasses which are the Fireball, IceStorm and MinorHealing 1.2.1.1 TargetedSpell For the sake of the exercise there should be at least 2 types of TargetedSpells Fireball • • • • Mana Cost 15 Minimum Effect 40 Maximum Effect 50 Sound:Crackle Boom IceStorm • • • • Mana Cost 20 Minimum Effect 50 Maximum Effect 60 Sound:Chatter Boom 1.2.1.2 Healing For the sake of the exercise there should be at least 1 types of Healing Spell MinorHealing • • • • Mana Cost 20 Minimum Effect 40 Maximum Effect 40 Sound:Warble 1.2.2 Weapons Weapons are another type of effector. All weapons have a calculateDamage method to return the amount of damage the weapon did between minimum and maximum effect. For the sake of the exercise there should be at least two types of weapon. Axe • • • Minimum Effect 15 Maximum Effect 25 Sound:Clink Sword • • • Minimum Effect 1 Maximum Effect 50 Sound:Wosh 1.3 Spellbook The mage holds a spellbook which each page contains one spell. Spellbooks contain both targetedSpells and Healing spells. Spellbook has two methods (getTargetedSpells and getHealingSpells) which returns a list of all the spells of that type that are in the spell book. This is necessary so that the mage can choose from either offensive or defensive spells during the fight. To save you time this has been supplied to you below. 1.4 Log To keep a record of these epic battles there is a centralized logging program for your fight. This class will either output to the screen or to the disk depending on whether a method is called. This class is supplied to you in skeleton below with only the screen output working. You should extend this to allow the HaveBattle method call write to disk or write to screen methods. 2 Your Mission You are to take the description above and build the software to implement the code to run the battle. 2.1 Requirements Here are a list of requirements for your assignment. • • • • • • • • • • • • HaveBattle class must work. This is designed to use your code. You must use inheritance where appropriate Push as much code up the inheritance structure as possible. You must use abstract where appropriate You should write some testing to make sure your assignment works. You don't need to use junit however, whatever you write should do reasonable job of making sure your assignment works. A static method for generating a random number in a range is supplied in the effector class skeleton. Feel free to use it. Only import the needed classes in each class Jpg image of your inheritance diagram called inheritance.jpg included in the project txt file with your testing outline called testing.txt Class javadoc, Method javadoc, Instance javadoc and method body commenting 16 classes should be included in your workspace. Don't panic quite a few of them are only a few lines of code. Whatever you submit it should be compilable and runnable even if it doesn't do everything that is required. 2.2 Suggested Order This is a suggested approach to doing your assignment. 1. Create the packages (base package of unisa.pf.assign02. then subpackages base, characters, spells, 2. testing, util and weapons). 3. Draw up the inheritance structure using this document and supplied code to give you clues. 4. Put the supplied code into classes into the appropriate packages. 5. Get the code commented and tested 6. Create the missing files and get it to compile (even with empty classes). 7. Get the code commented and tested 8. Work on the log.java file (this will work independantly). 9. Get the code commented and tested 10. Write missing methods so that the HaveBattle class will compile. 11. Get the code commented and tested 12. Get the program so it will call dealDamage and receiveDamage. 13. Get the code commented and tested 14. Get the dealDamage and receiveDamage methods to work (trickiest part) 15. Get the code commented and tested 2.3 Testing You are to write a test outline of what you would test and how you would test it in your program. It is not necessary to code this just include a textfile (testing.txt). You should put in sections on each class and under each class each method and the test cases you would test. You do not need to do junit testing for this assignment (I think you have enough to do without writing all that). 3.0 Marking This assignment will be marked on the following independant criteria Number of Marks 10 10 5 15 15 10 20 15 Description Commenting Style Inheritance Diagram Inheritance Code Logging System Implementation Other Code doBattle and receiveDamage methods Testing Design If the code doesn't compile/work the maximum marks you can receive is 40% 4.0 Supplied Code Here is some code to get you going. You must use this code and you should also fully comment the code. 4.1 Spellbook.java (this code only needs commenting) package unisa.pf.assign02.spells; import java.util.Arrays; import java.util.LinkedList; public class SpellBook { LinkedList pages = new LinkedList(); public Spell[] getTargetedSpells() { LinkedList offensive = new LinkedList(); for (Spell i: pages) { if(i instanceof TargetedSpell) { offensive.add(i); } } Spell[] returnVal = new Spell[offensive.size()]; for(int i=0;iwith Weapon:Sword for 37.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 37 to 37. Remaining hp is 66 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 42.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 42 to 32. Remaining hp is 121 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 23.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 23 to 23. Remaining hp is 43 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 40.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 40 to 30. Remaining hp is 91 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 20.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 20 to 20. Remaining hp is 23 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 23 HP to 63 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(0) uses armor to reduce damage from 0 to 0. Remaining hp is 91 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 19 to 19. Remaining hp is 44 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 53.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 53 to 43. Remaining hp is 48 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 15.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 15 to 15. Remaining hp is 29 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(0) uses armor to reduce damage from 0 to 0. Remaining hp is 48 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 17.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 17 to 17. Remaining hp is 22 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 22 HP to 62 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(0) uses armor to reduce damage from 0 to 0. Remaining hp is 48 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(0) uses armor to reduce damage from 18 to 18. Remaining hp is 44 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce da mage from 43 to 33. Remaining hp is 15 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 9.0 hp of damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage f rom 9 to 9. Remaining hp is 35 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(0) uses armor to reduce damage from 0 to 0. Remaining hp is 15 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 50.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 50 to 50. Remaining hp is 0 Warrior Ashen-Shugar Ver(0) Wins [[Warrior [weapons=[Axe [soundItMakes()=:Clink, getName()=Weapon:Axe, getM inimumImpact()=15.0, getMaximumImpact()=25.0], Sword [soundItMakes()=:Wosh , getName()=Weapon:Sword, getMinimumImpact()=1.0, getMaximumImpact()=50.0] , null, null, null], numberOfWeapons=2]]] **************************************************** ****** Round 2 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 48.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 48 to 38. Remaining hp is 202 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 20.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 20 to 20. Remaining hp is 100 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 56.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 56 to 46. Remaining hp is 156 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 20.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(1) uses armor to reduce damage from 20 to 20. Remaining hp is 80 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 44.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 44 to 34. Remaining hp is 122 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 18 to 18. Remaining hp is 62 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 43 to 33. Remaining hp is 89 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 22 to 22. Remaining hp is 40 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 43 to 33. Remaining hp is 56 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 18 to 18. Remaining hp is 22 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 22 HP to 62 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(1) uses armor to reduce damage from 0 to 0. Remaining hp is 56 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 32.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(1) uses armor to reduce damage from 32 to 32. Remaining hp is 30 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 41.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce da mage from 41 to 31. Remaining hp is 25 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 22 to 22. Remaining hp is 8 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(1) uses armor to reduce damage from 0 to 0. Remaining hp is 25 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(1) uses armor to reduce damage from 22 to 22. Remaining hp is 0 Warrior Ashen-Shugar Ver(1) Wins [[Warrior [weapons=[Axe [soundItMakes()=:Clink, getName()=Weapon:Axe, getM inimumImpact()=15.0, getMaximumImpact()=25.0], Sword [soundItMakes()=:Wosh , getName()=Weapon:Sword, getMinimumImpact()=1.0, getMaximumImpact()=50.0] , null, null, null], numberOfWeapons=2]]] **************************************************** ****** Round 3 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 47.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 47 to 37. Remaining hp is 203 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 3.0 hp of damage:][Sound::Wosh]Macros the Black Ver(2) uses armor to reduce damage f rom 3 to 3. Remaining hp is 117 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 46.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 46 to 36. Remaining hp is 167 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 16.0 hp of damage:][Sound::Clink]Macros the Black Ver(2) uses armor to reduce damage from 16 to 16. Remaining hp is 101 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 59.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 59 to 49. Remaining hp is 118 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 8.0 hp of damage:][Sound::Wosh]Macros the Black Ver(2) uses armor to reduce damage f rom 8 to 8. Remaining hp is 93 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 55.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 55 to 45. Remaining hp is 73 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 26.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(2) uses armor to reduce damage from 26 to 26. Remaining hp is 67 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 57.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 57 to 47. Remaining hp is 26 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(2) uses armor to reduce damage from 19 to 19. Remaining hp is 48 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 55.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce da mage from 55 to 45. Remaining hp is 0 [[Warrior Turn]][Warrior Action: Warrior has died and chooses to skip turn ] Macros the Black Ver(2) uses armor to reduce damage from 0 to 0. Remaining hp is 48 Mage Macros the Black Ver(2) Wins [[Mage [sb=SpellBook [Fireball [name=Spell:Fireball, manaCost=15.0, minimu mImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=2 0.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Mino r Healing, manaCost=10.0, minimumImpact=40.0, maximumImpact=40.0]], mana=0 .0, getName()=Macros the Black Ver(2), getHp()=48.0, getMaxHp()=120.0]]] **************************************************** ****** Round 4 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 52.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 52 to 42. Remaining hp is 198 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 14.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage from 14 to 14. Remaining hp is 106 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 45.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 45 to 35. Remaining hp is 163 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 10.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage from 10 to 10. Remaining hp is 96 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 59.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 59 to 49. Remaining hp is 114 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 3.0 hp of damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage f rom 3 to 3. Remaining hp is 93 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 43 to 33. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 23.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 23 to 23. Remaining hp is 70 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 45.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 45 to 35. Remaining hp is 46 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 26.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(3) uses armor to reduce damage from 26 to 26. Remaining hp is 44 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 50.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 50 to 40. Remaining hp is 6 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 25.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 25 to 25. Remaining hp is 19 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(3) uses armor to reduce damage from 0 to 0. Remaining hp is 6 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 15.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 15 to 15. Remaining hp is 14 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 14 HP to 54 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(3) uses armor to reduce damage from 0 to 0. Remaining hp is 6 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 16.0 hp of damage:][Sound::Clink]Macros the Black Ver(3) uses armor to reduce damage from 16 to 16. Remaining hp is 38 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 50.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce da mage from 50 to 40. Remaining hp is 0 [[Warrior Turn]][Warrior Action: Warrior has died and chooses to skip turn ] Macros the Black Ver(3) uses armor to reduce damage from 0 to 0. Remaining hp is 38 Mage Macros the Black Ver(3) Wins [[Mage [sb=SpellBook [Fireball [name=Spell:Fireball, manaCost=15.0, minimu mImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=2 0.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Mino r Healing, manaCost=10.0, minimumImpact=40.0, maximumImpact=40.0]], mana=0 .0, getName()=Macros the Black Ver(3), getHp()=38.0, getMaxHp()=120.0]]] **************************************************** ****** Round 5 ******** +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 53.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 53 to 43. Remaining hp is 197 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 49.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 49 to 49. Remaining hp is 71 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 47.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 47 to 37. Remaining hp is 160 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 42.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 42 to 42. Remaining hp is 29 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 29 HP to 69 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 160 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 50.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 50 to 50. Remaining hp is 19 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 19 HP to 59 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 160 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 22.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 22 to 22. Remaining hp is 37 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 41.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 41 to 31. Remaining hp is 129 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 20.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 20 to 20. Remaining hp is 17 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 17 HP to 57 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 129 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 18.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 18 to 18. Remaining hp is 39 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 58.0 HP o f damage:][Sound::Chatter Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 58 to 48. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 25.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 25 to 25. Remaining hp is 14 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 18.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 18 to 18. Remaining hp is 6 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 6 HP to 4 6 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 19 to 19. Remaining hp is 27 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 27 HP to 67 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 24.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 24 to 24. Remaining hp is 43 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 81 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 15.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 15 to 15. Remaining hp is 38 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 47.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 47 to 37. Remaining hp is 44 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 17.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 17 to 17. Remaining hp is 21 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 21 HP to 61 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 44 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 15.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 15 to 15. Remaining hp is 46 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 44 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 10.0 hp o f damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage from 10 to 10. Remaining hp is 46 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 45.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 45 to 35. Remaining hp is 9 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 24.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 24 to 24. Remaining hp is 22 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Health -)Health Changed From 22 HP to 62 HP with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-Shugar Ve r(4) uses armor to reduce damage from 0 to 0. Remaining hp is 9 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 1.0 hp of damage:][Sound::Wosh]Macros the Black Ver(4) uses armor to reduce damage f rom 1 to 1. Remaining hp is 61 +++New Turn+++ [[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Re generated 10.0Ashen-Shugar Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 9 [[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Axe for 19.0 hp of damage:][Sound::Clink]Macros the Black Ver(4) uses armor to reduce damage from 19 to 19. Remaining hp is 52 +++New Turn+++ [[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 49.0 HP o f damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce da mage from 49 to 39. Remaining hp is 0 [[Warrior Turn]][Warrior Action: Warrior has died and chooses to skip turn ] Macros the Black Ver(4) uses armor to reduce damage from 0 to 0. Remaining hp is 52 Mage Macros the Black Ver(4) Wins [[Mage [sb=SpellBook [Fireball [name=Spell:Fireball, manaCost=15.0, minimu mImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=2 0.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Mino r Healing, manaCost=10.0, minimumImpact=40.0, maximumImpact=40.0]], mana=1 5.0, getName()=Macros the Black Ver(4), getHp()=52.0, getMaxHp()=120.0]]] **************************************************** Mage :3 Warrior :2 Killed Each Other :0 Debug Structure Code Below X Deal Damage [Warrior Action: Attacks ->with Weapon:Sword for 32.0 hp of damage:][Sound ::Wosh] X Receive Damage Mym uses armor to reduce damage from 999 to 989. Remaining hp is 10 W Receive Damage Jon-Tom uses armor to reduce damage from 999 to 999. Remaining hp is 0Magi cian Action: Mage has died and chooses to skip turn
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer


Anonymous
Just the thing I needed, saved me a lot of time.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Similar Content

Related Tags