header files sym.h and defsym.h
There were multiple symbol-related lists that had to be kept
in sync in various places.
Consolidate some of that into a single new file
defsym.h
with a set of morphing macros that can be custom-called from
the various places that use the sym info without maintaining
multiple occurrences. Most maintenance can be done there.
Rename monsym.h to sym.h since it looks after some
symbols not related to monsters now too.
The defsym.h header file is included in multiple places to
produce different code depending on its use and the controlling
macro definitions in place prior to including it.
Its purpose is to have a definitive source for
pchar, objclass and mon symbol maintenance.
The controlling macros used to morph the resulting code are
used in these places:
- in include/sym.h for enums of some S_ symbol values
(define PCHAR_ENUM, MONSYMS_ENUM prior to #include defsym.h)
- in include/objclass.h for enums of some S_ symbol values
(define OBJCLASS_ENUM prior to #include defsym.h)
- in src/symbols.c for parsing S_ entries in config files
(define PCHAR_PARSE, MONSYMS_PARSE, OBJCLASS_PARSE prior
to #include defsym.h)
- in src/drawing.c for initializing some data structures/arrays
(define PCHAR_DRAWING, MONSYMS_DRAWING, OBJCLASS_DRAWING prior
to #include defsym.h)
- in win/share/tilemap.c for processing a tile file
(define PCHAR_TILES prior to #include defsym.h).
This commit is contained in:
357
include/defsym.h
Normal file
357
include/defsym.h
Normal file
@@ -0,0 +1,357 @@
|
||||
/* NetHack 3.7 defsym.h */
|
||||
/* Copyright (c) 2016 by Pasi Kallinen */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
|
||||
/*
|
||||
This header is included in multiple places to produced
|
||||
differing code depending on its use. Its purpose is to
|
||||
ensure that there is only one definitive source for
|
||||
pchar, objclass and mon
|
||||
|
||||
The morphing macro expansions are used in these places:
|
||||
- in include/sym.h for enums of some S_ symbol values
|
||||
(define PCHAR_ENUM, MONSYMS_ENUM prior to #include defsym.h)
|
||||
- in include/objclass.h for enums of some S_ symbol values
|
||||
(define OBJCLASS_ENUM prior to #include defsym.h)
|
||||
- in src/symbols.c for parsing S_ entries in config files
|
||||
(define PCHAR_PARSE, MONSYMS_PARSE, OBJCLASS_PARSE prior
|
||||
to #include defsym.h)
|
||||
- in src/drawing.c for initializing some data structures/arrays
|
||||
(define PCHAR_DRAWING, MONSYMS_DRAWING, OBJCLASS_DRAWING prior
|
||||
to #include defsym.h)
|
||||
- in win/share/tilemap.c for processing a tile file
|
||||
(define PCHAR_TILES prior to #include defsym.h).
|
||||
*/
|
||||
|
||||
#ifdef CLR
|
||||
#undef CLR
|
||||
#endif
|
||||
|
||||
#ifdef TEXTCOLOR
|
||||
#define CLR(n) n
|
||||
#else
|
||||
#define CLR(n)
|
||||
#endif
|
||||
|
||||
#if defined(PCHAR_ENUM) || defined(PCHAR_PARSE) || defined(PCHAR_DRAWING) || defined(PCHAR_TILES)
|
||||
|
||||
/*
|
||||
PCHAR(idx, ch, sym, desc, clr)
|
||||
idx: index used in enum
|
||||
ch: character symbol
|
||||
sym: symbol name for parsing purposes
|
||||
desc: description
|
||||
clr: color
|
||||
|
||||
PCHAR2(idx, ch, sym, tilenm, desc, clr)
|
||||
idx: index used in enum
|
||||
ch: character symbol
|
||||
sym: symbol name for parsing purposes
|
||||
desc: description
|
||||
clr: color
|
||||
*/
|
||||
|
||||
#if defined(PCHAR_ENUM)
|
||||
/* sym.h */
|
||||
#define PCHAR(idx, ch, sym, desc, clr) \
|
||||
sym = idx,
|
||||
#define PCHAR2(idx, ch, sym, tilenm, desc, clr) \
|
||||
sym = idx,
|
||||
|
||||
#elif defined(PCHAR_PARSE)
|
||||
/* symbols.c */
|
||||
#define PCHAR(idx, ch, sym, desc, clr) \
|
||||
{ SYM_PCHAR, sym, #sym },
|
||||
#define PCHAR2(idx, ch, sym, tilenm, desc, clr) \
|
||||
{ SYM_PCHAR, sym, #sym },
|
||||
|
||||
#elif defined(PCHAR_DRAWING)
|
||||
/* drawing.c */
|
||||
#define PCHAR(idx, ch, sym, desc, clr) \
|
||||
{ ch, desc, clr },
|
||||
#define PCHAR2(idx, ch, sym, tilenm, desc, clr) \
|
||||
{ ch, desc, clr },
|
||||
|
||||
#elif defined(PCHAR_TILES)
|
||||
/* win/share/tilemap.c */
|
||||
#define PCHAR(idx, ch, sym, desc, clr) \
|
||||
{ sym, desc, desc },
|
||||
#define PCHAR2(idx, ch, sym, tilenm, desc, clr) \
|
||||
{ sym, tilenm, desc },
|
||||
#endif
|
||||
|
||||
PCHAR2( 0, ' ', S_stone, "dark part of a room", "stone", CLR(NO_COLOR))
|
||||
PCHAR2( 1, '|', S_vwall, "vertical wall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 2, '-', S_hwall, "horizontal wall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 3, '-', S_tlcorn, "top left corner wall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 4, '-', S_trcorn, "top right corner wall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 5, '-', S_blcorn, "bottom left corner wall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 6, '-', S_brcorn, "bottom right corner wall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 7, '-', S_crwall, "cross wall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 8, '-', S_tuwall, "tuwall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2( 9, '-', S_tdwall, "tdwall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2(10, '|', S_tlwall, "tlwall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2(11, '|', S_trwall, "trwall", "wall", CLR(CLR_GRAY))
|
||||
PCHAR2(12, '.', S_ndoor, "no door", "doorway", CLR(CLR_GRAY))
|
||||
PCHAR2(13, '-', S_vodoor, "vertical open door", "open door", CLR(CLR_BROWN))
|
||||
PCHAR2(14, '|', S_hodoor, "horizontal open door", "open door", CLR(CLR_BROWN))
|
||||
PCHAR( 15, '+', S_vcdoor, "vertical closed door", CLR(CLR_BROWN))
|
||||
PCHAR( 16, '+', S_hcdoor, "horizontal closed door", CLR(CLR_BROWN))
|
||||
PCHAR( 17, '#', S_bars, "iron bars", CLR(HI_METAL))
|
||||
PCHAR( 18, '#', S_tree, "tree", CLR(CLR_GREEN))
|
||||
PCHAR( 19, '.', S_room, "floor of a room", CLR(CLR_GRAY))
|
||||
PCHAR( 20, '.', S_darkroom, "dark part of a room", CLR(CLR_BLACK))
|
||||
PCHAR2(21, '#', S_corr, "dark corridor", "corridor", CLR(CLR_GRAY))
|
||||
PCHAR( 22, '#', S_litcorr, "lit corridor", CLR(CLR_GRAY))
|
||||
PCHAR2(23, '<', S_upstair, "up stairs", "staircase up", CLR(CLR_GRAY))
|
||||
PCHAR2(24, '>', S_dnstair, "down stairs", "staircase down", CLR(CLR_GRAY))
|
||||
PCHAR2(25, '<', S_upladder, "up ladder", "ladder up", CLR(CLR_BROWN))
|
||||
PCHAR2(26, '>', S_dnladder, "down ladder", "ladder down", CLR(CLR_BROWN))
|
||||
PCHAR( 27, '<', S_brupstair, "branch staircase up", CLR(CLR_YELLOW))
|
||||
PCHAR( 28, '>', S_brdnstair, "branch staircase down", CLR(CLR_YELLOW))
|
||||
PCHAR( 29, '<', S_brupladder, "branch ladder up", CLR(CLR_YELLOW))
|
||||
PCHAR( 30, '>', S_brdnladder, "branch ladder down", CLR(CLR_YELLOW))
|
||||
PCHAR( 31, '_', S_altar, "altar", CLR(CLR_GRAY))
|
||||
PCHAR( 32, '|', S_grave, "grave", CLR(CLR_WHITE))
|
||||
PCHAR2(33, '\\', S_throne, "throne", "opulent throne", CLR(HI_GOLD))
|
||||
PCHAR( 34, '#', S_sink, "sink", CLR(CLR_GRAY))
|
||||
PCHAR( 35, '{', S_fountain, "fountain", CLR(CLR_BRIGHT_BLUE))
|
||||
PCHAR2(36, '}', S_pool, "pool", "water", CLR(CLR_BLUE))
|
||||
PCHAR( 37, '.', S_ice, "ice", CLR(CLR_CYAN))
|
||||
PCHAR( 38, '}', S_lava, "molten lava", CLR(CLR_RED))
|
||||
PCHAR2(39, '.', S_vodbridge, "vertical open drawbridge",
|
||||
"lowered drawbridge", CLR(CLR_BROWN))
|
||||
PCHAR2(40, '.', S_hodbridge, "horizontal open drawbridge",
|
||||
"lowered drawbridge", CLR(CLR_BROWN))
|
||||
PCHAR2(41, '#', S_vcdbridge, "vertical closed drawbridge",
|
||||
"raised drawbridge", CLR(CLR_BROWN))
|
||||
PCHAR2(42, '#', S_hcdbridge, "horizontal closed drawbridge",
|
||||
"raised drawbridge", CLR(CLR_BROWN))
|
||||
PCHAR( 43, ' ', S_air, "air", CLR(CLR_CYAN))
|
||||
PCHAR( 44, '#', S_cloud, "cloud", CLR(CLR_GRAY))
|
||||
PCHAR( 45, '}', S_water, "water", CLR(CLR_BLUE))
|
||||
/* end dungeon characters, begin traps */
|
||||
PCHAR( 46, '^', S_arrow_trap, "arrow trap", CLR(HI_METAL))
|
||||
PCHAR( 47, '^', S_dart_trap, "dart trap", CLR(HI_METAL))
|
||||
PCHAR( 48, '^', S_falling_rock_trap, "falling rock trap", CLR(CLR_GRAY))
|
||||
PCHAR( 49, '^', S_squeaky_board, "squeaky board", CLR(CLR_BROWN))
|
||||
PCHAR( 50, '^', S_bear_trap, "bear trap", CLR(HI_METAL))
|
||||
PCHAR( 51, '^', S_land_mine, "land mine", CLR(CLR_RED))
|
||||
PCHAR( 52, '^', S_rolling_boulder_trap, "rolling boulder trap", CLR(CLR_GRAY))
|
||||
PCHAR( 53, '^', S_sleeping_gas_trap, "sleeping gas trap", CLR(HI_ZAP))
|
||||
PCHAR( 54, '^', S_rust_trap, "rust trap", CLR(CLR_BLUE))
|
||||
PCHAR( 55, '^', S_fire_trap, "fire trap", CLR(CLR_ORANGE))
|
||||
PCHAR( 56, '^', S_pit, "pit", CLR(CLR_BLACK))
|
||||
PCHAR( 57, '^', S_spiked_pit, "spiked pit", CLR(CLR_BLACK))
|
||||
PCHAR( 58, '^', S_hole, "hole", CLR(CLR_BROWN))
|
||||
PCHAR( 59, '^', S_trap_door, "trap door", CLR(CLR_BROWN))
|
||||
PCHAR( 60, '^', S_teleportation_trap, "teleportation trap", CLR(CLR_MAGENTA))
|
||||
PCHAR( 61, '^', S_level_teleporter, "level teleporter", CLR(CLR_MAGENTA))
|
||||
PCHAR( 62, '^', S_magic_portal, "magic portal", CLR(CLR_BRIGHT_MAGENTA))
|
||||
PCHAR( 63, '"', S_web, "web", CLR(CLR_GRAY))
|
||||
PCHAR( 64, '^', S_statue_trap, "statue trap", CLR(CLR_GRAY))
|
||||
PCHAR( 65, '^', S_magic_trap, "magic trap", CLR(HI_ZAP))
|
||||
PCHAR2(66, '^', S_anti_magic_trap, "anti magic trap", "anti-magic field", CLR(HI_ZAP))
|
||||
PCHAR( 67, '^', S_polymorph_trap, "polymorph trap", CLR(CLR_BRIGHT_GREEN))
|
||||
PCHAR( 68, '~', S_vibrating_square, "vibrating square", CLR(CLR_MAGENTA))
|
||||
/* end traps, begin special effects */
|
||||
/* zap colors are changed by map_glyphinfo() to match type of beam */
|
||||
PCHAR2(69, '|', S_vbeam, "vertical beam", "", CLR(CLR_GRAY))
|
||||
PCHAR2(70, '-', S_hbeam, "horizontal beam", "", CLR(CLR_GRAY))
|
||||
PCHAR2(71, '\\', S_lslant, "left slant beam", "", CLR(CLR_GRAY))
|
||||
PCHAR2(72, '/', S_rslant, "right slant beam", "", CLR(CLR_GRAY))
|
||||
PCHAR2(73, '*', S_digbeam, "dig beam", "", CLR(CLR_WHITE))
|
||||
PCHAR2(74, '!', S_flashbeam, "flash beam", "", CLR(CLR_WHITE))
|
||||
PCHAR2(75, ')', S_boomleft, "boom left", "", CLR(HI_WOOD))
|
||||
PCHAR2(76, '(', S_boomright, "boom right", "", CLR(HI_WOOD))
|
||||
/* 4 magic shield symbols */
|
||||
PCHAR2(77, '0', S_ss1, "shield1", "", CLR(HI_ZAP))
|
||||
PCHAR2(78, '#', S_ss2, "shield2", "", CLR(HI_ZAP))
|
||||
PCHAR2(79, '@', S_ss3, "shield3", "", CLR(HI_ZAP))
|
||||
PCHAR2(80, '*', S_ss4, "shield4", "", CLR(HI_ZAP))
|
||||
PCHAR( 81, '#', S_poisoncloud, "poison cloud", CLR(CLR_BRIGHT_GREEN))
|
||||
PCHAR( 82, '?', S_goodpos, "valid position", CLR(CLR_BRIGHT_GREEN))
|
||||
/* The 8 swallow symbols. Do NOT separate. To change order or add, */
|
||||
/* see the function swallow_to_glyph() in display.c. */
|
||||
/* swallow colors are changed by map_glyphinfo() to match engulfing monst */
|
||||
PCHAR2(83, '/', S_sw_tl, "swallow top left", "", CLR(CLR_GREEN)) /* 1 */
|
||||
PCHAR2(84, '-', S_sw_tc, "swallow top center", "", CLR(CLR_GREEN)) /* 2 Order: */
|
||||
PCHAR2(85, '\\', S_sw_tr, "swallow top right", "", CLR(CLR_GREEN)) /* 3 */
|
||||
PCHAR2(86, '|', S_sw_ml, "swallow middle left", "", CLR(CLR_GREEN)) /* 4 1 2 3 */
|
||||
PCHAR2(87, '|', S_sw_mr, "swallow middle right", "", CLR(CLR_GREEN)) /* 6 4 5 6 */
|
||||
PCHAR2(88, '\\', S_sw_bl, "swallow bottom left", "", CLR(CLR_GREEN)) /* 7 7 8 9 */
|
||||
PCHAR2(89, '-', S_sw_bc, "swallow bottom center", "", CLR(CLR_GREEN)) /* 8 */
|
||||
PCHAR2(90, '/', S_sw_br, "swallow bottom right", "", CLR(CLR_GREEN)) /* 9 */
|
||||
/* explosion colors are changed by map_glyphinfo() to match type of expl. */
|
||||
PCHAR2(91, '/', S_explode1, "explosion top left", "", CLR(CLR_ORANGE)) /* */
|
||||
PCHAR2(92, '-', S_explode2, "explosion top center", "", CLR(CLR_ORANGE)) /* */
|
||||
PCHAR2(93, '\\', S_explode3, "explosion top right", "", CLR(CLR_ORANGE)) /*Ex. */
|
||||
PCHAR2(94, '|', S_explode4, "explosion middle left", "", CLR(CLR_ORANGE)) /* */
|
||||
PCHAR2(95, ' ', S_explode5, "explosion middle center", "", CLR(CLR_ORANGE)) /* /-\ */
|
||||
PCHAR2(96, '|', S_explode6, "explosion middle right", "", CLR(CLR_ORANGE)) /* |@| */
|
||||
PCHAR2(97, '\\', S_explode7, "explosion bottom left", "", CLR(CLR_ORANGE)) /* \-/ */
|
||||
PCHAR2(98, '-', S_explode8, "explosion bottom center", "", CLR(CLR_ORANGE)) /* */
|
||||
PCHAR2(99, '/', S_explode9, "explosion bottom right", "", CLR(CLR_ORANGE)) /* */
|
||||
#undef PCHAR
|
||||
#undef PCHAR2
|
||||
#endif /* PCHAR_ENUM || PCHAR_DEFSYMS || PCHAR_DRAWING || PCHAR_TILES */
|
||||
|
||||
#if defined(MONSYMS_ENUM) || defined(MONSYMS_PARSE) || defined (MONSYMS_DRAWING)
|
||||
|
||||
/*
|
||||
MONSYM(idx, ch, sym desc)
|
||||
idx: index used in enum
|
||||
ch: character symbol
|
||||
sym: symbol name for parsing purposes
|
||||
desc: description
|
||||
*/
|
||||
|
||||
#if defined(MONSYMS_ENUM)
|
||||
/* sym.h */
|
||||
#define MONSYM(idx, ch, sym, desc) \
|
||||
sym = idx,
|
||||
|
||||
#elif defined(MONSYMS_PARSE)
|
||||
/* symbols.c */
|
||||
#define MONSYM(idx, ch, sym, desc) \
|
||||
{ SYM_MON, sym + SYM_OFF_M, #sym },
|
||||
|
||||
#elif defined(MONSYMS_DRAWING)
|
||||
/* drawing.c */
|
||||
#define MONSYM(idx, ch, sym, desc) \
|
||||
{ ch, "", desc },
|
||||
#endif
|
||||
|
||||
MONSYM( 1, DEF_ANT, S_ANT, "ant or other insect")
|
||||
MONSYM( 2, DEF_BLOB, S_BLOB, "blob")
|
||||
MONSYM( 3, DEF_COCKATRICE, S_COCKATRICE, "cockatrice")
|
||||
MONSYM( 4, DEF_DOG, S_DOG, "dog or other canine")
|
||||
MONSYM( 5, DEF_EYE, S_EYE, "eye or sphere")
|
||||
MONSYM( 6, DEF_FELINE, S_FELINE, "cat or other feline")
|
||||
MONSYM( 7, DEF_GREMLIN, S_GREMLIN, "gremlin")
|
||||
/* small humanoids: hobbit, dwarf */
|
||||
MONSYM( 8, DEF_HUMANOID, S_HUMANOID, "humanoid")
|
||||
/* minor demons */
|
||||
MONSYM( 9, DEF_IMP, S_IMP, "imp or minor demon")
|
||||
MONSYM(10, DEF_JELLY, S_JELLY, "jelly")
|
||||
MONSYM(11, DEF_KOBOLD, S_KOBOLD, "kobold")
|
||||
MONSYM(12, DEF_LEPRECHAUN, S_LEPRECHAUN, "leprechaun")
|
||||
MONSYM(13, DEF_MIMIC, S_MIMIC, "mimic") /* 'm' */
|
||||
MONSYM(14, DEF_NYMPH, S_NYMPH, "nymph")
|
||||
MONSYM(15, DEF_ORC, S_ORC, "orc")
|
||||
MONSYM(16, DEF_PIERCER, S_PIERCER, "piercer")
|
||||
/* quadruped excludes horses */
|
||||
MONSYM(17, DEF_QUADRUPED, S_QUADRUPED, "quadruped")
|
||||
MONSYM(18, DEF_RODENT, S_RODENT, "rodent")
|
||||
MONSYM(19, DEF_SPIDER, S_SPIDER, "arachnid or centipede")
|
||||
MONSYM(20, DEF_TRAPPER, S_TRAPPER, "trapper or lurker above")
|
||||
/* unicorn, horses */
|
||||
MONSYM(21, DEF_UNICORN, S_UNICORN, "unicorn or horse")
|
||||
MONSYM(22, DEF_VORTEX, S_VORTEX, "vortex")
|
||||
MONSYM(23, DEF_WORM, S_WORM, "worm")
|
||||
MONSYM(24, DEF_XAN, S_XAN, "xan or other mythical/fantastic insect")
|
||||
/* yellow light, black light */
|
||||
MONSYM(25, DEF_LIGHT, S_LIGHT, "light")
|
||||
MONSYM(26, DEF_ZRUTY, S_ZRUTY, "zruty")
|
||||
MONSYM(27, DEF_ANGEL, S_ANGEL, "angelic being")
|
||||
MONSYM(28, DEF_BAT, S_BAT, "bat or bird")
|
||||
MONSYM(29, DEF_CENTAUR, S_CENTAUR, "centaur")
|
||||
MONSYM(30, DEF_DRAGON, S_DRAGON, "dragon")
|
||||
/* elemental includes invisible stalker */
|
||||
MONSYM(31, DEF_ELEMENTAL, S_ELEMENTAL, "elemental")
|
||||
MONSYM(32, DEF_FUNGUS, S_FUNGUS, "fungus or mold")
|
||||
MONSYM(33, DEF_GNOME, S_GNOME, "gnome")
|
||||
/* large humanoid: giant, ettin, minotaur */
|
||||
MONSYM(34, DEF_GIANT, S_GIANT, "giant humanoid")
|
||||
MONSYM(35, DEF_INVISIBLE, S_invisible, "invisible monster")
|
||||
MONSYM(36, DEF_JABBERWOCK, S_JABBERWOCK, "jabberwock")
|
||||
MONSYM(37, DEF_KOP, S_KOP, "Keystone Kop")
|
||||
MONSYM(38, DEF_LICH, S_LICH, "lich")
|
||||
MONSYM(39, DEF_MUMMY, S_MUMMY, "mummy")
|
||||
MONSYM(40, DEF_NAGA, S_NAGA, "naga")
|
||||
MONSYM(41, DEF_OGRE, S_OGRE, "ogre")
|
||||
MONSYM(42, DEF_PUDDING, S_PUDDING, "pudding or ooze")
|
||||
MONSYM(43, DEF_QUANTMECH, S_QUANTMECH, "quantum mechanic")
|
||||
MONSYM(44, DEF_RUSTMONST, S_RUSTMONST, "rust monster or disenchanter")
|
||||
MONSYM(45, DEF_SNAKE, S_SNAKE, "snake")
|
||||
MONSYM(46, DEF_TROLL, S_TROLL, "troll")
|
||||
/* umber hulk */
|
||||
MONSYM(47, DEF_UMBER, S_UMBER, "umber hulk")
|
||||
MONSYM(48, DEF_VAMPIRE, S_VAMPIRE, "vampire")
|
||||
MONSYM(49, DEF_WRAITH, S_WRAITH, "wraith")
|
||||
MONSYM(50, DEF_XORN, S_XORN, "xorn")
|
||||
/* apelike creature includes owlbear, monkey */
|
||||
MONSYM(51, DEF_YETI, S_YETI, "apelike creature")
|
||||
MONSYM(52, DEF_ZOMBIE, S_ZOMBIE, "zombie")
|
||||
MONSYM(53, DEF_HUMAN, S_HUMAN, "human or elf")
|
||||
/* space symbol*/
|
||||
MONSYM(54, DEF_GHOST, S_GHOST, "ghost")
|
||||
MONSYM(55, DEF_GOLEM, S_GOLEM, "golem")
|
||||
MONSYM(56, DEF_DEMON, S_DEMON, "major demon")
|
||||
/* fish */
|
||||
MONSYM(57, DEF_EEL, S_EEL, "sea monster")
|
||||
/* reptiles */
|
||||
MONSYM(58, DEF_LIZARD, S_LIZARD, "lizard")
|
||||
MONSYM(59, DEF_WORM_TAIL, S_WORM_TAIL, "long worm tail")
|
||||
MONSYM(60, DEF_MIMIC_DEF, S_MIMIC_DEF, "mimic")
|
||||
|
||||
#undef MONSYM
|
||||
#endif /* MONSYMS_ENUM || MONSYMS_PARSE || MONSYMS_DRAWING */
|
||||
|
||||
#if defined(OBJCLASS_ENUM) || defined(OBJCLASS_PARSE) || defined (OBJCLASS_DRAWING)
|
||||
|
||||
/*
|
||||
OBJCLASS(idx, class, defsym, sym, name, explain)
|
||||
idx: index used in enum
|
||||
class: enum entry
|
||||
defsym: symbol macro (defined in sym.h)
|
||||
sym: symbol name for parsing purposes
|
||||
name: used in object_detect()
|
||||
explain: used in do_look()
|
||||
*/
|
||||
|
||||
#if defined(OBJCLASS_ENUM)
|
||||
/* objclass.h */
|
||||
#define OBJCLASS(idx, class, defsym, sym, name, explain) \
|
||||
class = idx,
|
||||
|
||||
#elif defined(OBJCLASS_PARSE)
|
||||
/* symbols.c */
|
||||
#define OBJCLASS(idx, class, defsym, sym, name, explain) \
|
||||
{ SYM_OC, class + SYM_OFF_O, #sym },
|
||||
|
||||
#elif defined(OBJCLASS_DRAWING)
|
||||
/* drawing.c */
|
||||
#define OBJCLASS(idx, class, defsym, sym, name, explain) \
|
||||
{ defsym, name, explain },
|
||||
#endif
|
||||
|
||||
OBJCLASS( 1, ILLOBJ_CLASS, ILLOBJ_SYM, S_strange_obj,
|
||||
"illegal objects", "strange object")
|
||||
OBJCLASS( 2, WEAPON_CLASS, WEAPON_SYM, S_weapon, "weapons", "weapon")
|
||||
OBJCLASS( 3, ARMOR_CLASS, ARMOR_SYM, S_armor,
|
||||
"armor", "suit or piece of armor")
|
||||
OBJCLASS( 4, RING_CLASS, RING_SYM, S_ring, "rings", "ring")
|
||||
OBJCLASS( 5, AMULET_CLASS, AMULET_SYM, S_amulet, "amulets", "amulet")
|
||||
OBJCLASS( 6, TOOL_CLASS, TOOL_SYM, S_tool,
|
||||
"tools", "useful item (pick-axe, key, lamp...)")
|
||||
OBJCLASS( 7, FOOD_CLASS, FOOD_SYM, S_food, "food", "piece of food")
|
||||
OBJCLASS( 8, POTION_CLASS, POTION_SYM, S_potion, "potions", "potion")
|
||||
OBJCLASS( 9, SCROLL_CLASS, SCROLL_SYM, S_scroll, "scrolls", "scroll")
|
||||
OBJCLASS(10, SPBOOK_CLASS, SPBOOK_SYM, S_book, "spellbooks", "spellbook")
|
||||
OBJCLASS(11, WAND_CLASS, WAND_SYM, S_wand, "wands", "wand")
|
||||
OBJCLASS(12, COIN_CLASS, GOLD_SYM, S_coin, "coins", "pile of coins")
|
||||
OBJCLASS(13, GEM_CLASS, GEM_SYM, S_gem, "rocks", "gem or rock")
|
||||
OBJCLASS(14, ROCK_CLASS, ROCK_SYM, S_rock,
|
||||
"large stones", "boulder or statue")
|
||||
OBJCLASS(15, BALL_CLASS, BALL_SYM, S_ball, "iron balls", "iron ball")
|
||||
OBJCLASS(16, CHAIN_CLASS, CHAIN_SYM, S_chain, "chains", "iron chain")
|
||||
OBJCLASS(17, VENOM_CLASS, VENOM_SYM, S_venom, "venoms", "splash of venom")
|
||||
|
||||
#undef OBJCLASS
|
||||
#endif /* OBJCLASS_ENUM || OBJCLASS_PARSE || OBJCLASS_DRAWING */
|
||||
|
||||
#undef CLR
|
||||
|
||||
/* end of defsym.h */
|
||||
@@ -183,7 +183,7 @@ typedef struct {
|
||||
|
||||
#include "align.h"
|
||||
#include "dungeon.h"
|
||||
#include "monsym.h"
|
||||
#include "sym.h"
|
||||
#include "mkroom.h"
|
||||
#include "objclass.h"
|
||||
#include "youprop.h"
|
||||
@@ -194,9 +194,9 @@ typedef struct {
|
||||
|
||||
/* Symbol offsets */
|
||||
#define SYM_OFF_P (0)
|
||||
#define SYM_OFF_O (SYM_OFF_P + MAXPCHARS) /* MAXPCHARS from rm.h */
|
||||
#define SYM_OFF_O (SYM_OFF_P + MAXPCHARS) /* MAXPCHARS from sym.h */
|
||||
#define SYM_OFF_M (SYM_OFF_O + MAXOCLASSES) /* MAXOCLASSES from objclass.h */
|
||||
#define SYM_OFF_W (SYM_OFF_M + MAXMCLASSES) /* MAXMCLASSES from monsym.h*/
|
||||
#define SYM_OFF_W (SYM_OFF_M + MAXMCLASSES) /* MAXMCLASSES from sym.h*/
|
||||
#define SYM_OFF_X (SYM_OFF_W + WARNCOUNT)
|
||||
#define SYM_MAX (SYM_OFF_X + MAXOTHER)
|
||||
|
||||
|
||||
148
include/monsym.h
148
include/monsym.h
@@ -1,148 +0,0 @@
|
||||
/* NetHack 3.7 monsym.h $NHDT-Date: 1596498550 2020/08/03 23:49:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.13 $ */
|
||||
/* Copyright (c) 2016 by Pasi Kallinen */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
/* Monster symbols and creation information rev 1.0 */
|
||||
|
||||
#ifndef MONSYM_H
|
||||
#define MONSYM_H
|
||||
|
||||
/*
|
||||
* Monster classes. Below, are the corresponding default characters for
|
||||
* them. Monster class 0 is not used or defined so we can use it as a
|
||||
* NULL character.
|
||||
*/
|
||||
enum mon_class_types {
|
||||
S_ANT = 1, /* a */
|
||||
S_BLOB = 2, /* b */
|
||||
S_COCKATRICE = 3, /* c */
|
||||
S_DOG = 4, /* d */
|
||||
S_EYE = 5, /* e */
|
||||
S_FELINE = 6, /* f: cats */
|
||||
S_GREMLIN = 7, /* g */
|
||||
S_HUMANOID = 8, /* h: small humanoids: hobbit, dwarf */
|
||||
S_IMP = 9, /* i: minor demons */
|
||||
S_JELLY = 10, /* j */
|
||||
S_KOBOLD = 11, /* k */
|
||||
S_LEPRECHAUN = 12, /* l */
|
||||
S_MIMIC = 13, /* m */
|
||||
S_NYMPH = 14, /* n */
|
||||
S_ORC = 15, /* o */
|
||||
S_PIERCER = 16, /* p */
|
||||
S_QUADRUPED = 17, /* q: excludes horses */
|
||||
S_RODENT = 18, /* r */
|
||||
S_SPIDER = 19, /* s */
|
||||
S_TRAPPER = 20, /* t */
|
||||
S_UNICORN = 21, /* u: includes horses */
|
||||
S_VORTEX = 22, /* v */
|
||||
S_WORM = 23, /* w */
|
||||
S_XAN = 24, /* x */
|
||||
S_LIGHT = 25, /* y: yellow light, black light */
|
||||
S_ZRUTY = 26, /* z */
|
||||
S_ANGEL = 27, /* A */
|
||||
S_BAT = 28, /* B */
|
||||
S_CENTAUR = 29, /* C */
|
||||
S_DRAGON = 30, /* D */
|
||||
S_ELEMENTAL = 31, /* E: includes invisible stalker */
|
||||
S_FUNGUS = 32, /* F */
|
||||
S_GNOME = 33, /* G */
|
||||
S_GIANT = 34, /* H: large humanoid: giant, ettin, minotaur */
|
||||
S_invisible = 35, /* I: non-class present in def_monsyms[] */
|
||||
S_JABBERWOCK = 36, /* J */
|
||||
S_KOP = 37, /* K */
|
||||
S_LICH = 38, /* L */
|
||||
S_MUMMY = 39, /* M */
|
||||
S_NAGA = 40, /* N */
|
||||
S_OGRE = 41, /* O */
|
||||
S_PUDDING = 42, /* P */
|
||||
S_QUANTMECH = 43, /* Q */
|
||||
S_RUSTMONST = 44, /* R */
|
||||
S_SNAKE = 45, /* S */
|
||||
S_TROLL = 46, /* T */
|
||||
S_UMBER = 47, /* U: umber hulk */
|
||||
S_VAMPIRE = 48, /* V */
|
||||
S_WRAITH = 49, /* W */
|
||||
S_XORN = 50, /* X */
|
||||
S_YETI = 51, /* Y: includes owlbear, monkey */
|
||||
S_ZOMBIE = 52, /* Z */
|
||||
S_HUMAN = 53, /* @ */
|
||||
S_GHOST = 54, /* <space> */
|
||||
S_GOLEM = 55, /* ' */
|
||||
S_DEMON = 56, /* & */
|
||||
S_EEL = 57, /* ; (fish) */
|
||||
S_LIZARD = 58, /* : (reptiles) */
|
||||
|
||||
S_WORM_TAIL = 59, /* ~ */
|
||||
S_MIMIC_DEF = 60, /* ] */
|
||||
|
||||
MAXMCLASSES = 61 /* number of monster classes */
|
||||
};
|
||||
|
||||
/*
|
||||
* Default characters for monsters. These correspond to the monster classes
|
||||
* above.
|
||||
*/
|
||||
/* clang-format off */
|
||||
#define DEF_ANT 'a'
|
||||
#define DEF_BLOB 'b'
|
||||
#define DEF_COCKATRICE 'c'
|
||||
#define DEF_DOG 'd'
|
||||
#define DEF_EYE 'e'
|
||||
#define DEF_FELINE 'f'
|
||||
#define DEF_GREMLIN 'g'
|
||||
#define DEF_HUMANOID 'h'
|
||||
#define DEF_IMP 'i'
|
||||
#define DEF_JELLY 'j'
|
||||
#define DEF_KOBOLD 'k'
|
||||
#define DEF_LEPRECHAUN 'l'
|
||||
#define DEF_MIMIC 'm'
|
||||
#define DEF_NYMPH 'n'
|
||||
#define DEF_ORC 'o'
|
||||
#define DEF_PIERCER 'p'
|
||||
#define DEF_QUADRUPED 'q'
|
||||
#define DEF_RODENT 'r'
|
||||
#define DEF_SPIDER 's'
|
||||
#define DEF_TRAPPER 't'
|
||||
#define DEF_UNICORN 'u'
|
||||
#define DEF_VORTEX 'v'
|
||||
#define DEF_WORM 'w'
|
||||
#define DEF_XAN 'x'
|
||||
#define DEF_LIGHT 'y'
|
||||
#define DEF_ZRUTY 'z'
|
||||
#define DEF_ANGEL 'A'
|
||||
#define DEF_BAT 'B'
|
||||
#define DEF_CENTAUR 'C'
|
||||
#define DEF_DRAGON 'D'
|
||||
#define DEF_ELEMENTAL 'E'
|
||||
#define DEF_FUNGUS 'F'
|
||||
#define DEF_GNOME 'G'
|
||||
#define DEF_GIANT 'H'
|
||||
#define DEF_JABBERWOCK 'J'
|
||||
#define DEF_KOP 'K'
|
||||
#define DEF_LICH 'L'
|
||||
#define DEF_MUMMY 'M'
|
||||
#define DEF_NAGA 'N'
|
||||
#define DEF_OGRE 'O'
|
||||
#define DEF_PUDDING 'P'
|
||||
#define DEF_QUANTMECH 'Q'
|
||||
#define DEF_RUSTMONST 'R'
|
||||
#define DEF_SNAKE 'S'
|
||||
#define DEF_TROLL 'T'
|
||||
#define DEF_UMBER 'U'
|
||||
#define DEF_VAMPIRE 'V'
|
||||
#define DEF_WRAITH 'W'
|
||||
#define DEF_XORN 'X'
|
||||
#define DEF_YETI 'Y'
|
||||
#define DEF_ZOMBIE 'Z'
|
||||
#define DEF_HUMAN '@'
|
||||
#define DEF_GHOST ' '
|
||||
#define DEF_GOLEM '\''
|
||||
#define DEF_DEMON '&'
|
||||
#define DEF_EEL ';'
|
||||
#define DEF_LIZARD ':'
|
||||
|
||||
#define DEF_INVISIBLE 'I'
|
||||
#define DEF_WORM_TAIL '~'
|
||||
#define DEF_MIMIC_DEF ']'
|
||||
/* clang-format on */
|
||||
|
||||
#endif /* MONSYM_H */
|
||||
@@ -143,25 +143,10 @@ extern NEARDATA struct objdescr obj_descr[];
|
||||
*/
|
||||
enum obj_class_types {
|
||||
RANDOM_CLASS = 0, /* used for generating random objects */
|
||||
ILLOBJ_CLASS = 1,
|
||||
WEAPON_CLASS = 2,
|
||||
ARMOR_CLASS = 3,
|
||||
RING_CLASS = 4,
|
||||
AMULET_CLASS = 5,
|
||||
TOOL_CLASS = 6,
|
||||
FOOD_CLASS = 7,
|
||||
POTION_CLASS = 8,
|
||||
SCROLL_CLASS = 9,
|
||||
SPBOOK_CLASS = 10, /* actually SPELL-book */
|
||||
WAND_CLASS = 11,
|
||||
COIN_CLASS = 12,
|
||||
GEM_CLASS = 13,
|
||||
ROCK_CLASS = 14,
|
||||
BALL_CLASS = 15,
|
||||
CHAIN_CLASS = 16,
|
||||
VENOM_CLASS = 17,
|
||||
|
||||
MAXOCLASSES = 18
|
||||
#define OBJCLASS_ENUM
|
||||
#include "defsym.h"
|
||||
#undef OBJCLASS_ENUM
|
||||
MAXOCLASSES
|
||||
};
|
||||
/* for mkobj() use ONLY! odd '-SPBOOK_CLASS' is in case of unsigned enums */
|
||||
#define SPBOOK_no_NOVEL (0 - (int) SPBOOK_CLASS)
|
||||
@@ -175,26 +160,6 @@ extern const struct class_sym
|
||||
extern uchar oc_syms[MAXOCLASSES]; /* current class symbols */
|
||||
#endif
|
||||
|
||||
/* Default definitions of all object-symbols (must match classes above). */
|
||||
|
||||
#define ILLOBJ_SYM ']' /* also used for mimics */
|
||||
#define WEAPON_SYM ')'
|
||||
#define ARMOR_SYM '['
|
||||
#define RING_SYM '='
|
||||
#define AMULET_SYM '"'
|
||||
#define TOOL_SYM '('
|
||||
#define FOOD_SYM '%'
|
||||
#define POTION_SYM '!'
|
||||
#define SCROLL_SYM '?'
|
||||
#define SPBOOK_SYM '+'
|
||||
#define WAND_SYM '/'
|
||||
#define GOLD_SYM '$'
|
||||
#define GEM_SYM '*'
|
||||
#define ROCK_SYM '`'
|
||||
#define BALL_SYM '0'
|
||||
#define CHAIN_SYM '_'
|
||||
#define VENOM_SYM '.'
|
||||
|
||||
struct fruit {
|
||||
char fname[PL_FSIZ];
|
||||
int fid;
|
||||
|
||||
212
include/rm.h
212
include/rm.h
@@ -106,218 +106,6 @@ enum levl_typ_types {
|
||||
#define IS_AIR(typ) ((typ) == AIR || (typ) == CLOUD)
|
||||
#define IS_SOFT(typ) ((typ) == AIR || (typ) == CLOUD || IS_POOL(typ))
|
||||
|
||||
/*
|
||||
* The screen symbols may be the default or defined at game startup time.
|
||||
* See drawing.c for defaults.
|
||||
* Note: {ibm|dec|curses}_graphics[] arrays (also in drawing.c) must be kept in
|
||||
* synch.
|
||||
*/
|
||||
|
||||
/* begin dungeon characters */
|
||||
enum screen_symbols {
|
||||
S_stone = 0,
|
||||
S_vwall = 1,
|
||||
S_hwall = 2,
|
||||
S_tlcorn = 3,
|
||||
S_trcorn = 4,
|
||||
S_blcorn = 5,
|
||||
S_brcorn = 6,
|
||||
S_crwall = 7,
|
||||
S_tuwall = 8,
|
||||
S_tdwall = 9,
|
||||
S_tlwall = 10,
|
||||
S_trwall = 11,
|
||||
S_ndoor = 12,
|
||||
S_vodoor = 13,
|
||||
S_hodoor = 14,
|
||||
S_vcdoor = 15, /* closed door, vertical wall */
|
||||
S_hcdoor = 16, /* closed door, horizontal wall */
|
||||
S_bars = 17, /* KMH -- iron bars */
|
||||
S_tree = 18, /* KMH */
|
||||
S_room = 19,
|
||||
S_darkroom = 20,
|
||||
S_corr = 21,
|
||||
S_litcorr = 22,
|
||||
S_upstair = 23,
|
||||
S_dnstair = 24,
|
||||
S_upladder = 25,
|
||||
S_dnladder = 26,
|
||||
S_brupstair = 27,
|
||||
S_brdnstair = 28,
|
||||
S_brupladder= 29,
|
||||
S_brdnladder= 30,
|
||||
S_altar = 31,
|
||||
S_grave = 32,
|
||||
S_throne = 33,
|
||||
S_sink = 34,
|
||||
S_fountain = 35,
|
||||
S_pool = 36,
|
||||
S_ice = 37,
|
||||
S_lava = 38,
|
||||
S_vodbridge = 39,
|
||||
S_hodbridge = 40,
|
||||
S_vcdbridge = 41, /* closed drawbridge, vertical wall */
|
||||
S_hcdbridge = 42, /* closed drawbridge, horizontal wall */
|
||||
S_air = 43,
|
||||
S_cloud = 44,
|
||||
S_water = 45,
|
||||
|
||||
/* end dungeon characters, begin traps */
|
||||
|
||||
S_arrow_trap = 46,
|
||||
S_dart_trap = 47,
|
||||
S_falling_rock_trap = 48,
|
||||
S_squeaky_board = 49,
|
||||
S_bear_trap = 50,
|
||||
S_land_mine = 51,
|
||||
S_rolling_boulder_trap = 52,
|
||||
S_sleeping_gas_trap = 53,
|
||||
S_rust_trap = 54,
|
||||
S_fire_trap = 55,
|
||||
S_pit = 56,
|
||||
S_spiked_pit = 57,
|
||||
S_hole = 58,
|
||||
S_trap_door = 59,
|
||||
S_teleportation_trap = 60,
|
||||
S_level_teleporter = 61,
|
||||
S_magic_portal = 62,
|
||||
S_web = 63,
|
||||
S_statue_trap = 64,
|
||||
S_magic_trap = 65,
|
||||
S_anti_magic_trap = 66,
|
||||
S_polymorph_trap = 67,
|
||||
S_vibrating_square = 68, /* for display rather than any trap effect */
|
||||
|
||||
/* end traps, begin special effects */
|
||||
|
||||
S_vbeam = 69, /* The 4 zap beam symbols. Do NOT separate. */
|
||||
S_hbeam = 70, /* To change order or add, see function */
|
||||
S_lslant = 71, /* zapdir_to_glyph() in display.c. */
|
||||
S_rslant = 72,
|
||||
S_digbeam = 73, /* dig beam symbol */
|
||||
S_flashbeam = 74, /* camera flash symbol */
|
||||
S_boomleft = 75, /* thrown boomerang, open left, e.g ')' */
|
||||
S_boomright = 76, /* thrown boomerang, open right, e.g. '(' */
|
||||
S_ss1 = 77, /* 4 magic shield ("resistance sparkle") glyphs */
|
||||
S_ss2 = 78,
|
||||
S_ss3 = 79,
|
||||
S_ss4 = 80,
|
||||
S_poisoncloud = 81,
|
||||
S_goodpos = 82, /* valid position for targeting via getpos() */
|
||||
|
||||
/* The 8 swallow symbols. Do NOT separate. To change order or add, */
|
||||
/* see the function swallow_to_glyph() in display.c. */
|
||||
S_sw_tl = 83, /* swallow top left [1] */
|
||||
S_sw_tc = 84, /* swallow top center [2] Order: */
|
||||
S_sw_tr = 85, /* swallow top right [3] */
|
||||
S_sw_ml = 86, /* swallow middle left [4] 1 2 3 */
|
||||
S_sw_mr = 87, /* swallow middle right [6] 4 5 6 */
|
||||
S_sw_bl = 88, /* swallow bottom left [7] 7 8 9 */
|
||||
S_sw_bc = 89, /* swallow bottom center [8] */
|
||||
S_sw_br = 90, /* swallow bottom right [9] */
|
||||
|
||||
S_explode1 = 91, /* explosion top left */
|
||||
S_explode2 = 92, /* explosion top center */
|
||||
S_explode3 = 93, /* explosion top right Ex. */
|
||||
S_explode4 = 94, /* explosion middle left */
|
||||
S_explode5 = 95, /* explosion middle center /-\ */
|
||||
S_explode6 = 96, /* explosion middle right |@| */
|
||||
S_explode7 = 97, /* explosion bottom left \-/ */
|
||||
S_explode8 = 98, /* explosion bottom center */
|
||||
S_explode9 = 99, /* explosion bottom right */
|
||||
|
||||
/* end effects */
|
||||
|
||||
MAXPCHARS = 100 /* maximum number of mapped characters */
|
||||
};
|
||||
|
||||
#define MAXDCHARS (S_water - S_stone + 1) /* mapped dungeon characters */
|
||||
#define MAXTCHARS (S_vibrating_square - S_arrow_trap + 1) /* trap chars */
|
||||
#define MAXECHARS (S_explode9 - S_vbeam + 1) /* mapped effects characters */
|
||||
#define MAXEXPCHARS 9 /* number of explosion characters */
|
||||
|
||||
#define DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom)
|
||||
|
||||
#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap)
|
||||
#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge)
|
||||
#define is_cmap_door(i) ((i) >= S_vodoor && (i) <= S_hcdoor)
|
||||
#define is_cmap_wall(i) ((i) >= S_stone && (i) <= S_trwall)
|
||||
#define is_cmap_room(i) ((i) >= S_room && (i) <= S_darkroom)
|
||||
#define is_cmap_corr(i) ((i) >= S_corr && (i) <= S_litcorr)
|
||||
#define is_cmap_furniture(i) ((i) >= S_upstair && (i) <= S_fountain)
|
||||
#define is_cmap_water(i) ((i) == S_pool || (i) == S_water)
|
||||
#define is_cmap_lava(i) ((i) == S_lava)
|
||||
#define is_cmap_stairs(i) ((i) == S_upstair || (i) == S_dnstair || \
|
||||
(i) == S_upladder || (i) == S_dnladder)
|
||||
|
||||
|
||||
struct symdef {
|
||||
uchar sym;
|
||||
const char *explanation;
|
||||
#ifdef TEXTCOLOR
|
||||
uchar color;
|
||||
#endif
|
||||
};
|
||||
|
||||
struct symparse {
|
||||
unsigned range;
|
||||
#define SYM_CONTROL 1 /* start/finish markers */
|
||||
#define SYM_PCHAR 2 /* index into showsyms */
|
||||
#define SYM_OC 3 /* index into oc_syms */
|
||||
#define SYM_MON 4 /* index into monsyms */
|
||||
#define SYM_OTH 5 /* misc */
|
||||
int idx;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/* misc symbol definitions */
|
||||
#define SYM_NOTHING 0
|
||||
#define SYM_UNEXPLORED 1
|
||||
#define SYM_BOULDER 2
|
||||
#define SYM_INVISIBLE 3
|
||||
#define SYM_PET_OVERRIDE 4
|
||||
#define SYM_HERO_OVERRIDE 5
|
||||
#define MAXOTHER 6
|
||||
|
||||
/* linked list of symsets and their characteristics */
|
||||
struct symsetentry {
|
||||
struct symsetentry *next; /* next in list */
|
||||
char *name; /* ptr to symset name */
|
||||
char *desc; /* ptr to description */
|
||||
int idx; /* an index value */
|
||||
int handling; /* known handlers value */
|
||||
Bitfield(nocolor, 1); /* don't use color if set */
|
||||
Bitfield(primary, 1); /* restricted for use as primary set */
|
||||
Bitfield(rogue, 1); /* restricted for use as rogue lev set */
|
||||
Bitfield(explicitly, 1); /* explicit symset set */
|
||||
/* 4 free bits */
|
||||
};
|
||||
|
||||
/*
|
||||
* Graphics sets for display symbols
|
||||
*/
|
||||
#define DEFAULT_GRAPHICS 0 /* regular characters: '-', '+', &c */
|
||||
#define PRIMARY 0 /* primary graphics set */
|
||||
#define ROGUESET 1 /* rogue graphics set */
|
||||
#define NUM_GRAPHICS 2
|
||||
|
||||
/*
|
||||
* special symbol set handling types ( for invoking callbacks, etc.)
|
||||
* Must match the order of the known_handlers strings
|
||||
* in drawing.c
|
||||
*/
|
||||
#define H_UNK 0
|
||||
#define H_IBM 1
|
||||
#define H_DEC 2
|
||||
#define H_CURS 3
|
||||
#define H_MAC 4 /* obsolete; needed so that the listing of available
|
||||
* symsets by 'O' can skip it for !MAC_GRAPHICS_ENV */
|
||||
|
||||
extern const struct symdef defsyms[MAXPCHARS]; /* defaults */
|
||||
#define WARNCOUNT 6 /* number of different warning levels */
|
||||
extern const struct symdef def_warnsyms[WARNCOUNT];
|
||||
#define SYMHANDLING(ht) (g.symset[g.currentgraphics].handling == (ht))
|
||||
|
||||
/*
|
||||
* Note: secret doors (SDOOR) want to use both rm.doormask and
|
||||
* rm.wall_info but those both overload rm.flags. SDOOR only
|
||||
|
||||
215
include/sym.h
Normal file
215
include/sym.h
Normal file
@@ -0,0 +1,215 @@
|
||||
/* NetHack 3.7 sym.h */
|
||||
/* Copyright (c) 2016 by Pasi Kallinen */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
#ifndef SYM_H
|
||||
#define SYM_H
|
||||
|
||||
/*
|
||||
* Default characters for monsters.
|
||||
*/
|
||||
/* clang-format off */
|
||||
#define DEF_ANT 'a'
|
||||
#define DEF_BLOB 'b'
|
||||
#define DEF_COCKATRICE 'c'
|
||||
#define DEF_DOG 'd'
|
||||
#define DEF_EYE 'e'
|
||||
#define DEF_FELINE 'f'
|
||||
#define DEF_GREMLIN 'g'
|
||||
#define DEF_HUMANOID 'h'
|
||||
#define DEF_IMP 'i'
|
||||
#define DEF_JELLY 'j'
|
||||
#define DEF_KOBOLD 'k'
|
||||
#define DEF_LEPRECHAUN 'l'
|
||||
#define DEF_MIMIC 'm'
|
||||
#define DEF_NYMPH 'n'
|
||||
#define DEF_ORC 'o'
|
||||
#define DEF_PIERCER 'p'
|
||||
#define DEF_QUADRUPED 'q'
|
||||
#define DEF_RODENT 'r'
|
||||
#define DEF_SPIDER 's'
|
||||
#define DEF_TRAPPER 't'
|
||||
#define DEF_UNICORN 'u'
|
||||
#define DEF_VORTEX 'v'
|
||||
#define DEF_WORM 'w'
|
||||
#define DEF_XAN 'x'
|
||||
#define DEF_LIGHT 'y'
|
||||
#define DEF_ZRUTY 'z'
|
||||
#define DEF_ANGEL 'A'
|
||||
#define DEF_BAT 'B'
|
||||
#define DEF_CENTAUR 'C'
|
||||
#define DEF_DRAGON 'D'
|
||||
#define DEF_ELEMENTAL 'E'
|
||||
#define DEF_FUNGUS 'F'
|
||||
#define DEF_GNOME 'G'
|
||||
#define DEF_GIANT 'H'
|
||||
#define DEF_JABBERWOCK 'J'
|
||||
#define DEF_KOP 'K'
|
||||
#define DEF_LICH 'L'
|
||||
#define DEF_MUMMY 'M'
|
||||
#define DEF_NAGA 'N'
|
||||
#define DEF_OGRE 'O'
|
||||
#define DEF_PUDDING 'P'
|
||||
#define DEF_QUANTMECH 'Q'
|
||||
#define DEF_RUSTMONST 'R'
|
||||
#define DEF_SNAKE 'S'
|
||||
#define DEF_TROLL 'T'
|
||||
#define DEF_UMBER 'U'
|
||||
#define DEF_VAMPIRE 'V'
|
||||
#define DEF_WRAITH 'W'
|
||||
#define DEF_XORN 'X'
|
||||
#define DEF_YETI 'Y'
|
||||
#define DEF_ZOMBIE 'Z'
|
||||
#define DEF_HUMAN '@'
|
||||
#define DEF_GHOST ' '
|
||||
#define DEF_GOLEM '\''
|
||||
#define DEF_DEMON '&'
|
||||
#define DEF_EEL ';'
|
||||
#define DEF_LIZARD ':'
|
||||
|
||||
#define DEF_INVISIBLE 'I'
|
||||
#define DEF_WORM_TAIL '~'
|
||||
#define DEF_MIMIC_DEF ']'
|
||||
/* clang-format on */
|
||||
|
||||
enum mon_class_types {
|
||||
#define MONSYMS_ENUM
|
||||
#include "defsym.h"
|
||||
#undef MONSYMS_ENUM
|
||||
|
||||
MAXMCLASSES /* number of monster classes */
|
||||
};
|
||||
|
||||
#ifndef MAKEDEFS_C
|
||||
|
||||
/* Default characters for object classes */
|
||||
|
||||
#define ILLOBJ_SYM ']' /* also used for mimics */
|
||||
#define WEAPON_SYM ')'
|
||||
#define ARMOR_SYM '['
|
||||
#define RING_SYM '='
|
||||
#define AMULET_SYM '"'
|
||||
#define TOOL_SYM '('
|
||||
#define FOOD_SYM '%'
|
||||
#define POTION_SYM '!'
|
||||
#define SCROLL_SYM '?'
|
||||
#define SPBOOK_SYM '+'
|
||||
#define WAND_SYM '/'
|
||||
#define GOLD_SYM '$'
|
||||
#define GEM_SYM '*'
|
||||
#define ROCK_SYM '`'
|
||||
#define BALL_SYM '0'
|
||||
#define CHAIN_SYM '_'
|
||||
#define VENOM_SYM '.'
|
||||
|
||||
/* Default characters for dungeon surroundings and furniture */
|
||||
enum screen_symbols {
|
||||
#define PCHAR_ENUM
|
||||
#include "defsym.h"
|
||||
#undef PCHAR_ENUM
|
||||
MAXPCHARS
|
||||
};
|
||||
|
||||
struct symdef {
|
||||
uchar sym;
|
||||
const char *explanation;
|
||||
#ifdef TEXTCOLOR
|
||||
uchar color;
|
||||
#endif
|
||||
};
|
||||
|
||||
enum symparse_range {
|
||||
SYM_CONTROL = 1, /* start/finish markers */
|
||||
SYM_PCHAR = 2, /* index into showsyms */
|
||||
SYM_OC = 3, /* index into oc_syms */
|
||||
SYM_MON = 4, /* index into monsyms */
|
||||
SYM_OTH = 5 /* misc */
|
||||
};
|
||||
|
||||
struct symparse {
|
||||
unsigned range;
|
||||
int idx;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/* linked list of symsets and their characteristics */
|
||||
struct symsetentry {
|
||||
struct symsetentry *next; /* next in list */
|
||||
char *name; /* ptr to symset name */
|
||||
char *desc; /* ptr to description */
|
||||
int idx; /* an index value */
|
||||
int handling; /* known handlers value */
|
||||
Bitfield(nocolor, 1); /* don't use color if set */
|
||||
Bitfield(primary, 1); /* restricted for use as primary set */
|
||||
Bitfield(rogue, 1); /* restricted for use as rogue lev set */
|
||||
Bitfield(explicitly, 1); /* explicit symset set */
|
||||
/* 4 free bits */
|
||||
};
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
#define MAXDCHARS (S_water - S_stone + 1) /* mapped dungeon characters */
|
||||
#define MAXTCHARS (S_vibrating_square - S_arrow_trap + 1) /* trap chars */
|
||||
#define MAXECHARS (S_explode9 - S_vbeam + 1) /* mapped effects characters */
|
||||
#define MAXEXPCHARS 9 /* number of explosion characters */
|
||||
|
||||
#define DARKROOMSYM (Is_rogue_level(&u.uz) ? S_stone : S_darkroom)
|
||||
|
||||
#define is_cmap_trap(i) ((i) >= S_arrow_trap && (i) <= S_polymorph_trap)
|
||||
#define is_cmap_drawbridge(i) ((i) >= S_vodbridge && (i) <= S_hcdbridge)
|
||||
#define is_cmap_door(i) ((i) >= S_vodoor && (i) <= S_hcdoor)
|
||||
#define is_cmap_wall(i) ((i) >= S_stone && (i) <= S_trwall)
|
||||
#define is_cmap_room(i) ((i) >= S_room && (i) <= S_darkroom)
|
||||
#define is_cmap_corr(i) ((i) >= S_corr && (i) <= S_litcorr)
|
||||
#define is_cmap_furniture(i) ((i) >= S_upstair && (i) <= S_fountain)
|
||||
#define is_cmap_water(i) ((i) == S_pool || (i) == S_water)
|
||||
#define is_cmap_lava(i) ((i) == S_lava)
|
||||
#define is_cmap_stairs(i) ((i) == S_upstair || (i) == S_dnstair || \
|
||||
(i) == S_upladder || (i) == S_dnladder)
|
||||
|
||||
/* misc symbol definitions */
|
||||
enum misc_symbols {
|
||||
SYM_NOTHING = 0,
|
||||
SYM_UNEXPLORED = 1,
|
||||
SYM_BOULDER = 2,
|
||||
SYM_INVISIBLE = 3,
|
||||
SYM_PET_OVERRIDE = 4,
|
||||
SYM_HERO_OVERRIDE = 5,
|
||||
MAXOTHER
|
||||
};
|
||||
|
||||
/*
|
||||
* Graphics sets for display symbols
|
||||
*/
|
||||
#define DEFAULT_GRAPHICS 0 /* regular characters: '-', '+', &c */
|
||||
enum graphics_sets {
|
||||
PRIMARY = 0, /* primary graphics set */
|
||||
ROGUESET = 1, /* rogue graphics set */
|
||||
NUM_GRAPHICS
|
||||
};
|
||||
|
||||
/*
|
||||
* special symbol set handling types ( for invoking callbacks, etc.)
|
||||
* Must match the order of the known_handlers strings
|
||||
* in drawing.c
|
||||
*/
|
||||
|
||||
enum symset_handling_types {
|
||||
H_UNK = 0,
|
||||
H_IBM = 1,
|
||||
H_DEC = 2,
|
||||
H_CURS = 3,
|
||||
H_MAC = 4 /* obsolete; needed so that the listing of available
|
||||
* symsets by 'O' can skip it for !MAC_GRAPHICS_ENV */
|
||||
};
|
||||
|
||||
extern const struct symdef defsyms[MAXPCHARS]; /* defaults */
|
||||
#define WARNCOUNT 6 /* number of different warning levels */
|
||||
extern const struct symdef def_warnsyms[WARNCOUNT];
|
||||
#define SYMHANDLING(ht) (g.symset[g.currentgraphics].handling == (ht))
|
||||
|
||||
#endif /* !MAKEDEFS_C */
|
||||
#endif /* SYM_H */
|
||||
|
||||
Reference in New Issue
Block a user