#ifndef _STRUCTS_H_3e1cf0f1_ #define _STRUCTS_H_3e1cf0f1_ /* * Data structure definitions, including relevant constants. */ #include #include #include "param.h" /* * Levels are `named' by numbers. These are the numbers for the * special levels: the elemental planes, the underworld, and hell. */ #define L_EARTH (-1) #define L_AIR (-2) #define L_FIRE (-3) #define L_WATER (-4) #define L_UNDERWORLD (-5) #define L_HELL (-6) // The (algebraeically) lowest elemental level number. #define L__FIRSTELEM (-4) // The number of elemental levels. #define L__NELEM 4 // Negative of the most-negative special level number. #define LEVEL_OFFSET 6 // Total number of levels. #define N_LEVELS (DUNGEON_LEVELS+LEVEL_OFFSET) /* * An inventory type. There are two types of inventories: those * carried by monsters (incuding the player) and those in locations. * IT_MON corresponds to the former, IT_LOC to the latter. */ typedef enum { IT_MON = 1, IT_LOC } INVTYPE; /* * The possible kinds of traps. */ typedef enum { TRAP_ARROW = 1, TRAP_TRAPDOOR, TRAP_PIT } TRAPTYPE; /* * PIK = Prob Init Kind. These are used to describe probabilities of, * eg, monster spawning. See PROBINIT, below. */ typedef enum { PIK_END = 1, PIK_LEV } PIKIND; /* * The possible kinds of location. * * ROCK is a completely undug cell. WALL is a cell forming the * boundary between dug and undug. SDOOR is a secret door the player * is not yet aware exists. CAVE is dug space - most of the * player-accessible cells are CAVE. GATE is a gate between planes. * DOOR is, well, a door. * * Some of these have subtypes (for example, WALL has variants for * horizontal, vertical, and corners). These subtypes are recorded * separately - see LOC, below. */ typedef enum { LOC_ROCK = 1, LOC_WALL, LOC_SDOOR, LOC_CAVE, LOC_GATE, LOC_DOOR } LOCTYPE; /* * These are the subtypes of LOC_CAVE. JUSTCAVE is plain old boring * empthy space; STARS_U and STAIRS_D are stairs up and down. */ typedef enum { LOC_JUSTCAVE = 1, LOC_STAIRS_U, LOC_STAIRS_D } CAVETYPE; /* * These are the subtypes of LOC_GATE. Which level the "in" and "out" * gates link to depends on the level the gate appears on. */ typedef enum { /* subtypes of LOC_GATE */ LOC_GATE_IN = 1, LOC_GATE_OUT } GATETYPE; typedef struct invobj INVOBJ; typedef struct level LEVEL; typedef struct loc LOC; typedef struct monops MONOPS; typedef struct monst MONST; typedef struct montype MONTYPE; typedef struct mtinfo MTINFO; typedef struct obj OBJ; typedef struct objops OBJOPS; typedef struct objtype OBJTYPE; typedef struct shop SHOP; typedef struct time TIME; typedef struct trail TRAIL; typedef struct trap TRAP; typedef struct invent INVENT; typedef struct xy XY; typedef struct jmp JMP; typedef struct probinit PROBINIT; /* * These are used as part of SIGINT handling. See signals.c. */ struct jmp { jmp_buf b; } ; /* * Used in various places for coordinate pairs, either absolute or * relative. */ struct xy { short int x; short int y; } ; /* * Time. Time is nominally measured in "ticks", whose size is * unspecified. Since we want to be able to represent less than a * tick (eg, for hasted monsters), we also keep tick fractions, * represented as integers (uticks) divided by 1<