Browse Source

Merge branch 'NetHack-3.7' into compile_test

compile_test
nhmall 2 months ago
parent
commit
6980928ca4
  1. 20
      Files
  2. 357
      include/defsym.h
  3. 6
      include/hack.h
  4. 148
      include/monsym.h
  5. 43
      include/objclass.h
  6. 212
      include/rm.h
  7. 215
      include/sym.h
  8. 205
      src/drawing.c
  9. 2
      src/hack.c
  10. 2
      src/mdlib.c
  11. 2
      src/monst.c
  12. 19
      src/options.c
  13. 190
      src/symbols.c
  14. 30
      sys/msdos/Makefile.GCC
  15. 20
      sys/unix/Makefile.src
  16. 2
      sys/unix/Makefile.utl
  17. 4
      sys/unix/NetHack.xcodeproj/project.pbxproj
  18. 20
      sys/vms/Makefile.src
  19. 6
      sys/vms/Makefile.utl
  20. 24
      sys/windows/Makefile.gcc
  21. 26
      sys/windows/Makefile.msc
  22. 3
      sys/windows/vs/NetHack/NetHack.vcxproj
  23. 3
      sys/windows/vs/NetHackW/NetHackW.vcxproj
  24. 3
      sys/windows/vs/makedefs/makedefs.vcxproj
  25. 3
      sys/windows/vs/tilemap/tilemap.vcxproj
  26. 34
      test/testmove.lua
  27. 2
      util/makedefs.c
  28. 4
      win/share/other.txt
  29. 136
      win/share/tilemap.c

20
Files

@ -87,18 +87,18 @@ tile2x11.h winX.h xwindow.h xwindowp.h
(files for all versions)
align.h artifact.h artilist.h attrib.h botl.h
color.h config.h config1.h context.h coord.h
decl.h dgn_file.h display.h dlb.h dungeon.h
engrave.h extern.h flag.h fnamesiz.h func_tab.h
global.h hack.h integer.h isaac64.h lint.h
mail.h mextra.h mfndpos.h micro.h mkroom.h
monattk.h mondata.h monflag.h monst.h monsym.h
decl.h defsym.h dgn_file.h display.h dlb.h
dungeon.h engrave.h extern.h flag.h fnamesiz.h
func_tab.h global.h hack.h integer.h isaac64.h
lint.h mail.h mextra.h mfndpos.h micro.h
mkroom.h monattk.h mondata.h monflag.h monst.h
obj.h objclass.h optlist.h patchlevel.h pcconf.h
permonst.h prop.h quest.h rect.h region.h
rm.h skills.h sp_lev.h spell.h sys.h
system.h tcap.h tileset.h timeout.h tradstdc.h
trap.h unixconf.h vision.h vmsconf.h warnings.h
winami.h wincurs.h windconf.h winprocs.h wintype.h
you.h youprop.h
rm.h skills.h sp_lev.h spell.h sym.h
sys.h system.h tcap.h tileset.h timeout.h
tradstdc.h trap.h unixconf.h vision.h vmsconf.h
warnings.h winami.h wincurs.h windconf.h winprocs.h
wintype.h you.h youprop.h
(file for tty versions)
wintty.h

357
include/defsym.h

@ -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 produce
different code depending on its use. Its purpose is to
ensure that there is only one definitive source for
pchar, objclass and mon symbols.
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 */

6
include/hack.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

@ -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 */

43
include/objclass.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

@ -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

@ -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 */

205
src/drawing.c

@ -6,9 +6,9 @@
#include "color.h"
#include "rm.h"
#include "objclass.h"
#include "monsym.h"
#include "sym.h"
/* Relevant header information in rm.h, objclass.h, and monsym.h. */
/* Relevant header information in rm.h, objclass.h, sym.h, defsym.h. */
#ifdef C
#undef C
@ -27,88 +27,17 @@
*/
const struct class_sym def_oc_syms[MAXOCLASSES] = {
{ '\0', "", "" }, /* placeholder for the "random class" */
{ ILLOBJ_SYM, "illegal objects", "strange object" },
{ WEAPON_SYM, "weapons", "weapon" },
{ ARMOR_SYM, "armor", "suit or piece of armor" },
{ RING_SYM, "rings", "ring" },
{ AMULET_SYM, "amulets", "amulet" },
{ TOOL_SYM, "tools", "useful item (pick-axe, key, lamp...)" },
{ FOOD_SYM, "food", "piece of food" },
{ POTION_SYM, "potions", "potion" },
{ SCROLL_SYM, "scrolls", "scroll" },
{ SPBOOK_SYM, "spellbooks", "spellbook" },
{ WAND_SYM, "wands", "wand" },
{ GOLD_SYM, "coins", "pile of coins" },
{ GEM_SYM, "rocks", "gem or rock" },
{ ROCK_SYM, "large stones", "boulder or statue" },
{ BALL_SYM, "iron balls", "iron ball" },
{ CHAIN_SYM, "chains", "iron chain" },
{ VENOM_SYM, "venoms", "splash of venom" }
#define OBJCLASS_DRAWING
#include "defsym.h"
#undef OBJCLASS_DRAWING
};
/* Default monster class symbols. See monsym.h. */
/* Default monster class symbols. See sym.h and defsym.h. */
const struct class_sym def_monsyms[MAXMCLASSES] = {
{ '\0', "", "" },
{ DEF_ANT, "", "ant or other insect" },
{ DEF_BLOB, "", "blob" },
{ DEF_COCKATRICE, "", "cockatrice" },
{ DEF_DOG, "", "dog or other canine" },
{ DEF_EYE, "", "eye or sphere" },
{ DEF_FELINE, "", "cat or other feline" },
{ DEF_GREMLIN, "", "gremlin" },
{ DEF_HUMANOID, "", "humanoid" },
{ DEF_IMP, "", "imp or minor demon" },
{ DEF_JELLY, "", "jelly" },
{ DEF_KOBOLD, "", "kobold" },
{ DEF_LEPRECHAUN, "", "leprechaun" },
{ DEF_MIMIC, "", "mimic" },
{ DEF_NYMPH, "", "nymph" },
{ DEF_ORC, "", "orc" },
{ DEF_PIERCER, "", "piercer" },
{ DEF_QUADRUPED, "", "quadruped" },
{ DEF_RODENT, "", "rodent" },
{ DEF_SPIDER, "", "arachnid or centipede" },
{ DEF_TRAPPER, "", "trapper or lurker above" },
{ DEF_UNICORN, "", "unicorn or horse" },
{ DEF_VORTEX, "", "vortex" },
{ DEF_WORM, "", "worm" },
{ DEF_XAN, "", "xan or other mythical/fantastic insect" },
{ DEF_LIGHT, "", "light" },
{ DEF_ZRUTY, "", "zruty" },
{ DEF_ANGEL, "", "angelic being" },
{ DEF_BAT, "", "bat or bird" },
{ DEF_CENTAUR, "", "centaur" },
{ DEF_DRAGON, "", "dragon" },
{ DEF_ELEMENTAL, "", "elemental" },
{ DEF_FUNGUS, "", "fungus or mold" },
{ DEF_GNOME, "", "gnome" },
{ DEF_GIANT, "", "giant humanoid" },
{ '\0', "", "invisible monster" },
{ DEF_JABBERWOCK, "", "jabberwock" },
{ DEF_KOP, "", "Keystone Kop" },
{ DEF_LICH, "", "lich" },
{ DEF_MUMMY, "", "mummy" },
{ DEF_NAGA, "", "naga" },
{ DEF_OGRE, "", "ogre" },
{ DEF_PUDDING, "", "pudding or ooze" },
{ DEF_QUANTMECH, "", "quantum mechanic" },
{ DEF_RUSTMONST, "", "rust monster or disenchanter" },
{ DEF_SNAKE, "", "snake" },
{ DEF_TROLL, "", "troll" },
{ DEF_UMBER, "", "umber hulk" },
{ DEF_VAMPIRE, "", "vampire" },
{ DEF_WRAITH, "", "wraith" },
{ DEF_XORN, "", "xorn" },
{ DEF_YETI, "", "apelike creature" },
{ DEF_ZOMBIE, "", "zombie" },
{ DEF_HUMAN, "", "human or elf" },
{ DEF_GHOST, "", "ghost" },
{ DEF_GOLEM, "", "golem" },
{ DEF_DEMON, "", "major demon" },
{ DEF_EEL, "", "sea monster" },
{ DEF_LIZARD, "", "lizard" },
{ DEF_WORM_TAIL, "", "long worm tail" },
{ DEF_MIMIC_DEF, "", "mimic" },
#define MONSYMS_DRAWING
#include "defsym.h"
#undef MONSYMS_DRAWING
};
const struct symdef def_warnsyms[WARNCOUNT] = {
@ -137,119 +66,9 @@ const struct symdef def_warnsyms[WARNCOUNT] = {
* within NetHack itself.
*/
const struct symdef defsyms[MAXPCHARS] = {
/* 0*/
{ ' ', "stone", C(NO_COLOR) }, /* stone */
{ '|', "wall", C(CLR_GRAY) }, /* vwall */
{ '-', "wall", C(CLR_GRAY) }, /* hwall */
{ '-', "wall", C(CLR_GRAY) }, /* tlcorn */
{ '-', "wall", C(CLR_GRAY) }, /* trcorn */
{ '-', "wall", C(CLR_GRAY) }, /* blcorn */
{ '-', "wall", C(CLR_GRAY) }, /* brcorn */
{ '-', "wall", C(CLR_GRAY) }, /* crwall */
{ '-', "wall", C(CLR_GRAY) }, /* tuwall */
{ '-', "wall", C(CLR_GRAY) }, /* tdwall */
/*10*/
{ '|', "wall", C(CLR_GRAY) }, /* tlwall */
{ '|', "wall", C(CLR_GRAY) }, /* trwall */
{ '.', "doorway", C(CLR_GRAY) }, /* ndoor */
{ '-', "open door", C(CLR_BROWN) }, /* vodoor */
{ '|', "open door", C(CLR_BROWN) }, /* hodoor */
{ '+', "closed door", C(CLR_BROWN) }, /* vcdoor */
{ '+', "closed door", C(CLR_BROWN) }, /* hcdoor */
{ '#', "iron bars", C(HI_METAL) }, /* bars */
{ '#', "tree", C(CLR_GREEN) }, /* tree */
{ '.', "floor of a room", C(CLR_GRAY) }, /* room */
/*20*/
{ '.', "dark part of a room", C(CLR_BLACK) }, /* dark room */
{ '#', "corridor", C(CLR_GRAY) }, /* dark corr */
{ '#', "lit corridor", C(CLR_GRAY) }, /* lit corr, see map_glyphinfo() */
{ '<', "staircase up", C(CLR_GRAY) }, /* upstair */
{ '>', "staircase down", C(CLR_GRAY) }, /* dnstair */
{ '<', "ladder up", C(CLR_BROWN) }, /* upladder */
{ '>', "ladder down", C(CLR_BROWN) }, /* dnladder */
{ '<', "branch staircase up", C(CLR_YELLOW) }, /* brupstair */
{ '>', "branch staircase down", C(CLR_YELLOW) }, /* brdnstair */
{ '<', "branch ladder up", C(CLR_YELLOW) }, /* brupladder */
/*30*/
{ '>', "branch ladder down", C(CLR_YELLOW) }, /* brdnladder */
{ '_', "altar", C(CLR_GRAY) }, /* altar */
{ '|', "grave", C(CLR_WHITE) }, /* grave */
{ '\\', "opulent throne", C(HI_GOLD) }, /* throne */
{ '#', "sink", C(CLR_GRAY) }, /* sink */
{ '{', "fountain", C(CLR_BRIGHT_BLUE) }, /* fountain */
{ '}', "water", C(CLR_BLUE) }, /* pool */
{ '.', "ice", C(CLR_CYAN) }, /* ice */
{ '}', "molten lava", C(CLR_RED) }, /* lava */
{ '.', "lowered drawbridge", C(CLR_BROWN) }, /* vodbridge */
/*40*/
{ '.', "lowered drawbridge", C(CLR_BROWN) }, /* hodbridge */
{ '#', "raised drawbridge", C(CLR_BROWN) }, /* vcdbridge */
{ '#', "raised drawbridge", C(CLR_BROWN) }, /* hcdbridge */
{ ' ', "air", C(CLR_CYAN) }, /* open air */
{ '#', "cloud", C(CLR_GRAY) }, /* [part of] a cloud */
{ '}', "water", C(CLR_BLUE) }, /* under water */
{ '^', "arrow trap", C(HI_METAL) }, /* trap */
{ '^', "dart trap", C(HI_METAL) }, /* trap */
{ '^', "falling rock trap", C(CLR_GRAY) }, /* trap */
{ '^', "squeaky board", C(CLR_BROWN) }, /* trap */
/*50*/
{ '^', "bear trap", C(HI_METAL) }, /* trap */
{ '^', "land mine", C(CLR_RED) }, /* trap */
{ '^', "rolling boulder trap", C(CLR_GRAY) }, /* trap */
{ '^', "sleeping gas trap", C(HI_ZAP) }, /* trap */
{ '^', "rust trap", C(CLR_BLUE) }, /* trap */
{ '^', "fire trap", C(CLR_ORANGE) }, /* trap */
{ '^', "pit", C(CLR_BLACK) }, /* trap */
{ '^', "spiked pit", C(CLR_BLACK) }, /* trap */
{ '^', "hole", C(CLR_BROWN) }, /* trap */
{ '^', "trap door", C(CLR_BROWN) }, /* trap */
/*60*/
{ '^', "teleportation trap", C(CLR_MAGENTA) }, /* trap */
{ '^', "level teleporter", C(CLR_MAGENTA) }, /* trap */
{ '^', "magic portal", C(CLR_BRIGHT_MAGENTA) }, /* trap */
{ '"', "web", C(CLR_GRAY) }, /* web */
{ '^', "statue trap", C(CLR_GRAY) }, /* trap */
{ '^', "magic trap", C(HI_ZAP) }, /* trap */
{ '^', "anti-magic field", C(HI_ZAP) }, /* trap */
{ '^', "polymorph trap", C(CLR_BRIGHT_GREEN) }, /* trap */
{ '~', "vibrating square", C(CLR_MAGENTA) }, /* "trap" */
/* zap colors are changed by map_glyphinfo() to match type of beam */
{ '|', "", C(CLR_GRAY) }, /* vbeam */
/*70*/
{ '-', "", C(CLR_GRAY) }, /* hbeam */
{ '\\', "", C(CLR_GRAY) }, /* lslant */
{ '/', "", C(CLR_GRAY) }, /* rslant */
{ '*', "", C(CLR_WHITE) }, /* dig beam */
{ '!', "", C(CLR_WHITE) }, /* camera flash beam */
{ ')', "", C(HI_WOOD) }, /* boomerang open left */
{ '(', "", C(HI_WOOD) }, /* boomerang open right */
{ '0', "", C(HI_ZAP) }, /* 4 magic shield symbols */
{ '#', "", C(HI_ZAP) },
{ '@', "", C(HI_ZAP) },
/*80*/
{ '*', "", C(HI_ZAP) },
{ '#', "poison cloud", C(CLR_BRIGHT_GREEN) }, /* part of a cloud */
{ '?', "valid position", C(CLR_BRIGHT_GREEN) }, /* target position */
/* swallow colors are changed by map_glyphinfo() to match engulfing monst */
{ '/', "", C(CLR_GREEN) }, /* swallow top left */
{ '-', "", C(CLR_GREEN) }, /* swallow top center */
{ '\\', "", C(CLR_GREEN) }, /* swallow top right */
{ '|', "", C(CLR_GREEN) }, /* swallow middle left */
{ '|', "", C(CLR_GREEN) }, /* swallow middle right */
{ '\\', "", C(CLR_GREEN) }, /* swallow bottom left */
{ '-', "", C(CLR_GREEN) }, /* swallow bottom center */
/*90*/
{ '/', "", C(CLR_GREEN) }, /* swallow bottom right */
/* explosion colors are changed by map_glyphinfo() to match type of expl. */
{ '/', "", C(CLR_ORANGE) }, /* explosion top left */
{ '-', "", C(CLR_ORANGE) }, /* explosion top center */
{ '\\', "", C(CLR_ORANGE) }, /* explosion top right */
{ '|', "", C(CLR_ORANGE) }, /* explosion middle left */
{ ' ', "", C(CLR_ORANGE) }, /* explosion middle center*/
{ '|', "", C(CLR_ORANGE) }, /* explosion middle right */
{ '\\', "", C(CLR_ORANGE) }, /* explosion bottom left */
{ '-', "", C(CLR_ORANGE) }, /* explosion bottom center*/
{ '/', "", C(CLR_ORANGE) }, /* explosion bottom right */
#define PCHAR_DRAWING
#include "defsym.h"
#undef PCHAR_DRAWING
};
/* default rogue level symbols */

2
src/hack.c

@ -2807,7 +2807,7 @@ lookaround(void)
if ((mtmp = m_at(x, y)) != 0
&& M_AP_TYPE(mtmp) != M_AP_FURNITURE
&& M_AP_TYPE(mtmp) != M_AP_OBJECT
&& (!mtmp->minvis || See_invisible) && !mtmp->mundetected) {
&& mon_visible(mtmp)) {
if ((g.context.run != 1 && !mtmp->mtame)
|| (x == u.ux + u.dx && y == u.uy + u.dy
&& !g.context.travel)) {

2
src/mdlib.c

@ -19,7 +19,7 @@
#endif
#include "permonst.h"
#include "objclass.h"
#include "monsym.h"
#include "sym.h"
#include "artilist.h"
#include "dungeon.h"
#include "obj.h"

2
src/monst.c

@ -5,7 +5,7 @@
#include "config.h"
#include "permonst.h"
#include "monsym.h"
#include "sym.h"
#define NO_ATTK \
{ \

19
src/options.c

@ -7822,6 +7822,14 @@ parsesymbols(register char *opts, int which_set)
struct symparse *
match_sym(char *buf)
{
int i;
struct alternate_parse {
const char *altnm;
const char *nm;
} alternates[] = {
{ "S_armour" , "S_armor"},
};
size_t len = strlen(buf);
const char *p = index(buf, ':'), *q = index(buf, '=');
struct symparse *sp = loadsyms;
@ -7840,6 +7848,17 @@ match_sym(char *buf)
return sp;
sp++;
}
for (i = 0; i < SIZE(alternates); ++i) {
if ((len >= strlen(alternates[i].altnm))
&& !strncmpi(buf, alternates[i].altnm, len)) {
sp = loadsyms;
while (sp->range) {
if (!strcmp(alternates[i].nm, sp->name))
return sp;
sp++;
}
}
}
return (struct symparse *) 0;
}

190
src/symbols.c

@ -318,7 +318,7 @@ clear_symsetentry(int which_set, boolean name_too)
/*
* If you are adding code somewhere to be able to recognize
* particular types of symset "handling", define a
* H_XXX macro in include/rm.h and add the name
* H_XXX macro in include/sym.h and add the name
* to this array at the matching offset.
*/
const char *known_handling[] = {
@ -335,7 +335,7 @@ const char *known_handling[] = {
* These can be virtually anything that you want to
* be able to test in the code someplace.
* Be sure to:
* - add a corresponding Bitfield to the symsetentry struct in rm.h
* - add a corresponding Bitfield to the symsetentry struct in sym.h
* - initialize the field to zero in parse_sym_line in the SYM_CONTROL
* case 0 section of the idx switch. The location is prefaced with
* with a comment stating "initialize restriction bits".
@ -356,183 +356,15 @@ const struct symparse loadsyms[] = {
{ SYM_CONTROL, 4, "color" },
{ SYM_CONTROL, 4, "colour" },
{ SYM_CONTROL, 5, "restrictions" },
{ SYM_PCHAR, S_stone, "S_stone" },
{ SYM_PCHAR, S_vwall, "S_vwall" },
{ SYM_PCHAR, S_hwall, "S_hwall" },
{ SYM_PCHAR, S_tlcorn, "S_tlcorn" },
{ SYM_PCHAR, S_trcorn, "S_trcorn" },
{ SYM_PCHAR, S_blcorn, "S_blcorn" },
{ SYM_PCHAR, S_brcorn, "S_brcorn" },
{ SYM_PCHAR, S_crwall, "S_crwall" },
{ SYM_PCHAR, S_tuwall, "S_tuwall" },
{ SYM_PCHAR, S_tdwall, "S_tdwall" },
{ SYM_PCHAR, S_tlwall, "S_tlwall" },
{ SYM_PCHAR, S_trwall, "S_trwall" },
{ SYM_PCHAR, S_ndoor, "S_ndoor" },
{ SYM_PCHAR, S_vodoor, "S_vodoor" },
{ SYM_PCHAR, S_hodoor, "S_hodoor" },
{ SYM_PCHAR, S_vcdoor, "S_vcdoor" },
{ SYM_PCHAR, S_hcdoor, "S_hcdoor" },
{ SYM_PCHAR, S_bars, "S_bars" },
{ SYM_PCHAR, S_tree, "S_tree" },
{ SYM_PCHAR, S_room, "S_room" },
{ SYM_PCHAR, S_darkroom, "S_darkroom" },
{ SYM_PCHAR, S_corr, "S_corr" }