Beruflich Dokumente
Kultur Dokumente
Machine Problem
Release Date
Due Date
:
:
T
P
This room has three exits, one on the east, west and south sides of the room. There can only be one exit per side
of a room (hence why a room can have up to four). This room also contains a treasure (labeled as T), with P
indicating the player location. From here, you may have the player approach the treasure to collect it, or go
through any of the three exits to make the player leave the room.
It is up to your discretion if you want to display the rooms adjacent to the current room the player is in, or to
only display the room the player currently is in. It is important however that once a room has been generated,
its configuration must NOT be changed. Exits, unencountered monsters, uncollected treasure, weapon or armor
and surface links that were previously set up must remain where they are. Remember also that defeating a
monster or collecting treasure, weapon or armor will make the room it occupied empty, if I leave the room and
return to it again, it should remain empty.
What this means is, if I find a monster in a room with a north and south exit, then I head north (avoiding the
monster), if I head back south I should be back in the room with the monster and with a north and south exit. If I
defeat the monster and head south, then head back north, I should be back in the room, this time the room will
be empty but will still have a north and south exit. If I set up a surface link and head north, then back south
again, I should once again be in the same room, this time with a surface link and a north and south exit.
Of course, it goes without saying that exits and entrances must make sense. What this means is that rooms must
be connected, with an exit to one room being connected to the exit of another room; I should be able to
backtrack to previous rooms I have already visited. The rooms need not make sense in 2D space, however.
Finally, after one hundred rooms are generated (this number of rooms should be easy to change), the next room
generated should be the mythical room mentioned in the project description. Entering this room should trigger
the victory of the player, and should take the player to a victory screen.
Page 2
LVL determines how much the player has progressed, and starts at 1 plus any points distributed to
this stat by the player. This is raised as the player defeats enemies or encounters treasure. The amount
of treasure or enemies required to raise the level is equivalent to 30% of the players level rounded up.
DMG determines move much damage the player deals to enemies. This value by default is equivalent
to 80% of the players level rounded up plus any points distributed to this stat by the player, and is
increased by the DMG value of the weapon the player is currently using.
DEF determines the amount of damage mitigated when the player takes damage. This value by default
is equivalent to 20% of the players level rounded up plus any points distributed to this stat by the
player and is increased by the DEF value of the armor the player is currently using.
HP determines how much damage a player can take before dying. The maximum value of this is
equivalent to the players LVL plus any points distributed to this stat by the player and is increased by
the HP value of the armor and the HP value of the weapon the player is currently using. Changing
weapon or armor does not restore HP, it merely increases the players maximum HP. HP is only
restored fully when using surface links. Should the players HP drop to 0, the game is over.
CON determines how much health the player regains after defeating a monster or encounters treasure.
This is equivalent to 20% of the players HP rounded up plus any points distributed to this stat by the
player.
Note that the player only distributes points when the salvager is created (i.e. when the salvager is named). No
other points are distributed to the stats as the game proceeds.
The player also maintains an inventory of items. These items are composed of treasure, weapons and armor,
and the player is permitted to carry as many items he or she can collect. The player, however, can only equip
one weapon and one armor at a time, though he or she may freely switch weapons or armor at any time.
Finally, a player has an amount of credits, which will serve as the players points. A high score table must be
maintained for the game, which contains the top ten points and the names of the players who got them. Victory
in the game is not necessary to achieve a high score, once the end of the game is reached either via victory or
defeat, the players score is considered for the high score table.
equivalent to the value of the treasure. Collecting a treasure instantly restores HP to the player equivalent to the
players CON (though this must not cause the players HP to exceed its maximum value).
Treasures are randomly generated whenever a treasure room is encountered for the first time (thought once
collected, the room will become an empty room). It is up to you how you will generate the name of the treasure,
but its value is computed via the formula:
(
Each salvager always starts with a Sentimental Necklace, which has a value of 10.
Weapons are offensive items a player may equip to help him or her deal with the enemies encountered in the
labyrinth. Each weapon has a name, a DMG value, an HP value and an equivalent value. Weapons are randomly
generated whenever a weapon room is encountered for the first time (thought once collected, the room will
become an empty room). It is up to you how you will generate the name of the weapon, but its value is
computed via the formula:
(
))
Each salvager always starts with a Standard Issue Forceblaster, which has a value of 2, a DMG value of 1 and
an HP value of 1.
Armors are defensive items a player may equip to help him or her deal with the enemies encountered in the
labyrinth. Similar to weapons, each has a name and an HP value but instead of having a DMG value, armors have
DEF values. Armors are randomly generated whenever an armor room is encountered for the first time
(thought once collected, the room will become an empty room). It is up to you how you will generate the name
of the armor, but its value is computed via toe formula:
(
))
Each salvager always starts with a Standard Issue Salvager Uniform, which has a value of 3, a DEF value of 1
and an HP value of 2.
If the players items arent converted to credits (and thus to points), they wont count towards the players final
points.
Page 4
DMG is the amount of damage the enemy will deal when approached. This value is computed as:
(
HP is the amount of damage the enemy can take before being defeated. This value is computed as:
(
))
Boss monsters have 3 times the HP as a normal monster (its HP is computed using the same formula as a
normal monster, but is multiplied by 3), and will turn into treasure after being defeated (the treasure is
generated the same way you will generate a normal treasure).
To fight a monster, a player would simply have to issue a move command that moves the player to the monster.
Doing so will not move the player but will instead cause the monster and the player to deal damage to each
other simultaneously. Damage dealt is computed using the following formula (note that enemies do not have
DEF, and so their DEF value is 0):
(
Once the HP of the monster has been reduced to 0, depending on whether the monster was a boss or a regular
monster, one of the two may happen:
If the monster was a boss monster, the monster will turn into a treasure, generated as if you were
generating a normal treasure. Moving onto the treasure will collect it.
If the monster was a regular monster, the monster is removed from the room, and the room becomes an
empty room.
Page 5
the item in exchange for losing the sold item. Finally, Closing the Link will bring the player back to exploring the
labyrinth (again, the Surface Link itself is not destroyed; it can be accessed again later).
PLAYER ACTIONS, MP PHASES AND DELIVERABLES
At the start of the game, the player will first be asked whether he or she would want to load an existing game or
start a new game.
If the player chooses to start a new game, the player will be asked to name the salvager he or she will be using
for the game session. Then, he or she will be asked to distribute 7 points to any of the players stats (see the
Player section for more information on this).
If the player chooses to load an existing game, the chosen game is loaded and the player may continue playing.
Afterwards, the screen is cleared (you may use the statement system("cls"); to achieve this) ,the player will
be placed in an empty room with four exits. From here, the player may choose any of the following actions:
MOVE moving will prompt the user to input a direction (if you dont want to implement it this way,
you may choose a different implementation), then the player will move one space towards that
direction. The direction choices are North, South, East and West. Note that moving into treasure,
weapon or armor will collect the item, and moving into a monster will fight that monster.
CHECK INVENTORY this action will clear the screen and display all the contents of the players
inventory. Doing so will bring up a numbered list of items, and will prompt the user to either go back to
the game (which will bring the player back to the room he or she was in) or enter a number from the list
of items. Doing so will clear the screen and display the details of that item. The player may then exit the
display and go back to the numbered list of items in the inventory.
SET UP SURFACE LINK this action will clear the screen and display a numbered list of all the treasures
in the players inventory. Selecting one of these treasures will trigger the setting up of a surface link, and
the surface link will be placed in the center of the room the player currently is in. Note that a player may
not select this action if the room was not empty.
EQUIP WEAPON this action will clear the screen and display the players stats and the currently
equipped weapon of the player, followed by a numbered list of all the weapons a player may equip
(taken from his or her inventory). Selecting a number will swap the weapon in the players inventory
with the weapon the player is currently equipping, and will take the player back to the room where he
or she was in.
EQUIP ARMOR this action will clear the screen and display the players stats and the currently
equipped armor of the player, followed by a numbered list of all the armors a player may equip (taken
from his or her inventory). Selecting a number will swap the armor in the players inventory with the
armor the player is currently equipping, and will take the player back to the room where he or she was
in.
CHECK SELF this action will clear the screen and display the players current stats. The player may
then go back to the room where he or she was in.
The availability of these commands, however, is dependent on the MP Phases. The following is a run through of
the MP phases and what you need to prepare for each.
Page 6
Phase 1
For phase 1, the player can only MOVE or CHECK SELF, which behaves similarly to how they were described but
with a few changes.
If the player heads north of the starting room, the player encounters a room with a regular monster (the
monster will be generated randomly) with only one exit (the south exit), and may fight the monster. Once
defeated, the room becomes empty. If the player leaves the room and re-enters, a new regular monster is
generated.
If the player heads west of the starting room, the player encounters a room with a treasure with only one exit
(the east exit), which the player may collect. Collecting the treasure follows the regular procedure for collecting
treasure, but instead of the treasure being stored in the inventory of the player, the treasure is sold
immediately. Leaving and re-entering the room generates a new treasure in the room.
If the player heads east of the starting room, the player encounters a room with a weapon with only one exit
(the west exit), which the player may collect. Collecting the weapon follows the regular procedure for collecting
weapons, but instead of the weapon being stored in the inventory of the player, the weapon is equipped
immediately. Leaving and re-entering the room generates a new weapon in the room.
If the player heads south of the starting room, the player encounters a room with armor with only one exit (the
north exit), which the player may collect. Collecting the armor follows the regular procedure for collecting
armor, but instead of the armor being stored in the inventory of the player, the armor is equipped immediately.
Leaving and re-entering the room generates a new armor in the room.
As you might have noticed, the rooms are not generated at random for phase 1.
Phase 2
For phase 2, you are expected to complete the whole machine project as specified in this document, along with
all the actions and random room generation.
Deliverables
For both phases, you are expected to submit the source code of your machine project as an attachment to your
instructors email, along with the function specifications document (see the separate section on this function
specifications document). Use the subject [COMPRO2] Machine Project Phase <phase number> - <last name>,
<first name> and send it to dimaunahan.ryan.dlsu@gmail.com on or before the specified deadline in your
syllabus.
Function Specifications Document
The format of the function specifications document is as follows. This document is basically a table form
explanation of the functions you used for your program. Take note that failure to follow the format specified will
merit a 0 for your machine project. Failure to submit this document would likewise merit a 0.
Function Name
move
Description
This function moves direction
the player in a certain
direction
*pRoom
Input Parameter
the direction the player is
heading to
a pointer to the current
room
Return Data
This function returns the
address of the new room
the player is heading to.
Page 7
GENERAL REQUIREMENTS
The following general set of guidelines should be followed:
1. The implementation of this project will require you to use C (not C++) to be compiled and ran with
DevC++, or the command prompt compiler.
2. You are required to create and use functions whenever possible. Make sure to modularization principles
properly. No brute force solution.
3. The above description of the program is the basic requirement. Any additional feature will be left to the
creativity of the student. Bonus points would be awarded depending on the additional implemented
features. These additional features could include more logical items and monster generation, better
combat mechanics, etc.. Depending on the scale of the new feature, additional points will be awarded to
the student. However, make sure that all the minimum requirements are met first; if this is not the case
then no additional points will be credited despite the additional features.
4. For the minimum requirements of this MP all features specified in the document should be present and
working. A text based interface would do.
5. Do not forget to include internal documentation (comments) in your code. At the very least, there
should be an introductory comment before every method.
6. Statements and methods not taught in class can be used in the implementation. However, these are left
for the student to learn on his or her own.
7. Submission of the project is on the indicated submission deadlines. Late submissions WILL NOT BE
ACCEPTED.
8. Any instruction not followed will incur deductions (or a 0.0).
9. This project is individual. Copying other peoples work and/or working in collaboration (i.e. sharing
code) with other students are not allowed and are punishable by a grade of 0.0 for the entire COMPRO2
course and a case may be filed with the Discipline Office. In short, do not risk it; the consequences are
not worth the reward. (Also, what is a measly passing grade compared to a life-long conscience
burden?)
10. During the MP demo, the student is expected to appear on time, to answer questions in relation to the
output and to the implementation (source code) of the project, and/or to revise the program based on a
given demo problem. Failure to meet either of these requirements could result to a grade of 0.0 for the
project.
11. It should be noted that during the MP demo, it is expected that the program can be compiled
successfully and will run. If the program does not run, the grade for that phase is 0. However, a running
program with complete features may not necessarily get full credit, as implementation (i.e., code) will
still be checked.
Page 8