Merge branch 'master' into win32-x64-working

This commit is contained in:
nhmall
2015-04-19 13:47:09 -04:00
11 changed files with 164 additions and 74 deletions

View File

@@ -564,15 +564,17 @@ feel_location(x, y)
if (lev->typ != ROOM && lev->seenv) {
map_background(x, y, 1);
} else {
lev->glyph = lev->waslit ? cmap_to_glyph(S_room) :
cmap_to_glyph(S_stone);
lev->glyph = flags.dark_room ? cmap_to_glyph(S_darkroom) :
(lev->waslit ? cmap_to_glyph(S_room) :
cmap_to_glyph(S_stone));
show_glyph(x,y,lev->glyph);
}
} else if ((lev->glyph >= cmap_to_glyph(S_stone) &&
lev->glyph < cmap_to_glyph(S_room)) ||
lev->glyph < cmap_to_glyph(S_darkroom)) ||
glyph_is_invisible(levl[x][y].glyph)) {
lev->glyph = lev->waslit ? cmap_to_glyph(S_room) :
cmap_to_glyph(S_stone);
lev->glyph = flags.dark_room ? cmap_to_glyph(S_darkroom) :
(lev->waslit ? cmap_to_glyph(S_room) :
cmap_to_glyph(S_stone));
show_glyph(x,y,lev->glyph);
}
} else {
@@ -583,6 +585,9 @@ feel_location(x, y)
if (lev->typ == CORR &&
lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
else if (lev->typ == ROOM && flags.dark_room &&
lev->glyph == cmap_to_glyph(S_room))
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_darkroom));
}
} else {
_map_location(x, y, 1);
@@ -610,9 +615,9 @@ feel_location(x, y)
}
/* Floor spaces are dark if unlit. Corridors are dark if unlit. */
if (lev->typ == ROOM &&
lev->glyph == cmap_to_glyph(S_room) && !lev->waslit)
show_glyph(x,y, lev->glyph = cmap_to_glyph(S_stone));
if (lev->typ == ROOM && lev->glyph == cmap_to_glyph(S_room) &&
(!lev->waslit || flags.dark_room))
show_glyph(x,y, lev->glyph = cmap_to_glyph(flags.dark_room ? S_darkroom : S_stone));
else if (lev->typ == CORR &&
lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit)
show_glyph(x,y, lev->glyph = cmap_to_glyph(S_corr));

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 hack.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 hack.c $NHDT-Date: 1429412557 2015/04/19 03:02:37 $ $NHDT-Branch: master $:$NHDT-Revision: 1.143 $ */
/* NetHack 3.5 hack.c $Date: 2013/10/26 21:33:47 $ $Revision: 1.120 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1336,49 +1336,67 @@ domove()
if (context.forcefight ||
/* remembered an 'I' && didn't use a move command */
(glyph_is_invisible(levl[x][y].glyph) && !context.nopick)) {
struct obj *boulder = sobj_at(BOULDER, x, y);
struct obj *boulder = 0;
boolean explo = (Upolyd && attacktype(youmonst.data, AT_EXPL)),
solid = !accessible(x, y);
int glyph = glyph_at(x, y); /* might be monster */
char buf[BUFSZ];
/* if a statue is displayed at the target location,
player is attempting to attack it [and boulder
handlng below is suitable for handling that] */
if (glyph_is_statue(glyph) ||
(Hallucination && glyph_is_monster(glyph)))
boulder = sobj_at(STATUE, x, y);
if (!Underwater) {
boulder = sobj_at(BOULDER, x, y);
/* if a statue is displayed at the target location,
player is attempting to attack it [and boulder
handlng below is suitable for handling that] */
if (glyph_is_statue(glyph) ||
(Hallucination && glyph_is_monster(glyph)))
boulder = sobj_at(STATUE, x, y);
/* force fight at boulder/statue or wall/door while wielding
pick: start digging to break the boulder or wall */
if (context.forcefight &&
/* can we dig? */
uwep && dig_typ(uwep, x, y) &&
/* should we dig? */
!glyph_is_invisible(glyph) &&
!glyph_is_monster(glyph)) {
(void)use_pick_axe2(uwep);
return;
}
/* force fight at boulder/statue or wall/door while wielding
pick: start digging to break the boulder or wall */
if (context.forcefight &&
/* can we dig? */
uwep && dig_typ(uwep, x, y) &&
/* should we dig? */
!glyph_is_invisible(glyph) &&
!glyph_is_monster(glyph)) {
(void)use_pick_axe2(uwep);
return;
}
}
/* about to become known empty -- remove 'I' if present */
unmap_object(x, y);
if (boulder) map_object(boulder, TRUE);
newsym(x, y);
glyph = glyph_at(x, y); /* might have just changed */
if (boulder)
Strcpy(buf, ansimpleoname(boulder));
else if (solid && glyph_is_cmap(glyph))
Strcpy(buf, the(defsyms[glyph_to_cmap(glyph)].explanation));
else if (!Underwater)
Strcpy(buf, "thin air");
else if (is_pool(x, y))
Strcpy(buf, "empty water");
else /* Underwater, targetting non-water */
Sprintf(buf, "a vacant spot on the %s", surface(x,y));
else if (Underwater && !is_pool(x, y))
/* Underwater, targetting non-water; the map just shows blank
because you don't see remembered terrain while underwater;
although the hero can attack an adjacent monster this way,
assume he can't reach out far enough to distinguish terrain */
Sprintf(buf, (Is_waterlevel(&u.uz) && levl[x][y].typ == AIR) ?
"an air bubble" : "nothing");
else if (solid)
/* glyph might indicate unseen terrain if hero is blind;
unlike searching, this won't reveal what that terrain is
(except for solid rock, where the glyph would otherwise
yield ludicrous "dark part of a room") */
Strcpy(buf, (levl[x][y].typ == STONE) ? "solid rock" :
glyph_is_cmap(glyph) ?
the(defsyms[glyph_to_cmap(glyph)].explanation) :
(const char *)"an unknown obstacle");
/* note: 'solid' is misleadingly named and catches pools
of water and lava as well as rock and walls */
else
Strcpy(buf, "thin air");
You("%s%s %s.",
!(boulder || solid) ? "" :
!explo ? "harmlessly " : "futilely ",
!(boulder || solid) ? "" : !explo ? "harmlessly " : "futilely ",
explo ? "explode at" : "attack",
buf);
unmap_object(x, y); /* known empty -- remove 'I' if present */
if (boulder) map_object(boulder, TRUE);
newsym(x, y);
nomul(0);
if (explo) {
wake_nearby();

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 objnam.c $NHDT-Date: 1426470349 2015/03/16 01:45:49 $ $NHDT-Branch: derek-farming $:$NHDT-Revision: 1.108 $ */
/* NetHack 3.5 objnam.c $NHDT-Date: 1429413519 2015/04/19 03:18:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.128 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -567,6 +567,10 @@ struct obj *obj;
!objects[otyp].oc_uses_known;
bareobj.quan = 1L; /* don't want plural */
bareobj.corpsenm = NON_PM; /* suppress statue and figurine details */
/* but suppressing fruit details leads to "bad fruit #0"
[perhaps we should force "slime mold" rather than use xname?] */
if (obj->otyp == SLIME_MOLD) bareobj.spe = obj->spe;
bufp = distant_name(&bareobj, xname); /* xname(&bareobj) */
if (!strncmp(bufp, "uncursed ", 9)) bufp += 9; /* Role_if(PM_PRIEST) */

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 pager.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 pager.c $NHDT-Date: 1429408230 2015/04/19 01:50:30 $ $NHDT-Branch: master $:$NHDT-Revision: 1.62 $ */
/* NetHack 3.5 pager.c $Date: 2012/01/15 09:27:06 $ $Revision: 1.41 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -273,8 +273,7 @@ lookat(x, y, buf, monbuf)
Strcpy(buf, Is_airlevel(&u.uz) ? "cloudy area" : "fog/vapor cloud");
break;
default:
if (glyph_is_cmap(glyph))
Strcpy(buf,defsyms[glyph_to_cmap(glyph)].explanation);
Strcpy(buf,defsyms[glyph_to_cmap(glyph)].explanation);
break;
}