Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How can i make the following program? Overview For this assignment, you will implement the classes described by the UML diagram below including a driver
How can i make the following program?
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 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started