86 lines
2.9 KiB
C++
86 lines
2.9 KiB
C++
// TODO: Consider moving the contents of this header to their relevant
|
|
// headers
|
|
|
|
#ifndef __CONSTANTS_H__
|
|
#define __CONSTANTS_H__
|
|
#include <vector>
|
|
#include "position.h"
|
|
|
|
// IMPORTANT: panic is reserved for invalid results
|
|
|
|
enum error {none};
|
|
|
|
// TODO: update result to include subject
|
|
enum result {fine, died, go_down, hit, moved};
|
|
|
|
enum game_status {terminated, main_menu, in_game, options};
|
|
|
|
enum game_command {game_command_terminate = 0,
|
|
move_north, move_south, move_east, move_west,
|
|
move_northeast, move_northwest,
|
|
move_southeast, move_southwest,
|
|
apply_north, apply_south, apply_east, apply_west,
|
|
apply_northeast, apply_northwest,
|
|
apply_southeast, apply_southwest,
|
|
apply_prompt, apply_panic, // for curses_input specifically
|
|
attack_north, attack_south, attack_east, attack_west,
|
|
attack_northeast, attack_northwest,
|
|
attack_southeast, attack_southwest,
|
|
up_stairs, down_stairs,
|
|
game_command_pass, game_command_panic
|
|
};
|
|
|
|
enum stat_name {HP, ATK, DEF, hostile};
|
|
|
|
const int LAYER_CNT = 4; // TODO: update as you go
|
|
enum layer_num {map = 0, objects, characters, shop};
|
|
|
|
const int RACE_CNT = 2; // TODO: update as you go
|
|
|
|
enum race {unknown = 0, rshade /* TODO: fill out the other races (including enemies) */};
|
|
|
|
// TODO: fill out the other races (including enemies)
|
|
const int MAX_HP[RACE_CNT] = {0, 125};
|
|
const int STARTING_HP[RACE_CNT] = {0, 125};
|
|
const int STARTING_ATK[RACE_CNT] = {0, 25};
|
|
const int STARTING_DEF[RACE_CNT] = {0, 25};
|
|
const char CHARACTER_REP[RACE_CNT] = {'@', 'S'};
|
|
|
|
const int DIRECTION_CNT = 8;
|
|
// IMPORTANT: east is positive for x and SOUTH is positive for y
|
|
// initializes all directions to an int
|
|
enum direction { north = 0, south, east, west, northeast,
|
|
northwest, southeast, southest
|
|
};
|
|
|
|
const position MOVE[DIRECTION_CNT] = {
|
|
{0, -1}, {0, 1}, {1, 0}, {-1, 0},
|
|
{1, -1}, {-1, -1}, {1, 1}, {-1, 1}
|
|
};
|
|
|
|
const int MAP_HEIGHT = 25;
|
|
const int MAP_WIDTH = 79;
|
|
const int DISPLAY_HEIGHT = 30;
|
|
const int DISPLAY_WIDTH = 79;
|
|
|
|
// TODO: list all extra features
|
|
// using constants to keep track of features
|
|
// method: features: FEATURE_XXX | FEATURE_YYY
|
|
// That is: use bit manipulation
|
|
// check if feature is enabled:
|
|
// features & FEATURE_XXX
|
|
typedef unsigned int feature; // can extend to unsigned long (long) if needed
|
|
const feature FEATURE_NCURSES = 1 << 0;
|
|
const feature FEATURE_RAND_MAP = 1 << 1;
|
|
const feature FEATURE_ENEMIES_CHASE = 1 << 2;
|
|
const feature FEATURE_INVENTORY = 1 << 3;
|
|
const feature FEATURE_THROW = 1 << 4;
|
|
const feature FEATURE_REVISIT = 1 << 5;
|
|
const feature FEATURE_LOG = 1 << 6;
|
|
const feature FEATURE_SAVE = 1 << 7;
|
|
|
|
typedef std::vector<position> position_list;
|
|
typedef std::vector<direction> direction_list;
|
|
|
|
#endif
|