Files
cc3k/src/constants.h
a25liang 234f06191a - Moved calc_dmg to characters.h
- put vampire into new source files
2024-07-02 20:39:48 -04:00

70 lines
2.1 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"
const int INF = 0x3F3F3F3F;
enum error {none};
// TODO: update result to include subject
enum result {fine, died, go_down, hit, moved, miss};
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 = 3; // TODO: update as you go
enum race {unknown = 0, rshade , rvampire /* TODO: fill out the other races (including enemies) */};
// TODO: fill out the other races (including enemies)
const int MAX_HP[RACE_CNT] = {0, 125, INF};
const int STARTING_HP[RACE_CNT] = {0, 125, 50};
const int STARTING_ATK[RACE_CNT] = {0, 25, 25};
const int STARTING_DEF[RACE_CNT] = {0, 25, 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 {east = 0, west, north, south, northeast,
northwest, southeast, southest
};
const position MOVE[DIRECTION_CNT] = {
{1, 0}, {-1, 0}, {0, -1}, {0, 1},
{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;
typedef std::vector<position> position_list;
typedef std::vector<direction> direction_list;
#endif