From: nethack.rankin Date: Tue, 6 Dec 2005 03:19:33 +0000 (+0000) Subject: drawbridge feedback X-Git-Tag: MOVE2GIT~1191 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c394330208a5b559560b8b7638f6945b9463e6f0;p=nethack drawbridge feedback From a bug report: playing mastermind with the castle drawbridge yields a sequence of "you hear tumblers click and gears turn" messages when the notes are partly right, but no sound when all notes are right and you succeed in opening the bridge. Blinded hero won't know that it has opened and could reasonably expect to have heard 5 gears turning. This gives a general gears turning message (for any bridge changed by any means, not just castle's tune) when it opens or closes out of view of the hero. So, you get a message about seeing it open when that is the case, or about hearing gears if you can hear but not see, or no feedback if you can't see it or hear it (You_hear() is a no-op when you're deaf). Also, scatter some iron chains when a drawbridge gets destroyed. Iron chain seems to be the only really suitable item available for bridge debris. --- diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 8c8b5e079..300998f01 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -166,6 +166,7 @@ several quest messages were worded inappropriately if the hero was blind a samurai quest guardian message used "ninja" where "ronin" was intended revive from fainting if vault guard or bribe-demanding demon approaches tame flaming spheres and shocking spheres shouldn't pick up items +can hear the opening or closing of an unseen drawbridge Platform- and/or Interface-Specific Fixes @@ -195,6 +196,7 @@ Fire Brand and Frost Brand have a chance to avoid taking rust damage support ^R (and ^L in numpad mode) to request display repaint during direction choosing and location choosing prompting modes intelligent pets will use keys to unlock doors +destroyed drawbridge leaves some iron chains Platform- and/or Interface-Specific New Features diff --git a/src/dbridge.c b/src/dbridge.c index 0f117fd15..48d421bec 100644 --- a/src/dbridge.c +++ b/src/dbridge.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dbridge.c 3.5 2005/06/22 */ +/* SCCS Id: @(#)dbridge.c 3.5 2005/12/05 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -749,6 +749,8 @@ int x,y; You_see("a drawbridge %s up!", (((u.ux == x || u.uy == y) && !Underwater) || distu(x2,y2) < distu(x,y)) ? "coming" : "going"); + else /* "5 gears turn" for castle drawbridge tune */ + You_hear("chains rattling and gears turning."); lev1->typ = DRAWBRIDGE_UP; lev2 = &levl[x2][y2]; lev2->typ = DBWALL; @@ -800,6 +802,8 @@ int x,y; if (cansee(x,y) || cansee(x2,y2)) You_see("a drawbridge %s down!", (distu(x2,y2) < distu(x,y)) ? "going" : "coming"); + else /* "5 gears turn" for castle drawbridge tune */ + You_hear("gears turning and chains rattling."); lev1->typ = DRAWBRIDGE_DOWN; lev2 = &levl[x2][y2]; lev2->typ = DOOR; @@ -829,7 +833,8 @@ int x,y; { register struct rm *lev1, *lev2; struct trap *t; - int x2, y2; + struct obj *otmp; + int x2, y2, i; boolean e_inview; struct entity *etmp1 = &(occupants[0]), *etmp2 = &(occupants[1]); @@ -877,6 +882,17 @@ int x,y; lev2->doormask = D_NODOOR; if ((t = t_at(x, y)) != 0) deltrap(t); if ((t = t_at(x2, y2)) != 0) deltrap(t); + for (i = rn2(6); i > 0; --i) { /* scatter some debris */ + /* doesn't matter if we happen to pick or ; + since drawbridges are never placed diagonally, those + pairings will always match one of or */ + otmp = mksobj_at(IRON_CHAIN, + rn2(2) ? x : x2, rn2(2) ? y : y2, + TRUE, FALSE); + /* a force of 5 here would yield a radius of 2 for + iron chain; anything less produces a radius of 1 */ + (void) scatter(otmp->ox, otmp->oy, 1, MAY_HIT, otmp); + } newsym(x,y); newsym(x2,y2); if (!does_block(x2,y2,lev2)) unblock_point(x2,y2); /* vision */