wand of secret door detection discovery

Since wand of secret door detection now gives feedback even when it
fails to find anything, always discover it.

Some of the other zapnodir() wands had suspect discoveries.
This commit is contained in:
PatR
2024-09-05 01:54:17 -07:00
parent cd19f84721
commit 74981d9ff2
+24 -15
View File
@@ -2483,7 +2483,7 @@ do_enlightenment_effect(void)
/* /*
* zapnodir - zaps a NODIR wand/spell. * zapnodir - zaps a NODIR wand/spell.
* added by GAN 11/03/86 * Won't get here if wand has no charges (unless wresting 1 last charge).
*/ */
void void
zapnodir(struct obj *obj) zapnodir(struct obj *obj)
@@ -2493,36 +2493,45 @@ zapnodir(struct obj *obj)
switch (obj->otyp) { switch (obj->otyp) {
case WAN_LIGHT: case WAN_LIGHT:
case SPE_LIGHT: case SPE_LIGHT:
/* FIXME? wand of light becoming discovered should be contingent upon
seeing at least one previously unlit spot become lit */
known = (obj->dknown && !Blind);
litroom(TRUE, obj); litroom(TRUE, obj);
if (!Blind) (void) lightdamage(obj, TRUE, 5);
known = TRUE;
if (lightdamage(obj, TRUE, 5))
known = TRUE;
break; break;
case WAN_SECRET_DOOR_DETECTION: case WAN_SECRET_DOOR_DETECTION:
case SPE_DETECT_UNSEEN: case SPE_DETECT_UNSEEN:
if (!findit()) /* findit() gives sufficient feedback to discover the wand even when
return; blinded or when it fails to find anything */
if (!Blind) known = !!obj->dknown;
known = TRUE; (void) findit();
break; break;
case WAN_CREATE_MONSTER: case WAN_CREATE_MONSTER:
known = create_critters(rn2(23) ? 1 : rn1(7, 2), /* create_critters() returns True iff hero sees a new monster appear */
(struct permonst *) 0, FALSE); if (create_critters(rn2(23) ? 1 : rn1(7, 2),
(struct permonst *) 0, FALSE))
known = !!obj->dknown;
break; break;
case WAN_WISHING: case WAN_WISHING:
known = TRUE;
if (Luck + rn2(5) < 0) { if (Luck + rn2(5) < 0) {
pline("Unfortunately, nothing happens."); pline("Unfortunately, nothing happens.");
break; known = FALSE;
} else {
known = !!obj->dknown;
/* wand of wishing asks player what to wish for so always becomes
discovered (unless it hasn't been seen) */
makewish();
} }
makewish();
break; break;
case WAN_ENLIGHTENMENT: case WAN_ENLIGHTENMENT:
known = TRUE; known = !!obj->dknown;
/* do_enlightenmnt_effect() always describes enlightenment */
do_enlightenment_effect(); do_enlightenment_effect();
break; break;
default:
break;
} }
if (known) { if (known) {
if (!objects[obj->otyp].oc_name_known) if (!objects[obj->otyp].oc_name_known)
more_experienced(0, 10); more_experienced(0, 10);