Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-02-02 21:15:37 -05:00
8 changed files with 98 additions and 22 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 hack.c $NHDT-Date: 1546656413 2019/01/05 02:46:53 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.203 $ */
/* NetHack 3.6 hack.c $NHDT-Date: 1549157812 2019/02/03 01:36:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.206 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2268,9 +2268,9 @@ register int typewanted;
int typefound, min_x, min_y, max_x, max_y_offset, step;
register struct rm *lev;
#define goodtype(rno) \
(!typewanted \
|| (typefound = g.rooms[rno - ROOMOFFSET].rtype) == typewanted \
#define goodtype(rno) \
(!typewanted \
|| (typefound = (g.rooms[rno - ROOMOFFSET].rtype == typewanted)) != 0 \
|| (typewanted == SHOPBASE && typefound > SHOPBASE))
switch (rno = levl[x][y].roomno) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 invent.c $NHDT-Date: 1547025166 2019/01/09 09:12:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.250 $ */
/* NetHack 3.6 invent.c $NHDT-Date: 1549075239 2019/02/02 02:40:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$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. */
@@ -2682,7 +2682,8 @@ long *out_cnt;
else
any.a_char = ilet;
add_menu(win, obj_to_glyph(otmp, rn2_on_display_rng), &any, ilet,
0, ATR_NONE, doname(otmp), MENU_UNSELECTED);
wizid ? def_oc_syms[(int) otmp->oclass].sym : 0,
ATR_NONE, doname(otmp), MENU_UNSELECTED);
}
}
if (flags.sortpack) {

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 potion.c $NHDT-Date: 1547518427 2019/01/15 02:13:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.159 $ */
/* NetHack 3.6 potion.c $NHDT-Date: 1549074254 2019/02/02 02:24:14 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.160 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1158,6 +1158,8 @@ register boolean curesick, cureblind;
mundane 'dirt', but if it doesn't, blindness isn't cured */
u.ucreamed = 0;
make_blinded(0L, TRUE);
/* heal deafness too */
make_deaf(0L, TRUE);
}
if (curesick) {
make_vomiting(0L, TRUE);
@@ -1639,8 +1641,10 @@ register struct obj *obj;
u.uhp++, g.context.botl = 1;
if (obj->blessed)
cureblind = TRUE;
if (cureblind)
if (cureblind) {
make_blinded(0L, !u.ucreamed);
make_deaf(0L, TRUE);
}
exercise(A_CON, TRUE);
break;
case POT_SICKNESS:

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 pray.c $NHDT-Date: 1540596912 2018/10/26 23:35:12 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.104 $ */
/* NetHack 3.6 pray.c $NHDT-Date: 1549074257 2019/02/02 02:24:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.110 $ */
/* Copyright (c) Benson I. Margulies, Mike Stephenson, Steve Linhart, 1989. */
/* NetHack may be freely redistributed. See license for details. */
@@ -242,6 +242,11 @@ in_trouble()
&& (!u.uswallow
|| !attacktype_fordmg(u.ustuck->data, AT_ENGL, AD_BLND)))
return TROUBLE_BLIND;
/* deafness isn't it's own trouble; healing magic cures deafness
when it cures blindness, so do the same with trouble repair */
if ((HDeaf & TIMEOUT) > 1L)
return TROUBLE_BLIND;
for (i = 0; i < A_MAX; i++)
if (ABASE(i) < AMAX(i))
return TROUBLE_POISONED;
@@ -508,14 +513,27 @@ int trouble;
}
(void) encumber_msg();
break;
case TROUBLE_BLIND: {
case TROUBLE_BLIND: { /* handles deafness as well as blindness */
char msgbuf[BUFSZ];
const char *eyes = body_part(EYE);
boolean cure_deaf = (HDeaf & TIMEOUT) ? TRUE : FALSE;
if (eyecount(g.youmonst.data) != 1)
eyes = makeplural(eyes);
Your("%s %s better.", eyes, vtense(eyes, "feel"));
u.ucreamed = 0;
make_blinded(0L, FALSE);
msgbuf[0] = '\0';
if (Blinded) {
if (eyecount(g.youmonst.data) != 1)
eyes = makeplural(eyes);
Sprintf(msgbuf, "Your %s %s better", eyes, vtense(eyes, "feel"));
u.ucreamed = 0;
make_blinded(0L, FALSE);
}
if (cure_deaf) {
make_deaf(0L, FALSE);
if (!Deaf)
Sprintf(eos(msgbuf), "%s can hear again",
!*msgbuf ? "You" : " and you");
}
if (*msgbuf)
pline("%s.", msgbuf);
break;
}
case TROUBLE_WOUNDED_LEGS:

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 teleport.c $NHDT-Date: 1546655319 2019/01/05 02:28:39 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.83 $ */
/* NetHack 3.6 teleport.c $NHDT-Date: 1549157815 2019/02/03 01:36:55 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.84 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -249,6 +249,7 @@ register int nux, nuy;
boolean allow_drag;
{
boolean ball_active, ball_still_in_range;
struct monst *vault_guard = vault_occupied(u.urooms) ? findgd() : 0;
if (u.utraptype == TT_BURIEDBALL) {
/* unearth it */
@@ -351,6 +352,21 @@ boolean allow_drag;
else
g.telescroll = 0; /* no discovery by scrolltele()'s caller */
}
/* sequencing issue: we want guard's alarm, if any, to occur before
room entry message, if any, so need to check for vault exit prior
to spoteffects; but spoteffects() sets up new value for u.urooms
and vault code depends upon that value, so we need to fake it */
if (vault_guard) {
char save_urooms[5]; /* [sizeof u.urooms] */
Strcpy(save_urooms, u.urooms);
Strcpy(u.urooms, in_rooms(u.ux, u.uy, VAULT));
/* if hero has left vault, make guard notice */
if (!vault_occupied(u.urooms))
uleftvault(vault_guard);
Strcpy(u.urooms, save_urooms); /* reset prior to spoteffects() */
}
/* possible shop entry message comes after guard's shrill whistle */
spoteffects(TRUE);
invocation_message();
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 vault.c $NHDT-Date: 1545269451 2018/12/20 01:30:51 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.59 $ */
/* NetHack 3.6 vault.c $NHDT-Date: 1549157816 2019/02/03 01:36:56 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.60 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -10,7 +10,6 @@ STATIC_DCL void FDECL(blackout, (int, int));
STATIC_DCL void FDECL(restfakecorr, (struct monst *));
STATIC_DCL void FDECL(parkguard, (struct monst *));
STATIC_DCL boolean FDECL(in_fcorridor, (struct monst *, int, int));
STATIC_DCL struct monst *NDECL(findgd);
STATIC_DCL boolean FDECL(find_guard_dest, (struct monst *, xchar *, xchar *));
STATIC_DCL void FDECL(move_gold, (struct obj *, int));
STATIC_DCL void FDECL(wallify_vault, (struct monst *));
@@ -104,7 +103,9 @@ boolean forceshow;
}
if (sawcorridor)
pline_The("corridor disappears.");
if (IS_ROCK(levl[u.ux][u.uy].typ))
/* only give encased message if hero is still alive (might get here
via paygd() when game is over; died: no message, quit: message) */
if (IS_ROCK(levl[u.ux][u.uy].typ) && (Upolyd ? u.mh : u.uhp) > 0)
You("are encased in rock.");
return TRUE;
}
@@ -199,7 +200,6 @@ int x, y;
return FALSE;
}
STATIC_OVL
struct monst *
findgd()
{
@@ -233,6 +233,33 @@ char *array;
return '\0';
}
/* hero has teleported out of vault while a guard is active */
void
uleftvault(grd)
struct monst *grd;
{
/* only called if caller has checked vault_occupied() and findgd() */
if (!grd || !grd->isgd || DEADMONSTER(grd)) {
impossible("escaping vault without guard?");
return;
}
/* if carrying gold and arriving anywhere other than next to the guard,
set the guard loose */
if ((money_cnt(g.invent) || hidden_gold())
&& um_dist(grd->mx, grd->my, 1)) {
if (grd->mpeaceful) {
if (canspotmon(grd)) /* see or sense via telepathy */
pline("%s becomes irate.", Monnam(grd));
grd->mpeaceful = 0; /* bypass setmangry() */
}
/* if arriving outside guard's temporary corridor, give the
guard an extra move to deliver message(s) and to teleport
out of and remove that corridor */
if (!in_fcorridor(grd, u.ux, u.uy))
(void) gd_move(grd);
}
}
STATIC_OVL boolean
find_guard_dest(guard, rx, ry)
struct monst *guard;