bag of tricks, horn of plenty, #tip (trunk only)

<Someone> reported that he applied an unID'd bag and it became
discovered as a bag of tricks even though a spellbook appeared on the floor
next to him rather than having a monster show up (the monster was a mimic).
Suppress the bag discovery unless you can see or sense a monster appear.
(This doesn't really achieve much for most players, who'll recognize the
bag because they know that only one type of container doesn't prompt to
take things out and/or put things in, but I think it does make sense.)

     While mucking with bag of tricks I decided that to be consistent with
the behavior of other containers, the #tip command should release all the
monsters in the bag instead of just one.

     And after doing that, I realized that horn of plenty ought to behave
much the same, so #tip will operate on it now.  However, it won't be listed
as a likely candidate in the "which item?" prompt unless/until it has been
discovered.  (Attempting to empty any other type of horn yields "nothing
happens", same as for a horn of plenty with no charges left.)  Emptying a
horn of plenty in a shop can be extremely verbose, but I don't think that
qualifies as a bug and don't currently have any plans to alter it.
This commit is contained in:
nethack.rankin
2006-06-18 05:20:36 +00:00
parent e79a41ccb6
commit 58137a608a
8 changed files with 138 additions and 62 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)shk.c 3.5 2006/05/20 */
/* SCCS Id: @(#)shk.c 3.5 2006/06/17 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3897,7 +3897,8 @@ boolean altusage; /* some items have an "alternate" use with different cost */
tmp /= 2L;
} else if(otmp->otyp == BAG_OF_TRICKS || /* 1 - 20 */
otmp->otyp == HORN_OF_PLENTY) {
tmp /= 5L;
/* altusage: emptying of all the contents at once */
if (!altusage) tmp /= 5L;
} else if(otmp->otyp == CRYSTAL_BALL || /* 1 - 5 */
otmp->otyp == OIL_LAMP || /* 1 - 10 */
otmp->otyp == BRASS_LANTERN ||
@@ -3949,16 +3950,22 @@ boolean altusage;
arg2 = ESHK(shkp)->debit > 0L ? " an additional" : "";
} else if (otmp->otyp == POT_OIL) {
fmt = "%s%sThat will cost you %ld %s (Yendorian Fuel Tax).";
} else if (altusage &&
(otmp->otyp == BAG_OF_TRICKS || otmp->otyp == HORN_OF_PLENTY)) {
fmt = "%s%sEmptying that will cost you %ld %s.";
if (!rn2(3)) arg1 = "Whoa! ";
if (!rn2(3)) arg1 = "Watch it! ";
} else {
fmt = "%s%sUsage fee, %ld %s.";
if (!rn2(3)) arg1 = "Hey! ";
if (!rn2(3)) arg2 = "Ahem. ";
}
if (shkp->mcanmove || !shkp->msleeping)
if (!muteshk(shkp)) {
verbalize(fmt, arg1, arg2, tmp, currency(tmp));
exercise(A_WIS, TRUE); /* you just got info */
}
ESHK(shkp)->debit += tmp;
exercise(A_WIS, TRUE); /* you just got info */
}
/* for using charges of unpaid objects "used in the normal manner" */