SlideShare a Scribd company logo
1 of 13
Download to read offline
In this rpg battle games, please create a java for a simple battle game. it will have two types of
opponents:
Hydrons and Zexors. Create two classes: one for Hydrons and one for Zexors. Create a DiceRoll
class.
The attributes of the classes are as follows:
Hydrons: have color, height, weight, health (starts at 25), damage potential (0-10, scaled by
health),
attack type, numbers of battles won, numbers of battles lost, name, and home planet.
Zexors: have color, height, weight, health (starts at 25), damage potential (0-10, scaled by
health),
attack type, numbers of battles won, numbers of battles lost, name, and species.
DiceRoll: number of sides
The methods are up to you.
Setup: The user is asked to create 3 Hydrons and 3 Zexors, and determines how many sides to
the dice.
The program randomly chooses a Hydron and pits it against a Zexor. Each battle is determined
by a
dice roll – each Hydron and Zexor rolls a single die. The higher of the dice rolls wins the battle.
Damage
is attributed to the loser, which also affects the damage potential of the loser. If a Hydron or
Zexor does
not engage in a battle, then their health increases by 1 to a maximum of 25. Appropriate
information
should be printed at the end of each battle round for all 6 creatures.
For example:
Battle 1: HydronFred (damage potential 8) battles ZexorSally (damage potential 6). They are
both at full health and roll a 7 sided die. ZexorSally rolls a 6 and HydronFred rolls a 1.
ZexorSally
wins, HydronFred has a health of 19 (25-6).
Battle 2: HydronFred battles ZexorThor (damage potential 9). ZexorThor is at full health.
ZexorThor rolls a 2 and HydronFred rolls 7. ZexorThor takes damage of 76% of 8.
And so on until one of the 6 creatures has a health of 0.
This project incorporates:
Loops
Random numbers
Classes & objects
Arrays of objects
Methods
Solution
I am giving you a solution, which should be very straight. Although, in your question, there are
some points which are not clearly stated:
=> Battle 2: HydronFred battles ZexorThor (damage potential 9). ZexorThor is at full health.
ZexorThor rolls a 2 and HydronFred rolls 7. ZexorThor takes damage of 76% of 8.
And so on until one of the 6 creatures has a health of 0.
how is this 76% damage figuere is derieved??
I am creating a common class Opponent.java to which Zexor and Hydrons extend. I did this,
because of reusability. A lot of attributes in both the classes are same and can be resused.
Opponent.java
public abstract class Opponent {
protected String color;
protected int height;
protected int weight;
protected int health = 25;
protected int damagePotential;
protected String attacktype;
protected int battlesWon=0;
protected int battlesLost=0;
protected String name;
public Opponent(String name, String color, int height, int weight, int damagePotential,
String attacktype) {
this.color = color;
this.height = height;
this.weight = weight;
this.damagePotential = damagePotential;
this.attacktype = attacktype;
this.name = name;
}
public void increaseHealthByOne() {
if(health < 25) {
health++;
}
}
public void reduceHealth(int value) {
health -= value;
if(health < 0) {
health = 0;
}
}
public int getHealth() {
return health;
}
public int getDamagepotential() {
return damagePotential;
}
public void won() {
battlesWon++;
}
public void lost() {
battlesLost++;
}
public abstract String toString();
}
Hydron.java
public class Hydron extends Opponent {
private String homePlanet;
public Hydron(String name, String color, int height, int weight,
int damagePotential, String attacktype, String homePlanet) {
super(name, color, height, weight, damagePotential, attacktype);
this.homePlanet = homePlanet;
}
public Hydron(String name, int damagePotential) {
super(name, "", 0, 0, damagePotential, "");
this.homePlanet = "";
}
@Override
public String toString() {
return "Hydron: " + name + " Health: " + health + " DamagePotential: "
+ damagePotential + " Won: " + battlesWon + " Lost: "
+ battlesLost;
}
}
Zexor.java
public class Zexor extends Opponent {
private String species;
public Zexor(String name, String color, int height, int weight,
int damagePotential, String attacktype, String species) {
super(name, color, height, weight, damagePotential, attacktype);
this.species = species;
}
public Zexor(String name, int damagePotential) {
super(name, "", 0, 0, damagePotential, "");
this.species = "";
}
@Override
public String toString() {
return "Zexor: " + name + " Health: " + health + " DamagePotential: "
+ damagePotential + " Won: " + battlesWon + " Lost: "
+ battlesLost;
}
}
DiceRoll.java
import java.util.Random;
public class DiceRoll {
private int noOfSides;
Random random = new Random();
public DiceRoll(int noOfSides) {
this.noOfSides = noOfSides;
}
public int rollDice() {
return 1 + random.nextInt(noOfSides);
}
}
Match.java
import java.util.List;
import java.util.Random;
public class Match {
List hydrons;
List zexors;
DiceRoll diceRoll;
Random random = new Random();
/*
* Constructor, which takes players list and noOfSides of dices
*/
public Match(List hydrons, List zexors, int noOfSides) {
if(hydrons == null || hydrons.size() != 3 || zexors == null || zexors.size() != 3) {
throw new IllegalArgumentException();
}
this.hydrons = hydrons;
this.zexors = zexors;
diceRoll = new DiceRoll(noOfSides);
}
// method to start the match
public void startMatch() {
System.out.println("Match has started.  ");
System.out.println("Initial States");
printInfoRelatedToPlayers();
// keep picking players untill some player has got 0 health
while(true) {
// picking 0, 1st or 2nd hydron
int hydronIndex = random.nextInt(3);
int zexorIndex = random.nextInt(3);
System.out.println(" Picked " + hydrons.get(hydronIndex).name + " " +
zexors.get(zexorIndex).name + " for match");
boolean somebodyWon = false;
// roll the dice and determine who will win
while(!somebodyWon) {
somebodyWon = true;
int hydronRoll = diceRoll.rollDice();
int zexorRoll = diceRoll.rollDice();
System.out.println("Dice roll===> Hydron:" + hydronRoll + " Zexor:" +
zexorRoll);
// check who has won the match
if(hydronRoll > zexorRoll) {
// hydron won
int potential = hydrons.get(hydronIndex).getDamagepotential();
zexors.get(zexorIndex).reduceHealth(potential);
hydrons.get(hydronIndex).won();
zexors.get(zexorIndex).lost();
System.out.println("******************************** Hydron won
********************************");
} else if(zexorRoll > hydronRoll) {
// zexors won
int potential = zexors.get(zexorIndex).getDamagepotential();
hydrons.get(hydronIndex).reduceHealth(potential);
zexors.get(hydronIndex).won();
hydrons.get(zexorIndex).lost();
System.out.println("******************************** Zexor won
********************************");
} else {
// if nobody won, give one more try with dice
somebodyWon = false;
}
}
// increase other player health to max of 25
for(int i=0; i< hydrons.size(); i++) {
if(i != hydronIndex) {
hydrons.get(i).increaseHealthByOne();
}
}
for(int i=0; i< zexors.size(); i++) {
if(i != zexorIndex) {
zexors.get(i).increaseHealthByOne();
}
}
// print health of every player
printInfoRelatedToPlayers();
if(hasGameOver()) {
System.out.println("Game is over now.");
break;
}
}
}
// prints info related to players
private void printInfoRelatedToPlayers() {
for(int i=0; i< hydrons.size(); i++) {
System.out.println(hydrons.get(i));
}
for(int i=0; i< zexors.size(); i++) {
System.out.println(zexors.get(i));
}
}
// check if some player has got 0 health
private boolean hasGameOver() {
boolean gameEnd = false;
for(int i=0; i< hydrons.size(); i++) {
if(hydrons.get(i).getHealth() == 0) {
gameEnd = true;
}
}
for(int i=0; !gameEnd && i< zexors.size(); i++) {
if(zexors.get(i).getHealth() == 0) {
gameEnd = true;
}
}
return gameEnd;
}
}
Demo.java
import java.util.ArrayList;
import java.util.List;
public class Demo {
public static void main(String args[]) {
// Creating Zexors
Zexor zexor1 = new Zexor("Zexor1", 7);
Zexor zexor2 = new Zexor("Zexor2", 4);
Zexor zexor3 = new Zexor("Zexor3", 9);
Hydron hydron1 = new Hydron("Hydron1", 8);
Hydron hydron2 = new Hydron("Hydron2", 6);
Hydron hydron3 = new Hydron("Hydron3", 10);
List hydrons = new ArrayList<>();
List zexors = new ArrayList<>();
hydrons.add(hydron1);
hydrons.add(hydron2);
hydrons.add(hydron3);
zexors.add(zexor1);
zexors.add(zexor2);
zexors.add(zexor3);
Match match = new Match(zexors, hydrons, 6);
match.startMatch();
}
}
// do let me know in case you require some more functionality
Sample Output:
Match has started.
Initial States
Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 0 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 0 Lost: 0
Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0
Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 0 Lost: 0
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 25 DamagePotential: 10 Won: 0 Lost: 0
Picked Zexor2 Hydron3 for match
Dice roll===> Hydron:6 Zexor:4
******************************** Hydron won ********************************
Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 0 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 1 Lost: 0
Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0
Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 0 Lost: 0
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 21 DamagePotential: 10 Won: 0 Lost: 1
Picked Zexor1 Hydron1 for match
Dice roll===> Hydron:4 Zexor:2
******************************** Hydron won ********************************
Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 1 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 1 Lost: 0
Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0
Hydron: Hydron1 Health: 18 DamagePotential: 8 Won: 0 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 22 DamagePotential: 10 Won: 0 Lost: 1
Picked Zexor1 Hydron3 for match
Dice roll===> Hydron:3 Zexor:2
******************************** Hydron won ********************************
Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 2 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 1 Lost: 0
Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0
Hydron: Hydron1 Health: 19 DamagePotential: 8 Won: 0 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 15 DamagePotential: 10 Won: 0 Lost: 2
Picked Zexor2 Hydron3 for match
Dice roll===> Hydron:6 Zexor:2
******************************** Hydron won ********************************
Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 2 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 0
Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0
Hydron: Hydron1 Health: 20 DamagePotential: 8 Won: 0 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 11 DamagePotential: 10 Won: 0 Lost: 3
Picked Zexor3 Hydron3 for match
Dice roll===> Hydron:4 Zexor:5
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 2 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 0
Zexor: Zexor3 Health: 15 DamagePotential: 9 Won: 0 Lost: 1
Hydron: Hydron1 Health: 21 DamagePotential: 8 Won: 0 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 11 DamagePotential: 10 Won: 1 Lost: 3
Picked Zexor1 Hydron2 for match
Dice roll===> Hydron:1 Zexor:3
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 19 DamagePotential: 7 Won: 2 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 1
Zexor: Zexor3 Health: 16 DamagePotential: 9 Won: 0 Lost: 1
Hydron: Hydron1 Health: 22 DamagePotential: 8 Won: 1 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 12 DamagePotential: 10 Won: 1 Lost: 3
Picked Zexor3 Hydron2 for match
Dice roll===> Hydron:6 Zexor:6
Dice roll===> Hydron:6 Zexor:6
Dice roll===> Hydron:1 Zexor:3
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 20 DamagePotential: 7 Won: 2 Lost: 0
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 2
Zexor: Zexor3 Health: 10 DamagePotential: 9 Won: 0 Lost: 1
Hydron: Hydron1 Health: 23 DamagePotential: 8 Won: 1 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 13 DamagePotential: 10 Won: 2 Lost: 3
Picked Zexor1 Hydron1 for match
Dice roll===> Hydron:2 Zexor:3
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 12 DamagePotential: 7 Won: 2 Lost: 1
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 2
Zexor: Zexor3 Health: 11 DamagePotential: 9 Won: 0 Lost: 1
Hydron: Hydron1 Health: 23 DamagePotential: 8 Won: 2 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 14 DamagePotential: 10 Won: 2 Lost: 3
Picked Zexor3 Hydron2 for match
Dice roll===> Hydron:3 Zexor:4
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 13 DamagePotential: 7 Won: 2 Lost: 1
Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 3
Zexor: Zexor3 Health: 5 DamagePotential: 9 Won: 0 Lost: 1
Hydron: Hydron1 Health: 24 DamagePotential: 8 Won: 2 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
Hydron: Hydron3 Health: 15 DamagePotential: 10 Won: 3 Lost: 3
Picked Zexor2 Hydron3 for match
Dice roll===> Hydron:4 Zexor:6
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 14 DamagePotential: 7 Won: 2 Lost: 1
Zexor: Zexor2 Health: 15 DamagePotential: 4 Won: 2 Lost: 3
Zexor: Zexor3 Health: 6 DamagePotential: 9 Won: 0 Lost: 2
Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 2 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 1 Lost: 0
Hydron: Hydron3 Health: 15 DamagePotential: 10 Won: 3 Lost: 3
Picked Zexor2 Hydron1 for match
Dice roll===> Hydron:2 Zexor:4
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 15 DamagePotential: 7 Won: 2 Lost: 2
Zexor: Zexor2 Health: 7 DamagePotential: 4 Won: 2 Lost: 3
Zexor: Zexor3 Health: 7 DamagePotential: 9 Won: 0 Lost: 2
Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 2 Lost: 1
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 2 Lost: 0
Hydron: Hydron3 Health: 16 DamagePotential: 10 Won: 3 Lost: 3
Picked Zexor3 Hydron1 for match
Dice roll===> Hydron:5 Zexor:2
******************************** Hydron won ********************************
Zexor: Zexor1 Health: 16 DamagePotential: 7 Won: 2 Lost: 2
Zexor: Zexor2 Health: 8 DamagePotential: 4 Won: 2 Lost: 3
Zexor: Zexor3 Health: 7 DamagePotential: 9 Won: 1 Lost: 2
Hydron: Hydron1 Health: 16 DamagePotential: 8 Won: 2 Lost: 2
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 2 Lost: 0
Hydron: Hydron3 Health: 17 DamagePotential: 10 Won: 3 Lost: 3
Picked Zexor3 Hydron3 for match
Dice roll===> Hydron:1 Zexor:2
******************************** Zexor won ********************************
Zexor: Zexor1 Health: 17 DamagePotential: 7 Won: 2 Lost: 2
Zexor: Zexor2 Health: 9 DamagePotential: 4 Won: 2 Lost: 3
Zexor: Zexor3 Health: 0 DamagePotential: 9 Won: 1 Lost: 3
Hydron: Hydron1 Health: 17 DamagePotential: 8 Won: 2 Lost: 2
Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 2 Lost: 0
Hydron: Hydron3 Health: 17 DamagePotential: 10 Won: 4 Lost: 3
Game is over now.

More Related Content

More from aminbijal86

Which of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdfWhich of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdf
aminbijal86
 
Thouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdfThouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdf
aminbijal86
 
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdfSubmit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
aminbijal86
 
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdfNessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
aminbijal86
 
Solve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdfSolve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdf
aminbijal86
 
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdfProject 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
aminbijal86
 
please help me in C++Objective Create a singly linked list of num.pdf
please help me in C++Objective Create a singly linked list of num.pdfplease help me in C++Objective Create a singly linked list of num.pdf
please help me in C++Objective Create a singly linked list of num.pdf
aminbijal86
 
On May 1, Melforth Realty Company offered to sell Green acre to Dall.pdf
On May 1, Melforth Realty Company offered to sell Green acre to Dall.pdfOn May 1, Melforth Realty Company offered to sell Green acre to Dall.pdf
On May 1, Melforth Realty Company offered to sell Green acre to Dall.pdf
aminbijal86
 
Notes1-this is web programming ... HTML2-I need the calculator l.pdf
Notes1-this is web programming ... HTML2-I need the calculator l.pdfNotes1-this is web programming ... HTML2-I need the calculator l.pdf
Notes1-this is web programming ... HTML2-I need the calculator l.pdf
aminbijal86
 

More from aminbijal86 (20)

Which of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdfWhich of the following are principles of the AICPA Code of Professio.pdf
Which of the following are principles of the AICPA Code of Professio.pdf
 
Thouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdfThouhgts on the future of information technology (IT) software secur.pdf
Thouhgts on the future of information technology (IT) software secur.pdf
 
Two of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdfTwo of the following ions depend on their conversion into a gas .pdf
Two of the following ions depend on their conversion into a gas .pdf
 
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdfThe systemic acquired resistance (SAR) demonstrated in the experimen.pdf
The systemic acquired resistance (SAR) demonstrated in the experimen.pdf
 
One implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdfOne implication of the Lyon hypothesis was that adult females would b.pdf
One implication of the Lyon hypothesis was that adult females would b.pdf
 
the problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdfthe problems of vietnam in communication during international busine.pdf
the problems of vietnam in communication during international busine.pdf
 
The first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdfThe first signs of niacin deficiency are all of the following EXCEPT .pdf
The first signs of niacin deficiency are all of the following EXCEPT .pdf
 
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdfThe Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
The Ba(s) gets formed after reductionBa2+ + 2e- -- Ba(s) which is.pdf
 
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdfSubmit a 2-3 page paper addressing each of the following 1.Define .pdf
Submit a 2-3 page paper addressing each of the following 1.Define .pdf
 
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdfNessus is a network security toolIn a pragraph describe the tool’s.pdf
Nessus is a network security toolIn a pragraph describe the tool’s.pdf
 
Solve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdfSolve given LP problem using simplex method and find maximum value o.pdf
Solve given LP problem using simplex method and find maximum value o.pdf
 
Show a rightmost derivation for the string(id + id) id Usin.pdf
Show a rightmost derivation for the string(id + id)  id Usin.pdfShow a rightmost derivation for the string(id + id)  id Usin.pdf
Show a rightmost derivation for the string(id + id) id Usin.pdf
 
25. The Performance Principle of GAAS requires that sufficient approp.pdf
25. The Performance Principle of GAAS requires that sufficient approp.pdf25. The Performance Principle of GAAS requires that sufficient approp.pdf
25. The Performance Principle of GAAS requires that sufficient approp.pdf
 
Question 4 The recent civil war in Syria is an example of O the succe.pdf
Question 4 The recent civil war in Syria is an example of O the succe.pdfQuestion 4 The recent civil war in Syria is an example of O the succe.pdf
Question 4 The recent civil war in Syria is an example of O the succe.pdf
 
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdfProject 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
Project 3–Advanced Taxi SystemObjectiveTo gain experience and prac.pdf
 
please help me in C++Objective Create a singly linked list of num.pdf
please help me in C++Objective Create a singly linked list of num.pdfplease help me in C++Objective Create a singly linked list of num.pdf
please help me in C++Objective Create a singly linked list of num.pdf
 
Part ENow predict the outcome of a partial diploid of your novel d.pdf
Part ENow predict the outcome of a partial diploid of your novel d.pdfPart ENow predict the outcome of a partial diploid of your novel d.pdf
Part ENow predict the outcome of a partial diploid of your novel d.pdf
 
On May 1, Melforth Realty Company offered to sell Green acre to Dall.pdf
On May 1, Melforth Realty Company offered to sell Green acre to Dall.pdfOn May 1, Melforth Realty Company offered to sell Green acre to Dall.pdf
On May 1, Melforth Realty Company offered to sell Green acre to Dall.pdf
 
Find the kernel and range (Image) of the following transformation p.pdf
Find the kernel and range (Image) of the following transformation  p.pdfFind the kernel and range (Image) of the following transformation  p.pdf
Find the kernel and range (Image) of the following transformation p.pdf
 
Notes1-this is web programming ... HTML2-I need the calculator l.pdf
Notes1-this is web programming ... HTML2-I need the calculator l.pdfNotes1-this is web programming ... HTML2-I need the calculator l.pdf
Notes1-this is web programming ... HTML2-I need the calculator l.pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUMDEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
DEMONSTRATION LESSON IN ENGLISH 4 MATATAG CURRICULUM
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Book Review of Run For Your Life Powerpoint
Book Review of Run For Your Life PowerpointBook Review of Run For Your Life Powerpoint
Book Review of Run For Your Life Powerpoint
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
An Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge AppAn Overview of the Odoo 17 Knowledge App
An Overview of the Odoo 17 Knowledge App
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 

In this rpg battle games, please create a java for a simple battle g.pdf

  • 1. In this rpg battle games, please create a java for a simple battle game. it will have two types of opponents: Hydrons and Zexors. Create two classes: one for Hydrons and one for Zexors. Create a DiceRoll class. The attributes of the classes are as follows: Hydrons: have color, height, weight, health (starts at 25), damage potential (0-10, scaled by health), attack type, numbers of battles won, numbers of battles lost, name, and home planet. Zexors: have color, height, weight, health (starts at 25), damage potential (0-10, scaled by health), attack type, numbers of battles won, numbers of battles lost, name, and species. DiceRoll: number of sides The methods are up to you. Setup: The user is asked to create 3 Hydrons and 3 Zexors, and determines how many sides to the dice. The program randomly chooses a Hydron and pits it against a Zexor. Each battle is determined by a dice roll – each Hydron and Zexor rolls a single die. The higher of the dice rolls wins the battle. Damage is attributed to the loser, which also affects the damage potential of the loser. If a Hydron or Zexor does not engage in a battle, then their health increases by 1 to a maximum of 25. Appropriate information should be printed at the end of each battle round for all 6 creatures. For example: Battle 1: HydronFred (damage potential 8) battles ZexorSally (damage potential 6). They are both at full health and roll a 7 sided die. ZexorSally rolls a 6 and HydronFred rolls a 1. ZexorSally wins, HydronFred has a health of 19 (25-6). Battle 2: HydronFred battles ZexorThor (damage potential 9). ZexorThor is at full health. ZexorThor rolls a 2 and HydronFred rolls 7. ZexorThor takes damage of 76% of 8. And so on until one of the 6 creatures has a health of 0. This project incorporates: Loops Random numbers
  • 2. Classes & objects Arrays of objects Methods Solution I am giving you a solution, which should be very straight. Although, in your question, there are some points which are not clearly stated: => Battle 2: HydronFred battles ZexorThor (damage potential 9). ZexorThor is at full health. ZexorThor rolls a 2 and HydronFred rolls 7. ZexorThor takes damage of 76% of 8. And so on until one of the 6 creatures has a health of 0. how is this 76% damage figuere is derieved?? I am creating a common class Opponent.java to which Zexor and Hydrons extend. I did this, because of reusability. A lot of attributes in both the classes are same and can be resused. Opponent.java public abstract class Opponent { protected String color; protected int height; protected int weight; protected int health = 25; protected int damagePotential; protected String attacktype; protected int battlesWon=0; protected int battlesLost=0; protected String name; public Opponent(String name, String color, int height, int weight, int damagePotential, String attacktype) { this.color = color; this.height = height;
  • 3. this.weight = weight; this.damagePotential = damagePotential; this.attacktype = attacktype; this.name = name; } public void increaseHealthByOne() { if(health < 25) { health++; } } public void reduceHealth(int value) { health -= value; if(health < 0) { health = 0; } } public int getHealth() { return health; } public int getDamagepotential() { return damagePotential; } public void won() { battlesWon++; } public void lost() { battlesLost++; } public abstract String toString(); } Hydron.java
  • 4. public class Hydron extends Opponent { private String homePlanet; public Hydron(String name, String color, int height, int weight, int damagePotential, String attacktype, String homePlanet) { super(name, color, height, weight, damagePotential, attacktype); this.homePlanet = homePlanet; } public Hydron(String name, int damagePotential) { super(name, "", 0, 0, damagePotential, ""); this.homePlanet = ""; } @Override public String toString() { return "Hydron: " + name + " Health: " + health + " DamagePotential: " + damagePotential + " Won: " + battlesWon + " Lost: " + battlesLost; } } Zexor.java public class Zexor extends Opponent { private String species; public Zexor(String name, String color, int height, int weight, int damagePotential, String attacktype, String species) { super(name, color, height, weight, damagePotential, attacktype); this.species = species; } public Zexor(String name, int damagePotential) { super(name, "", 0, 0, damagePotential, "");
  • 5. this.species = ""; } @Override public String toString() { return "Zexor: " + name + " Health: " + health + " DamagePotential: " + damagePotential + " Won: " + battlesWon + " Lost: " + battlesLost; } } DiceRoll.java import java.util.Random; public class DiceRoll { private int noOfSides; Random random = new Random(); public DiceRoll(int noOfSides) { this.noOfSides = noOfSides; } public int rollDice() { return 1 + random.nextInt(noOfSides); } } Match.java import java.util.List; import java.util.Random; public class Match { List hydrons;
  • 6. List zexors; DiceRoll diceRoll; Random random = new Random(); /* * Constructor, which takes players list and noOfSides of dices */ public Match(List hydrons, List zexors, int noOfSides) { if(hydrons == null || hydrons.size() != 3 || zexors == null || zexors.size() != 3) { throw new IllegalArgumentException(); } this.hydrons = hydrons; this.zexors = zexors; diceRoll = new DiceRoll(noOfSides); } // method to start the match public void startMatch() { System.out.println("Match has started. "); System.out.println("Initial States"); printInfoRelatedToPlayers(); // keep picking players untill some player has got 0 health while(true) { // picking 0, 1st or 2nd hydron int hydronIndex = random.nextInt(3); int zexorIndex = random.nextInt(3); System.out.println(" Picked " + hydrons.get(hydronIndex).name + " " + zexors.get(zexorIndex).name + " for match"); boolean somebodyWon = false; // roll the dice and determine who will win while(!somebodyWon) { somebodyWon = true;
  • 7. int hydronRoll = diceRoll.rollDice(); int zexorRoll = diceRoll.rollDice(); System.out.println("Dice roll===> Hydron:" + hydronRoll + " Zexor:" + zexorRoll); // check who has won the match if(hydronRoll > zexorRoll) { // hydron won int potential = hydrons.get(hydronIndex).getDamagepotential(); zexors.get(zexorIndex).reduceHealth(potential); hydrons.get(hydronIndex).won(); zexors.get(zexorIndex).lost(); System.out.println("******************************** Hydron won ********************************"); } else if(zexorRoll > hydronRoll) { // zexors won int potential = zexors.get(zexorIndex).getDamagepotential(); hydrons.get(hydronIndex).reduceHealth(potential); zexors.get(hydronIndex).won(); hydrons.get(zexorIndex).lost(); System.out.println("******************************** Zexor won ********************************"); } else { // if nobody won, give one more try with dice somebodyWon = false; } } // increase other player health to max of 25 for(int i=0; i< hydrons.size(); i++) { if(i != hydronIndex) { hydrons.get(i).increaseHealthByOne(); } } for(int i=0; i< zexors.size(); i++) { if(i != zexorIndex) {
  • 8. zexors.get(i).increaseHealthByOne(); } } // print health of every player printInfoRelatedToPlayers(); if(hasGameOver()) { System.out.println("Game is over now."); break; } } } // prints info related to players private void printInfoRelatedToPlayers() { for(int i=0; i< hydrons.size(); i++) { System.out.println(hydrons.get(i)); } for(int i=0; i< zexors.size(); i++) { System.out.println(zexors.get(i)); } } // check if some player has got 0 health private boolean hasGameOver() { boolean gameEnd = false; for(int i=0; i< hydrons.size(); i++) { if(hydrons.get(i).getHealth() == 0) { gameEnd = true; } } for(int i=0; !gameEnd && i< zexors.size(); i++) { if(zexors.get(i).getHealth() == 0) { gameEnd = true; } } return gameEnd;
  • 9. } } Demo.java import java.util.ArrayList; import java.util.List; public class Demo { public static void main(String args[]) { // Creating Zexors Zexor zexor1 = new Zexor("Zexor1", 7); Zexor zexor2 = new Zexor("Zexor2", 4); Zexor zexor3 = new Zexor("Zexor3", 9); Hydron hydron1 = new Hydron("Hydron1", 8); Hydron hydron2 = new Hydron("Hydron2", 6); Hydron hydron3 = new Hydron("Hydron3", 10); List hydrons = new ArrayList<>(); List zexors = new ArrayList<>(); hydrons.add(hydron1); hydrons.add(hydron2); hydrons.add(hydron3); zexors.add(zexor1); zexors.add(zexor2); zexors.add(zexor3); Match match = new Match(zexors, hydrons, 6); match.startMatch(); } } // do let me know in case you require some more functionality Sample Output:
  • 10. Match has started. Initial States Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 0 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 0 Lost: 0 Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0 Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 0 Lost: 0 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 25 DamagePotential: 10 Won: 0 Lost: 0 Picked Zexor2 Hydron3 for match Dice roll===> Hydron:6 Zexor:4 ******************************** Hydron won ******************************** Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 0 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 1 Lost: 0 Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0 Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 0 Lost: 0 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 21 DamagePotential: 10 Won: 0 Lost: 1 Picked Zexor1 Hydron1 for match Dice roll===> Hydron:4 Zexor:2 ******************************** Hydron won ******************************** Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 1 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 1 Lost: 0 Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0 Hydron: Hydron1 Health: 18 DamagePotential: 8 Won: 0 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 22 DamagePotential: 10 Won: 0 Lost: 1 Picked Zexor1 Hydron3 for match Dice roll===> Hydron:3 Zexor:2 ******************************** Hydron won ******************************** Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 2 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 1 Lost: 0 Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0 Hydron: Hydron1 Health: 19 DamagePotential: 8 Won: 0 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0
  • 11. Hydron: Hydron3 Health: 15 DamagePotential: 10 Won: 0 Lost: 2 Picked Zexor2 Hydron3 for match Dice roll===> Hydron:6 Zexor:2 ******************************** Hydron won ******************************** Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 2 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 0 Zexor: Zexor3 Health: 25 DamagePotential: 9 Won: 0 Lost: 0 Hydron: Hydron1 Health: 20 DamagePotential: 8 Won: 0 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 11 DamagePotential: 10 Won: 0 Lost: 3 Picked Zexor3 Hydron3 for match Dice roll===> Hydron:4 Zexor:5 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 25 DamagePotential: 7 Won: 2 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 0 Zexor: Zexor3 Health: 15 DamagePotential: 9 Won: 0 Lost: 1 Hydron: Hydron1 Health: 21 DamagePotential: 8 Won: 0 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 11 DamagePotential: 10 Won: 1 Lost: 3 Picked Zexor1 Hydron2 for match Dice roll===> Hydron:1 Zexor:3 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 19 DamagePotential: 7 Won: 2 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 1 Zexor: Zexor3 Health: 16 DamagePotential: 9 Won: 0 Lost: 1 Hydron: Hydron1 Health: 22 DamagePotential: 8 Won: 1 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 12 DamagePotential: 10 Won: 1 Lost: 3 Picked Zexor3 Hydron2 for match Dice roll===> Hydron:6 Zexor:6 Dice roll===> Hydron:6 Zexor:6 Dice roll===> Hydron:1 Zexor:3 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 20 DamagePotential: 7 Won: 2 Lost: 0 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 2 Zexor: Zexor3 Health: 10 DamagePotential: 9 Won: 0 Lost: 1
  • 12. Hydron: Hydron1 Health: 23 DamagePotential: 8 Won: 1 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 13 DamagePotential: 10 Won: 2 Lost: 3 Picked Zexor1 Hydron1 for match Dice roll===> Hydron:2 Zexor:3 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 12 DamagePotential: 7 Won: 2 Lost: 1 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 2 Zexor: Zexor3 Health: 11 DamagePotential: 9 Won: 0 Lost: 1 Hydron: Hydron1 Health: 23 DamagePotential: 8 Won: 2 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 14 DamagePotential: 10 Won: 2 Lost: 3 Picked Zexor3 Hydron2 for match Dice roll===> Hydron:3 Zexor:4 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 13 DamagePotential: 7 Won: 2 Lost: 1 Zexor: Zexor2 Health: 25 DamagePotential: 4 Won: 2 Lost: 3 Zexor: Zexor3 Health: 5 DamagePotential: 9 Won: 0 Lost: 1 Hydron: Hydron1 Health: 24 DamagePotential: 8 Won: 2 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 0 Lost: 0 Hydron: Hydron3 Health: 15 DamagePotential: 10 Won: 3 Lost: 3 Picked Zexor2 Hydron3 for match Dice roll===> Hydron:4 Zexor:6 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 14 DamagePotential: 7 Won: 2 Lost: 1 Zexor: Zexor2 Health: 15 DamagePotential: 4 Won: 2 Lost: 3 Zexor: Zexor3 Health: 6 DamagePotential: 9 Won: 0 Lost: 2 Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 2 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 1 Lost: 0 Hydron: Hydron3 Health: 15 DamagePotential: 10 Won: 3 Lost: 3 Picked Zexor2 Hydron1 for match Dice roll===> Hydron:2 Zexor:4 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 15 DamagePotential: 7 Won: 2 Lost: 2 Zexor: Zexor2 Health: 7 DamagePotential: 4 Won: 2 Lost: 3 Zexor: Zexor3 Health: 7 DamagePotential: 9 Won: 0 Lost: 2
  • 13. Hydron: Hydron1 Health: 25 DamagePotential: 8 Won: 2 Lost: 1 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 2 Lost: 0 Hydron: Hydron3 Health: 16 DamagePotential: 10 Won: 3 Lost: 3 Picked Zexor3 Hydron1 for match Dice roll===> Hydron:5 Zexor:2 ******************************** Hydron won ******************************** Zexor: Zexor1 Health: 16 DamagePotential: 7 Won: 2 Lost: 2 Zexor: Zexor2 Health: 8 DamagePotential: 4 Won: 2 Lost: 3 Zexor: Zexor3 Health: 7 DamagePotential: 9 Won: 1 Lost: 2 Hydron: Hydron1 Health: 16 DamagePotential: 8 Won: 2 Lost: 2 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 2 Lost: 0 Hydron: Hydron3 Health: 17 DamagePotential: 10 Won: 3 Lost: 3 Picked Zexor3 Hydron3 for match Dice roll===> Hydron:1 Zexor:2 ******************************** Zexor won ******************************** Zexor: Zexor1 Health: 17 DamagePotential: 7 Won: 2 Lost: 2 Zexor: Zexor2 Health: 9 DamagePotential: 4 Won: 2 Lost: 3 Zexor: Zexor3 Health: 0 DamagePotential: 9 Won: 1 Lost: 3 Hydron: Hydron1 Health: 17 DamagePotential: 8 Won: 2 Lost: 2 Hydron: Hydron2 Health: 25 DamagePotential: 6 Won: 2 Lost: 0 Hydron: Hydron3 Health: 17 DamagePotential: 10 Won: 4 Lost: 3 Game is over now.