Sting's glow while blind

Give an alternate message if Sting starts or stops glowing while the
hero can't see.  It probably ought to give an immediate message when
blindness toggles but that looks like it could get messy.

Having an 'o' die or migrate off level should probably also redo the
Sting message immediately, otherwise we see things like:
  The little dog kills the goblin.
  The little dog eats a goblin corpse.
  Sting stops glowing.
(There could be lots of additional intervening messages depending on
other monster activity at the time.)  Calling see_monsters() in the
relevant places--probably m_detach() and migrate_to_level()--would
address this but won't do because that could result in hallucinating
monsters changing appearance mid-turn.
This commit is contained in:
PatR
2015-05-28 18:36:51 -07:00
parent 777038d110
commit 29617ada12
2 changed files with 22 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 artifact.c $NHDT-Date: 1432512770 2015/05/25 00:12:50 $ $NHDT-Branch: master $:$NHDT-Revision: 1.86 $ */
/* NetHack 3.6 artifact.c $NHDT-Date: 1432863398 2015/05/29 01:36:38 $ $NHDT-Branch: master $:$NHDT-Revision: 1.87 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1813,11 +1813,24 @@ Sting_effects(orc_count)
int orc_count;
{
if (uwep && uwep->oartifact == ART_STING) {
if (orc_count > 0 && warn_obj_cnt == 0)
pline("%s %s %s!", bare_artifactname(uwep), otense(uwep, "glow"),
hcolor(NH_LIGHT_BLUE));
else if (orc_count == 0 && warn_obj_cnt > 0)
pline("%s stops glowing.", bare_artifactname(uwep));
/*
* Toggling blindness in between warning messages can result in
* Sting glows light blue! [...] Sting stops quivering.
* or
* Sting quivers slightly. [...] Sting stops glowing.
* but addressing that is far more trouble than it's worth.
*/
if (orc_count > 0 && warn_obj_cnt == 0) {
if (!Blind)
pline("%s %s %s!", bare_artifactname(uwep),
otense(uwep, "glow"),
hcolor(NH_LIGHT_BLUE));
else
pline("%s quivers slightly.", bare_artifactname(uwep));
} else if (orc_count == 0 && warn_obj_cnt > 0) {
pline("%s stops %s.", bare_artifactname(uwep),
!Blind ? "glowing" : "quivering");
}
}
}

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 display.c $NHDT-Date: 1432536528 2015/05/25 06:48:48 $ $NHDT-Branch: master $:$NHDT-Revision: 1.54 $ */
/* NetHack 3.6 display.c $NHDT-Date: 1432863399 2015/05/29 01:36:39 $ $NHDT-Branch: master $:$NHDT-Revision: 1.55 $ */
/* Copyright (c) Dean Luick, with acknowledgements to Kevin Darcy */
/* and Dave Cohrs, 1990. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1141,11 +1141,8 @@ see_monsters()
newsym(mon->mx, mon->my);
if (mon->wormno)
see_wsegs(mon);
if (MATCH_WARN_OF_MON(mon)) {
if (context.warntype.obj
&& (context.warntype.obj & mon->data->mflags2))
new_warn_obj_cnt++;
}
if (Warn_of_mon && (context.warntype.obj & mon->data->mflags2) != 0L)
new_warn_obj_cnt++;
}
/*
* Make Sting glow blue or stop glowing if required.