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     

Description 

10

Commenting

10

Style

5

Inheritance Diagram     

15

Inheritance Code

15

Logging System Implementation 

10

Other Code

20

doBattle and receiveDamage methods

15

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;i<returnVal.length;i++) {

returnVal[i] = offensive.get(i);

}

return returnVal;

}

public Spell[] getHealingSpells() {

LinkedList healing = new LinkedList();

for (Spell i: pages) {

if(i instanceof HealingSpell) {

healing.add(i);

}

}

Spell[] returnVal = new Spell[healing.size()];

for(int i=0;i<returnVal.length;i++) {

returnVal[i] = healing.get(i);

}

return returnVal;

}

public void addSpell(Spell newSpell) {

pages.add(newSpell);

}

public Spell getSpell(int location) {

return pages.get(location);

}

public int length() {

return pages.size();

}

@Override

public String toString() {

String spells = "SpellBook [";

for (int i=0;i<pages.size();i++) {

spells += pages.get(i).toString();

}

return spells + "]";

}

}

4.2 HaveBattle.java

(this code only needs commenting)

package unisa.pf.assign02.testing;

import java.io.File;

import java.io.FileNotFoundException;

import java.util.Scanner;

import unisa.pf.assign02.base.Effector;

import unisa.pf.assign02.characters.Mage;

import unisa.pf.assign02.characters.CharacterClass;

import unisa.pf.assign02.characters.Warrior;

import unisa.pf.assign02.spells.Spell;

import unisa.pf.assign02.spells.MinorHealing;

import unisa.pf.assign02.spells.TargetedSpell;

import unisa.pf.assign02.spells.Fireball;

import unisa.pf.assign02.spells.HealingSpell;

import unisa.pf.assign02.spells.IceStorm;

import unisa.pf.assign02.weapons.Weapon;

import unisa.pf.assign02.weapons.Axe;

import unisa.pf.assign02.weapons.Sword;

import unisa.pf.assign02.util.Log;

public class HaveBattle {

public static void main(String[] args) {

int numberOfBattles = 5;

int numberMageWins = 0;

int numberWarriorWins = 0;

int draw = 0;

for (int i=0;i<numberOfBattles;i++) {

Log.println("****** Round "+(i+1)+" ********");

CharacterClass mage = new Mage("Macros the Black Ver("+i+")",120);

((Mage)mage).addSpell(new Fireball());

((Mage)mage).addSpell(new IceStorm());

((Mage)mage).addSpell(new MinorHealing(mage));

CharacterClass warrior = new Warrior("Ashen-Shugar Ver("+i+")",240,new Axe());

((Warrior)warrior).addWeapon(new Sword());

while(mage.isAlive() && warrior.isAlive()) {

Log.println("+++New Turn+++");

Log.print("[[Mage Turn]]");

warrior.receiveDamage(mage.dealDamage());

Log.println("");

Log.print("[[Warrior Turn]]");

mage.receiveDamage(warrior.dealDamage());

Log.println("\n");

}

if (mage.isAlive()) {

Log.println("Mage "+mage.getName()+" Wins \n[["+mage+"]]");

numberMageWins++;

} else if (warrior.isAlive()){

Log.println("Warrior "+warrior.getName()+" Wins \n[["+warrior+"]]");

numberWarriorWins++;

} else {

Log.println("Killed Each Other No One Wins\nDead:"+mage+"\nDead:"+warrior);

draw++;

}

Log.println("****************************************************\n\n\n");

}

Log.println("Mage :"+numberMageWins);

Log.println("Warrior :"+numberWarriorWins);

Log.println("Killed Each Other :"+draw);

Log.println("\n\n");

Log.println("Debug Structure Code Below");

//This code will force you to get the structure right.

CharacterClass x = new Warrior("Mym",999,new Sword());

CharacterClass y = new Mage("Atoning Unifex",9999999);

Warrior z = new Warrior("Falameezar-aziz-Sulmonmee",900,new Sword());

Mage w = new Mage("Jon-Tom",300);

Mage u = new Mage("Mondain",300);

Spell s1 = new MinorHealing(y);

HealingSpell s2 = new MinorHealing(y);

TargetedSpell s3 = new IceStorm();

Spell s4 = new IceStorm();

Effector e1 = new Sword();

Effector e2 = new IceStorm();

Weapon w1 = new Axe();

x.addHealth(99);

z.addWeapon(new Axe());

x.isAlive();

Log.println("X Deal Damage");

x.dealDamage();

Log.println("\nX Receive Damage");

x.receiveDamage(999);

Log.println("\nW Receive Damage");

w.receiveDamage(999);

w.dealDamage();

s4.getMinimumImpact();

s4.getMaximumImpact();

s4.getManaCost();

Log.close();

}

}

4.3 Log.java

(this code needs additional code written)

package unisa.pf.assign02.util;

import java.io.File;

import java.io.FileNotFoundException;

import java.io.FileWriter;

import java.io.IOException;

public class Log {

private static FileWriter log = null;

private static boolean fileOut = false;

static {

//CODE HERE.

//THINK OF THIS AS A CONSTRUCTOR FOR STATIC VARIABLES

}

public static void println(String output) {

print(output+"\n");

}

public static void print(String output) {

if (fileOut) {

//CODE HERE

} else {

System.out.print(output);

}

}

public static void close() {

try {

log.close();

} catch (IOException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

public static void setFileOut() {

fileOut = true;

}

public static void setConsoleOut() {

fileOut = false;

}

}

4.4 Effector.java

(this code needs additional code written)

package unisa.pf.assign02.base;

import java.util.Random;

import unisa.pf.assign02.util.Log;

abstract public class Effector {

//you need to write additional code/instance variables

static public double randomNumberInRange(double start, double finish) {

Random r1 = new Random();

r1.nextGaussian();

return (Math.abs(r1.nextInt())%((finish+1)-start))+start;

}

}

5 Example Output

****** Round 1 ********

+++New Turn+++

[[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 51.0 HP of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(0) uses armor to reduce damage from 51 to 41. Remaining hp is 199

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 17.0 hp of damage:][Sound::Wosh]Macros the Black Ver(0) uses armor to reduce damage from 17 to 17. Remaining hp is 103

+++New Turn+++

[[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 56.0 HP of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(0) uses armor to reduce damage from 56 to 46. Remaining hp is 153

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 37.0 hp of 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce damage 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce damage 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 Ver(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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(0) uses armor to reduce damage from 53 to 43. Remaining hp is 48

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 15.0 hp of 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 Regenerated 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 of 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 Ver(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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(0) uses armor to reduce damage 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 from 9 to 9. Remaining hp is 35

+++New Turn+++

[[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Regenerated 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 of 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, getMinimumImpact()=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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce damage 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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(1) uses armor to reduce damage from 56 to 46. Remaining hp is 156

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 20.0 hp of 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce damage 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce damage 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce damage 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 Ver(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 of 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(1) uses armor to reduce damage 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 Regenerated 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, getMinimumImpact()=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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(2) uses armor to reduce damage 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 from 3 to 3. Remaining hp is 117

+++New Turn+++

[[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 46.0 HP of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(2) uses armor to reduce damage 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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce damage 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 from 8 to 8. Remaining hp is 93

+++New Turn+++

[[Mage Turn]][Magician Action: Attacks ->with Spell:IceStorm for 55.0 HP of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce damage from 55 to 45. Remaining hp is 73

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 26.0 hp of 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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce damage 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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(2) uses armor to reduce damage 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, minimumImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=20.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Minor 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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(3) uses armor to reduce damage from 52 to 42. Remaining hp is 198

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 14.0 hp of 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce damage from 45 to 35. Remaining hp is 163

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 10.0 hp of 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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(3) uses armor to reduce damage 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 from 3 to 3. Remaining hp is 93

+++New Turn+++

[[Mage Turn]][Magician Action: Attacks ->with Spell:Fireball for 43.0 HP of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce damage 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce damage from 45 to 35. Remaining hp is 46

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 26.0 hp of 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce damage 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 Regenerated 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 Ver(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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(3) uses armor to reduce damage 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, minimumImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=20.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Minor 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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(4) uses armor to reduce damage from 53 to 43. Remaining hp is 197

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 49.0 hp of 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce damage from 47 to 37. Remaining hp is 160

[[Warrior Turn]][Warrior Action: Attacks ->with Weapon:Sword for 42.0 hp of 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 Ver(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 of 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 Ver(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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce damage 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 Ver(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 of damage:][Sound::Chatter Boom]Ashen-Shugar Ver(4) uses armor to reduce damage 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 Regenerated 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 of 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 46 HP

with Spell:Minor Healing for 0 hp of damage: Sound[:Warble]Ashen-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 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 Ver(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 Regenerated 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce damage 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 Ver(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 of 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 Regenerated 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 of 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce damage 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 Ver(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 from 1 to 1. Remaining hp is 61

+++New Turn+++

[[Mage Turn]]Magician Action: Regen Mana -)Mana Regenerated 25.0 Health Regenerated 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 of damage:][Sound::Crackle Boom]Ashen-Shugar Ver(4) uses armor to reduce damage 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, minimumImpact=40.0, maximumImpact=50.0]IceStorm [name=Spell:IceStorm, manaCost=20.0, minimumImpact=50.0, maximumImpact=60.0]Minor Healing [name=Spell:Minor Healing, manaCost=10.0, minimumImpact=40.0, maximumImpact=40.0]], mana=15.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 0Magician Action: Mage has died and chooses to skip turn

Get help from top-rated tutors in any subject.

Efficiently complete your homework and academic assignments by getting help from the experts at homeworkarchive.com