Sunsword vs <u.ux,u.uy>

Using #invoke on wielded or carried Sunsword and picking direction
'>' or '<' lights the hero's spot.  But setting levl[u.ux][u.uy].lit
was too simplistic.  Lighting on the Rogue Level operates on full
rooms when done inside a room and doesn't to anything with done in a
corridor.

litroom() gave inappropriate messages in a couple of special cases.
This commit is contained in:
PatR
2024-05-16 13:26:46 -07:00
parent 26b12f83fe
commit 6aa42750ad
2 changed files with 22 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 artifact.c $NHDT-Date: 1711734229 2024/03/29 17:43:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.230 $ */
/* NetHack 3.7 artifact.c $NHDT-Date: 1715889721 2024/05/16 20:02:01 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.236 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2013. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1930,11 +1930,14 @@ arti_invoke(struct obj *obj)
if (u.dx || u.dy) {
do_blinding_ray(obj);
} else if (u.dz) {
/* up or down; light this map spot */
levl[u.ux][u.uy].lit = 1;
pline("%s", ((Blind || levl[u.ux][u.uy].waslit)
? nothing_seems_to_happen
: "It is lit here now."));
/* up or down => light this map spot; litroom() uses
radius 0 for Sunsword, except on Rogue level where
whole room gets lit and corridor spots remain unlit */
litroom(TRUE, obj);
pline("%s", ((!Blind && levl[u.ux][u.uy].lit
&& !levl[u.ux][u.uy].waslit)
? "It is lit here now."
: nothing_seems_to_happen));
} else { /* zapyourself() */
boolean vulnerable = (u.umonnum == PM_GREMLIN);
int damg = obj->blessed ? 15 : !obj->cursed ? 10 : 5;