From: PatR Date: Sat, 12 Jan 2019 01:18:48 +0000 (-0800) Subject: enum values X-Git-Tag: NetHack-3.6.2_Released~93^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8b02e5b32bd7f6d4d1c666235e9a5a1aedabcfc5;p=nethack enum values Give the enum lists in several header files explicit values. Adding or removing new entries will be more tedious, but doing that is rare and being able to grep the headers for numeric values in addition to names is very useful. rm.h also has a bunch of tabs replaced with spaces. --- diff --git a/include/objclass.h b/include/objclass.h index 22fd02894..a74526c78 100644 --- a/include/objclass.h +++ b/include/objclass.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 objclass.h $NHDT-Date: 1462067744 2016/05/01 01:55:44 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.16 $ */ +/* NetHack 3.6 objclass.h $NHDT-Date: 1547255901 2019/01/12 01:18:21 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.20 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2018. */ /* NetHack may be freely redistributed. See license for details. */ @@ -6,46 +6,48 @@ #ifndef OBJCLASS_H #define OBJCLASS_H -/* [misnamed] definition of a type of object */ +/* [misnamed] definition of a type of object; many objects are composites + (liquid potion inside glass bottle, metal arrowhead on wooden shaft) + and object definitions only specify one type on a best-fit basis */ enum obj_material_types { - LIQUID = 1, /* currently only for venom */ - WAX, - VEGGY, /* foodstuffs */ - FLESH, /* ditto */ - PAPER, - CLOTH, - LEATHER, - WOOD, - BONE, - DRAGON_HIDE, /* not leather! */ - IRON, /* Fe - includes steel */ - METAL, /* Sn, &c. */ - COPPER, /* Cu - includes brass */ - SILVER, /* Ag */ - GOLD, /* Au */ - PLATINUM, /* Pt */ - MITHRIL, - PLASTIC, - GLASS, - GEMSTONE, - MINERAL + LIQUID = 1, /* currently only for venom */ + WAX = 2, + VEGGY = 3, /* foodstuffs */ + FLESH = 4, /* ditto */ + PAPER = 5, + CLOTH = 6, + LEATHER = 7, + WOOD = 8, + BONE = 9, + DRAGON_HIDE = 10, /* not leather! */ + IRON = 11, /* Fe - includes steel */ + METAL = 12, /* Sn, &c. */ + COPPER = 13, /* Cu - includes brass */ + SILVER = 14, /* Ag */ + GOLD = 15, /* Au */ + PLATINUM = 16, /* Pt */ + MITHRIL = 17, + PLASTIC = 18, + GLASS = 19, + GEMSTONE = 20, + MINERAL = 21 }; enum obj_armor_types { - ARM_SUIT = 0, - ARM_SHIELD, /* needed for special wear function */ - ARM_HELM, - ARM_GLOVES, - ARM_BOOTS, - ARM_CLOAK, - ARM_SHIRT + ARM_SUIT = 0, + ARM_SHIELD = 1, /* needed for special wear function */ + ARM_HELM = 2, + ARM_GLOVES = 3, + ARM_BOOTS = 4, + ARM_CLOAK = 5, + ARM_SHIRT = 6 }; struct objclass { short oc_name_idx; /* index of actual name */ short oc_descr_idx; /* description when name unknown */ char *oc_uname; /* called by user */ - Bitfield(oc_name_known, 1); + Bitfield(oc_name_known, 1); /* discovered */ Bitfield(oc_merge, 1); /* merge otherwise equal objects */ Bitfield(oc_uses_known, 1); /* obj->known affects full description; otherwise, obj->dknown and obj->bknown @@ -72,7 +74,7 @@ struct objclass { #define SLASH 2 /* (latter includes iron ball & chain) */ #define WHACK 0 - /*Bitfield(oc_subtyp,3);*/ /* Now too big for a bitfield... see below */ + /* 4 free bits */ Bitfield(oc_material, 5); /* one of obj_material_types */ @@ -94,12 +96,14 @@ struct objclass { (is_rustprone(otmp) || is_flammable(otmp) || is_rottable(otmp) \ || is_corrodeable(otmp)) + /* 3 free bits */ + schar oc_subtyp; #define oc_skill oc_subtyp /* Skills of weapons, spellbooks, tools, gems */ -#define oc_armcat oc_subtyp /* for armor */ +#define oc_armcat oc_subtyp /* for armor (enum obj_armor_types) */ uchar oc_oprop; /* property (invis, &c.) conveyed */ - char oc_class; /* object class */ + char oc_class; /* object class (enum obj_class_types) */ schar oc_delay; /* delay when using such an object */ uchar oc_color; /* color of the object */ @@ -138,26 +142,26 @@ extern NEARDATA struct objdescr obj_descr[]; * symbol below. */ enum obj_class_types { - RANDOM_CLASS = 0, /* used for generating random objects */ - ILLOBJ_CLASS, - WEAPON_CLASS, - ARMOR_CLASS, - RING_CLASS, - AMULET_CLASS, - TOOL_CLASS, - FOOD_CLASS, - POTION_CLASS, - SCROLL_CLASS, - SPBOOK_CLASS, /* actually SPELL-book */ - WAND_CLASS, - COIN_CLASS, - GEM_CLASS, - ROCK_CLASS, - BALL_CLASS, - CHAIN_CLASS, - VENOM_CLASS, - - MAXOCLASSES + 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 ALLOW_COUNT (MAXOCLASSES + 1) /* Can be used in the object class */ diff --git a/include/rm.h b/include/rm.h index 080677e15..d6ec07819 100644 --- a/include/rm.h +++ b/include/rm.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 rm.h $NHDT-Date: 1543052680 2018/11/24 09:44:40 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */ +/* NetHack 3.6 rm.h $NHDT-Date: 1547255911 2019/01/12 01:18:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.60 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2017. */ /* NetHack may be freely redistributed. See license for details. */ @@ -17,18 +17,18 @@ */ /* - * TLCORNER TDWALL TRCORNER - * +- -+- -+ - * | | | + * TLCORNER TDWALL TRCORNER + * +- -+- -+ + * | | | * - * TRWALL CROSSWALL TLWALL HWALL - * | | | - * +- -+- -+ --- - * | | | + * TRWALL CROSSWALL TLWALL HWALL + * | | | + * +- -+- -+ --- + * | | | * - * BLCORNER TUWALL BRCORNER VWALL - * | | | | - * +- -+- -+ | + * BLCORNER TUWALL BRCORNER VWALL + * | | | | + * +- -+- -+ | */ /* Level location types. [Some debugging code in src/display.c @@ -36,44 +36,44 @@ these, so needs to be kept in sync if any new types are added or existing ones renumbered.] */ enum levl_typ_types { - STONE = 0, - VWALL, - HWALL, - TLCORNER, - TRCORNER, - BLCORNER, - BRCORNER, - CROSSWALL, /* For pretty mazes and special levels */ - TUWALL, - TDWALL, - TLWALL, - TRWALL, - DBWALL, - TREE, /* KMH */ - SDOOR, - SCORR, - POOL, - MOAT, /* pool that doesn't boil, adjust messages */ - WATER, - DRAWBRIDGE_UP, - LAVAPOOL, - IRONBARS, /* KMH */ - DOOR, - CORR, - ROOM, - STAIRS, - LADDER, - FOUNTAIN, - THRONE, - SINK, - GRAVE, - ALTAR, - ICE, - DRAWBRIDGE_DOWN, - AIR, - CLOUD, - - MAX_TYPE, + STONE = 0, + VWALL = 1, + HWALL = 2, + TLCORNER = 3, + TRCORNER = 4, + BLCORNER = 5, + BRCORNER = 6, + CROSSWALL = 7, /* For pretty mazes and special levels */ + TUWALL = 8, + TDWALL = 9, + TLWALL = 10, + TRWALL = 11, + DBWALL = 12, + TREE = 13, /* KMH */ + SDOOR = 14, + SCORR = 15, + POOL = 16, + MOAT = 17, /* pool that doesn't boil, adjust messages */ + WATER = 18, + DRAWBRIDGE_UP = 19, + LAVAPOOL = 20, + IRONBARS = 21, /* KMH */ + DOOR = 22, + CORR = 23, + ROOM = 24, + STAIRS = 25, + LADDER = 26, + FOUNTAIN = 27, + THRONE = 28, + SINK = 29, + GRAVE = 30, + ALTAR = 31, + ICE = 32, + DRAWBRIDGE_DOWN = 33, + AIR = 34, + CLOUD = 35, + + MAX_TYPE = 36, INVALID_TYPE = 127 }; @@ -114,121 +114,121 @@ enum levl_typ_types { /* begin dungeon characters */ enum screen_symbols { - S_stone = 0, - S_vwall, - S_hwall, - S_tlcorn, - S_trcorn, - S_blcorn, - S_brcorn, - S_crwall, - S_tuwall, - S_tdwall, - S_tlwall, - S_trwall, - S_ndoor, - S_vodoor, - S_hodoor, - S_vcdoor, /* closed door, vertical wall */ - S_hcdoor, /* closed door, horizontal wall */ - S_bars, /* KMH -- iron bars */ - S_tree, /* KMH */ - S_room, - S_darkroom, - S_corr, - S_litcorr, - S_upstair, - S_dnstair, - S_upladder, - S_dnladder, - S_altar, - S_grave, - S_throne, - S_sink, - S_fountain, - S_pool, - S_ice, - S_lava, - S_vodbridge, - S_hodbridge, - S_vcdbridge, /* closed drawbridge, vertical wall */ - S_hcdbridge, /* closed drawbridge, horizontal wall */ - S_air, - S_cloud, - S_water, + 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_altar = 27, + S_grave = 28, + S_throne = 29, + S_sink = 30, + S_fountain = 31, + S_pool = 32, + S_ice = 33, + S_lava = 34, + S_vodbridge = 35, + S_hodbridge = 36, + S_vcdbridge = 37, /* closed drawbridge, vertical wall */ + S_hcdbridge = 38, /* closed drawbridge, horizontal wall */ + S_air = 39, + S_cloud = 40, + S_water = 41, /* end dungeon characters, begin traps */ - S_arrow_trap, - S_dart_trap, - S_falling_rock_trap, - S_squeaky_board, - S_bear_trap, - S_land_mine, - S_rolling_boulder_trap, - S_sleeping_gas_trap, - S_rust_trap, - S_fire_trap, - S_pit, - S_spiked_pit, - S_hole, - S_trap_door, - S_teleportation_trap, - S_level_teleporter, - S_magic_portal, - S_web, - S_statue_trap, - S_magic_trap, - S_anti_magic_trap, - S_polymorph_trap, - S_vibrating_square, + S_arrow_trap = 42, + S_dart_trap = 43, + S_falling_rock_trap = 44, + S_squeaky_board = 45, + S_bear_trap = 46, + S_land_mine = 47, + S_rolling_boulder_trap = 48, + S_sleeping_gas_trap = 49, + S_rust_trap = 50, + S_fire_trap = 51, + S_pit = 52, + S_spiked_pit = 53, + S_hole = 54, + S_trap_door = 55, + S_teleportation_trap = 56, + S_level_teleporter = 57, + S_magic_portal = 58, + S_web = 59, + S_statue_trap = 60, + S_magic_trap = 61, + S_anti_magic_trap = 62, + S_polymorph_trap = 63, + S_vibrating_square = 64, /* for display rather than any trap effect */ /* end traps, begin special effects */ - S_vbeam, /* The 4 zap beam symbols. Do NOT separate. */ - S_hbeam, /* To change order or add, see function */ - S_lslant, /* zapdir_to_glyph() in display.c. */ - S_rslant, - S_digbeam, /* dig beam symbol */ - S_flashbeam, /* camera flash symbol */ - S_boomleft, /* thrown boomerang, open left, e.g ')' */ - S_boomright, /* thrown boomerang, open right, e.g. '(' */ - S_ss1, /* 4 magic shield glyphs */ - S_ss2, - S_ss3, - S_ss4, - S_poisoncloud, - S_goodpos, /* valid position for targeting */ - -/* The 8 swallow symbols. Do NOT separate. To change order or add, see */ -/* the function swallow_to_glyph() in display.c. */ - S_sw_tl, /* swallow top left [1] */ - S_sw_tc, /* swallow top center [2] Order: */ - S_sw_tr, /* swallow top right [3] */ - S_sw_ml, /* swallow middle left [4] 1 2 3 */ - S_sw_mr, /* swallow middle right [6] 4 5 6 */ - S_sw_bl, /* swallow bottom left [7] 7 8 9 */ - S_sw_bc, /* swallow bottom center [8] */ - S_sw_br, /* swallow bottom right [9] */ - - S_explode1, /* explosion top left */ - S_explode2, /* explosion top center */ - S_explode3, /* explosion top right Ex. */ - S_explode4, /* explosion middle left */ - S_explode5, /* explosion middle center /-\ */ - S_explode6, /* explosion middle right |@| */ - S_explode7, /* explosion bottom left \-/ */ - S_explode8, /* explosion bottom center */ - S_explode9, /* explosion bottom right */ + S_vbeam = 65, /* The 4 zap beam symbols. Do NOT separate. */ + S_hbeam = 66, /* To change order or add, see function */ + S_lslant = 67, /* zapdir_to_glyph() in display.c. */ + S_rslant = 68, + S_digbeam = 69, /* dig beam symbol */ + S_flashbeam = 70, /* camera flash symbol */ + S_boomleft = 71, /* thrown boomerang, open left, e.g ')' */ + S_boomright = 72, /* thrown boomerang, open right, e.g. '(' */ + S_ss1 = 73, /* 4 magic shield ("resistance sparkle") glyphs */ + S_ss2 = 74, + S_ss3 = 75, + S_ss4 = 76, + S_poisoncloud = 77, + S_goodpos = 78, /* 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 = 79, /* swallow top left [1] */ + S_sw_tc = 80, /* swallow top center [2] Order: */ + S_sw_tr = 81, /* swallow top right [3] */ + S_sw_ml = 82, /* swallow middle left [4] 1 2 3 */ + S_sw_mr = 83, /* swallow middle right [6] 4 5 6 */ + S_sw_bl = 84, /* swallow bottom left [7] 7 8 9 */ + S_sw_bc = 85, /* swallow bottom center [8] */ + S_sw_br = 86, /* swallow bottom right [9] */ + + S_explode1 = 87, /* explosion top left */ + S_explode2 = 88, /* explosion top center */ + S_explode3 = 89, /* explosion top right Ex. */ + S_explode4 = 90, /* explosion middle left */ + S_explode5 = 91, /* explosion middle center /-\ */ + S_explode6 = 92, /* explosion middle right |@| */ + S_explode7 = 93, /* explosion bottom left \-/ */ + S_explode8 = 94, /* explosion bottom center */ + S_explode9 = 95, /* explosion bottom right */ /* end effects */ - MAXPCHARS /* maximum number of mapped characters */ + MAXPCHARS = 96 /* maximum number of mapped characters */ }; -#define MAXDCHARS (S_water - S_stone + 1) /* maximum of mapped dungeon characters */ -#define MAXTCHARS (S_vibrating_square - S_arrow_trap + 1) /* maximum of mapped trap characters */ -#define MAXECHARS (S_explode9 - S_vbeam + 1) /* maximum of mapped effects 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) @@ -450,30 +450,30 @@ struct rm { * * The following should cover all of the cases. * - * type mode Examples: R=rock, F=finished - * ----- ---- ---------------------------- - * WALL: 0 none hwall, mode 1 - * 1 left/top (1/2 rock) RRR - * 2 right/bottom (1/2 rock) --- - * FFF + * type mode Examples: R=rock, F=finished + * ----- ---- ---------------------------- + * WALL: 0 none hwall, mode 1 + * 1 left/top (1/2 rock) RRR + * 2 right/bottom (1/2 rock) --- + * FFF * - * CORNER: 0 none trcorn, mode 2 - * 1 outer (3/4 rock) FFF - * 2 inner (1/4 rock) F+- - * F|R + * CORNER: 0 none trcorn, mode 2 + * 1 outer (3/4 rock) FFF + * 2 inner (1/4 rock) F+- + * F|R * - * TWALL: 0 none tlwall, mode 3 - * 1 long edge (1/2 rock) F|F - * 2 bottom left (on a tdwall) -+F - * 3 bottom right (on a tdwall) R|F + * TWALL: 0 none tlwall, mode 3 + * 1 long edge (1/2 rock) F|F + * 2 bottom left (on a tdwall) -+F + * 3 bottom right (on a tdwall) R|F * - * CRWALL: 0 none crwall, mode 5 - * 1 top left (1/4 rock) R|F - * 2 top right (1/4 rock) -+- - * 3 bottom left (1/4 rock) F|R - * 4 bottom right (1/4 rock) - * 5 top left & bottom right (1/2 rock) - * 6 bottom left & top right (1/2 rock) + * CRWALL: 0 none crwall, mode 5 + * 1 top left (1/4 rock) R|F + * 2 top right (1/4 rock) -+- + * 3 bottom left (1/4 rock) F|R + * 4 bottom right (1/4 rock) + * 5 top left & bottom right (1/2 rock) + * 6 bottom left & top right (1/2 rock) */ #define WM_W_LEFT 1 /* vertical or horizontal wall */ @@ -496,25 +496,25 @@ struct rm { #define WM_X_BLTR 6 /* - * Seen vector values. The seen vector is an array of 8 bits, one for each + * Seen vector values. The seen vector is an array of 8 bits, one for each * octant around a given center x: * - * 0 1 2 - * 7 x 3 - * 6 5 4 + * 0 1 2 + * 7 x 3 + * 6 5 4 * * In the case of walls, a single wall square can be viewed from 8 possible - * directions. If we know the type of wall and the directions from which + * directions. If we know the type of wall and the directions from which * it has been seen, then we can determine what it looks like to the hero. */ -#define SV0 0x1 -#define SV1 0x2 -#define SV2 0x4 -#define SV3 0x8 -#define SV4 0x10 -#define SV5 0x20 -#define SV6 0x40 -#define SV7 0x80 +#define SV0 0x01 +#define SV1 0x02 +#define SV2 0x04 +#define SV3 0x08 +#define SV4 0x10 +#define SV5 0x20 +#define SV6 0x40 +#define SV7 0x80 #define SVALL 0xFF #define doormask flags diff --git a/include/skills.h b/include/skills.h index a4a312a0d..a7cdb5256 100644 --- a/include/skills.h +++ b/include/skills.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 skills.h $NHDT-Date: 1432512778 2015/05/25 00:12:58 $ $NHDT-Branch: master $:$NHDT-Revision: 1.11 $ */ +/* NetHack 3.6 skills.h $NHDT-Date: 1547255911 2019/01/12 01:18:31 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.15 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985-1999. */ /*-Copyright (c) Pasi Kallinen, 2017. */ /* NetHack may be freely redistributed. See license for details. */ @@ -21,50 +21,50 @@ enum p_skills { * Update weapon.c if you amend any skills. * Also used for oc_subtyp. */ - P_DAGGER, - P_KNIFE, - P_AXE, - P_PICK_AXE, - P_SHORT_SWORD, - P_BROAD_SWORD, - P_LONG_SWORD, - P_TWO_HANDED_SWORD, - P_SCIMITAR, - P_SABER, - P_CLUB, /* Heavy-shafted bludgeon */ - P_MACE, - P_MORNING_STAR, /* Spiked bludgeon */ - P_FLAIL, /* Two pieces hinged or chained together */ - P_HAMMER, /* Heavy head on the end */ - P_QUARTERSTAFF, /* Long-shafted bludgeon */ - P_POLEARMS, - P_SPEAR, /* includes javelin */ - P_TRIDENT, - P_LANCE, - P_BOW, - P_SLING, - P_CROSSBOW, - P_DART, - P_SHURIKEN, - P_BOOMERANG, - P_WHIP, - P_UNICORN_HORN, /* last weapon */ + P_DAGGER = 1, + P_KNIFE = 2, + P_AXE = 3, + P_PICK_AXE = 4, + P_SHORT_SWORD = 5, + P_BROAD_SWORD = 6, + P_LONG_SWORD = 7, + P_TWO_HANDED_SWORD = 8, + P_SCIMITAR = 9, + P_SABER = 10, + P_CLUB = 11, /* Heavy-shafted bludgeon */ + P_MACE = 12, + P_MORNING_STAR = 13, /* Spiked bludgeon */ + P_FLAIL = 14, /* Two pieces hinged or chained together */ + P_HAMMER = 15, /* Heavy head on the end */ + P_QUARTERSTAFF = 16, /* Long-shafted bludgeon */ + P_POLEARMS = 17, /* attack two or three steps away */ + P_SPEAR = 18, /* includes javelin */ + P_TRIDENT = 19, + P_LANCE = 20, + P_BOW = 21, /* launchers */ + P_SLING = 22, + P_CROSSBOW = 23, + P_DART = 24, /* hand-thrown missiles */ + P_SHURIKEN = 25, + P_BOOMERANG = 26, + P_WHIP = 27, /* flexible, one-handed */ + P_UNICORN_HORN = 28, /* last weapon, two-handed */ /* Spell Skills added by Larry Stewart-Zerba */ - P_ATTACK_SPELL, - P_HEALING_SPELL, - P_DIVINATION_SPELL, - P_ENCHANTMENT_SPELL, - P_CLERIC_SPELL, - P_ESCAPE_SPELL, - P_MATTER_SPELL, + P_ATTACK_SPELL = 29, + P_HEALING_SPELL = 30, + P_DIVINATION_SPELL = 31, + P_ENCHANTMENT_SPELL = 32, + P_CLERIC_SPELL = 33, + P_ESCAPE_SPELL = 34, + P_MATTER_SPELL = 35, /* Other types of combat */ - P_BARE_HANDED_COMBAT, /* actually weaponless; gloves are ok */ - P_TWO_WEAPON_COMBAT, - P_RIDING, /* How well you control your steed */ + P_BARE_HANDED_COMBAT = 36, /* actually weaponless; gloves are ok */ + P_TWO_WEAPON_COMBAT = 37, /* pair of weapons, one in each hand */ + P_RIDING = 38, /* How well you control your steed */ - P_NUM_SKILLS + P_NUM_SKILLS = 39 }; #define P_MARTIAL_ARTS P_BARE_HANDED_COMBAT /* Role distinguishes */ @@ -89,13 +89,19 @@ enum p_skills { * a value of 0 needed. */ enum skill_levels { - P_ISRESTRICTED = 0, - P_UNSKILLED, - P_BASIC, - P_SKILLED, - P_EXPERT, - P_MASTER, /* Unarmed combat/martial arts only */ - P_GRAND_MASTER /* Unarmed combat/martial arts only */ + P_ISRESTRICTED = 0, /* unskilled and can't be advanced */ + P_UNSKILLED = 1, /* unskilled so far but can be advanced */ + /* Skill levels Basic/Advanced/Expert had long been used by + Heroes of Might and Magic (tm) and its sequels... */ + P_BASIC = 2, + P_SKILLED = 3, + P_EXPERT = 4, + /* when the skill system was adopted into nethack, levels beyond expert + were unnamed and just used numbers. Devteam coined them Master and + Grand Master. Sometime after that, Heroes of Might and Magic IV (tm) + was released and had two more levels which use these same names. */ + P_MASTER = 5, /* Unarmed combat/martial arts only */ + P_GRAND_MASTER = 6 /* ditto */ }; #define practice_needed_to_advance(level) ((level) * (level) *20) diff --git a/include/trap.h b/include/trap.h index 8eacc6ccd..ef9392939 100644 --- a/include/trap.h +++ b/include/trap.h @@ -1,4 +1,4 @@ -/* NetHack 3.6 trap.h $NHDT-Date: 1432512776 2015/05/25 00:12:56 $ $NHDT-Branch: master $:$NHDT-Revision: 1.12 $ */ +/* NetHack 3.6 trap.h $NHDT-Date: 1547255912 2019/01/12 01:18:32 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.17 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Pasi Kallinen, 2016. */ /* NetHack may be freely redistributed. See license for details. */ @@ -24,7 +24,7 @@ struct trap { Bitfield(tseen, 1); Bitfield(once, 1); Bitfield(madeby_u, 1); /* So monsters may take offence when you trap - them. Recognizing who made the trap isn't + them. Recognizing who made the trap isn't completely unreasonable, everybody has their own style. This flag is also needed when you untrap a monster. It would be too @@ -55,32 +55,32 @@ extern struct trap *ftrap; /* unconditional traps */ enum trap_types { - NO_TRAP = 0, - ARROW_TRAP, - DART_TRAP, - ROCKTRAP, - SQKY_BOARD, - BEAR_TRAP, - LANDMINE, - ROLLING_BOULDER_TRAP, - SLP_GAS_TRAP, - RUST_TRAP, - FIRE_TRAP, - PIT, - SPIKED_PIT, - HOLE, - TRAPDOOR, - TELEP_TRAP, - LEVEL_TELEP, - MAGIC_PORTAL, - WEB, - STATUE_TRAP, - MAGIC_TRAP, - ANTI_MAGIC, - POLY_TRAP, - VIBRATING_SQUARE, + NO_TRAP = 0, + ARROW_TRAP = 1, + DART_TRAP = 2, + ROCKTRAP = 3, + SQKY_BOARD = 4, + BEAR_TRAP = 5, + LANDMINE = 6, + ROLLING_BOULDER_TRAP = 7, + SLP_GAS_TRAP = 8, + RUST_TRAP = 9, + FIRE_TRAP = 10, + PIT = 11, + SPIKED_PIT = 12, + HOLE = 13, + TRAPDOOR = 14, + TELEP_TRAP = 15, + LEVEL_TELEP = 16, + MAGIC_PORTAL = 17, + WEB = 18, + STATUE_TRAP = 19, + MAGIC_TRAP = 20, + ANTI_MAGIC = 21, + POLY_TRAP = 22, + VIBRATING_SQUARE = 23, - TRAPNUM + TRAPNUM = 24 }; #define is_pit(ttyp) ((ttyp) == PIT || (ttyp) == SPIKED_PIT)