Click here to Skip to main content
15,891,841 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
The game is made up of five units. Four friendly units (Warrior, Rogue, Archer and Mage)
and one enemy unit (Ogre). Each unit must be able to Display(), Attack() and Defend(). You
must ensure that the attack behavior and a defend behavior are set dynamically and that
they are interchangeable. The following guidelines on the units are given to be used at
instantiation time:
• Ogre: ClubAttack, NoDefend
• Warrior: SwordAttack, ShieldDefend
• Rogue: DaggerAttack, ShieldDefend
• Archer: ArrowAttack, NoDefend
• Mage: Adapt the given code (next page) to work with project:

public class Mage
{
public object fireball()
{
return"CAST A FIREBALL"
}
public object orb
{
return "Cast orb protection"
}
}


Equipment
The units should have the functionality to be dynamically decorated with equipment and
allow for unlimited additions. For this simulation the Warrior should get three “Golden
Rings” and the Mage one “Topaz Amulet”. Have a single “Golden Ring” removed from the
Warrior whenever the “Remove Ring from Warrior” button is clicked until the Warrior has no
more rings outfitted.
Note: Display a MessageBox if there is no ring left to beremoved.
Upgrades
The units should have the functionality to be dynamically decorated with upgrades to both
their base weapon class and base armor class. Use +10 for each armor upgrade and +1 for
each weapon upgrade. The upgrades should be unlimited. You do not need to upgrade the
base armor or base weapon class of the Mage.
Bonus Marks: Include the functionality to upgrade the Ogre’s armor class and weapon
class.

Weapons Messages
The Weapons textbox must display the damage information for each unit. This value must
be accumulative taking into account the base damageand all weapon upgrades.
• Ogre base damage is 20
• Warrior base damage is 10
• Archer base damage is 9
• Rogue base damage is 8
• Mage base damage is 15

NOTE: The damage value should be displayed for each unit’s behavioural attack as
indicated on Figure 1.
Bonus marks. Give units the functionality to be decorated with aweapon and allow the units
to use that weapon for the attack. For example decorate the “Warrior” with “Excalibur”
resulting in the following output: Warrior : Attack with Excalibur. [21].
Armor Messages:
The Armor textbox must display the armor information for each unit. This value must be
accumulative taking into account the base armor class and all armor upgrades.
• Ogre base armor is 0
• Warrior base armor is 0
• Archer base armor is 0
• Rogue base armor is 0
• Mage base armor is 0
NOTE: The armor value should be displayed each unit’s behavioral defense as indicated on


Hit points
Each unit must have hit points which will be adjusted according to the damage inflicted upon
it by the Ogre. Starting hit points;
• Ogre starts with 1000 hit points
• Warrior starts with 250 hit points
• Archers starts with 100 hit points
• Rogues starts with 100 hit points
• Mages starts with 100 hit points


Combat
Combat can be divided into three section: the party, units combatting with the ogre and ogre
combatting the units.

The Party
The four friendly units must belong to the party tobe able to engage in combat. Ensure they
are assigned to the party when the simulation starts. When a party member flees or dies, the
unit is no longer a member of the party and will disengage from combat. You can then
remove it from the party list. Make sure you updatethe Party Members textbox (see below)
to reflect any changes to the party. Also in brackets [] indicate the current hit points of each
unit.

Ogre Combatting the Units
When the “Ogre Deal Damage” button is clicked, the Ogre will attack all the party members
(listed in Party Members). The Ogre must be able to dynamically change his weapon to
either a Club or Sword. Also, the attacks of the Ogre must be modified according to the unit’s
armor upgrades. Use the following formula:
formula = ogreDamage - (unit.Armor() / 10);
Update the (Feedback Round x) and (Party Member) textboxes each time you click “Ogre
Deal Damage”. An example is provided. The attacks of the Ogre should be listed under
(Feedback Round x) and the members and their respective hit points in [] under (Party
Members).

Party Combating the Ogre
When the “Combat” button is clicked, the units in the party will attack the Ogre and inflict
physical damage to it. The attacks of each unit must take into account all weapon upgrades
made to it.
Update the (Feedback Round x) textbox for each timeyou click “Combat”. An example is
provided.
Leader
Make use of a delegateto assign the warrior unit as the leader of the group. Each time you
click on “Combat” he must display the message “Charge!”. If the warrior dies, or flees,
deregister the warrior as a delegate and indicate on the screen the party is leaderless.
Sorting
Please Note: You must sort all the textboxes on the simulationinterface alphabetically.
Posted
Updated 4-Oct-14 10:10am
v4
Comments
CHill60 4-Oct-14 13:15pm    
We don't do homework
Setshabelo 4-Oct-14 13:36pm    
its not a home work its a project cud kindly help or gve me ideas on how to go about it, i have sreenshot of how the game should look like
CHill60 4-Oct-14 13:44pm    
That's not how things work here. If you want someone to write your code for you there are plenty of other sites (but they charge, sometimes a lot of money)
Besides, reading your post you already have some code to give you a hint ... "Adapt the given code (next page)"
If you have just chosen this homework-sounding project at random then you must already have an idea on how to go about it, otherwise choose simpler projects until you have a better understanding of programming
BillWoodruff 4-Oct-14 13:42pm    
Sounds like a great learning experience is waiting for you to begin. When you have done some planning, and created a prototype, come back with specific questions and carefully selected examples of your code.
Setshabelo 4-Oct-14 13:48pm    
yah! i olready have a little idea because i started with a uml diagram 1st,i guesss it will lead me step by step , i just needed some little help or more ideas
not a full source code

1 solution

OK, since you didn't ask a question at all, it's pretty much impossible to tell you anything useful.

Well, other than "Permission Granted, please proceed with your development work!"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900