Skip to content
Snippets Groups Projects
Commit 0c42f4c0 authored by Jake Feddersen's avatar Jake Feddersen
Browse files

Finish 1.09

parent 8d658f8d
No related branches found
No related tags found
No related merge requests found
......@@ -65,4 +65,11 @@
4/8: Add item factory, implement item class and rendering
4/9: Actually add item generation to the game
Fix memory leaks
4/10: Begin implementing new commands for items
4/11: Continue implementing new commands for items
4/12: Finish implementing items, begin implementing combat
4/15: Finish updated combat implementation
Implement game end when boss is killed
Implement monsters pushing each other out of the way
Fix bug where PC loses inventory when going up or down stairs
Rogue-Like Game COMS 327
Generates or loads a dungeon map and optionally saves it to a file.
Generates random monsters in the dungeon, and runs based on player
input until the game is over.
More or less final version of the game. Functional gameplay with
items and monsters implemented.
Compile: `make`
Run: `./rlg327`
For all options, run: `./rlg327 -h`
For this assignment I implemented monster and object generation based on the
descriptions we parsed in the last assignment. I used Dr. Sheaffer's code,
only for description parsing. I did not implement any of the optional new
monster abilities yet, and I did not implement object pickup because I could
not find anything about how that should work in the assignment.
In this assignment, monsters and items become functional in a basic way.
Combat is updated, and the game does not end until the boss (Spongebob) is
defeated or the player character dies.
I implemented color using ncurses and I got color flickering NPCs using
the ncurses timeout() function. I implemented stacks of objects by creating
a vector for each position in the map, so the depth of a stack of items
has no hard limit.
I implemented selective pickup. When standing over an object, select ',' to
choose from the objects at that location to pick up.
The teleport command is switched to 'g' to make way for 't' to be take off.
The status area at the bottom of the screen now shows the player hitpoints
and speed.
The player character retains its inventory and attributes when going up
or down stairs by saving a pointer to the instance and inserting it into
the new level. Items are not lost by transitioning to a new level.
......@@ -77,6 +77,10 @@ std::string item::get_name() {
return desc->get_name() + " - Speed:" + std::to_string(speed) + " Damage:" + damage->to_string();
}
void item::pick_up() {
if (desc->get_artifact()) desc->invalidate();
}
monster::monster(uint8_t x, uint8_t y, monster_description *desc, int speed, uint32_t abilities, int hitpoints, dice *damage, char symbol) : character(speed, symbol, hitpoints) {
this->desc = desc;
desc->instances++;
......
......@@ -40,6 +40,7 @@ class item {
int get_color();
char get_symbol();
std::string get_name();
void pick_up();
};
class character {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment