Anda di halaman 1dari 3

DV1107 : Assignment 3

March 6, 2011
Your submission must be entirely your own work. Both the design of the code and the actual text of the program itself must be your individual eort. You may not use code that you have not written. If there is any doubt about the authorship of your assignment then you may have an oral viva which you must pass in order to receive credit.

Description

Since the earliest days of student access to computers there have been role playing games (RPGs). Decades ago these started with simple textual interfaces describing the players progress through a dungeon lled with evil monsters and glorious loot. As processing power has improved these games have expanded in scope: during the 80s and 90s increasing access to networks led to MUDs multiplayer games in which player character could explore the game together. Most recently advances in graphical power have allowed the creation of Everquest and World of Warcraft which place the game playing mechanic in a rich 3D world. Your assignment is to write a simple textual version of a RPG. In this game the player character will face a series of monsters of dierent strengths. Rather than inputting choices from the user your player will act automatically in deciding what to do. The game will proceed in encounters, where each encounter is made up of several rounds. For each encounter the game will randomly select a monster. In that encounter there will be a series of rounds until the monster is dead, the player is dead or the player ees. In each round the monster will attack rst then the player will have a chance to attack. The combat will be decided by the formula s + w (d + a): s is the strength of the attacker w is the weapon value of the attacker d is the defense value of the defender a is the armor value of the defender Each of the variables is selected randomly: each type of monster or player will have a strength and defense value associated with them and in each round a random number up to this value will be selected and used for combat in this round. After evaluating the formula the result will be the number of hit points that the defender loses. Each monster and player will start with a xed number of hit points, when the number reaches zero the character dies. If the monster dies then the player wins the encounter. The number of hit points that the player started with is a cap the maximum value of that attribute. Firstly they receive a small 1

recovery bonus of 5% of their maximum hit points (up to but not above the cap). They will receive some randomly chosen loot. Loot may be things like better armor, or better weapons, or health potions that add a number of hit-points. The player also receives score, if the monster had fewer hit points than the player then the score is 10, otherwise it is (m p + 1) 10 where m is the monsters hit-points and p is the players hitpoints. In each round the player has three choices: attack the monster. ee the monster. beserk . If the player attacks then they have a chance of killing the monster, but also a chance of dying. If the player ees then they survive, but they gain no loot before the next encounter and the monster has one nal attack chance. If the player beserks then they lose all further chances to withdraw but they gain a 50% bonus on their combat values. Your program should output a description of what is happening, similar to this: Player Bob enters the dungeon with 10 hp. Player Bob encounters a small rat with 6 hp. The rat attacks doing 2 damage. Player Bob attacks doing 3 damage. The rat attacks doing 1 damage. Player Bob attacks doing 5 damage. The rat dies! Player Bob find a small rusty sword, and a health potion (+5). Player Bob now carries a small rusty sword and has 12 hp. Player Bob encounters a dragon with 100hp. The dragon attacks doing 8 damage. Player Bob goes beserk. Player Bob attacks doing 18 damage. The dragon attacks doing 10 damage. Player Bob is dead!!! Player Bob scored 10 points.

Specication

You must decide how to design this program, as we have been covering the design of classes and objects on the course you can assume that we are looking for an object oriented design from you. remember that you cannot discuss your ideas for this assessment: similarities in design will be treated as plagiarism. Your rst task is to take the informal description and decide which parts of the project you will represent as classes, and how the objects in those classes will related to each other, and where they will be stored. 1. Your submission must be a .zip le containing the entire folder with your project and corresponding source les.

2. Your submitted zip must have a lename with your person-number, this must be a 10-digit number followed by .zip. 3. Your project must compile without any modication on Visual Studio 2010. 4. When executed your program must follow the specication. 5. The deadline in Its Learning is hard. You must submit before it occurs. 6. Your program must include at least ve dierent monsters. 7. You must have made appropriate decisions about the design to avoid unnecessary duplication in each of these dierent monsters. 8. Your program must include at least two dierent players who have separate logic to decide what they will do in each round. 9. The game must follow the structure given. 10. The mechanics of the game (e.g combat formula, adjustment of hit-points etc) must match the description. 11. The output of your program must show what is happening with at least the level of detail shown in the example. 12. The decision made by the player must be local: it can be based on information that the player has, but not on information that is internal to the monster. 13. To receive credit for this assignment you must be present and registered in the Monday, Wednesday and Thursday lab sessions. The labs are mandatory, and we will enforce what it says in the course descriptor about attendence to qualify for credit on this assignment. One more thing: you may nd this assignment daunting. You have not been given a starting point - nding that starting point is one of the things that you are being assessed on. What I will be looking for when I mark your work is evidence that you could read the informal description and decide which classes to design, and how to design them. There is a lot of material in the textbook on this process, and because of the enforced attendence you have nine hours to ask me questions. Good luck.

Anda mungkin juga menyukai