Merge branch 'NetHack-3.6'
This commit is contained in:
@@ -379,7 +379,11 @@ boolean resuming;
|
||||
if (g.multi >= 0 && g.occupation) {
|
||||
#if defined(MICRO) || defined(WIN32)
|
||||
abort_lev = 0;
|
||||
#ifdef NEW_KEYBOARD_HIT
|
||||
if (keyboard_hit()) {
|
||||
#else
|
||||
if (kbhit()) {
|
||||
#endif
|
||||
if ((ch = pgetchar()) == ABORT)
|
||||
abort_lev++;
|
||||
else
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1559670605 2019/06/04 17:50:05 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.250 $ */
|
||||
/* NetHack 3.6 files.c $NHDT-Date: 1562719337 2019/07/10 00:42:17 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.252 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Derek S. Ray, 2015. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -3151,7 +3151,7 @@ char *buf;
|
||||
int which_set;
|
||||
{
|
||||
int val, i;
|
||||
struct symparse *symp = (struct symparse *) 0;
|
||||
struct symparse *symp;
|
||||
char *bufp, *commentp, *altp;
|
||||
|
||||
/* convert each instance of whitespace (tabs, consecutive spaces)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 mhitu.c $NHDT-Date: 1556649298 2019/04/30 18:34:58 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.164 $ */
|
||||
/* NetHack 3.6 mhitu.c $NHDT-Date: 1562800504 2019/07/10 23:15:04 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.166 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -2404,9 +2404,13 @@ struct attack *mattk; /* non-Null: current attack; Null: general capability */
|
||||
if (agrinvis && !defperc && adtyp == AD_SEDU)
|
||||
return 0;
|
||||
|
||||
/* nymphs have two attacks, one for steal-item damage and the other
|
||||
for seduction, both pass the could_seduce() test;
|
||||
incubi/succubi have three attacks, their claw attacks for damage
|
||||
don't pass the test */
|
||||
if ((pagr->mlet != S_NYMPH
|
||||
&& pagr != &mons[PM_INCUBUS] && pagr != &mons[PM_SUCCUBUS])
|
||||
|| (adtyp != AD_SEDU && adtyp != AD_SSEX))
|
||||
|| (adtyp != AD_SEDU && adtyp != AD_SSEX && adtyp != AD_SITM))
|
||||
return 0;
|
||||
|
||||
return (genagr == 1 - gendef) ? 1 : (pagr->mlet == S_NYMPH) ? 2 : 0;
|
||||
|
||||
11
src/steal.c
11
src/steal.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 steal.c $NHDT-Date: 1561588404 2019/06/26 22:33:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.73 $ */
|
||||
/* NetHack 3.6 steal.c $NHDT-Date: 1562806584 2019/07/11 00:56:24 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.74 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -247,7 +247,8 @@ struct monst *mtmp;
|
||||
char *objnambuf;
|
||||
{
|
||||
struct obj *otmp;
|
||||
int tmp, could_petrify, armordelay, olddelay, named = 0, retrycnt = 0;
|
||||
int tmp, could_petrify, armordelay, olddelay, icnt,
|
||||
named = 0, retrycnt = 0;
|
||||
boolean monkey_business, /* true iff an animal is doing the thievery */
|
||||
was_doffing, was_punished = Punished;
|
||||
|
||||
@@ -263,11 +264,15 @@ char *objnambuf;
|
||||
if (g.occupation)
|
||||
(void) maybe_finished_meal(FALSE);
|
||||
|
||||
if (!g.invent || (inv_cnt(FALSE) == 1 && uskin)) {
|
||||
icnt = inv_cnt(FALSE); /* don't include gold */
|
||||
if (!icnt || (icnt == 1 && uskin)) {
|
||||
nothing_to_steal:
|
||||
/* Not even a thousand men in armor can strip a naked man. */
|
||||
if (Blind)
|
||||
pline("Somebody tries to rob you, but finds nothing to steal.");
|
||||
else if (inv_cnt(TRUE) > inv_cnt(FALSE)) /* ('icnt' might be stale) */
|
||||
pline("%s tries to rob you, but isn't interested in gold.",
|
||||
Monnam(mtmp));
|
||||
else
|
||||
pline("%s tries to rob you, but there is nothing to steal!",
|
||||
Monnam(mtmp));
|
||||
|
||||
37
src/uhitm.c
37
src/uhitm.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 uhitm.c $NHDT-Date: 1555720104 2019/04/20 00:28:24 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.207 $ */
|
||||
/* NetHack 3.6 uhitm.c $NHDT-Date: 1562806586 2019/07/11 00:56:26 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.210 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2012. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -1493,10 +1493,11 @@ steal_it(mdef, mattk)
|
||||
struct monst *mdef;
|
||||
struct attack *mattk;
|
||||
{
|
||||
struct obj *otmp, *stealoid, **minvent_ptr;
|
||||
struct obj *otmp, *gold = 0, *stealoid, **minvent_ptr;
|
||||
long unwornmask;
|
||||
|
||||
if (!mdef->minvent)
|
||||
otmp = mdef->minvent;
|
||||
if (!otmp || (otmp->oclass == COIN_CLASS && !otmp->nobj))
|
||||
return; /* nothing to take */
|
||||
|
||||
/* look for worn body armor */
|
||||
@@ -1519,14 +1520,25 @@ struct attack *mattk;
|
||||
|
||||
if (stealoid) { /* we will be taking everything */
|
||||
if (gender(mdef) == (int) u.mfemale && g.youmonst.data->mlet == S_NYMPH)
|
||||
You("charm %s. She gladly hands over her possessions.",
|
||||
mon_nam(mdef));
|
||||
You("charm %s. She gladly hands over %sher possessions.",
|
||||
mon_nam(mdef), !gold ? "" : "most of ");
|
||||
else
|
||||
You("seduce %s and %s starts to take off %s clothes.",
|
||||
mon_nam(mdef), mhe(mdef), mhis(mdef));
|
||||
}
|
||||
|
||||
/* prevent gold from being stolen so that steal-item isn't a superset
|
||||
of steal-gold; shuffling it out of minvent before selecting next
|
||||
item, and then back in case hero or monster dies (hero touching
|
||||
stolen c'trice corpse or monster wielding one and having gloves
|
||||
stolen) is less bookkeeping than skipping it within the loop or
|
||||
taking it out once and then trying to figure out how to put it back */
|
||||
if ((gold = findgold(mdef->minvent)) != 0)
|
||||
obj_extract_self(gold);
|
||||
|
||||
while ((otmp = mdef->minvent) != 0) {
|
||||
if (gold) /* put 'mdef's gold back */
|
||||
mpickobj(mdef, gold), gold = 0;
|
||||
if (!Upolyd)
|
||||
break; /* no longer have ability to steal */
|
||||
/* take the object away from the monster */
|
||||
@@ -1559,12 +1571,25 @@ struct attack *mattk;
|
||||
} else if (unwornmask & W_ARMG) { /* stole worn gloves */
|
||||
mselftouch(mdef, (const char *) 0, TRUE);
|
||||
if (DEADMONSTER(mdef)) /* it's now a statue */
|
||||
return; /* can't continue stealing */
|
||||
break; /* can't continue stealing */
|
||||
}
|
||||
|
||||
if (!stealoid)
|
||||
break; /* only taking one item */
|
||||
|
||||
/* take gold out of minvent before making next selection; if it
|
||||
is the only thing left, the loop will terminate and it will be
|
||||
put back below */
|
||||
if ((gold = findgold(mdef->minvent)) != 0)
|
||||
obj_extract_self(gold);
|
||||
}
|
||||
|
||||
/* put gold back; won't happen if either hero or 'mdef' dies because
|
||||
gold will be back in monster's inventory at either of those times
|
||||
(so will be present in mdef's minvent for bones, or in its statue
|
||||
now if it has just been turned into one) */
|
||||
if (gold)
|
||||
mpickobj(mdef, gold);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -521,6 +521,9 @@ static void NDECL(hup_void_ndecl);
|
||||
static void FDECL(hup_void_fdecl_int, (int));
|
||||
static void FDECL(hup_void_fdecl_winid, (winid));
|
||||
static void FDECL(hup_void_fdecl_constchar_p, (const char *));
|
||||
#ifdef NEW_KEYBOARD_HIT
|
||||
static boolean NDECL(hup_keyboard_hit);
|
||||
#endif
|
||||
|
||||
static struct window_procs hup_procs = {
|
||||
"hup", 0L, 0L, hup_init_nhwindows,
|
||||
@@ -568,6 +571,9 @@ static struct window_procs hup_procs = {
|
||||
hup_void_ndecl, /* status_finish */
|
||||
genl_status_enablefield, hup_status_update,
|
||||
genl_can_suspend_no,
|
||||
#ifdef NEW_KEYBOARD_HIT
|
||||
hup_keyboard_hit
|
||||
#endif
|
||||
};
|
||||
|
||||
static void FDECL((*previnterface_exit_nhwindows), (const char *)) = 0;
|
||||
@@ -622,6 +628,14 @@ hup_nhgetch(VOID_ARGS)
|
||||
return '\033'; /* ESC */
|
||||
}
|
||||
|
||||
#ifdef NEW_KEYBOARD_HIT
|
||||
static boolean
|
||||
hup_keyboard_hit(VOID_ARGS)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*ARGSUSED*/
|
||||
static char
|
||||
hup_yn_function(prompt, resp, deflt)
|
||||
|
||||
Reference in New Issue
Block a user