From: nethack.rankin Date: Tue, 17 Jul 2007 01:07:37 +0000 (+0000) Subject: extremely porous boulders (trunk only) X-Git-Tag: MOVE2GIT~542 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f17e97bac604e0fcb9fe39dd07b08e1600aba865;p=nethack extremely porous boulders (trunk only) This is another item from "#Q397: List of Bugs from #nethack" sent in Janurary by and containing a list of things collected from the IRC channel associated with nethack.alt.org's public server. Using F prefix and moving toward a boulder would give "You attack thin air." Now that'll be "You harmlessly attack a boulder." --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 235f1e552..690e5fddf 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -258,6 +258,7 @@ can't swap places with tame grid bug when moving diagonally can't move diagonally through a long worm's body (can still fight that way) require confirmation to read a scroll of mail if doing so will be the first violation of illiteracy conduct +using F to force an attack towards a boulder gave "you attack thin air" Platform- and/or Interface-Specific Fixes diff --git a/src/hack.c b/src/hack.c index d95b4c38a..252d26372 100644 --- a/src/hack.c +++ b/src/hack.c @@ -1203,17 +1203,28 @@ 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); boolean explo = (Upolyd && attacktype(youmonst.data, AT_EXPL)); - char buf[BUFSZ]; - Sprintf(buf,"a vacant spot on the %s", surface(x,y)); - You("%s %s.", + char buf[BUFSZ]; + + if (boulder) + Strcpy(buf, ansimpleoname(boulder)); + 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)); + You("%s%s %s.", + !boulder ? "" : !explo ? "harmlessly " : "futilely ", explo ? "explode at" : "attack", - !Underwater ? "thin air" : - is_pool(x,y) ? "empty water" : buf); + 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(); u.mh = -1; /* dead in the current form */ rehumanize(); }