diff --git a/include/defsym.h b/include/defsym.h new file mode 100644 index 000000000..3b0b77a2a --- /dev/null +++ b/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 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 */ diff --git a/include/hack.h b/include/hack.h index ab3670494..c4e86bbba 100644 --- a/include/hack.h +++ b/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) diff --git a/include/monsym.h b/include/monsym.h deleted file mode 100644 index e09a0b55d..000000000 --- a/include/monsym.h +++ /dev/null @@ -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, /* */ - 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 */ diff --git a/include/objclass.h b/include/objclass.h index 7339d41bb..cbdce8338 100644 --- a/include/objclass.h +++ b/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; diff --git a/include/rm.h b/include/rm.h index 165d8b1b9..1a3ab335d 100644 --- a/include/rm.h +++ b/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 diff --git a/include/sym.h b/include/sym.h new file mode 100644 index 000000000..515c06374 --- /dev/null +++ b/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 */ + diff --git a/src/drawing.c b/src/drawing.c index 0f24545ac..50589e032 100644 --- a/src/drawing.c +++ b/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 */ diff --git a/src/hack.c b/src/hack.c index a6a6e2997..c259a4734 100644 --- a/src/hack.c +++ b/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)) { diff --git a/src/mdlib.c b/src/mdlib.c index 8bdfc79c4..b20b53e71 100644 --- a/src/mdlib.c +++ b/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" diff --git a/src/monst.c b/src/monst.c index bc19a9bad..e0a70ad72 100644 --- a/src/monst.c +++ b/src/monst.c @@ -5,7 +5,7 @@ #include "config.h" #include "permonst.h" -#include "monsym.h" +#include "sym.h" #define NO_ATTK \ { \ diff --git a/src/options.c b/src/options.c index 587455ddd..b2841bd37 100644 --- a/src/options.c +++ b/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; } diff --git a/src/symbols.c b/src/symbols.c index 7723b9d8c..d2d9ee7a0 100644 --- a/src/symbols.c +++ b/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" }, - { SYM_PCHAR, S_litcorr, "S_litcorr" }, - { SYM_PCHAR, S_upstair, "S_upstair" }, - { SYM_PCHAR, S_dnstair, "S_dnstair" }, - { SYM_PCHAR, S_upladder, "S_upladder" }, - { SYM_PCHAR, S_dnladder, "S_dnladder" }, - { SYM_PCHAR, S_brupstair, "S_brupstair" }, - { SYM_PCHAR, S_brdnstair, "S_brdnstair" }, - { SYM_PCHAR, S_brupladder, "S_brupladder" }, - { SYM_PCHAR, S_brdnladder, "S_brdnladder" }, - { SYM_PCHAR, S_altar, "S_altar" }, - { SYM_PCHAR, S_grave, "S_grave" }, - { SYM_PCHAR, S_throne, "S_throne" }, - { SYM_PCHAR, S_sink, "S_sink" }, - { SYM_PCHAR, S_fountain, "S_fountain" }, - { SYM_PCHAR, S_pool, "S_pool" }, - { SYM_PCHAR, S_ice, "S_ice" }, - { SYM_PCHAR, S_lava, "S_lava" }, - { SYM_PCHAR, S_vodbridge, "S_vodbridge" }, - { SYM_PCHAR, S_hodbridge, "S_hodbridge" }, - { SYM_PCHAR, S_vcdbridge, "S_vcdbridge" }, - { SYM_PCHAR, S_hcdbridge, "S_hcdbridge" }, - { SYM_PCHAR, S_air, "S_air" }, - { SYM_PCHAR, S_cloud, "S_cloud" }, - { SYM_PCHAR, S_poisoncloud, "S_poisoncloud" }, - { SYM_PCHAR, S_water, "S_water" }, - { SYM_PCHAR, S_arrow_trap, "S_arrow_trap" }, - { SYM_PCHAR, S_dart_trap, "S_dart_trap" }, - { SYM_PCHAR, S_falling_rock_trap, "S_falling_rock_trap" }, - { SYM_PCHAR, S_squeaky_board, "S_squeaky_board" }, - { SYM_PCHAR, S_bear_trap, "S_bear_trap" }, - { SYM_PCHAR, S_land_mine, "S_land_mine" }, - { SYM_PCHAR, S_rolling_boulder_trap, "S_rolling_boulder_trap" }, - { SYM_PCHAR, S_sleeping_gas_trap, "S_sleeping_gas_trap" }, - { SYM_PCHAR, S_rust_trap, "S_rust_trap" }, - { SYM_PCHAR, S_fire_trap, "S_fire_trap" }, - { SYM_PCHAR, S_pit, "S_pit" }, - { SYM_PCHAR, S_spiked_pit, "S_spiked_pit" }, - { SYM_PCHAR, S_hole, "S_hole" }, - { SYM_PCHAR, S_trap_door, "S_trap_door" }, - { SYM_PCHAR, S_teleportation_trap, "S_teleportation_trap" }, - { SYM_PCHAR, S_level_teleporter, "S_level_teleporter" }, - { SYM_PCHAR, S_magic_portal, "S_magic_portal" }, - { SYM_PCHAR, S_web, "S_web" }, - { SYM_PCHAR, S_statue_trap, "S_statue_trap" }, - { SYM_PCHAR, S_magic_trap, "S_magic_trap" }, - { SYM_PCHAR, S_anti_magic_trap, "S_anti_magic_trap" }, - { SYM_PCHAR, S_polymorph_trap, "S_polymorph_trap" }, - { SYM_PCHAR, S_vibrating_square, "S_vibrating_square" }, - { SYM_PCHAR, S_vbeam, "S_vbeam" }, - { SYM_PCHAR, S_hbeam, "S_hbeam" }, - { SYM_PCHAR, S_lslant, "S_lslant" }, - { SYM_PCHAR, S_rslant, "S_rslant" }, - { SYM_PCHAR, S_digbeam, "S_digbeam" }, - { SYM_PCHAR, S_flashbeam, "S_flashbeam" }, - { SYM_PCHAR, S_boomleft, "S_boomleft" }, - { SYM_PCHAR, S_boomright, "S_boomright" }, - { SYM_PCHAR, S_goodpos, "S_goodpos" }, - { SYM_PCHAR, S_ss1, "S_ss1" }, - { SYM_PCHAR, S_ss2, "S_ss2" }, - { SYM_PCHAR, S_ss3, "S_ss3" }, - { SYM_PCHAR, S_ss4, "S_ss4" }, - { SYM_PCHAR, S_sw_tl, "S_sw_tl" }, - { SYM_PCHAR, S_sw_tc, "S_sw_tc" }, - { SYM_PCHAR, S_sw_tr, "S_sw_tr" }, - { SYM_PCHAR, S_sw_ml, "S_sw_ml" }, - { SYM_PCHAR, S_sw_mr, "S_sw_mr" }, - { SYM_PCHAR, S_sw_bl, "S_sw_bl" }, - { SYM_PCHAR, S_sw_bc, "S_sw_bc" }, - { SYM_PCHAR, S_sw_br, "S_sw_br" }, - { SYM_PCHAR, S_explode1, "S_explode1" }, - { SYM_PCHAR, S_explode2, "S_explode2" }, - { SYM_PCHAR, S_explode3, "S_explode3" }, - { SYM_PCHAR, S_explode4, "S_explode4" }, - { SYM_PCHAR, S_explode5, "S_explode5" }, - { SYM_PCHAR, S_explode6, "S_explode6" }, - { SYM_PCHAR, S_explode7, "S_explode7" }, - { SYM_PCHAR, S_explode8, "S_explode8" }, - { SYM_PCHAR, S_explode9, "S_explode9" }, - { SYM_OC, ILLOBJ_CLASS + SYM_OFF_O, "S_strange_obj" }, - { SYM_OC, WEAPON_CLASS + SYM_OFF_O, "S_weapon" }, - { SYM_OC, ARMOR_CLASS + SYM_OFF_O, "S_armor" }, - { SYM_OC, ARMOR_CLASS + SYM_OFF_O, "S_armour" }, - { SYM_OC, RING_CLASS + SYM_OFF_O, "S_ring" }, - { SYM_OC, AMULET_CLASS + SYM_OFF_O, "S_amulet" }, - { SYM_OC, TOOL_CLASS + SYM_OFF_O, "S_tool" }, - { SYM_OC, FOOD_CLASS + SYM_OFF_O, "S_food" }, - { SYM_OC, POTION_CLASS + SYM_OFF_O, "S_potion" }, - { SYM_OC, SCROLL_CLASS + SYM_OFF_O, "S_scroll" }, - { SYM_OC, SPBOOK_CLASS + SYM_OFF_O, "S_book" }, - { SYM_OC, WAND_CLASS + SYM_OFF_O, "S_wand" }, - { SYM_OC, COIN_CLASS + SYM_OFF_O, "S_coin" }, - { SYM_OC, GEM_CLASS + SYM_OFF_O, "S_gem" }, - { SYM_OC, ROCK_CLASS + SYM_OFF_O, "S_rock" }, - { SYM_OC, BALL_CLASS + SYM_OFF_O, "S_ball" }, - { SYM_OC, CHAIN_CLASS + SYM_OFF_O, "S_chain" }, - { SYM_OC, VENOM_CLASS + SYM_OFF_O, "S_venom" }, - { SYM_MON, S_ANT + SYM_OFF_M, "S_ant" }, - { SYM_MON, S_BLOB + SYM_OFF_M, "S_blob" }, - { SYM_MON, S_COCKATRICE + SYM_OFF_M, "S_cockatrice" }, - { SYM_MON, S_DOG + SYM_OFF_M, "S_dog" }, - { SYM_MON, S_EYE + SYM_OFF_M, "S_eye" }, - { SYM_MON, S_FELINE + SYM_OFF_M, "S_feline" }, - { SYM_MON, S_GREMLIN + SYM_OFF_M, "S_gremlin" }, - { SYM_MON, S_HUMANOID + SYM_OFF_M, "S_humanoid" }, - { SYM_MON, S_IMP + SYM_OFF_M, "S_imp" }, - { SYM_MON, S_JELLY + SYM_OFF_M, "S_jelly" }, - { SYM_MON, S_KOBOLD + SYM_OFF_M, "S_kobold" }, - { SYM_MON, S_LEPRECHAUN + SYM_OFF_M, "S_leprechaun" }, - { SYM_MON, S_MIMIC + SYM_OFF_M, "S_mimic" }, - { SYM_MON, S_NYMPH + SYM_OFF_M, "S_nymph" }, - { SYM_MON, S_ORC + SYM_OFF_M, "S_orc" }, - { SYM_MON, S_PIERCER + SYM_OFF_M, "S_piercer" }, - { SYM_MON, S_QUADRUPED + SYM_OFF_M, "S_quadruped" }, - { SYM_MON, S_RODENT + SYM_OFF_M, "S_rodent" }, - { SYM_MON, S_SPIDER + SYM_OFF_M, "S_spider" }, - { SYM_MON, S_TRAPPER + SYM_OFF_M, "S_trapper" }, - { SYM_MON, S_UNICORN + SYM_OFF_M, "S_unicorn" }, - { SYM_MON, S_VORTEX + SYM_OFF_M, "S_vortex" }, - { SYM_MON, S_WORM + SYM_OFF_M, "S_worm" }, - { SYM_MON, S_XAN + SYM_OFF_M, "S_xan" }, - { SYM_MON, S_LIGHT + SYM_OFF_M, "S_light" }, - { SYM_MON, S_ZRUTY + SYM_OFF_M, "S_zruty" }, - { SYM_MON, S_ANGEL + SYM_OFF_M, "S_angel" }, - { SYM_MON, S_BAT + SYM_OFF_M, "S_bat" }, - { SYM_MON, S_CENTAUR + SYM_OFF_M, "S_centaur" }, - { SYM_MON, S_DRAGON + SYM_OFF_M, "S_dragon" }, - { SYM_MON, S_ELEMENTAL + SYM_OFF_M, "S_elemental" }, - { SYM_MON, S_FUNGUS + SYM_OFF_M, "S_fungus" }, - { SYM_MON, S_GNOME + SYM_OFF_M, "S_gnome" }, - { SYM_MON, S_GIANT + SYM_OFF_M, "S_giant" }, - { SYM_MON, S_JABBERWOCK + SYM_OFF_M, "S_jabberwock" }, - { SYM_MON, S_KOP + SYM_OFF_M, "S_kop" }, - { SYM_MON, S_LICH + SYM_OFF_M, "S_lich" }, - { SYM_MON, S_MUMMY + SYM_OFF_M, "S_mummy" }, - { SYM_MON, S_NAGA + SYM_OFF_M, "S_naga" }, - { SYM_MON, S_OGRE + SYM_OFF_M, "S_ogre" }, - { SYM_MON, S_PUDDING + SYM_OFF_M, "S_pudding" }, - { SYM_MON, S_QUANTMECH + SYM_OFF_M, "S_quantmech" }, - { SYM_MON, S_RUSTMONST + SYM_OFF_M, "S_rustmonst" }, - { SYM_MON, S_SNAKE + SYM_OFF_M, "S_snake" }, - { SYM_MON, S_TROLL + SYM_OFF_M, "S_troll" }, - { SYM_MON, S_UMBER + SYM_OFF_M, "S_umber" }, - { SYM_MON, S_VAMPIRE + SYM_OFF_M, "S_vampire" }, - { SYM_MON, S_WRAITH + SYM_OFF_M, "S_wraith" }, - { SYM_MON, S_XORN + SYM_OFF_M, "S_xorn" }, - { SYM_MON, S_YETI + SYM_OFF_M, "S_yeti" }, - { SYM_MON, S_ZOMBIE + SYM_OFF_M, "S_zombie" }, - { SYM_MON, S_HUMAN + SYM_OFF_M, "S_human" }, - { SYM_MON, S_GHOST + SYM_OFF_M, "S_ghost" }, - { SYM_MON, S_GOLEM + SYM_OFF_M, "S_golem" }, - { SYM_MON, S_DEMON + SYM_OFF_M, "S_demon" }, - { SYM_MON, S_EEL + SYM_OFF_M, "S_eel" }, - { SYM_MON, S_LIZARD + SYM_OFF_M, "S_lizard" }, - { SYM_MON, S_WORM_TAIL + SYM_OFF_M, "S_worm_tail" }, - { SYM_MON, S_MIMIC_DEF + SYM_OFF_M, "S_mimic_def" }, +#define PCHAR_PARSE +#include "defsym.h" +#undef PCHAR_PARSE +#define OBJCLASS_PARSE +#include "defsym.h" +#undef OBJCLASS_PARSE +#define MONSYMS_PARSE +#include "defsym.h" +#undef MONSYMS_PARSE { SYM_OTH, SYM_NOTHING + SYM_OFF_X, "S_nothing" }, { SYM_OTH, SYM_UNEXPLORED + SYM_OFF_X, "S_unexplored" }, { SYM_OTH, SYM_BOULDER + SYM_OFF_X, "S_boulder" }, diff --git a/sys/msdos/Makefile.GCC b/sys/msdos/Makefile.GCC index 5c7e74b16..52cf9e080 100644 --- a/sys/msdos/Makefile.GCC +++ b/sys/msdos/Makefile.GCC @@ -382,25 +382,25 @@ REGION_H = $(INCL)/region.h RM_H = $(INCL)/align.h $(INCL)/rm.h SKILLS_H = $(INCL)/skills.h SP_LEV_H = $(INCL)/align.h $(INCL)/sp_lev.h -YOUPROP_H = $(PERMONST_H) $(MONDATA_H) $(INCL)/prop.h \ +YOUPROP_H = $(PERMONST_H) $(MONDATA_H) $(INCL)/prop.h \ $(INCL)/pm.h $(INCL)/youprop.h -YOU_H = $(MONST_H) $(YOUPROP_H) $(INCL)/align.h \ +YOU_H = $(MONST_H) $(YOUPROP_H) $(INCL)/align.h \ $(INCL)/attrib.h $(INCL)/you.h DISPLAY_H = $(MONDATA_H) $(INCL)/vision.h $(INCL)/display.h -PCCONF_H = $(INCL)/micro.h $(INCL)/system.h $(INCL)/pcconf.h \ +PCCONF_H = $(INCL)/micro.h $(INCL)/system.h $(INCL)/pcconf.h \ $(MSYS)/pcvideo.h CONFIG_H = $(GLOBAL_H) $(INCL)/fnamesiz.h $(INCL)/tradstdc.h \ $(INCL)/config1.h $(INCL)/config.h -DECL_H = $(YOU_H) $(INCL)/spell.h $(INCL)/color.h \ - $(INCL)/obj.h $(INCL)/onames.h $(INCL)/pm.h \ +DECL_H = $(YOU_H) $(INCL)/spell.h $(INCL)/color.h \ + $(INCL)/obj.h $(INCL)/onames.h $(INCL)/pm.h \ $(INCL)/decl.h GLOBAL_H = $(PCCONF_H) $(INCL)/coord.h $(INCL)/global.h HACK_H = $(CONFIG_H) $(INCL)/context.h $(DUNGEON_H) \ - $(DECL_H) $(DISPLAY_H) $(INCL)/monsym.h \ - $(INCL)/mkroom.h $(INCL)/objclass.h $(INCL)/trap.h \ - $(INCL)/flag.h $(RM_H) $(INCL)/vision.h \ - $(INCL)/wintype.h $(INCL)/engrave.h $(INCL)/rect.h \ - $(INCL)/hack.h $(REGION_H) \ + $(DECL_H) $(DISPLAY_H) $(INCL)/sym.h \ + $(INCL)/defsym.h $(INCL)/mkroom.h $(INCL)/objclass.h \ + $(INCL)/trap.h $(INCL)/flag.h $(RM_H) \ + $(INCL)/vision.h $(INCL)/wintype.h $(INCL)/engrave.h \ + $(INCL)/rect.h $(INCL)/hack.h $(REGION_H) \ $(INCL)/sys.h DLB_H = $(INCL)/dlb.h @@ -661,7 +661,7 @@ $(U)makedefs.exe: $(MAKEDEFSOBJS) $(LINK) $(LFLAGS) -o$@ $(MAKEDEFSOBJS) $(O)makedefs.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/objclass.h \ - $(INCL)/monsym.h $(U)makedefs.c + $(INCL)/sym.h $(INCL)/defsym.h $(U)makedefs.c #========================================== # Recover Utility @@ -814,8 +814,8 @@ $(O)drawing.o: $(CONFIG_H) drawing.c $(MSYS)/pcvideo.h $(O)decl.o: $(CONFIG_H) decl.c $(CC) $(cflags) -o$@ decl.c -$(O)monst.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/monsym.h \ - $(INCL)/color.h monst.c +$(O)monst.o: $(CONFIG_H) $(PERMONST_H) $(INCL)/sym.h \ + $(INCL)/defsym.h $(INCL)/color.h monst.c $(CC) $(cflags) -o$@ monst.c $(O)objects.o: $(CONFIG_H) $(INCL)/obj.h $(INCL)/objclass.h \ @@ -1209,8 +1209,8 @@ $(O)mon.o: mon.c $(HACK_H) $(INCL)/mfndpos.h $(O)mondata.o: mondata.c $(HACK_H) $(O)monmove.o: monmove.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/artifact.h $(O)monst.o: monst.c $(CONFIG_H) $(INCL)/permonst.h $(INCL)/align.h \ - $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/monsym.h \ - $(INCL)/color.h + $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/sym.h \ + $(INCL)/defsym.h $(INCL)/color.h $(O)mplayer.o: mplayer.c $(HACK_H) $(O)mthrowu.o: mthrowu.c $(HACK_H) $(O)muse.o: muse.c $(HACK_H) diff --git a/sys/unix/Makefile.src b/sys/unix/Makefile.src index f52e9c9be..6e1c60b44 100644 --- a/sys/unix/Makefile.src +++ b/sys/unix/Makefile.src @@ -523,10 +523,10 @@ HACKINCL = align.h artifact.h artilist.h attrib.h botl.h \ display.h dlb.h dungeon.h engrave.h extern.h flag.h fnamesiz.h \ func_tab.h global.h warnings.h hack.h lint.h mextra.h mfndpos.h \ micro.h mkroom.h \ - monattk.h mondata.h monflag.h monst.h monsym.h obj.h objclass.h \ + monattk.h mondata.h monflag.h monst.h obj.h objclass.h \ optlist.h patchlevel.h pcconf.h permonst.h prop.h rect.h \ - region.h rm.h sp_lev.h spell.h sys.h system.h tcap.h timeout.h \ - tradstdc.h trap.h unixconf.h vision.h vmsconf.h \ + region.h sym.h defsym.h rm.h sp_lev.h spell.h sys.h system.h \ + tcap.h timeout.h tradstdc.h trap.h unixconf.h vision.h vmsconf.h \ wintty.h wincurs.h winX.h winprocs.h wintype.h you.h youprop.h HSOURCES = $(HACKINCL) date.h onames.h pm.h dgn_file.h @@ -697,7 +697,7 @@ qt_yndlg.moc : ../win/Qt/qt_yndlg.h $(MAKEDEFS): $(FIRSTOBJ) \ ../util/makedefs.c ../src/mdlib.c $(CONFIG_H) \ ../include/permonst.h \ - ../include/objclass.h ../include/monsym.h \ + ../include/objclass.h ../include/sym.h ../include/defsym.h \ ../include/artilist.h ../include/dungeon.h ../include/obj.h \ ../include/monst.h ../include/you.h ../include/flag.h \ ../include/dlb.h ../include/patchlevel.h @@ -797,11 +797,12 @@ $(CONFIG_H): ../include/config.h ../include/config1.h ../include/patchlevel.h \ touch $(CONFIG_H) # hack.h timestamp $(HACK_H): ../include/hack.h $(CONFIG_H) ../include/lint.h ../include/align.h \ - ../include/dungeon.h ../include/monsym.h ../include/mkroom.h \ + ../include/dungeon.h ../include/mkroom.h \ ../include/objclass.h ../include/youprop.h ../include/prop.h \ ../include/permonst.h ../include/monattk.h \ ../include/monflag.h ../include/mondata.h ../include/pm.h \ - ../include/wintype.h ../include/context.h ../include/rm.h \ + ../include/wintype.h ../include/context.h \ + ../include/sym.h ../include/defsym.h ../include/rm.h \ ../include/botl.h ../include/rect.h ../include/region.h \ ../include/decl.h ../include/quest.h ../include/spell.h \ ../include/color.h ../include/obj.h ../include/engrave.h \ @@ -1053,7 +1054,8 @@ $(TARGETPFX)dogmove.o: dogmove.c $(HACK_H) ../include/mfndpos.h $(TARGETPFX)dokick.o: dokick.c $(HACK_H) $(TARGETPFX)dothrow.o: dothrow.c $(HACK_H) $(TARGETPFX)drawing.o: drawing.c $(CONFIG_H) ../include/color.h \ - ../include/rm.h ../include/objclass.h ../include/monsym.h + ../include/sym.h ../include/defsym.h ../include/rm.h \ + ../include/objclass.h $(TARGETPFX)dungeon.o: dungeon.c $(HACK_H) ../include/dgn_file.h \ ../include/dlb.h $(TARGETPFX)eat.o: eat.c $(HACK_H) @@ -1077,7 +1079,7 @@ $(TARGETPFX)makemon.o: makemon.c $(HACK_H) $(TARGETPFX)mcastu.o: mcastu.c $(HACK_H) $(TARGETPFX)mdlib.o: mdlib.c $(CONFIG_H) ../include/permonst.h \ ../include/align.h ../include/monattk.h ../include/monflag.h \ - ../include/objclass.h ../include/monsym.h \ + ../include/objclass.h ../include/sym.h ../include/defsym.h \ ../include/artilist.h ../include/dungeon.h ../include/obj.h \ ../include/monst.h ../include/mextra.h ../include/you.h \ ../include/attrib.h ../include/prop.h ../include/skills.h \ @@ -1096,7 +1098,7 @@ $(TARGETPFX)monmove.o: monmove.c $(HACK_H) ../include/mfndpos.h \ ../include/artifact.h $(TARGETPFX)monst.o: monst.c $(CONFIG_H) ../include/permonst.h \ ../include/align.h ../include/monattk.h ../include/monflag.h \ - ../include/monsym.h ../include/color.h + ../include/sym.h ../include/defsym.h ../include/color.h $(TARGETPFX)mplayer.o: mplayer.c $(HACK_H) $(TARGETPFX)mthrowu.o: mthrowu.c $(HACK_H) $(TARGETPFX)muse.o: muse.c $(HACK_H) diff --git a/sys/unix/Makefile.utl b/sys/unix/Makefile.utl index 38ef8bebf..b2f7979e8 100644 --- a/sys/unix/Makefile.utl +++ b/sys/unix/Makefile.utl @@ -207,7 +207,7 @@ makedefs: $(MAKEOBJS) mdgrep.h $(CLINK) $(LFLAGS) -o makedefs $(MAKEOBJS) makedefs.o: makedefs.c ../src/mdlib.c $(CONFIG_H) ../include/permonst.h \ - ../include/objclass.h ../include/monsym.h \ + ../include/objclass.h ../include/sym.h ../include/defsym.h \ ../include/artilist.h ../include/dungeon.h ../include/obj.h \ ../include/monst.h ../include/you.h ../include/flag.h \ ../include/dlb.h ../include/patchlevel.h diff --git a/sys/unix/NetHack.xcodeproj/project.pbxproj b/sys/unix/NetHack.xcodeproj/project.pbxproj index 30ec66d84..69bd88684 100644 --- a/sys/unix/NetHack.xcodeproj/project.pbxproj +++ b/sys/unix/NetHack.xcodeproj/project.pbxproj @@ -249,7 +249,7 @@ 3186A38121A4B0FB0052BF02 /* pcconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pcconf.h; path = ../../include/pcconf.h; sourceTree = ""; }; 3186A38221A4B0FB0052BF02 /* skills.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = skills.h; path = ../../include/skills.h; sourceTree = ""; }; 3186A38321A4B0FB0052BF02 /* permonst.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = permonst.h; path = ../../include/permonst.h; sourceTree = ""; }; - 3186A38421A4B0FB0052BF02 /* monsym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = monsym.h; path = ../../include/monsym.h; sourceTree = ""; }; + 3186A38421A4B0FB0052BF02 /* sym.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sym.h; path = ../../include/sym.h; sourceTree = ""; }; 3186A38521A4B0FB0052BF02 /* mextra.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mextra.h; path = ../../include/mextra.h; sourceTree = ""; }; 3186A38721A4B0FB0052BF02 /* color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = color.h; path = ../../include/color.h; sourceTree = ""; }; 3186A38821A4B0FB0052BF02 /* artifact.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = artifact.h; path = ../../include/artifact.h; sourceTree = ""; }; @@ -683,7 +683,7 @@ 3186A3C821A4B0FE0052BF02 /* mondata.h */, 3186A38F21A4B0FC0052BF02 /* monflag.h */, 3186A3BB21A4B0FD0052BF02 /* monst.h */, - 3186A38421A4B0FB0052BF02 /* monsym.h */, + 3186A38421A4B0FB0052BF02 /* sym.h */, 3186A39B21A4B0FD0052BF02 /* windconf.h */, 3186A39521A4B0FC0052BF02 /* obj.h */, 3186A3A821A4B0FD0052BF02 /* objclass.h */, diff --git a/sys/vms/Makefile.src b/sys/vms/Makefile.src index 1060c43ff..97eb0823d 100644 --- a/sys/vms/Makefile.src +++ b/sys/vms/Makefile.src @@ -176,13 +176,13 @@ VERSOURCES = $(HACKCSRC) $(SYSSRC) $(WINSRC) $(RANDSRC) $(GENCSRC) # cause dependency loops if run through "make depend" # HACKINCL = align.h artifact.h artilist.h attrib.h color.h \ - config.h config1.h context.h coord.h decl.h display.h \ + config.h config1.h context.h coord.h decl.h defsym.h display.h \ dlb.h dungeon.h engrave.h extern.h flag.h func_tab.h global.h \ hack.h mextra.h mfndpos.h micro.h mkroom.h \ - monattk.h mondata.h monflag.h monst.h monsym.h obj.h objclass.h \ + monattk.h mondata.h monflag.h monst.h sym.h obj.h objclass.h \ patchlevel.h pcconf.h permonst.h prop.h rect.h \ - region.h rm.h sp_lev.h spell.h sys.h system.h tcap.h timeout.h \ - tradstdc.h trap.h unixconf.h vision.h \ + region.h sym.h defsym.h rm.h sp_lev.h spell.h sys.h system.h \ + tcap.h timeout.h tradstdc.h trap.h unixconf.h vision.h \ vmsconf.h wintty.h winX.h winprocs.h wintype.h you.h youprop.h #HSOURCES = $(HACKINCL) date.h onames.h pm.h @@ -323,9 +323,9 @@ objects.obj : $(MAKEDEFS) : $(FIRSTOBJ) $(UTL)makedefs.c \ $(CONFIG_H) $(INC)permonst.h $(INC)objclass.h \ - $(INC)monsym.h $(INC)artilist.h $(INC)dungeon.h \ - $(INC)obj.h $(INC)monst.h $(INC)you.h $(INC)flag.h \ - $(INC)dlb.h $(INC)patchlevel.h \ + $(INC)sym.h $(INC)defsym.h $(INC)artilist.h \ + $(INC)dungeon.h $(INC)obj.h $(INC)monst.h $(INC)you.h \ + $(INC)flag.h $(INC)dlb.h $(INC)patchlevel.h \ $(LIBOPT) $(ID_OPT) $(CD) $(UTL) $(MAKE)$(MAKEFLAGS) $(MAKEDEFS) @@ -390,7 +390,7 @@ $(CONFIG_H) : $(INC)config.h $(INC)config1.h $(INC)tradstdc.h $(INC)global.h \ $(TOUCH) $(CONFIG_H) # hack.h timestamp $(HACK_H) : $(INC)hack.h $(CONFIG_H) $(INC)align.h \ - $(INC)dungeon.h $(INC)monsym.h $(INC)mkroom.h \ + $(INC)dungeon.h $(INC)sym.h $(INC)defsym.h $(INC)mkroom.h \ $(INC)objclass.h $(INC)youprop.h $(INC)prop.h \ $(INC)permonst.h $(INC)monattk.h \ $(INC)monflag.h $(INC)mondata.h $(INC)pm.h \ @@ -544,8 +544,8 @@ mon.obj : mon.c $(HACK_H) $(INC)mfndpos.h mondata.obj : mondata.c $(HACK_H) monmove.obj : monmove.c $(HACK_H) $(INC)mfndpos.h $(INC)artifact.h monst.obj : monst.c $(CONFIG_H) $(INC)permonst.h $(INC)align.h \ - $(INC)monattk.h $(INC)monflag.h $(INC)monsym.h \ - $(INC)color.h + $(INC)monattk.h $(INC)monflag.h $(INC)sym.h \ + $(INC)defsym.h $(INC)color.h mplayer.obj : mplayer.c $(HACK_H) mthrowu.obj : mthrowu.c $(HACK_H) muse.obj : muse.c $(HACK_H) diff --git a/sys/vms/Makefile.utl b/sys/vms/Makefile.utl index 4a93b27da..22224c245 100644 --- a/sys/vms/Makefile.utl +++ b/sys/vms/Makefile.utl @@ -110,9 +110,9 @@ $(MAKEDEFS) : $(MAKEOBJS) $(VMSOBJS) $(LIBOPT) $(ID_OPT) makedefs.obj : makedefs.c \ $(CONFIG_H) $(INC)permonst.h $(INC)objclass.h \ - $(INC)monsym.h $(INC)artilist.h $(INC)dungeon.h \ - $(INC)obj.h $(INC)monst.h $(INC)you.h $(INC)flag.h \ - $(INC)dlb.h $(INC)patchlevel.h + $(INC)sym.h $(INC)defsym.h $(INC)artilist.h \ + $(INC)dungeon.h $(INC)obj.h $(INC)monst.h \ + $(INC)you.h $(INC)flag.h $(INC)dlb.h $(INC)patchlevel.h $(INC)onames.h : $(MAKEDEFS) $(RUN) $(MAKEDEFS) -o diff --git a/sys/windows/Makefile.gcc b/sys/windows/Makefile.gcc index 3db145fcb..504d17882 100644 --- a/sys/windows/Makefile.gcc +++ b/sys/windows/Makefile.gcc @@ -498,18 +498,18 @@ CONFIG_H = $(INCL)/config.h $(INCL)/patchlevel.h \ $(INCL)/micro.h $(INCL)/pcconf.h $(INCL)/windconf.h HACK_H = $(INCL)/hack.h $(CONFIG_H) $(INCL)/align.h $(INCL)/context.h \ - $(INCL)/dungeon.h $(INCL)/monsym.h $(INCL)/mkroom.h \ - $(INCL)/objclass.h $(INCL)/youprop.h $(INCL)/prop.h \ - $(INCL)/permonst.h $(INCL)/monattk.h \ + $(INCL)/dungeon.h $(INCL)/sym.h $(INCL)/defsym.h \ + $(INCL)/mkroom.h $(INCL)/objclass.h $(INCL)/youprop.h \ + $(INCL)/prop.h $(INCL)/permonst.h $(INCL)/monattk.h \ $(INCL)/monflag.h $(INCL)/mondata.h $(INCL)/pm.h \ $(INCL)/wintype.h $(INCL)/decl.h $(INCL)/quest.h \ $(INCL)/spell.h $(INCL)/color.h $(INCL)/obj.h \ $(INCL)/you.h $(INCL)/attrib.h $(INCL)/monst.h $(INCL)/lint.h \ $(INCL)/mextra.h $(INCL)/skills.h $(INCL)/onames.h \ - $(INCL)/timeout.h $(INCL)/trap.h $(INCL)/flag.h $(INCL)/rm.h \ - $(INCL)/vision.h $(INCL)/display.h $(INCL)/engrave.h \ - $(INCL)/rect.h $(INCL)/region.h $(INCL)/winprocs.h \ - $(INCL)/wintty.h $(INCL)/sys.h + $(INCL)/timeout.h $(INCL)/trap.h $(INCL)/flag.h \ + $(INCL)/rm.h $(INCL)/vision.h $(INCL)/display.h \ + $(INCL)/engrave.h $(INCL)/rect.h $(INCL)/region.h \ + $(INCL)/winprocs.h $(INCL)/wintty.h $(INCL)/sys.h DGN_FILE_H = $(INCL)/dgn_file.h SP_LEV_H = $(INCL)/sp_lev.h @@ -918,7 +918,7 @@ $(U)makedefs.exe: $(MAKEDEFSOBJS) $(link) $(LFLAGSU) -o$@ $(MAKEDEFSOBJS) $(O)makedefs.o: $(CONFIG_H) $(INCL)/monattk.h $(INCL)/monflag.h \ - $(INCL)/objclass.h $(INCL)/monsym.h \ + $(INCL)/objclass.h $(INCL)/sym.h $(INCL)/defsym.h \ $(U)makedefs.c $(SRC)\mdlib.c $(cc) $(CFLAGSU) -o$@ $(U)makedefs.c @@ -1619,8 +1619,9 @@ $(O)dog.o: dog.c $(HACK_H) $(O)dogmove.o: dogmove.c $(HACK_H) $(INCL)/mfndpos.h $(O)dokick.o: dokick.c $(HACK_H) $(O)dothrow.o: dothrow.c $(HACK_H) -$(O)drawing.o: drawing.c $(CONFIG_H) $(INCL)/color.h $(INCL)/rm.h \ - $(INCL)/objclass.h $(INCL)/monsym.h +$(O)drawing.o: drawing.c $(CONFIG_H) $(INCL)/color.h $(INCL)/sym.h \ + $(INCL)/defsym.h $(INCL)/rm.h \ + $(INCL)/objclass.h $(O)dungeon.o: dungeon.c $(HACK_H) $(INCL)/dgn_file.h $(INCL)/dlb.h $(O)eat.o: eat.c $(HACK_H) $(O)end.o: end.c $(HACK_H) $(INCL)/dlb.h @@ -1651,8 +1652,7 @@ $(O)mon.o: mon.c $(HACK_H) $(INCL)/mfndpos.h $(O)mondata.o: mondata.c $(HACK_H) $(O)monmove.o: monmove.c $(HACK_H) $(INCL)/mfndpos.h $(INCL)/artifact.h $(O)monst.o: monst.c $(CONFIG_H) $(INCL)/permonst.h $(INCL)/align.h \ - $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/monsym.h \ - $(INCL)/color.h + $(INCL)/monattk.h $(INCL)/monflag.h $(INCL)/color.h $(O)mplayer.o: mplayer.c $(HACK_H) $(O)mthrowu.o: mthrowu.c $(HACK_H) $(O)muse.o: muse.c $(HACK_H) diff --git a/sys/windows/Makefile.msc b/sys/windows/Makefile.msc index c1c227909..37bc1072a 100644 --- a/sys/windows/Makefile.msc +++ b/sys/windows/Makefile.msc @@ -487,11 +487,12 @@ CONFIG_H = $(INCL)\config.h $(INCL)\patchlevel.h \ $(INCL)\windconf.h HACK_H = $(INCL)\hack.h $(CONFIG_H) $(INCL)\lint.h $(INCL)\align.h \ - $(INCL)\dungeon.h $(INCL)\monsym.h $(INCL)\mkroom.h \ + $(INCL)\dungeon.h $(INCL)\mkroom.h \ $(INCL)\objclass.h $(INCL)\youprop.h $(INCL)\prop.h \ $(INCL)\permonst.h $(INCL)\monattk.h \ $(INCL)\monflag.h $(INCL)\mondata.h $(INCL)\pm.h \ - $(INCL)\wintype.h $(INCL)\context.h $(INCL)\rm.h \ + $(INCL)\wintype.h $(INCL)\context.h \ + $(INCL)\sym.h $(INCL)\defsym.h $(INCL)\rm.h \ $(INCL)\botl.h $(INCL)\rect.h \ $(INCL)\region.h $(INCL)\decl.h $(INCL)\quest.h \ $(INCL)\spell.h $(INCL)\color.h $(INCL)\obj.h \ @@ -1091,7 +1092,7 @@ $(U)makedefs.exe: $(MAKEDEFSOBJS) @$(link) $(lflagsBuild) /PDB:"$(O)$(@B).PDB" /MAP:"$(O)$(@B).MAP" -out:$@ $(MAKEDEFSOBJS) $(O)makedefs.o: $(U)makedefs.c $(SRC)\mdlib.c $(CONFIG_H) $(INCL)\permonst.h \ - $(INCL)\objclass.h $(INCL)\monsym.h \ + $(INCL)\objclass.h $(INCL)\sym.h $(INCL)\defsym.h \ $(INCL)\artilist.h $(INCL)\dungeon.h $(INCL)\obj.h \ $(INCL)\monst.h $(INCL)\you.h $(INCL)\flag.h \ $(INCL)\dlb.h @@ -1566,18 +1567,19 @@ $(O)panic.o: $(U)panic.c $(CONFIG_H) $(O)drawing_host.o: drawing.c $(CONFIG_H) @$(cc) $(cflagsBuild) $(CROSSCOMPILE) -Fo$@ drawing.c -$(O)drawing.o: drawing.c $(CONFIG_H) $(INCL)\color.h $(INCL)\rm.h \ - $(INCL)\objclass.h $(INCL)\monsym.h +$(O)drawing.o: drawing.c $(CONFIG_H) $(INCL)\color.h \ + $(INCL)\sym.h $(INCL)\defsym.h $(INCL)\rm.h \ + $(INCL)\objclass.h @$(cc) $(cflagsBuild) -Fo$@ drawing.c $(O)monst_host.o: monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \ - $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h \ - $(INCL)\color.h + $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\sym.h \ + $(INCL)\defsym.h $(INCL)\color.h @$(cc) $(cflagsBuild) -Fo$@ monst.c $(O)monst.o: monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \ - $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h \ - $(INCL)\color.h + $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\sym.h \ + $(INCL)\defsym.h $(INCL)\color.h @$(cc) $(cflagsBuild) -Fo$@ monst.c $(O)objects_host.o: objects.c $(CONFIG_H) $(INCL)\obj.h $(INCL)\objclass.h \ @@ -1988,7 +1990,7 @@ $(O)makemon.o: makemon.c $(HACK_H) $(O)mcastu.o: mcastu.c $(HACK_H) $(O)mdlib.o: mdlib.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \ $(INCL)\monattk.h $(INCL)\monflag.h \ - $(INCL)\objclass.h $(INCL)\monsym.h \ + $(INCL)\objclass.h $(INCL)\sym.h $(INCL)\defsym.h \ $(INCL)\artilist.h $(INCL)\dungeon.h $(INCL)\obj.h \ $(INCL)\monst.h $(INCL)\mextra.h $(INCL)\you.h \ $(INCL)\attrib.h $(INCL)\prop.h $(INCL)\skills.h \ @@ -2005,8 +2007,8 @@ $(O)mon.o: mon.c $(HACK_H) $(INCL)\mfndpos.h $(O)mondata.o: mondata.c $(HACK_H) $(O)monmove.o: monmove.c $(HACK_H) $(INCL)\mfndpos.h $(INCL)\artifact.h $(O)monst.o: monst.c $(CONFIG_H) $(INCL)\permonst.h $(INCL)\align.h \ - $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\monsym.h \ - $(INCL)\color.h + $(INCL)\monattk.h $(INCL)\monflag.h $(INCL)\sym.h \ + $(INCL)\defsym.h $(INCL)\color.h $(O)mplayer.o: mplayer.c $(HACK_H) $(O)mthrowu.o: mthrowu.c $(HACK_H) $(O)muse.o: muse.c $(HACK_H) diff --git a/sys/windows/vs/NetHack/NetHack.vcxproj b/sys/windows/vs/NetHack/NetHack.vcxproj index 1f3997246..1f9557959 100644 --- a/sys/windows/vs/NetHack/NetHack.vcxproj +++ b/sys/windows/vs/NetHack/NetHack.vcxproj @@ -197,6 +197,7 @@ + @@ -214,7 +215,6 @@ - @@ -231,6 +231,7 @@ + diff --git a/sys/windows/vs/NetHackW/NetHackW.vcxproj b/sys/windows/vs/NetHackW/NetHackW.vcxproj index a628983a1..2a41b696d 100644 --- a/sys/windows/vs/NetHackW/NetHackW.vcxproj +++ b/sys/windows/vs/NetHackW/NetHackW.vcxproj @@ -212,6 +212,7 @@ + @@ -239,7 +240,6 @@ - @@ -258,6 +258,7 @@ + diff --git a/sys/windows/vs/makedefs/makedefs.vcxproj b/sys/windows/vs/makedefs/makedefs.vcxproj index fa20216ca..87c9dd6e3 100644 --- a/sys/windows/vs/makedefs/makedefs.vcxproj +++ b/sys/windows/vs/makedefs/makedefs.vcxproj @@ -42,7 +42,8 @@ - + + diff --git a/sys/windows/vs/tilemap/tilemap.vcxproj b/sys/windows/vs/tilemap/tilemap.vcxproj index 7e884d08e..a8178b86d 100644 --- a/sys/windows/vs/tilemap/tilemap.vcxproj +++ b/sys/windows/vs/tilemap/tilemap.vcxproj @@ -41,6 +41,7 @@ + @@ -51,7 +52,6 @@ - @@ -65,6 +65,7 @@ + diff --git a/test/testmove.lua b/test/testmove.lua index c5c3eee52..12d4a61ee 100644 --- a/test/testmove.lua +++ b/test/testmove.lua @@ -48,6 +48,18 @@ function setup3(param) des.replace_terrain({ region={01,01, 74,18}, fromterrain="C", toterrain=param, chance=100 }); end +function setup4(param) + local mapstr = [[ +------------ +|CCCC|CCC| | +|---C|C|C|-- +| |CCC|CCC| +------------ +]]; + des.map({ x = POS.x - 1, y = POS.y - 1, map = mapstr }); + des.replace_terrain({ region={01,01, 74,18}, fromterrain="C", toterrain=param, chance=100 }); +end + local basicmoves = { -- move h = { dx = -1, dy = 0, number_pad = 0 }, @@ -122,6 +134,9 @@ local basicmoves = { { key = ctrl("k"), x = POS.x, y = POS.y - 3, number_pad = 0, setup = setup3, param = "." }, { key = ctrl("k"), x = POS.x + 4, y = POS.y - 3, number_pad = 0, setup = setup3, param = "#" }, + { key = ctrl("l"), x = POS.x + 3, y = POS.y, number_pad = 0, setup = setup4, param = "." }, + { key = ctrl("l"), x = POS.x + 9, y = POS.y + 2, number_pad = 0, setup = setup4, param = "#" }, + }; diff --git a/util/makedefs.c b/util/makedefs.c index 8afa8b14e..d3e164c62 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -13,7 +13,7 @@ #endif #include "permonst.h" #include "objclass.h" -#include "monsym.h" +#include "sym.h" #include "artilist.h" #include "dungeon.h" #include "obj.h" diff --git a/win/share/other.txt b/win/share/other.txt index 7b0ada0db..f6e2718da 100644 --- a/win/share/other.txt +++ b/win/share/other.txt @@ -1699,7 +1699,7 @@ Z = (195, 195, 195) ......DDDDDDDDAA .......DDDDDDDAA } -# tile 88 (swallow bottom left ) +# tile 88 (swallow bottom left) { DDDCDDD......... DDDCDDD......... @@ -1775,7 +1775,7 @@ Z = (195, 195, 195) ..AAAA..AAAA.... ..AAA..AAAAA.... } -# tile 92 (explosion top centre) +# tile 92 (explosion top center) { ................ ................ diff --git a/win/share/tilemap.c b/win/share/tilemap.c index 3f7bcf721..bfbc8fa9d 100644 --- a/win/share/tilemap.c +++ b/win/share/tilemap.c @@ -13,6 +13,7 @@ #include "onames.h" #include "permonst.h" #include "objclass.h" +#include "sym.h" #include "rm.h" #include "display.h" @@ -90,7 +91,7 @@ struct conditionals_t { /* * Some entries in glyph2tile[] should be substituted for on various levels. * The tiles used for the substitute entries will follow the usual ones in - * other.til in the order given here, which should have every substitution + * other.txt in the order given here, which should have every substitution * for the same set of tiles grouped together. You will have to change * more code in process_substitutions()/substitute_tiles() if the sets * overlap in the future. @@ -301,6 +302,21 @@ init_tilemap(void) int corpsetile, swallowbase; int file_entry = 0; +#ifdef OBTAIN_TILEMAP + tilemap_file = fopen("tilemappings.lst", "w"); + Fprintf(tilemap_file, "NUMMONS = %d\n", NUMMONS); + Fprintf(tilemap_file, "NUM_OBJECTS = %d\n", NUM_OBJECTS); + Fprintf(tilemap_file, "MAXEXPCHARS = %d\n", MAXEXPCHARS); + Fprintf(tilemap_file, "MAXPCHARS = %d\n", MAXPCHARS); + Fprintf(tilemap_file, "MAX_GLYPH = %d\n", MAX_GLYPH); + Fprintf(tilemap_file, "GLYPH_MON_OFF = %d\n", GLYPH_MON_OFF); + Fprintf(tilemap_file, "GLYPH_PET_OFF = %d\n", GLYPH_PET_OFF); + Fprintf(tilemap_file, "GLYPH_DETECT_OFF = %d\n", GLYPH_DETECT_OFF); + Fprintf(tilemap_file, "GLYPH_RIDDEN_OFF = %d\n", GLYPH_RIDDEN_OFF); + Fprintf(tilemap_file, "GLYPH_BODY_OFF = %d\n", GLYPH_BODY_OFF); + Fprintf(tilemap_file, "GLYPH_SWALLOW_OFF = %d\n", GLYPH_SWALLOW_OFF); +#endif + for (i = 0; i < MAX_GLYPH; i++) { tilemap[i].tilenum = -1; } @@ -327,14 +343,12 @@ init_tilemap(void) } } -#ifdef OBTAIN_TILEMAP - tilemap_file = fopen("tilemappings.lst", "w"); -#endif tilenum = 0; for (i = 0; i < NUMMONS; i++) { #ifdef OBTAIN_TILEMAP char buf[256]; #endif + tilemap[GLYPH_MON_OFF + i].tilenum = tilenum; tilemap[GLYPH_PET_OFF + i].tilenum = tilenum; tilemap[GLYPH_DETECT_OFF + i].tilenum = tilenum; @@ -702,121 +716,29 @@ RESTORE_WARNINGS struct { int idx; - const char *betterlabel; + const char *tilelabel; const char *expectedlabel; } altlabels[MAXPCHARS] = { -{S_stone, "dark part of a room", "dark part of a room"}, -{S_vwall, "vertical wall", "wall"}, -{S_hwall, "horizontal wall", "wall"}, -{S_tlcorn, "top left corner wall", "wall"}, -{S_trcorn, "top right corner wall", "wall"}, -{S_blcorn, "bottom left corner wall", "wall"}, -{S_brcorn, "bottom right corner wall", "wall"}, -{S_crwall, "cross wall", "wall"}, -{S_tuwall, "tuwall", "wall"}, -{S_tdwall, "tdwall", "wall"}, -{S_tlwall, "tlwall", "wall"}, -{S_trwall, "trwall", "wall"}, -{S_ndoor, "no door", "doorway"}, -{S_vodoor, "vertical open door", "open door"}, -{S_hodoor, "horizontal open door", "open door"}, -{S_vcdoor, "vertical closed door", "closed door"}, -{S_hcdoor, "horizontal closed door", "closed door"}, -{S_bars, "iron bars", "iron bars"}, -{S_tree, "tree", "tree"}, -{S_room, "room", "floor of a room"}, -{S_darkroom, "darkroom", "dark part of a room"}, -{S_corr, "corridor", "corridor"}, -{S_litcorr, "lit corridor", "lit corridor"}, -{S_upstair, "up stairs", "staircase up"}, -{S_dnstair, "down stairs", "staircase down"}, -{S_upladder, "up ladder", "ladder up"}, -{S_dnladder, "down ladder", "ladder down"}, -{S_brupstair, "branch staircase up", "branch staircase up"}, -{S_brdnstair, "branch staircase down", "branch staircase down"}, -{S_brupladder, "branch ladder up", "branch ladder up"}, -{S_brdnladder, "branch ladder down", "branch ladder down"}, -{S_altar, "altar", "altar"}, -{S_grave, "grave", "grave"}, -{S_throne, "throne", "opulent throne"}, -{S_sink, "sink", "sink"}, -{S_fountain, "fountain", "fountain"}, -{S_pool, "pool", "water"}, -{S_ice, "ice", "ice"}, -{S_lava, "lava", "molten lava"}, -{S_vodbridge, "vertical open drawbridge", "lowered drawbridge"}, -{S_hodbridge, "horizontal open drawbridge", "lowered drawbridge"}, -{S_vcdbridge, "vertical closed drawbridge", "raised drawbridge"}, -{S_hcdbridge, "horizontal closed drawbridge", "raised drawbridge"}, -{S_air, "air", "air"}, -{S_cloud, "cloud", "cloud"}, -{S_water, "water", "water"}, -{S_arrow_trap, "arrow trap", "arrow trap"}, -{S_dart_trap, "dart trap", "dart trap"}, -{S_falling_rock_trap, "falling rock trap", "falling rock trap"}, -{S_squeaky_board, "squeaky board", "squeaky board"}, -{S_bear_trap, "bear trap", "bear trap"}, -{S_land_mine, "land mine", "land mine"}, -{S_rolling_boulder_trap, "rolling boulder trap", "rolling boulder trap"}, -{S_sleeping_gas_trap, "sleeping gas trap", "sleeping gas trap"}, -{S_rust_trap, "rust trap", "rust trap"}, -{S_fire_trap, "fire trap", "fire trap"}, -{S_pit, "pit", "pit"}, -{S_spiked_pit, "spiked pit", "spiked pit"}, -{S_hole, "hole", "hole"}, -{S_trap_door, "trap door", "trap door"}, -{S_teleportation_trap, "teleportation trap", "teleportation trap"}, -{S_level_teleporter, "level teleporter", "level teleporter"}, -{S_magic_portal, "magic portal", "magic portal"}, -{S_web, "web", "web"}, -{S_statue_trap, "statue trap", "statue trap"}, -{S_magic_trap, "magic trap", "magic trap"}, -{S_anti_magic_trap, "anti magic trap", "anti-magic field"}, -{S_polymorph_trap, "polymorph trap", "polymorph trap"}, -{S_vibrating_square, "vibrating square", "vibrating square"}, -{S_vbeam, "vertical beam", "cmap 69"}, -{S_hbeam, "horizontal beam", "cmap 70"}, -{S_lslant, "left slant beam", "cmap 71"}, -{S_rslant, "right slant beam", "cmap 72"}, -{S_digbeam, "dig beam", "cmap 73"}, -{S_flashbeam, "flash beam", "cmap 74"}, -{S_boomleft, "boom left", "cmap 75"}, -{S_boomright, "boom right", "cmap 76"}, -{S_ss1, "shield1", "cmap 77"}, -{S_ss2, "shield2", "cmap 78"}, -{S_ss3, "shield3", "cmap 79"}, -{S_ss4, "shield4", "cmap 80"}, -{S_poisoncloud, "poison cloud", "poison cloud"}, -{S_goodpos, "valid position", "valid position"}, -{S_sw_tl, "swallow top left", "cmap 83"}, -{S_sw_tc, "swallow top center", "cmap 84"}, -{S_sw_tr, "swallow top right", "cmap 85"}, -{S_sw_ml, "swallow middle left", "cmap 86"}, -{S_sw_mr, "swallow middle right", "cmap 87"}, -{S_sw_bl, "swallow bottom left ", "cmap 88"}, -{S_sw_bc, "swallow bottom center", "cmap 89"}, -{S_sw_br, "swallow bottom right", "cmap 90"}, -{S_explode1, "explosion top left", "explosion dark 0"}, -{S_explode2, "explosion top centre", "explosion dark 1"}, -{S_explode3, "explosion top right", "explosion dark 2"}, -{S_explode4, "explosion middle left", "explosion dark 3"}, -{S_explode5, "explosion middle center", "explosion dark 4"}, -{S_explode6, "explosion middle right", "explosion dark 5"}, -{S_explode7, "explosion bottom left", "explosion dark 6"}, -{S_explode8, "explosion bottom center", "explosion dark 7"}, -{S_explode9, "explosion bottom right", "explosion dark 8"}, +#define PCHAR_TILES +#include "defsym.h" +#undef PCHAR_TILES }; boolean acceptable_tilename(int glyph_set, int idx, const char *encountered, - const char *expected) + const char *expected UNUSED) { if (glyph_set == OTH_GLYPH) { if (idx >= 0 && idx < SIZE(altlabels)) { +#if 0 if (!strcmp(altlabels[idx].expectedlabel, expected)) { - if (!strcmp(altlabels[idx].betterlabel, encountered)) + if (!strcmp(altlabels[idx].tilelabel, encountered)) return TRUE; } +#else + if (!strcmp(altlabels[idx].tilelabel, encountered)) + return TRUE; +#endif } return FALSE; }