Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can i make this java program, following the details in the discription and the uml digram. This following UML digram is for the new

How can i make this java program, following the details in the discription and the uml digram.

image text in transcribed

This following UML digram is for the new one! VVV I want its code!

image text in transcribed

This is a sample run that shows how they want the program to work! it have to work exactly the same!

image text in transcribed

This is the UML digram for the 1st version(without arrays). It is done and working! I need the updated code(with arrays) for the BattleSim class!

image text in transcribed

Overview For this assignment, you will implement the classes described by the UML diagram below including a driver to conduct an epic battle. Battle Simulator 3060 The program simulates an epic battle between a powerfulMagus (human player) and a horde of evil Mugwumps (computer player). Using rules from some generic tabletop game, the player will attempt to vanquish the evil scourge and save the kingdom The core of this game should be the same as the previous Battle Simulator 3050. The only necessary changes are to create the Magus class and to modify the BattleSim to run a horde of Mugwumps. The Magus The Magus uses six six-sided dice to compute starting hit points and only rolls a six-sided die for initiative (making it more likely the mugwumps would go first) The Magus, however, has two powerful attacks at his or her disposal: 1. Her or his Vampiric Touch hits the nearest Mugwump on a roll of 5 or better. It does 3 four-sided dice in damage, and heals the Magus an equal amount (up to his or her starting hit points) 2. Her or his Flame Blast hits all Mugumps on a roll of two or better, and does six 8-sided dice in damage to each of them. The Horde You will represent the horde of mugwumps using an array. Initially, the horde will contain 20 mugwumps. When the horde attacks, each living mugwump in the horde has a mugwump (any one) can rol initiative for the entire horde For simplicity, when reporting on the status of the horde, just report the number of surviving mugwumps, rather than the life total of each. umberoflivingmuguumps) chance of attacking. One Battle End A combatant is out of the battle when her or his Hit Points go to zero below or below. If all the mugwumps in the horde are defeated, the Magus wins, and an appropriately exultant message is displayed. If the Magus fails she or he is mocked by the evil Mugwump It is difficult for every member of a horde to reach the Magus, but as their numbers dwindle, it becomes easier Die Magus VAMPIR H : int= 1 (ea + MIN SIDES nt 2 (read-only) + MAX SIDES : int 100 (read-only! + DEFAULT SIDES 6 (read-only) currentValue: int numberOfSides: int hitPoints: int startingHitPoints: int Random -vampiricTouch : Attack flameBlast : Attack -d6: Die +Die(numberOfSldes: int) +getNumberOfSides0: int +getCurrentValue): int +roll) void +Maguso +getHitPoints0: int BattleSim rolllnitiative): int +takeDamage(damage: int) void + attack(type: int, mugwumps: Mugwump[I) void +MAGUS int-1 fread-only +MUGWUMP int 2 (read-only + d100 Die fread-only) indexOfNearest(mugwumps Mugwump]): int rollHitPoints0: int + main(args : String[I: void +introo void texchangeBlows(magus: Magus, mps Mugwumpl. void Mugwump +numberSurviving(mugwumps Mugwumpl) - in + reportStatus(magus Magus +CLAWS int 1 fread-only) +FANGS int 2 read-only +attackChoi +initiative(magus Magus, hitPoints: int startingHitPoints: int claws: Attack + victory0: void + defeat0 void +playAgain(in : Scanner): boolean fangs : Attack d6 Die d10 Die d100 Die Attack -toHitNumber: int damageDie Die damageRolls: int hitMessage: String missMessage String d20 Die +Mugwump0 + getHitPoints0: int +rollinitiative int +takeDamage(damage : int): void attack(warrior Warrior) void +Attack( toHitNumber: int, damageDie: int, damageRolls: int, hitMessage String, missMessage String) rollHitPoints0: int ai0: int + doAttack): int Sample Run Welcome to Battle Simulator 3060! The world's even more low tech battle simulator! You are a Powerful Magus defending your humble village from a horde of evil Mugwumps! Fight bravel or the citizens of your town wi1l be the Mugwumps' dinner! You have your Vampiric Touch, which deals damages to one muguump and heals you slightly You also have your Flame Blast, which deals a large amount of damage to the entire horde Let the epic battle begin! The magus has 15 hit points 20 mugrumps swarm about you The Magus goes first Do you 1) Drain the life from the nearest mugvump, healing slightly, or 2) Douse the entire mob in fire with a flame blast? You scorch the mob of mugwumps with a wave of fire dealing 25 damage The Mugwump licks its wounds, healing 4 points of damage The Mugurump swipes its claws at you in vain The Mugurump swipes its claws at you in vain The magus has 15 hit points 20 mugrumps swarm about you The Mugwumps go first The Mugurump swipes its claws at you in vain The Mugurump swipes its claws at you in vain The Mugwump viciously gouges you vith its razor-sharp clavs for 4 damage Do you 1) Drain the life from the nearest mugvump, healing slightly, or 2) Douse the entire mob in fire with a flame blast? You scorch the mob of mugwumps with a wave of fire dealing 25 damage The magus has 11 hit points 10 mugwumps svarm about you The Mugwumps go first The Mugurump swipes its claws at you in vain The Mugwump licks its wounds, healing 3 points of damage The Mugwump licks its wounds, healing 4 points of damage The Mugurump swipes its claws at you in vain Do you 1) Drain the life from the nearest mugvump, healing slightly, or 2) Douse the entire mob in fire with a flame blast? You scorch the mob of mugwumps with a wave of fire dealing 26 damage You have finally slain the entire horde of vile Mugwumps In their gratitude, the villagers hold a feast in vour honor Play again? [y] Thanks for participating in the Battle Simulator 3060. Have a nice day! Die Warrion + IN SIDES: int 2 (read-only + AX SIDES: int 100 (read-only) +DEFAULT SIDES 6 (read-only) +SWORD int 1fread-only + SHIELD : int 2(read-only} - hitPoints: int -sword: Attack shield: Attack d10:Die currentValue int numberOfSides: int Random +Die(numberOfSldes: int) +getNumberOfSides): int +getCurrentValue): int +roll void +Warrior( + getHitPoints0: int +rollinitiative int +takeDamage(damage: int) void + attack(type: int, mugwump : Mugwump) : void BattleSim WARRIOR int 1 fread-only) MUGWUMP : ir -1 rollHitPoints0: int + main(args: String) : void +intro) void +exchangeBlows(warrior Warrior mugwump MugWump, in : Scanner): void Mugwump +reportStatus(warrior: Warrion + CLAWS-int 1 fread-only) +FANGS: int 2 read-only) mugwump MugWump): void +attackChoice(in Scanner): int + initiative(warrior : Warrior mugwump MugWump): void hitPoints int startingHitPoints: int -claws:Attack fangs: Attack d6: Die d10 Die d100:Die + victory0 void + defeat) void +playAgain(in Scanner) : boolean Attack toHitNumber: int damageDie Die damageRolls: int hitMessage: String missMessage: String d20 Die + Mugwumpo +getHitPoints0: int rolllnitiative int +takeDamage(damage: int): void +attack(warrior: Warrior): void Attack( toHitNumber: int, damageDie: int, damageRolls: int, rollHitPoints0: int ai0: int hitMessage: String, missMessage: String) + doAttack): int Overview For this assignment, you will implement the classes described by the UML diagram below including a driver to conduct an epic battle. Battle Simulator 3060 The program simulates an epic battle between a powerfulMagus (human player) and a horde of evil Mugwumps (computer player). Using rules from some generic tabletop game, the player will attempt to vanquish the evil scourge and save the kingdom The core of this game should be the same as the previous Battle Simulator 3050. The only necessary changes are to create the Magus class and to modify the BattleSim to run a horde of Mugwumps. The Magus The Magus uses six six-sided dice to compute starting hit points and only rolls a six-sided die for initiative (making it more likely the mugwumps would go first) The Magus, however, has two powerful attacks at his or her disposal: 1. Her or his Vampiric Touch hits the nearest Mugwump on a roll of 5 or better. It does 3 four-sided dice in damage, and heals the Magus an equal amount (up to his or her starting hit points) 2. Her or his Flame Blast hits all Mugumps on a roll of two or better, and does six 8-sided dice in damage to each of them. The Horde You will represent the horde of mugwumps using an array. Initially, the horde will contain 20 mugwumps. When the horde attacks, each living mugwump in the horde has a mugwump (any one) can rol initiative for the entire horde For simplicity, when reporting on the status of the horde, just report the number of surviving mugwumps, rather than the life total of each. umberoflivingmuguumps) chance of attacking. One Battle End A combatant is out of the battle when her or his Hit Points go to zero below or below. If all the mugwumps in the horde are defeated, the Magus wins, and an appropriately exultant message is displayed. If the Magus fails she or he is mocked by the evil Mugwump It is difficult for every member of a horde to reach the Magus, but as their numbers dwindle, it becomes easier Die Magus VAMPIR H : int= 1 (ea + MIN SIDES nt 2 (read-only) + MAX SIDES : int 100 (read-only! + DEFAULT SIDES 6 (read-only) currentValue: int numberOfSides: int hitPoints: int startingHitPoints: int Random -vampiricTouch : Attack flameBlast : Attack -d6: Die +Die(numberOfSldes: int) +getNumberOfSides0: int +getCurrentValue): int +roll) void +Maguso +getHitPoints0: int BattleSim rolllnitiative): int +takeDamage(damage: int) void + attack(type: int, mugwumps: Mugwump[I) void +MAGUS int-1 fread-only +MUGWUMP int 2 (read-only + d100 Die fread-only) indexOfNearest(mugwumps Mugwump]): int rollHitPoints0: int + main(args : String[I: void +introo void texchangeBlows(magus: Magus, mps Mugwumpl. void Mugwump +numberSurviving(mugwumps Mugwumpl) - in + reportStatus(magus Magus +CLAWS int 1 fread-only) +FANGS int 2 read-only +attackChoi +initiative(magus Magus, hitPoints: int startingHitPoints: int claws: Attack + victory0: void + defeat0 void +playAgain(in : Scanner): boolean fangs : Attack d6 Die d10 Die d100 Die Attack -toHitNumber: int damageDie Die damageRolls: int hitMessage: String missMessage String d20 Die +Mugwump0 + getHitPoints0: int +rollinitiative int +takeDamage(damage : int): void attack(warrior Warrior) void +Attack( toHitNumber: int, damageDie: int, damageRolls: int, hitMessage String, missMessage String) rollHitPoints0: int ai0: int + doAttack): int Sample Run Welcome to Battle Simulator 3060! The world's even more low tech battle simulator! You are a Powerful Magus defending your humble village from a horde of evil Mugwumps! Fight bravel or the citizens of your town wi1l be the Mugwumps' dinner! You have your Vampiric Touch, which deals damages to one muguump and heals you slightly You also have your Flame Blast, which deals a large amount of damage to the entire horde Let the epic battle begin! The magus has 15 hit points 20 mugrumps swarm about you The Magus goes first Do you 1) Drain the life from the nearest mugvump, healing slightly, or 2) Douse the entire mob in fire with a flame blast? You scorch the mob of mugwumps with a wave of fire dealing 25 damage The Mugwump licks its wounds, healing 4 points of damage The Mugurump swipes its claws at you in vain The Mugurump swipes its claws at you in vain The magus has 15 hit points 20 mugrumps swarm about you The Mugwumps go first The Mugurump swipes its claws at you in vain The Mugurump swipes its claws at you in vain The Mugwump viciously gouges you vith its razor-sharp clavs for 4 damage Do you 1) Drain the life from the nearest mugvump, healing slightly, or 2) Douse the entire mob in fire with a flame blast? You scorch the mob of mugwumps with a wave of fire dealing 25 damage The magus has 11 hit points 10 mugwumps svarm about you The Mugwumps go first The Mugurump swipes its claws at you in vain The Mugwump licks its wounds, healing 3 points of damage The Mugwump licks its wounds, healing 4 points of damage The Mugurump swipes its claws at you in vain Do you 1) Drain the life from the nearest mugvump, healing slightly, or 2) Douse the entire mob in fire with a flame blast? You scorch the mob of mugwumps with a wave of fire dealing 26 damage You have finally slain the entire horde of vile Mugwumps In their gratitude, the villagers hold a feast in vour honor Play again? [y] Thanks for participating in the Battle Simulator 3060. Have a nice day! Die Warrion + IN SIDES: int 2 (read-only + AX SIDES: int 100 (read-only) +DEFAULT SIDES 6 (read-only) +SWORD int 1fread-only + SHIELD : int 2(read-only} - hitPoints: int -sword: Attack shield: Attack d10:Die currentValue int numberOfSides: int Random +Die(numberOfSldes: int) +getNumberOfSides): int +getCurrentValue): int +roll void +Warrior( + getHitPoints0: int +rollinitiative int +takeDamage(damage: int) void + attack(type: int, mugwump : Mugwump) : void BattleSim WARRIOR int 1 fread-only) MUGWUMP : ir -1 rollHitPoints0: int + main(args: String) : void +intro) void +exchangeBlows(warrior Warrior mugwump MugWump, in : Scanner): void Mugwump +reportStatus(warrior: Warrion + CLAWS-int 1 fread-only) +FANGS: int 2 read-only) mugwump MugWump): void +attackChoice(in Scanner): int + initiative(warrior : Warrior mugwump MugWump): void hitPoints int startingHitPoints: int -claws:Attack fangs: Attack d6: Die d10 Die d100:Die + victory0 void + defeat) void +playAgain(in Scanner) : boolean Attack toHitNumber: int damageDie Die damageRolls: int hitMessage: String missMessage: String d20 Die + Mugwumpo +getHitPoints0: int rolllnitiative int +takeDamage(damage: int): void +attack(warrior: Warrior): void Attack( toHitNumber: int, damageDie: int, damageRolls: int, rollHitPoints0: int ai0: int hitMessage: String, missMessage: String) + doAttack): int

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Database Development For Dummies

Authors: Allen G. Taylor

1st Edition

978-0764507526

More Books

Students also viewed these Databases questions