engraving vs drawbridge

From the newsgroup:  ``Something is engraved here on the water.''
An engraving written on a lowered drawbridge would be transfered to the
underlying terrain when the bridge was raised.  The coverse was also true;
if you plugged the moat and then engraved on the ground, that engraving
would remain visible--and touchable if blind--when the bridge was lowered
to cover its spot.  Rather than try to handle two different engravings at
the same coordinates (with one of those two changing locations when the
bridge is raised or lowered), this just wipes out any engraving at both
span and portcullis locations whenever the bridge state changes, like is
done for traps.
This commit is contained in:
nethack.rankin
2006-12-15 03:11:14 +00:00
parent 175e5b67f5
commit 1c70b6f777
2 changed files with 15 additions and 1 deletions

View File

@@ -287,6 +287,7 @@ don't give erroneous "<mon> disppears" message for hero poly'd into quantum
mechanic who hits engulfer while swallowed and blinded
feedback from casting spell of protection was wrong in some situations
can't engrave on floor while inside solid rock, wall, or closed door
remove engravings at drawbridge location when it is opened, closed, or wrecked
Platform- and/or Interface-Specific Fixes

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)dbridge.c 3.5 2005/12/05 */
/* SCCS Id: @(#)dbridge.c 3.5 2006/12/13 */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
@@ -8,6 +8,13 @@
*
* Added comprehensive monster-handling, and the "entity" structure to
* deal with players as well. - 11/89
*
* Any traps and/or engravings at either the portcullis or span location
* are destroyed whenever the bridge is lowered, raised, or destroyed.
* (Engraving handling could be extended to flag whether an engraving on
* the DB_UNDER surface is hidden by the lowered bridge, or one on the
* bridge itself is hidden because the bridge has been raised, but that
* seems like an awful lot of effort for very little gain.)
*/
#include "hack.h"
@@ -778,6 +785,8 @@ int x,y;
delallobj(x2, y2);
if ((t = t_at(x, y)) != 0) deltrap(t);
if ((t = t_at(x2, y2)) != 0) deltrap(t);
del_engr_at(x, y);
del_engr_at(x2, y2);
newsym(x, y);
newsym(x2, y2);
block_point(x2,y2); /* vision */
@@ -817,6 +826,8 @@ int x,y;
delallobj(x, y);
if ((t = t_at(x, y)) != 0) deltrap(t);
if ((t = t_at(x2, y2)) != 0) deltrap(t);
del_engr_at(x, y);
del_engr_at(x2, y2);
newsym(x, y);
newsym(x2, y2);
unblock_point(x2,y2); /* vision */
@@ -882,6 +893,8 @@ 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);
del_engr_at(x, y);
del_engr_at(x2, y2);
for (i = rn2(6); i > 0; --i) { /* scatter some debris */
/* doesn't matter if we happen to pick <x,y2> or <x2,y>;
since drawbridges are never placed diagonally, those