/* File: borg1.h */ /* Purpose: Header file for "borg1.c" -BEN- */ #ifndef INCLUDED_BORG1_H #define INCLUDED_BORG1_H #include "angband.h" #ifdef ALLOW_BORG /* * This file provides support for "borg1.c". */ /*** Some constants ***/ /* * Maximum possible dungeon size */ #define AUTO_MAX_X MAX_WID #define AUTO_MAX_Y MAX_HGT /* * Flags for the "info" field of grids * * Note that some of the flags below are not "perfect", in particular, * several of the flags should be treated as "best guesses", see below. * * The "BORG_MARK" flag means that the grid has been "observed", though * the terrain feature may or may not be memorized. Note the use of the * "FEAT_NONE", "FEAT_FLOOR", and "FEAT_INVIS" feature codes below. * * The "BORG_GLOW" flag means that a grid is probably "perma-lit", but * sometimes it is really only "recently" perma-lit, but was then made * dark with a darkness attack, and it is now torch-lit or off-screen. * * The "BORG_DARK" flag means that a grid is probably not "perma-lit", * but sometimes it is really only "recently" dark, but was then made * "lite" with a "call lite" spell, and it is now torch-lit or off-screen. * * The "BORG_LITE" flag means that a grid is probably lit by the player * torch, but this may not be true if the nearby "BORG_VIEW" flags are * not correct, or if the "lite radius" has changed recently. * * The "BORG_VIEW" flag means that a grid is probably in line of sight * of the player, but this may not be true if some of the grids between * the player and the grid contain previously unseen walls/doors/etc. * * The "BORG_TEMP" flag means that a grid has been added to the array * "auto_temp_x"/"auto_temp_y", though normally we ignore this flag. * * The "BORG_XTRA" flag is used for various "extra" purposes, primarily * to assist with the "update_view()" code. */ #define BORG_MARK 0x01 /* observed grid */ #define BORG_GLOW 0x02 /* probably perma-lit */ #define BORG_DARK 0x04 /* probably not perma-lit */ #define BORG_OKAY 0x08 /* on the current panel */ #define BORG_LITE 0x10 /* lit by the torch */ #define BORG_VIEW 0x20 /* in line of sight */ #define BORG_TEMP 0x40 /* temporary flag */ #define BORG_XTRA 0x80 /* extra flag */ /* * Maximum size of the "lite" array */ #define AUTO_LITE_MAX 1536 /* * Maximum size of the "view" array */ #define AUTO_VIEW_MAX 1536 /* * Number of grids in the "temp" array */ #define AUTO_TEMP_MAX 1536 /* * Number of grids in the "flow" array */ #define AUTO_FLOW_MAX 1536 /* * Enable the "borg_note()" usage of the Recall Window * Also specify the number of "rolling rows" to use */ #define BORG_NOTE_ROWS 12 /* * Size of Keypress buffer */ #define KEY_SIZE 8192 /* * Object information */ typedef struct auto_take auto_take; struct auto_take { s16b k_idx; /* Kind index */ bool known; /* Verified kind */ bool seen; /* Assigned motion */ bool extra; /* Unused */ byte x, y; /* Location */ s16b when; /* When last seen */ }; /* * Monster information */ typedef struct auto_kill auto_kill; struct auto_kill { s16b r_idx; /* Race index */ bool known; /* Verified race */ bool awake; /* Probably awake */ bool seen; /* Assigned motion */ bool used; /* Assigned message */ byte x, y; /* Location */ byte ox, oy; /* Old location */ byte speed; /* Estimated speed */ byte moves; /* Estimates moves */ s16b power; /* Estimated hit-points */ s16b other; /* Estimated something */ s16b when; /* When last seen */ }; /* * OPTION: Use the "room" support * * Note -- this option causes slight bugs in "borg-ext.c" that * I have not yet tracked down. You have been warned... */ /* #define BORG_ROOMS */ #ifdef BORG_ROOMS /* * OPTION: Allow rooms to intersect. This is "pretty" but inefficient. */ /* #define CROSS_ROOMS */ /* * Maximum number of rooms. This may be too small. * But if AUTO_ROOMS * sizeof(auto_room) > 64K then some * machines may not be able to allocate the room array. */ #define AUTO_ROOMS (AUTO_MAX_X * AUTO_MAX_Y / 8) /* * Forward declare */ typedef struct auto_room auto_room; /* * A room in the dungeon. 20 bytes. * * The "rooms" are designed to (1) optimize the storage of information * about the map and (2) simplify navigation. Thus, we create rooms by * grouping relevant rectangles of grids together. This includes all * "normal" rooms in the dungeon, most "corridors", occasional "thick" * corridors, all left-over floor grids, and many regions in the town. * * A room index of "zero" means that the grid is not in any room yet * A room index N such that 0