00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef DEFINES_H
00012 #define DEFINES_H
00013
00014 #define NUM_MONSTER_SPELL_SLOTS 6
00015
00016 #define ESCAPE '\x1b' // most ansi-friendly way I can think of defining this.
00017
00018
00019 #ifndef _LIBUNIX_IMPLEMENTATION
00020 #else
00021 #ifndef TRUE
00022 #define TRUE 1
00023 #endif
00024
00025 #ifndef FALSE
00026 #define FALSE 0
00027 #endif
00028 #endif
00029
00030
00031 #define CYCLE_LENGTH 200
00032
00033
00034 #define CYCLE_INTERVAL 50
00035
00036
00037 #define SPAWN_SIZE 1
00038
00039
00040 #define BOSS_MONSTER_EXTRA_POWER 5
00041
00042
00043 #define FREQUENCY_OF_RUNES 7
00044
00045
00046 #define ENDOFPACK 52
00047
00048
00049 const int STR_REQ_THRESHOLD = 10;
00050
00051
00052 const int MAX_GHOSTS = 10;
00053
00054 #define NON_ENTITY 27000
00055
00056 enum extra_monster_index_type
00057 {
00058 MAX_MONSTERS = 700,
00059 ANON_FRIENDLY_MONSTER = MAX_MONSTERS,
00060 NON_MONSTER = NON_ENTITY,
00061
00062 MHITNOT = NON_MONSTER,
00063 MHITYOU,
00064
00065 ZOT_TRAP_MISCAST,
00066 WIELD_MISCAST,
00067 MELEE_MISCAST,
00068 MISC_MISCAST,
00069 };
00070
00071
00072 #define NUM_MON_ENCHANTS 6
00073
00074
00075 #define MAX_MONS_ALLOC 20
00076
00077 #define MAX_SUBTYPES 50
00078
00079
00080 #define MAX_ITEMS 2000 // //
00081
00082 #define NON_ITEM NON_ENTITY
00083
00084 #if NON_ITEM <= MAX_ITEMS
00085 #error NON_ITEM must be > MAX_ITEMS
00086 #endif
00087
00088
00089 #define MAX_CLOUDS 600
00090
00091
00092 #define EMPTY_CLOUD NON_ENTITY
00093
00094 #if EMPTY_CLOUD <= MAX_CLOUDS
00095 #error EMPTY_CLOUD must be > MAX_CLOUDS
00096 #endif
00097
00098
00099 #define GXM 80
00100
00101 #define GYM 70
00102
00103 const int INFINITE_DISTANCE = 30000;
00104
00105
00106 #define BOUNDARY_BORDER 1
00107
00108
00109
00110 const int MAPGEN_BORDER = 2;
00111
00112 const int LABYRINTH_BORDER = 4;
00113
00114
00115
00116
00117
00118 #define X_BOUND_1 (-1 + BOUNDARY_BORDER)
00119 #define X_BOUND_2 (GXM - BOUNDARY_BORDER)
00120 #define X_WIDTH (X_BOUND_2 - X_BOUND_1 + 1)
00121
00122 #define Y_BOUND_1 (-1 + BOUNDARY_BORDER)
00123 #define Y_BOUND_2 (GYM - BOUNDARY_BORDER)
00124 #define Y_WIDTH (Y_BOUND_2 - Y_BOUND_1 + 1)
00125
00126
00127 #define LOS_RADIUS 8
00128
00129 #define LOS_RADIUS_SQ (LOS_RADIUS * LOS_RADIUS + 1)
00130
00131 #define LOS_MAX_RADIUS LOS_RADIUS
00132 #define LOS_MAX_RADIUS_SQ (LOS_MAX_RADIUS * LOS_MAX_RADIUS + 1)
00133
00134
00135
00136 #define LOS_MAX_RANGE LOS_MAX_RADIUS
00137 #define ENV_SHOW_OFFSET LOS_MAX_RANGE
00138 #define ENV_SHOW_DIAMETER (ENV_SHOW_OFFSET * 2 + 1)
00139
00140 #define VIEW_BASE_WIDTH 33 // FIXME: never used
00141 #define VIEW_MIN_WIDTH ENV_SHOW_DIAMETER
00142 #define VIEW_MIN_HEIGHT ENV_SHOW_DIAMETER
00143 #define MSG_MIN_HEIGHT 5
00144
00145
00146 #define MAX_TRAPS 400
00147
00148
00149 #define MAX_SHOPS 64
00150
00151
00152
00153 #define MAX_RANDOM_SHOPS 5
00154
00155
00156 #define AUTOMATIC_HIT 1500
00157
00158
00159 const int DEBUG_COOKIE = 32767;
00160
00161 const int MAX_SKILL_LEVEL = 27;
00162 const int MAX_EXP_TOTAL = 8999999;
00163 const int MAX_EXP_POOL = 20000;
00164 const int FULL_EXP_POOL = MAX_EXP_POOL;
00165
00166 const int MIN_HIT_MISS_PERCENTAGE = 5;
00167
00168
00169 const int MONSTER_LOS_RANGE = LOS_RADIUS;
00170
00171
00172 const int MAX_ROD_CHARGE = 17;
00173 const int ROD_CHARGE_MULT = 100;
00174
00175 const int BASELINE_DELAY = 10;
00176 const int GOURMAND_MAX = 200 * BASELINE_DELAY;
00177 const int GOURMAND_NUTRITION_BASE = 10 * BASELINE_DELAY;
00178
00179 const int CHUNK_BASE_NUTRITION = 1000;
00180
00181 const int ICEMAIL_MAX = 10;
00182 const int ICEMAIL_TIME = 300 * BASELINE_DELAY;
00183
00184
00185 #define MAX_GOD_ABILITIES 5
00186
00187
00188 const int MAG_IMMUNE = 5000;
00189
00190
00191 const int INSTANT_DEATH = -9999;
00192
00193
00194
00195 const int MAX_WPN_ENCHANT = 9;
00196
00197
00198 const int MAX_ARM_ENCHANT = 8;
00199 const int MAX_SEC_ENCHANT = 2;
00200
00201
00202 #define POWER_DECAY 50
00203
00204 const int MAX_KNOWN_SPELLS = 21;
00205
00206 const int INVALID_ABSDEPTH = -1000;
00207
00208 const int DEPTH_ABYSS = 51;
00209 const int DEPTH_PAN = 52;
00210
00211 const int BRANCH_DUNGEON_DEPTH = 27;
00212
00213 const int ANTITRAIN_PENALTY = 2;
00214
00215 #define TORNADO_RADIUS 5
00216
00217 #define NUMBER_OF_RUNES_NEEDED 3
00218
00219
00220 #define MAX_UNRANDARTS 100
00221
00222
00223 #define haste_mul(x) div_rand_round((x) * 3, 2)
00224 #define haste_div(x) div_rand_round((x) * 2, 3)
00225
00226
00227 #define menv env.mons
00228 #define mitm env.item
00229 #define grd env.grid
00230 #define mgrd env.mgrid
00231 #define igrd env.igrid
00232
00233
00234 #ifndef TARGET_OS_DOS
00235
00236 enum COLORS
00237 {
00238 BLACK,
00239 BLUE,
00240 GREEN,
00241 CYAN,
00242 RED,
00243 MAGENTA,
00244 BROWN,
00245 LIGHTGRAY,
00246 LIGHTGREY = LIGHTGRAY,
00247 DARKGRAY,
00248 DARKGREY = DARKGRAY,
00249 LIGHTBLUE,
00250 LIGHTGREEN,
00251 LIGHTCYAN,
00252 LIGHTRED,
00253 LIGHTMAGENTA,
00254 YELLOW,
00255 WHITE,
00256 MAX_TERM_COLOUR
00257 };
00258 #else
00259 # include <conio.h>
00260 # define LIGHTGREY LIGHTGRAY
00261 # define DARKGREY DARKGRAY
00262 # define MAX_TERM_COLOUR 16
00263 #endif
00264
00265
00266
00267
00268
00269
00270 #define COLFLAG_CURSES_BRIGHTEN 0x0080
00271
00272 #define COLFLAG_FRIENDLY_MONSTER 0x0100
00273 #define COLFLAG_NEUTRAL_MONSTER 0x0200
00274 #define COLFLAG_WILLSTAB 0x0400
00275 #define COLFLAG_MAYSTAB 0x0800
00276 #define COLFLAG_ITEM_HEAP 0x1000
00277 #define COLFLAG_FEATURE_ITEM 0x2000
00278 #define COLFLAG_TRAP_ITEM 0x4000
00279 #define COLFLAG_REVERSE 0x8000
00280 #define COLFLAG_MASK 0xFF00
00281
00282 enum CHAR_ATTRIBUTES
00283 {
00284 CHATTR_NORMAL,
00285 CHATTR_STANDOUT,
00286 CHATTR_BOLD,
00287 CHATTR_BLINK,
00288 CHATTR_UNDERLINE,
00289 CHATTR_REVERSE,
00290 CHATTR_DIM,
00291 CHATTR_HILITE,
00292
00293 CHATTR_ATTRMASK = 0xF,
00294
00295 CHATTR_COLMASK = 0xF00,
00296 };
00297
00298 #define PDESCS(colour) (colour)
00299 #define PDESCQ(qualifier, colour) (((qualifier) * PDC_NCOLOURS) + (colour))
00300
00301 #define PCOLOUR(desc) ((desc) % PDC_NCOLOURS)
00302 #define PQUAL(desc) ((desc) / PDC_NCOLOURS)
00303
00304
00305
00306
00307 #define CONTROL(xxx) ((xxx) - 'A' + 1)
00308
00309 #define ARRAYSZ(x) (sizeof(x) / sizeof(x[0]))
00310 #define RANDOM_ELEMENT(x) (x[random2(ARRAYSZ(x))])
00311
00312 const char * const MONSTER_HIT_DICE = "monster-hit-dice";
00313 const char * const MONSTER_NUMBER = "monster-number";
00314 const char * const CORPSE_NEVER_DECAYS = "corpse-no-decay";
00315 const char * const MONSTER_MID = "monster-mid";
00316
00317
00318 #define KEY_MACRO_MORE_PROTECT -10
00319 #define KEY_MACRO_DISABLE_MORE -1
00320 #define KEY_MACRO_ENABLE_MORE -2
00321
00322
00323 enum GotoRegion
00324 {
00325 GOTO_CRT,
00326 GOTO_MSG,
00327 GOTO_STAT,
00328 GOTO_DNGN,
00329 GOTO_MLIST,
00330 };
00331
00332
00333 enum mouse_mode
00334 {
00335 MOUSE_MODE_NORMAL,
00336 MOUSE_MODE_COMMAND,
00337 MOUSE_MODE_TARGET,
00338 MOUSE_MODE_TARGET_DIR,
00339 MOUSE_MODE_TARGET_PATH,
00340 MOUSE_MODE_MORE,
00341 MOUSE_MODE_MACRO,
00342 MOUSE_MODE_MAX,
00343 };
00344
00345 #define PI 3.14159265359f
00346
00347 #endif