Merge branch 'NetHack-3.6.0'

This commit is contained in:
keni
2016-06-21 10:29:14 -04:00
84 changed files with 3167 additions and 1281 deletions

View File

@@ -364,11 +364,6 @@
*/
#endif /* CHDIR */
/* If GENERIC_USERNAMES is defined, and the player's username is found
* in the list, prompt for character name instead of using username.
* A public server should probably disable this. */
#define GENERIC_USERNAMES "play player game games nethack nethacker"
/*
* Section 3: Definitions that may vary with system type.
* For example, both schar and uchar should be short ints on

View File

@@ -185,8 +185,6 @@ E NEARDATA struct kinfo {
} killer;
E long done_money;
E const char *configfile;
E char lastconfigfile[BUFSZ]; /* used for messaging */
E NEARDATA char plname[PL_NSIZ];
E NEARDATA char dogname[];
E NEARDATA char catname[];

View File

@@ -236,6 +236,8 @@ E void NDECL(decl_init);
/* ### detect.c ### */
E boolean FDECL(trapped_chest_at, (int, int, int));
E boolean FDECL(trapped_door_at, (int, int, int));
E struct obj *FDECL(o_in, (struct obj *, CHAR_P));
E struct obj *FDECL(o_material, (struct obj *, unsigned));
E int FDECL(gold_detect, (struct obj *));
@@ -246,7 +248,7 @@ E int FDECL(trap_detect, (struct obj *));
E const char *FDECL(level_distance, (d_level *));
E void FDECL(use_crystal_ball, (struct obj **));
E void NDECL(do_mapping);
E void NDECL(do_vicinity_map);
E void FDECL(do_vicinity_map, (struct obj *));
E void FDECL(cvt_sdoor_to_door, (struct rm *));
#ifdef USE_TRAMPOLI
E void FDECL(findone, (int, int, genericptr_t));
@@ -399,6 +401,7 @@ E char *FDECL(distant_monnam, (struct monst *, int, char *));
E char *FDECL(rndmonnam, (char *));
E const char *FDECL(hcolor, (const char *));
E const char *NDECL(rndcolor);
E const char *FDECL(hliquid, (const char *));
E const char *NDECL(roguename);
E struct obj *FDECL(realloc_obj,
(struct obj *, int, genericptr_t, int, const char *));
@@ -1013,6 +1016,7 @@ E boolean FDECL(picking_lock, (int *, int *));
E boolean FDECL(picking_at, (int, int));
E void FDECL(breakchestlock, (struct obj *, BOOLEAN_P));
E void NDECL(reset_pick);
E void NDECL(maybe_reset_pick);
E int FDECL(pick_lock, (struct obj *));
E int NDECL(doforce);
E boolean FDECL(boxlock, (struct obj *, struct obj *));
@@ -1512,6 +1516,9 @@ E int FDECL(breamu, (struct monst *, struct attack *));
E boolean FDECL(linedup, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int));
E boolean FDECL(lined_up, (struct monst *));
E struct obj *FDECL(m_carrying, (struct monst *, int));
E int FDECL(thrwmm, (struct monst *, struct monst *));
E int FDECL(spitmm, (struct monst *, struct attack *, struct monst *));
E int FDECL(breamm, (struct monst *, struct attack *, struct monst *));
E void FDECL(m_useupall, (struct monst *, struct obj *));
E void FDECL(m_useup, (struct monst *, struct obj *));
E void FDECL(m_throw, (struct monst *, int, int, int, int, int, struct obj *));
@@ -1769,6 +1776,7 @@ E int FDECL(query_objlist, (const char *, struct obj **, int,
menu_item **, int, boolean (*)(OBJ_P)));
E struct obj *FDECL(pick_obj, (struct obj *));
E int NDECL(encumber_msg);
E int FDECL(container_at, (int, int, BOOLEAN_P));
E int NDECL(doloot);
E boolean FDECL(container_gone, (int (*)(OBJ_P)));
E boolean NDECL(u_handsy);
@@ -2796,6 +2804,7 @@ E struct monst *FDECL(boomhit, (struct obj *, int, int));
E int FDECL(zhitm, (struct monst *, int, int, struct obj **));
E int FDECL(burn_floor_objects, (int, int, BOOLEAN_P, BOOLEAN_P));
E void FDECL(buzz, (int, int, XCHAR_P, XCHAR_P, int, int));
E void FDECL(dobuzz, (int, int, XCHAR_P, XCHAR_P, int, int, BOOLEAN_P));
E void FDECL(melt_ice, (XCHAR_P, XCHAR_P, const char *));
E void FDECL(start_melt_ice_timeout, (XCHAR_P, XCHAR_P, long));
E void FDECL(melt_ice_away, (ANY_P *, long));

View File

@@ -187,10 +187,11 @@ struct instance_flags {
int override_ID; /* true to force full identification of objects */
int suppress_price; /* controls doname() for unpaid objects */
int terrainmode; /* for getpos()'s autodescribe when #terrain is active */
#define TER_MAP 0x01
#define TER_TRP 0x02
#define TER_OBJ 0x04
#define TER_MON 0x08
#define TER_MAP 0x01
#define TER_TRP 0x02
#define TER_OBJ 0x04
#define TER_MON 0x08
#define TER_DETECT 0x10 /* detect_foo magic rather than #terrain */
coord travelcc; /* coordinates for travel_cache */
boolean window_inited; /* true if init_nhwindows() completed */
boolean vision_inited; /* true if vision is ready */
@@ -347,6 +348,7 @@ struct instance_flags {
/* copies of values in struct u, used during detection when the
originals are temporarily cleared; kept here rather than
locally so that they can be restored during a hangup save */
Bitfield(save_uswallow, 1);
Bitfield(save_uinwater, 1);
Bitfield(save_uburied, 1);
};
@@ -434,7 +436,7 @@ struct cmd {
boolean num_pad; /* same as iflags.num_pad except during updates */
boolean pcHack_compat; /* for numpad: affects 5, M-5, and M-0 */
boolean phone_layout; /* inverted keypad: 1,2,3 above, 7,8,9 below */
boolean swap_yz; /* German keyboards; use z to move NW, y to zap */
boolean swap_yz; /* QWERTZ keyboards; use z to move NW, y to zap */
char move_W, move_NW, move_N, move_NE, move_E, move_SE, move_S, move_SW;
const char *dirchars; /* current movement/direction characters */
const char *alphadirchars; /* same as dirchars if !numpad */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 global.h $NHDT-Date: 1450306170 2015/12/16 22:49:30 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.47 $ */
/* NetHack 3.6 global.h $NHDT-Date: 1465114189 2016/06/05 08:09:49 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.49 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -18,6 +18,7 @@
#define RECORD "record" /* file containing list of topscorers */
#define HELP "help" /* file containing command descriptions */
#define SHELP "hh" /* abbreviated form of the same */
#define KEYHELP "keyhelp" /* explanatory text for 'whatdoes' command */
#define DEBUGHELP "wizhelp" /* file containing debug mode cmds */
#define RUMORFILE "rumors" /* file with fortune cookies */
#define ORACLEFILE "oracles" /* file with oracular information */

View File

@@ -57,13 +57,15 @@
#define DISMOUNT_BYCHOICE 6
/* Special returns from mapglyph() */
#define MG_CORPSE 0x01
#define MG_INVIS 0x02
#define MG_DETECT 0x04
#define MG_PET 0x08
#define MG_RIDDEN 0x10
#define MG_STATUE 0x20
#define MG_CORPSE 0x01
#define MG_INVIS 0x02
#define MG_DETECT 0x04
#define MG_PET 0x08
#define MG_RIDDEN 0x10
#define MG_STATUE 0x20
#define MG_OBJPILE 0x40 /* more than one stack of objects */
#define MG_BW_LAVA 0x80 /* 'black & white lava': highlight lava if it
can't be distringuished from water by color */
/* sellobj_state() states */
#define SELL_NORMAL (0)

View File

@@ -194,6 +194,9 @@
|| ((ptr)->mlet == S_PUDDING && (ptr) != &mons[PM_BLACK_PUDDING]))
#define befriend_with_obj(ptr, obj) \
((obj)->oclass == FOOD_CLASS && is_domestic(ptr))
(((obj)->oclass == FOOD_CLASS && is_domestic(ptr)) \
|| ((obj)->otyp == BANANA && \
((ptr) == &mons[PM_MONKEY] \
|| (ptr) == &mons[PM_APE])))
#endif /* MONDATA_H */

View File

@@ -227,6 +227,10 @@
#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)
struct symdef {
uchar sym;
const char *explanation;

View File

@@ -13,6 +13,7 @@ struct sysopt {
or "one or two" or "one, two, or three", &c */
char *explorers; /* like wizards, but for access to explore mode */
char *shellers; /* like wizards, for ! command (-DSHELL); also ^Z */
char *genericusers; /* usernames that prompt for user name */
char *debugfiles; /* files to show debugplines in. '*' is all. */
int env_dbgfl; /* 1: debugfiles comes from getenv("DEBUGFILES")
* so sysconf's DEBUGFILES shouldn't override it;

View File

@@ -27,9 +27,9 @@ struct RoleAdvance {
};
struct u_have {
Bitfield(amulet, 1); /* carrying Amulet */
Bitfield(bell, 1); /* carrying Bell */
Bitfield(book, 1); /* carrying Book */
Bitfield(amulet, 1); /* carrying Amulet */
Bitfield(bell, 1); /* carrying Bell */
Bitfield(book, 1); /* carrying Book */
Bitfield(menorah, 1); /* carrying Candelabrum */
Bitfield(questart, 1); /* carrying the Quest Artifact */
Bitfield(unused, 3);
@@ -124,16 +124,16 @@ struct Role {
short questarti; /* index (ART_) of quest artifact (questpgr.c) */
/*** Bitmasks ***/
short allow; /* bit mask of allowed variations */
#define ROLE_RACEMASK 0x0ff8 /* allowable races */
#define ROLE_GENDMASK 0xf000 /* allowable genders */
#define ROLE_MALE 0x1000
#define ROLE_FEMALE 0x2000
#define ROLE_NEUTER 0x4000
#define ROLE_ALIGNMASK AM_MASK /* allowable alignments */
#define ROLE_LAWFUL AM_LAWFUL
#define ROLE_NEUTRAL AM_NEUTRAL
#define ROLE_CHAOTIC AM_CHAOTIC
short allow; /* bit mask of allowed variations */
#define ROLE_RACEMASK 0x0ff8 /* allowable races */
#define ROLE_GENDMASK 0xf000 /* allowable genders */
#define ROLE_MALE 0x1000
#define ROLE_FEMALE 0x2000
#define ROLE_NEUTER 0x4000
#define ROLE_ALIGNMASK AM_MASK /* allowable alignments */
#define ROLE_LAWFUL AM_LAWFUL
#define ROLE_NEUTRAL AM_NEUTRAL
#define ROLE_CHAOTIC AM_CHAOTIC
/*** Attributes (from attrib.c and exper.c) ***/
xchar attrbase[A_MAX]; /* lowest initial attributes */
@@ -202,9 +202,9 @@ struct Race {
xchar attrmax[A_MAX]; /* maximum allowable attribute */
struct RoleAdvance hpadv; /* hit point advancement */
struct RoleAdvance enadv; /* energy advancement */
#if 0 /* DEFERRED */
int nv_range; /* night vision range */
int xray_range; /* X-ray vision range */
#if 0 /* DEFERRED */
int nv_range; /* night vision range */
int xray_range; /* X-ray vision range */
#endif
/*** Properties in variable-length arrays ***/
@@ -231,14 +231,14 @@ struct Gender {
const char *filecode; /* file code */
short allow; /* equivalent ROLE_ mask */
};
#define ROLE_GENDERS 2 /* number of permitted player genders */
/* increment to 3 if you allow neuter roles */
#define ROLE_GENDERS 2 /* number of permitted player genders
increment to 3 if you allow neuter roles */
extern const struct Gender genders[]; /* table of available genders */
#define uhe() (genders[flags.female ? 1 : 0].he)
#define uhim() (genders[flags.female ? 1 : 0].him)
#define uhis() (genders[flags.female ? 1 : 0].his)
#define mhe(mtmp) (genders[pronoun_gender(mtmp)].he)
#define uhe() (genders[flags.female ? 1 : 0].he)
#define uhim() (genders[flags.female ? 1 : 0].him)
#define uhis() (genders[flags.female ? 1 : 0].his)
#define mhe(mtmp) (genders[pronoun_gender(mtmp)].he)
#define mhim(mtmp) (genders[pronoun_gender(mtmp)].him)
#define mhis(mtmp) (genders[pronoun_gender(mtmp)].his)
@@ -250,32 +250,32 @@ struct Align {
short allow; /* equivalent ROLE_ mask */
aligntyp value; /* equivalent A_ value */
};
#define ROLE_ALIGNS 3 /* number of permitted player alignments */
#define ROLE_ALIGNS 3 /* number of permitted player alignments */
extern const struct Align aligns[]; /* table of available alignments */
/*** Information about the player ***/
struct you {
xchar ux, uy;
schar dx, dy, dz; /* direction of move (or zap or ... ) */
schar di; /* direction of FF */
xchar tx, ty; /* destination of travel */
xchar ux0, uy0; /* initial position FF */
d_level uz, uz0; /* your level on this and the previous turn */
d_level utolev; /* level monster teleported you to, or uz */
uchar utotype; /* bitmask of goto_level() flags for utolev */
boolean umoved; /* changed map location (post-move) */
int last_str_turn; /* 0: none, 1: half turn, 2: full turn */
/* +: turn right, -: turn left */
int ulevel; /* 1 to MAXULEV */
xchar ux, uy; /* current map coordinates */
schar dx, dy, dz; /* direction of move (or zap or ... ) */
schar di; /* direction of FF */
xchar tx, ty; /* destination of travel */
xchar ux0, uy0; /* initial position FF */
d_level uz, uz0; /* your level on this and the previous turn */
d_level utolev; /* level monster teleported you to, or uz */
uchar utotype; /* bitmask of goto_level() flags for utolev */
boolean umoved; /* changed map location (post-move) */
int last_str_turn; /* 0: none, 1: half turn, 2: full turn
+: turn right, -: turn left */
int ulevel; /* 1 to MAXULEV */
int ulevelmax;
unsigned utrap; /* trap timeout */
unsigned utraptype; /* defined if utrap nonzero */
#define TT_BEARTRAP 0
#define TT_PIT 1
#define TT_WEB 2
#define TT_LAVA 3
#define TT_INFLOOR 4
#define TT_BEARTRAP 0
#define TT_PIT 1
#define TT_WEB 2
#define TT_LAVA 3
#define TT_INFLOOR 4
#define TT_BURIEDBALL 5
char urooms[5]; /* rooms (roomno + 3) occupied now */
char urooms0[5]; /* ditto, for previous position */
@@ -310,16 +310,16 @@ struct you {
int bc_order; /* ball & chain order [see bc_order() in ball.c] */
int bc_felt; /* mask for ball/chain being felt */
int umonster; /* hero's "real" monster num */
int umonnum; /* current monster number */
int umonster; /* hero's "real" monster num */
int umonnum; /* current monster number */
int mh, mhmax, mtimedone; /* for polymorph-self */
struct attribs macurr, /* for monster attribs */
mamax; /* for monster attribs */
int ulycn; /* lycanthrope type */
int mh, mhmax, mtimedone; /* for polymorph-self */
struct attribs macurr, /* for monster attribs */
mamax; /* for monster attribs */
int ulycn; /* lycanthrope type */
unsigned ucreamed;
unsigned uswldtim; /* time you have been swallowed */
unsigned uswldtim; /* time you have been swallowed */
Bitfield(uswallow, 1); /* true if swallowed */
Bitfield(uinwater, 1); /* if you're currently in water (only
@@ -328,60 +328,62 @@ struct you {
Bitfield(mfemale, 1); /* saved human value of flags.female */
Bitfield(uinvulnerable, 1); /* you're invulnerable (praying) */
Bitfield(uburied, 1); /* you're buried */
Bitfield(uedibility, 1); /* blessed food detection; sense unsafe food */
Bitfield(uedibility, 1); /* blessed food detect; sense unsafe food */
/* 1 free bit! */
unsigned udg_cnt; /* how long you have been demigod */
struct u_achieve uachieve; /* achievements */
struct u_event uevent; /* certain events have happened */
struct u_have uhave; /* you're carrying special objects */
struct u_conduct uconduct; /* KMH, conduct */
unsigned udg_cnt; /* how long you have been demigod */
struct u_achieve uachieve; /* achievements */
struct u_event uevent; /* certain events have happened */
struct u_have uhave; /* you're carrying special objects */
struct u_conduct uconduct; /* KMH, conduct */
struct u_roleplay uroleplay;
struct attribs acurr, /* your current attributes (eg. str)*/
aexe, /* for gain/loss via "exercise" */
abon, /* your bonus attributes (eg. str) */
amax, /* your max attributes (eg. str) */
atemp, /* used for temporary loss/gain */
atime; /* used for loss/gain countdown */
align ualign; /* character alignment */
#define CONVERT 2
struct attribs acurr, /* your current attributes (eg. str)*/
aexe, /* for gain/loss via "exercise" */
abon, /* your bonus attributes (eg. str) */
amax, /* your max attributes (eg. str) */
atemp, /* used for temporary loss/gain */
atime; /* used for loss/gain countdown */
align ualign; /* character alignment */
#define CONVERT 2
#define A_ORIGINAL 1
#define A_CURRENT 0
#define A_CURRENT 0
aligntyp ualignbase[CONVERT]; /* for ualign conversion record */
schar uluck, moreluck; /* luck and luck bonus */
#define Luck (u.uluck + u.moreluck)
#define LUCKADD 3 /* added value when carrying luck stone */
#define LUCKMAX 10
#define LUCKMIN (-10)
#define LUCKADD 3 /* value of u.moreluck when carrying luck stone;
+ when blessed or uncursed, - when cursed */
#define LUCKMAX 10 /* maximum value of u.ulUck */
#define LUCKMIN (-10) /* minimum value of u.uluck */
schar uhitinc;
schar udaminc;
schar uac;
uchar uspellprot; /* protection by SPE_PROTECTION */
uchar usptime; /* #moves until uspellprot-- */
uchar uspmtime; /* #moves between uspellprot-- */
int uhp, uhpmax;
int uen, uenmax; /* magical energy - M. Stephenson */
xchar uhpinc[MAXULEV], ueninc[MAXULEV]; /* increases from level gain */
int ugangr; /* if the gods are angry at you */
int ugifts; /* number of artifacts bestowed */
int ublessed, ublesscnt; /* blessing/duration from #pray */
uchar uspellprot; /* protection by SPE_PROTECTION */
uchar usptime; /* #moves until uspellprot-- */
uchar uspmtime; /* #moves between uspellprot-- */
int uhp, uhpmax; /* hit points, aka health */
int uen, uenmax; /* magical energy - M. Stephenson */
xchar uhpinc[MAXULEV], /* increases to uhpmax for each level gain */
ueninc[MAXULEV]; /* increases to uenmax for each level gain */
int ugangr; /* if the gods are angry at you */
int ugifts; /* number of artifacts bestowed */
int ublessed, ublesscnt; /* blessing/duration from #pray */
long umoney0;
long uspare1;
long uexp, urexp;
long ucleansed; /* to record moves when player was cleansed */
long usleep; /* sleeping; monstermove you last started */
long ucleansed; /* to record moves when player was cleansed */
long usleep; /* sleeping; monstermove you last started */
int uinvault;
struct monst *ustuck;
struct monst *usteed;
long ugallop;
int urideturns;
int umortality; /* how many times you died */
struct monst *ustuck; /* engulfer or grabber, maybe grabbee if Upolyd */
struct monst *usteed; /* mount when riding */
long ugallop; /* turns steed will run after being kicked */
int urideturns; /* time spent riding, for skill advancement */
int umortality; /* how many times you died */
int ugrave_arise; /* you die and become something aside from a ghost */
int weapon_slots; /* unused skill slots */
int skills_advanced; /* # of advances made so far */
int weapon_slots; /* unused skill slots */
int skills_advanced; /* # of advances made so far */
xchar skill_record[P_SKILL_LIMIT]; /* skill advancements */
struct skills weapon_skills[P_NUM_SKILLS];
boolean twoweap; /* KMH -- Using two-weapon combat */
boolean twoweap; /* KMH -- Using two-weapon combat */
}; /* end of `struct you' */