Source:NetHack 3.6.0/include/rm.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to rm.h from the source code of NetHack 3.6.0. To link to a particular line, write [[Source:NetHack 3.6.0/include/rm.h#line123]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

  1.  /* NetHack 3.6	rm.h	$NHDT-Date: 1432512776 2015/05/25 00:12:56 $  $NHDT-Branch: master $:$NHDT-Revision: 1.41 $ */
  2.  /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3.  /* NetHack may be freely redistributed.  See license for details. */
  4.  
  5.  #ifndef RM_H
  6.  #define RM_H
  7.  
  8.  /*
  9.   * The dungeon presentation graphics code and data structures were rewritten
  10.   * and generalized for NetHack's release 2 by Eric S. Raymond (eric@snark)
  11.   * building on Don G. Kneller's MS-DOS implementation.	See drawing.c for
  12.   * the code that permits the user to set the contents of the symbol structure.
  13.   *
  14.   * The door representation was changed by Ari
  15.   * Huttunen(ahuttune@niksula.hut.fi)
  16.   */
  17.  
  18.  /*
  19.   * TLCORNER	TDWALL		TRCORNER
  20.   * +-		-+-		-+
  21.   * |		 |		 |
  22.   *
  23.   * TRWALL	CROSSWALL	TLWALL		HWALL
  24.   * |		 |		 |
  25.   * +-		-+-		-+		---
  26.   * |		 |		 |
  27.   *
  28.   * BLCORNER	TUWALL		BRCORNER	VWALL
  29.   * |		 |		 |		|
  30.   * +-		-+-		-+		|
  31.   */
  32.  
  33.  /* Level location types.  [Some debugging code in src/display.c
  34.     defines array type_names[] which contains an entry for each of
  35.     these, so needs to be kept in sync if any new types are added
  36.     or existing ones renumbered.] */
  37.  #define STONE 0
  38.  #define VWALL 1
  39.  #define HWALL 2
  40.  #define TLCORNER 3
  41.  #define TRCORNER 4
  42.  #define BLCORNER 5
  43.  #define BRCORNER 6
  44.  #define CROSSWALL 7 /* For pretty mazes and special levels */
  45.  #define TUWALL 8
  46.  #define TDWALL 9
  47.  #define TLWALL 10
  48.  #define TRWALL 11
  49.  #define DBWALL 12
  50.  #define TREE 13 /* KMH */
  51.  #define SDOOR 14
  52.  #define SCORR 15
  53.  #define POOL 16
  54.  #define MOAT 17 /* pool that doesn't boil, adjust messages */
  55.  #define WATER 18
  56.  #define DRAWBRIDGE_UP 19
  57.  #define LAVAPOOL 20
  58.  #define IRONBARS 21 /* KMH */
  59.  #define DOOR 22
  60.  #define CORR 23
  61.  #define ROOM 24
  62.  #define STAIRS 25
  63.  #define LADDER 26
  64.  #define FOUNTAIN 27
  65.  #define THRONE 28
  66.  #define SINK 29
  67.  #define GRAVE 30
  68.  #define ALTAR 31
  69.  #define ICE 32
  70.  #define DRAWBRIDGE_DOWN 33
  71.  #define AIR 34
  72.  #define CLOUD 35
  73.  
  74.  #define MAX_TYPE 36
  75.  #define INVALID_TYPE 127
  76.  
  77.  /*
  78.   * Avoid using the level types in inequalities:
  79.   * these types are subject to change.
  80.   * Instead, use one of the macros below.
  81.   */
  82.  #define IS_WALL(typ) ((typ) && (typ) <= DBWALL)
  83.  #define IS_STWALL(typ) ((typ) <= DBWALL) /* STONE <= (typ) <= DBWALL */
  84.  #define IS_ROCK(typ) ((typ) < POOL)      /* absolutely nonaccessible */
  85.  #define IS_DOOR(typ) ((typ) == DOOR)
  86.  #define IS_TREE(typ) \
  87.      ((typ) == TREE || (level.flags.arboreal && (typ) == STONE))
  88.  #define ACCESSIBLE(typ) ((typ) >= DOOR) /* good position */
  89.  #define IS_ROOM(typ) ((typ) >= ROOM)    /* ROOM, STAIRS, furniture.. */
  90.  #define ZAP_POS(typ) ((typ) >= POOL)
  91.  #define SPACE_POS(typ) ((typ) > DOOR)
  92.  #define IS_POOL(typ) ((typ) >= POOL && (typ) <= DRAWBRIDGE_UP)
  93.  #define IS_THRONE(typ) ((typ) == THRONE)
  94.  #define IS_FOUNTAIN(typ) ((typ) == FOUNTAIN)
  95.  #define IS_SINK(typ) ((typ) == SINK)
  96.  #define IS_GRAVE(typ) ((typ) == GRAVE)
  97.  #define IS_ALTAR(typ) ((typ) == ALTAR)
  98.  #define IS_DRAWBRIDGE(typ) \
  99.      ((typ) == DRAWBRIDGE_UP || (typ) == DRAWBRIDGE_DOWN)
  100.  #define IS_FURNITURE(typ) ((typ) >= STAIRS && (typ) <= ALTAR)
  101.  #define IS_AIR(typ) ((typ) == AIR || (typ) == CLOUD)
  102.  #define IS_SOFT(typ) ((typ) == AIR || (typ) == CLOUD || IS_POOL(typ))
  103.  
  104.  /*
  105.   * The screen symbols may be the default or defined at game startup time.
  106.   * See drawing.c for defaults.
  107.   * Note: {ibm|dec}_graphics[] arrays (also in drawing.c) must be kept in
  108.   * synch.
  109.   */
  110.  
  111.  /* begin dungeon characters */
  112.  
  113.  #define S_stone 0
  114.  #define S_vwall 1
  115.  #define S_hwall 2
  116.  #define S_tlcorn 3
  117.  #define S_trcorn 4
  118.  #define S_blcorn 5
  119.  #define S_brcorn 6
  120.  #define S_crwall 7
  121.  #define S_tuwall 8
  122.  #define S_tdwall 9
  123.  #define S_tlwall 10
  124.  #define S_trwall 11
  125.  #define S_ndoor 12
  126.  #define S_vodoor 13
  127.  #define S_hodoor 14
  128.  #define S_vcdoor 15 /* closed door, vertical wall */
  129.  #define S_hcdoor 16 /* closed door, horizontal wall */
  130.  #define S_bars 17   /* KMH -- iron bars */
  131.  #define S_tree 18   /* KMH */
  132.  #define S_room 19
  133.  #define S_darkroom 20
  134.  #define S_corr 21
  135.  #define S_litcorr 22
  136.  #define S_upstair 23
  137.  #define S_dnstair 24
  138.  #define S_upladder 25
  139.  #define S_dnladder 26
  140.  #define S_altar 27
  141.  #define S_grave 28
  142.  #define S_throne 29
  143.  #define S_sink 30
  144.  #define S_fountain 31
  145.  #define S_pool 32
  146.  #define S_ice 33
  147.  #define S_lava 34
  148.  #define S_vodbridge 35
  149.  #define S_hodbridge 36
  150.  #define S_vcdbridge 37 /* closed drawbridge, vertical wall */
  151.  #define S_hcdbridge 38 /* closed drawbridge, horizontal wall */
  152.  #define S_air 39
  153.  #define S_cloud 40
  154.  #define S_water 41
  155.  
  156.  /* end dungeon characters, begin traps */
  157.  
  158.  #define S_arrow_trap 42
  159.  #define S_dart_trap 43
  160.  #define S_falling_rock_trap 44
  161.  #define S_squeaky_board 45
  162.  #define S_bear_trap 46
  163.  #define S_land_mine 47
  164.  #define S_rolling_boulder_trap 48
  165.  #define S_sleeping_gas_trap 49
  166.  #define S_rust_trap 50
  167.  #define S_fire_trap 51
  168.  #define S_pit 52
  169.  #define S_spiked_pit 53
  170.  #define S_hole 54
  171.  #define S_trap_door 55
  172.  #define S_teleportation_trap 56
  173.  #define S_level_teleporter 57
  174.  #define S_magic_portal 58
  175.  #define S_web 59
  176.  #define S_statue_trap 60
  177.  #define S_magic_trap 61
  178.  #define S_anti_magic_trap 62
  179.  #define S_polymorph_trap 63
  180.  #define S_vibrating_square 64
  181.  
  182.  /* end traps, begin special effects */
  183.  
  184.  #define S_vbeam 65  /* The 4 zap beam symbols.  Do NOT separate. */
  185.  #define S_hbeam 66  /* To change order or add, see function     */
  186.  #define S_lslant 67 /* zapdir_to_glyph() in display.c.	    */
  187.  #define S_rslant 68
  188.  #define S_digbeam 69   /* dig beam symbol */
  189.  #define S_flashbeam 70 /* camera flash symbol */
  190.  #define S_boomleft 71  /* thrown boomerang, open left, e.g ')'    */
  191.  #define S_boomright 72 /* thrown boomerang, open right, e.g. '('  */
  192.  #define S_ss1 73       /* 4 magic shield glyphs */
  193.  #define S_ss2 74
  194.  #define S_ss3 75
  195.  #define S_ss4 76
  196.  #define S_poisoncloud 77
  197.  #define S_goodpos 78 /* valid position for targeting */
  198.  
  199.  /* The 8 swallow symbols.  Do NOT separate.  To change order or add, see */
  200.  /* the function swallow_to_glyph() in display.c.			 */
  201.  #define S_sw_tl 79 /* swallow top left [1]			*/
  202.  #define S_sw_tc 80 /* swallow top center [2]	Order:	*/
  203.  #define S_sw_tr 81 /* swallow top right [3]		*/
  204.  #define S_sw_ml 82 /* swallow middle left [4]	1 2 3	*/
  205.  #define S_sw_mr 83 /* swallow middle right [6]	4 5 6	*/
  206.  #define S_sw_bl 84 /* swallow bottom left [7]	7 8 9	*/
  207.  #define S_sw_bc 85 /* swallow bottom center [8]		*/
  208.  #define S_sw_br 86 /* swallow bottom right [9]		*/
  209.  
  210.  #define S_explode1 87 /* explosion top left			*/
  211.  #define S_explode2 88 /* explosion top center			*/
  212.  #define S_explode3 89 /* explosion top right		 Ex.	*/
  213.  #define S_explode4 90 /* explosion middle left		*/
  214.  #define S_explode5 91 /* explosion middle center	 /-\	*/
  215.  #define S_explode6 92 /* explosion middle right	 |@|	*/
  216.  #define S_explode7 93 /* explosion bottom left	 \-/	*/
  217.  #define S_explode8 94 /* explosion bottom center		*/
  218.  #define S_explode9 95 /* explosion bottom right		*/
  219.  
  220.  /* end effects */
  221.  
  222.  #define MAXPCHARS 96  /* maximum number of mapped characters */
  223.  #define MAXDCHARS 42  /* maximum of mapped dungeon characters */
  224.  #define MAXTCHARS 22  /* maximum of mapped trap characters */
  225.  #define MAXECHARS 31  /* maximum of mapped effects characters */
  226.  #define MAXEXPCHARS 9 /* number of explosion characters */
  227.  
  228.  #define DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom)
  229.  
  230.  struct symdef {
  231.      uchar sym;
  232.      const char *explanation;
  233.  #ifdef TEXTCOLOR
  234.      uchar color;
  235.  #endif
  236.  };
  237.  
  238.  struct symparse {
  239.      unsigned range;
  240.  #define SYM_CONTROL 1 /* start/finish markers */
  241.  #define SYM_PCHAR 2   /* index into showsyms  */
  242.  #define SYM_OC 3      /* index into oc_syms   */
  243.  #define SYM_MON 4     /* index into monsyms   */
  244.  #define SYM_OTH 5     /* misc                 */
  245.      int idx;
  246.      const char *name;
  247.  };
  248.  
  249.  /* misc symbol definitions */
  250.  #define SYM_BOULDER 0
  251.  #define SYM_INVISIBLE 1
  252.  #define MAXOTHER 2
  253.  
  254.  /* linked list of symsets and their characteristics */
  255.  struct symsetentry {
  256.      struct symsetentry *next; /* next in list                         */
  257.      char *name;               /* ptr to symset name                   */
  258.      char *desc;               /* ptr to description                   */
  259.      int idx;                  /* an index value                       */
  260.      int handling;             /* known handlers value                 */
  261.      Bitfield(nocolor, 1);     /* don't use color if set               */
  262.      Bitfield(primary, 1);     /* restricted for use as primary set    */
  263.      Bitfield(rogue, 1);       /* restricted for use as rogue lev set  */
  264.                                /* 5 free bits */
  265.  };
  266.  
  267.  /*
  268.   * Graphics sets for display symbols
  269.   */
  270.  #define DEFAULT_GRAPHICS 0 /* regular characters: '-', '+', &c */
  271.  #define PRIMARY 0          /* primary graphics set        */
  272.  #define ROGUESET 1         /* rogue graphics set          */
  273.  #define NUM_GRAPHICS 2
  274.  
  275.  /*
  276.   * special symbol set handling types ( for invoking callbacks, etc.)
  277.   * Must match the order of the known_handlers strings
  278.   * in drawing.c
  279.   */
  280.  #define H_UNK 0
  281.  #define H_IBM 1
  282.  #define H_DEC 2
  283.  
  284.  extern const struct symdef defsyms[MAXPCHARS]; /* defaults */
  285.  extern const struct symdef def_warnsyms[WARNCOUNT];
  286.  extern int currentgraphics; /* from drawing.c */
  287.  extern nhsym showsyms[];
  288.  
  289.  extern struct symsetentry symset[NUM_GRAPHICS]; /* from drawing.c */
  290.  #define SYMHANDLING(ht) (symset[currentgraphics].handling == (ht))
  291.  
  292.  /*
  293.   * The 5 possible states of doors
  294.   */
  295.  
  296.  #define D_NODOOR 0
  297.  #define D_BROKEN 1
  298.  #define D_ISOPEN 2
  299.  #define D_CLOSED 4
  300.  #define D_LOCKED 8
  301.  #define D_TRAPPED 16
  302.  #define D_SECRET 32 /* only used by sp_lev.c, NOT in rm-struct */
  303.  
  304.  /*
  305.   * Some altars are considered as shrines, so we need a flag.
  306.   */
  307.  #define AM_SHRINE 8
  308.  
  309.  /*
  310.   * Thrones should only be looted once.
  311.   */
  312.  #define T_LOOTED 1
  313.  
  314.  /*
  315.   * Trees have more than one kick result.
  316.   */
  317.  #define TREE_LOOTED 1
  318.  #define TREE_SWARM 2
  319.  
  320.  /*
  321.   * Fountains have limits, and special warnings.
  322.   */
  323.  #define F_LOOTED 1
  324.  #define F_WARNED 2
  325.  #define FOUNTAIN_IS_WARNED(x, y) (levl[x][y].looted & F_WARNED)
  326.  #define FOUNTAIN_IS_LOOTED(x, y) (levl[x][y].looted & F_LOOTED)
  327.  #define SET_FOUNTAIN_WARNED(x, y) levl[x][y].looted |= F_WARNED;
  328.  #define SET_FOUNTAIN_LOOTED(x, y) levl[x][y].looted |= F_LOOTED;
  329.  #define CLEAR_FOUNTAIN_WARNED(x, y) levl[x][y].looted &= ~F_WARNED;
  330.  #define CLEAR_FOUNTAIN_LOOTED(x, y) levl[x][y].looted &= ~F_LOOTED;
  331.  
  332.  /*
  333.   * Doors are even worse :-) The special warning has a side effect
  334.   * of instantly trapping the door, and if it was defined as trapped,
  335.   * the guards consider that you have already been warned!
  336.   */
  337.  #define D_WARNED 16
  338.  
  339.  /*
  340.   * Sinks have 3 different types of loot that shouldn't be abused
  341.   */
  342.  #define S_LPUDDING 1
  343.  #define S_LDWASHER 2
  344.  #define S_LRING 4
  345.  
  346.  /*
  347.   * The four directions for a DrawBridge.
  348.   */
  349.  #define DB_NORTH 0
  350.  #define DB_SOUTH 1
  351.  #define DB_EAST 2
  352.  #define DB_WEST 3
  353.  #define DB_DIR 3 /* mask for direction */
  354.  
  355.  /*
  356.   * What's under a drawbridge.
  357.   */
  358.  #define DB_MOAT 0
  359.  #define DB_LAVA 4
  360.  #define DB_ICE 8
  361.  #define DB_FLOOR 16
  362.  #define DB_UNDER 28 /* mask for underneath */
  363.  
  364.  /*
  365.   * Wall information.
  366.   */
  367.  #define WM_MASK 0x07 /* wall mode (bottom three bits) */
  368.  #define W_NONDIGGABLE 0x08
  369.  #define W_NONPASSWALL 0x10
  370.  
  371.  /*
  372.   * Ladders (in Vlad's tower) may be up or down.
  373.   */
  374.  #define LA_UP 1
  375.  #define LA_DOWN 2
  376.  
  377.  /*
  378.   * Room areas may be iced pools
  379.   */
  380.  #define ICED_POOL 8
  381.  #define ICED_MOAT 16
  382.  
  383.  /*
  384.   * The structure describing a coordinate position.
  385.   * Before adding fields, remember that this will significantly affect
  386.   * the size of temporary files and save files.
  387.   *
  388.   * Also remember that the run-length encoding for some ports in save.c
  389.   * must be updated to consider the field.
  390.   */
  391.  struct rm {
  392.      int glyph;               /* what the hero thinks is there */
  393.      schar typ;               /* what is really there */
  394.      uchar seenv;             /* seen vector */
  395.      Bitfield(flags, 5);      /* extra information for typ */
  396.      Bitfield(horizontal, 1); /* wall/door/etc is horiz. (more typ info) */
  397.      Bitfield(lit, 1);        /* speed hack for lit rooms */
  398.      Bitfield(waslit, 1);     /* remember if a location was lit */
  399.  
  400.      Bitfield(roomno, 6); /* room # for special rooms */
  401.      Bitfield(edge, 1);   /* marks boundaries for special rooms*/
  402.      Bitfield(candig, 1); /* Exception to Can_dig_down; was a trapdoor */
  403.  };
  404.  
  405.  #define SET_TYPLIT(x, y, ttyp, llit)                              \
  406.      {                                                             \
  407.          if ((x) >= 0 && (y) >= 0 && (x) < COLNO && (y) < ROWNO) { \
  408.              if ((ttyp) < MAX_TYPE)                                \
  409.                  levl[(x)][(y)].typ = (ttyp);                      \
  410.              if ((ttyp) == LAVAPOOL)                               \
  411.                  levl[(x)][(y)].lit = 1;                           \
  412.              else if ((schar)(llit) != -2) {                       \
  413.                  if ((schar)(llit) == -1)                          \
  414.                      levl[(x)][(y)].lit = rn2(2);                  \
  415.                  else                                              \
  416.                      levl[(x)][(y)].lit = (llit);                  \
  417.              }                                                     \
  418.          }                                                         \
  419.      }
  420.  
  421.  /*
  422.   * Add wall angle viewing by defining "modes" for each wall type.  Each
  423.   * mode describes which parts of a wall are finished (seen as as wall)
  424.   * and which are unfinished (seen as rock).
  425.   *
  426.   * We use the bottom 3 bits of the flags field for the mode.  This comes
  427.   * in conflict with secret doors, but we avoid problems because until
  428.   * a secret door becomes discovered, we know what sdoor's bottom three
  429.   * bits are.
  430.   *
  431.   * The following should cover all of the cases.
  432.   *
  433.   *	type	mode				Examples: R=rock, F=finished
  434.   *	-----	----				----------------------------
  435.   *	WALL:	0 none				hwall, mode 1
  436.   *		1 left/top (1/2 rock)			RRR
  437.   *		2 right/bottom (1/2 rock)		---
  438.   *							FFF
  439.   *
  440.   *	CORNER: 0 none				trcorn, mode 2
  441.   *		1 outer (3/4 rock)			FFF
  442.   *		2 inner (1/4 rock)			F+-
  443.   *							F|R
  444.   *
  445.   *	TWALL:	0 none				tlwall, mode 3
  446.   *		1 long edge (1/2 rock)			F|F
  447.   *		2 bottom left (on a tdwall)		-+F
  448.   *		3 bottom right (on a tdwall)		R|F
  449.   *
  450.   *	CRWALL: 0 none				crwall, mode 5
  451.   *		1 top left (1/4 rock)			R|F
  452.   *		2 top right (1/4 rock)			-+-
  453.   *		3 bottom left (1/4 rock)		F|R
  454.   *		4 bottom right (1/4 rock)
  455.   *		5 top left & bottom right (1/2 rock)
  456.   *		6 bottom left & top right (1/2 rock)
  457.   */
  458.  
  459.  #define WM_W_LEFT 1 /* vertical or horizontal wall */
  460.  #define WM_W_RIGHT 2
  461.  #define WM_W_TOP WM_W_LEFT
  462.  #define WM_W_BOTTOM WM_W_RIGHT
  463.  
  464.  #define WM_C_OUTER 1 /* corner wall */
  465.  #define WM_C_INNER 2
  466.  
  467.  #define WM_T_LONG 1 /* T wall */
  468.  #define WM_T_BL 2
  469.  #define WM_T_BR 3
  470.  
  471.  #define WM_X_TL 1 /* cross wall */
  472.  #define WM_X_TR 2
  473.  #define WM_X_BL 3
  474.  #define WM_X_BR 4
  475.  #define WM_X_TLBR 5
  476.  #define WM_X_BLTR 6
  477.  
  478.  /*
  479.   * Seen vector values.	The seen vector is an array of 8 bits, one for each
  480.   * octant around a given center x:
  481.   *
  482.   *			0 1 2
  483.   *			7 x 3
  484.   *			6 5 4
  485.   *
  486.   * In the case of walls, a single wall square can be viewed from 8 possible
  487.   * directions.	If we know the type of wall and the directions from which
  488.   * it has been seen, then we can determine what it looks like to the hero.
  489.   */
  490.  #define SV0 0x1
  491.  #define SV1 0x2
  492.  #define SV2 0x4
  493.  #define SV3 0x8
  494.  #define SV4 0x10
  495.  #define SV5 0x20
  496.  #define SV6 0x40
  497.  #define SV7 0x80
  498.  #define SVALL 0xFF
  499.  
  500.  #define doormask flags
  501.  #define altarmask flags
  502.  #define wall_info flags
  503.  #define ladder flags
  504.  #define drawbridgemask flags
  505.  #define looted flags
  506.  #define icedpool flags
  507.  
  508.  #define blessedftn horizontal /* a fountain that grants attribs */
  509.  #define disturbed horizontal  /* a grave that has been disturbed */
  510.  
  511.  struct damage {
  512.      struct damage *next;
  513.      long when, cost;
  514.      coord place;
  515.      schar typ;
  516.  };
  517.  
  518.  /* for bones levels:  identify the dead character, who might have died on
  519.     an existing bones level; if so, most recent victim will be first in list */
  520.  struct cemetery {
  521.      struct cemetery *next; /* next struct is previous dead character... */
  522.      /* "plname" + "-ROLe" + "-RACe" + "-GENder" + "-ALIgnment" + \0 */
  523.      char who[PL_NSIZ + 4 * (1 + 3) + 1];
  524.      /* death reason, same as in score/log file */
  525.      char how[100 + 1]; /* [DTHSZ+1] */
  526.      /* date+time in string of digits rather than binary */
  527.      char when[4 + 2 + 2 + 2 + 2 + 2 + 1]; /* "YYYYMMDDhhmmss\0" */
  528.      /* final resting place spot */
  529.      schar frpx, frpy;
  530.      boolean bonesknown;
  531.  };
  532.  
  533.  struct levelflags {
  534.      uchar nfountains; /* number of fountains on level */
  535.      uchar nsinks;     /* number of sinks on the level */
  536.      /* Several flags that give hints about what's on the level */
  537.      Bitfield(has_shop, 1);
  538.      Bitfield(has_vault, 1);
  539.      Bitfield(has_zoo, 1);
  540.      Bitfield(has_court, 1);
  541.      Bitfield(has_morgue, 1);
  542.      Bitfield(has_beehive, 1);
  543.      Bitfield(has_barracks, 1);
  544.      Bitfield(has_temple, 1);
  545.  
  546.      Bitfield(has_swamp, 1);
  547.      Bitfield(noteleport, 1);
  548.      Bitfield(hardfloor, 1);
  549.      Bitfield(nommap, 1);
  550.      Bitfield(hero_memory, 1);   /* hero has memory */
  551.      Bitfield(shortsighted, 1);  /* monsters are shortsighted */
  552.      Bitfield(graveyard, 1);     /* has_morgue, but remains set */
  553.      Bitfield(sokoban_rules, 1); /* fill pits and holes w/ boulders */
  554.  
  555.      Bitfield(is_maze_lev, 1);
  556.      Bitfield(is_cavernous_lev, 1);
  557.      Bitfield(arboreal, 1);     /* Trees replace rock */
  558.      Bitfield(wizard_bones, 1); /* set if level came from a bones file
  559.                                    which was created in wizard mode (or
  560.                                    normal mode descendant of such) */
  561.      Bitfield(corrmaze, 1);     /* Whether corridors are used for the maze
  562.                                    rather than ROOM */
  563.  };
  564.  
  565.  typedef struct {
  566.      struct rm locations[COLNO][ROWNO];
  567.  #ifndef MICROPORT_BUG
  568.      struct obj *objects[COLNO][ROWNO];
  569.      struct monst *monsters[COLNO][ROWNO];
  570.  #else
  571.      struct obj *objects[1][ROWNO];
  572.      char *yuk1[COLNO - 1][ROWNO];
  573.      struct monst *monsters[1][ROWNO];
  574.      char *yuk2[COLNO - 1][ROWNO];
  575.  #endif
  576.      struct obj *objlist;
  577.      struct obj *buriedobjlist;
  578.      struct monst *monlist;
  579.      struct damage *damagelist;
  580.      struct cemetery *bonesinfo;
  581.      struct levelflags flags;
  582.  } dlevel_t;
  583.  
  584.  extern schar lastseentyp[COLNO][ROWNO]; /* last seen/touched dungeon typ */
  585.  
  586.  extern dlevel_t level; /* structure describing the current level */
  587.  
  588.  /*
  589.   * Macros for compatibility with old code. Someday these will go away.
  590.   */
  591.  #define levl level.locations
  592.  #define fobj level.objlist
  593.  #define fmon level.monlist
  594.  
  595.  /*
  596.   * Covert a trap number into the defsym graphics array.
  597.   * Convert a defsym number into a trap number.
  598.   * Assumes that arrow trap will always be the first trap.
  599.   */
  600.  #define trap_to_defsym(t) (S_arrow_trap + (t) -1)
  601.  #define defsym_to_trap(d) ((d) -S_arrow_trap + 1)
  602.  
  603.  #define OBJ_AT(x, y) (level.objects[x][y] != (struct obj *) 0)
  604.  /*
  605.   * Macros for encapsulation of level.monsters references.
  606.   */
  607.  #define MON_AT(x, y)                            \
  608.      (level.monsters[x][y] != (struct monst *) 0 \
  609.       && !(level.monsters[x][y])->mburied)
  610.  #define MON_BURIED_AT(x, y)                     \
  611.      (level.monsters[x][y] != (struct monst *) 0 \
  612.       && (level.monsters[x][y])->mburied)
  613.  #define place_worm_seg(m, x, y) level.monsters[x][y] = m
  614.  #define remove_monster(x, y) level.monsters[x][y] = (struct monst *) 0
  615.  #define m_at(x, y) (MON_AT(x, y) ? level.monsters[x][y] : (struct monst *) 0)
  616.  #define m_buried_at(x, y) \
  617.      (MON_BURIED_AT(x, y) ? level.monsters[x][y] : (struct monst *) 0)
  618.  
  619.  /* restricted movement, potential luck penalties */
  620.  #define Sokoban level.flags.sokoban_rules
  621.  
  622.  #endif /* RM_H */