wand of stasis tweaks

When wand of stasis is zapped multiple times, keep the longest duration
rather than replace duration with each zap.

When current level is under the effect of a wand of stasis, have the
wizard-mode command #timeout say so.
This commit is contained in:
PatR
2026-04-12 21:03:21 -07:00
parent 8d6ab2f9ab
commit 7ed50f6ef8
2 changed files with 17 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 timeout.c $NHDT-Date: 1756531249 2025/08/29 21:20:49 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.205 $ */
/* NetHack 3.7 timeout.c $NHDT-Date: 1776080125 2026/04/13 03:35:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.207 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2112,6 +2112,14 @@ wiz_timeout_queue(void)
if (any_visible_region()) {
visible_region_summary(win);
}
if (svl.level.flags.stasis_until >= svm.moves) {
putstr(win, 0, "");
Sprintf(buf, "Level is no-teleport for %ld %s.",
svl.level.flags.stasis_until - svm.moves + 1L,
(svl.level.flags.stasis_until - svm.moves > 0L)
? "turns" : "more turn");
putstr(win, 0, buf);
}
display_nhwindow(win, FALSE);
destroy_nhwindow(win);

View File

@@ -2556,11 +2556,16 @@ zapnodir(struct obj *obj)
known = !!obj->dknown;
(void) findit();
break;
case WAN_STASIS:
case WAN_STASIS: {
long tmp_until = svm.moves + (long) rn1(21, 10);
/* no immediately obvious effect, and no message so that it isn't
distinguishable from other NODIR wands that produce no message */
svl.level.flags.stasis_until = svm.moves + rn1(21, 10);
distinguishable from other NODIR wands that produce no message;
for multiple zaps, keep the longest duration rather than latest */
if (tmp_until > svl.level.flags.stasis_until)
svl.level.flags.stasis_until = tmp_until;
break;
}
case WAN_CREATE_MONSTER:
/* create_critters() returns True iff hero sees a new monster appear */
if (create_critters(rn2(23) ? 1 : rn1(7, 2),