enum values

Give the enum lists in several header files explicit values.  Adding
or removing new entries will be more tedious, but doing that is rare
and being able to grep the headers for numeric values in addition to
names is very useful.

rm.h also has a bunch of tabs replaced with spaces.
This commit is contained in:
PatR
2019-01-11 17:18:48 -08:00
parent 5e2236a3ef
commit 8b02e5b32b
4 changed files with 321 additions and 311 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 trap.h $NHDT-Date: 1432512776 2015/05/25 00:12:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */
/* NetHack 3.6 trap.h $NHDT-Date: 1547255912 2019/01/12 01:18:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.17 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2016. */
/* NetHack may be freely redistributed. See license for details. */
@@ -24,7 +24,7 @@ struct trap {
Bitfield(tseen, 1);
Bitfield(once, 1);
Bitfield(madeby_u, 1); /* So monsters may take offence when you trap
them. Recognizing who made the trap isn't
them. Recognizing who made the trap isn't
completely unreasonable, everybody has
their own style. This flag is also needed
when you untrap a monster. It would be too
@@ -55,32 +55,32 @@ extern struct trap *ftrap;
/* unconditional traps */
enum trap_types {
NO_TRAP = 0,
ARROW_TRAP,
DART_TRAP,
ROCKTRAP,
SQKY_BOARD,
BEAR_TRAP,
LANDMINE,
ROLLING_BOULDER_TRAP,
SLP_GAS_TRAP,
RUST_TRAP,
FIRE_TRAP,
PIT,
SPIKED_PIT,
HOLE,
TRAPDOOR,
TELEP_TRAP,
LEVEL_TELEP,
MAGIC_PORTAL,
WEB,
STATUE_TRAP,
MAGIC_TRAP,
ANTI_MAGIC,
POLY_TRAP,
VIBRATING_SQUARE,
NO_TRAP = 0,
ARROW_TRAP = 1,
DART_TRAP = 2,
ROCKTRAP = 3,
SQKY_BOARD = 4,
BEAR_TRAP = 5,
LANDMINE = 6,
ROLLING_BOULDER_TRAP = 7,
SLP_GAS_TRAP = 8,
RUST_TRAP = 9,
FIRE_TRAP = 10,
PIT = 11,
SPIKED_PIT = 12,
HOLE = 13,
TRAPDOOR = 14,
TELEP_TRAP = 15,
LEVEL_TELEP = 16,
MAGIC_PORTAL = 17,
WEB = 18,
STATUE_TRAP = 19,
MAGIC_TRAP = 20,
ANTI_MAGIC = 21,
POLY_TRAP = 22,
VIBRATING_SQUARE = 23,
TRAPNUM
TRAPNUM = 24
};
#define is_pit(ttyp) ((ttyp) == PIT || (ttyp) == SPIKED_PIT)