helmets don't protect against cockatrice eggs thrown straight up
breaking container contents in a shop didn't always charge for them
some types of shop theft of a stack of items only charged for a single one
+wizard mode: WIZKIT wish for own quest artifact triggered crash at startup
Platform- and/or Interface-Specific Fixes
-/* SCCS Id: @(#)decl.h 3.4 2001/12/10 */
+/* SCCS Id: @(#)decl.h 3.4 2004/11/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
#ifdef PANICLOG
int in_paniclog;
#endif
+#ifdef WIZARD
+ int wizkit_wishing;
+#endif
} program_state;
E boolean restoring;
E char *FDECL(bare_artifactname, (struct obj *));
E char *FDECL(makeplural, (const char *));
E char *FDECL(makesingular, (const char *));
-E struct obj *FDECL(readobjnam, (char *,struct obj *,BOOLEAN_P));
+E struct obj *FDECL(readobjnam, (char *,struct obj *));
E int FDECL(rnd_class, (int,int));
E const char *FDECL(cloak_simple_name, (struct obj *));
E const char *FDECL(helm_simple_name, (struct obj *));
-/* SCCS Id: @(#)files.c 3.4 2003/11/14 */
+/* SCCS Id: @(#)files.c 3.4 2004/11/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
if (!wizard || !(fp = fopen_wizkit_file())) return;
+ program_state.wizkit_wishing = 1;
while (fgets(buf, (int)(sizeof buf), fp)) {
ep = index(buf, '\n');
if (skip) { /* in case previous line was too long */
else *ep = '\0'; /* remove newline */
if (buf[0]) {
- otmp = readobjnam(buf, (struct obj *)0, FALSE);
+ otmp = readobjnam(buf, (struct obj *)0);
if (otmp) {
if (otmp != &zeroobj)
otmp = addinv(otmp);
}
}
}
+ program_state.wizkit_wishing = 0;
if (bad_items)
wait_synch();
(void) fclose(fp);
{ "candle", TOOL_CLASS, TALLOW_CANDLE, WAX_CANDLE },
{ "horn", TOOL_CLASS, TOOLED_HORN, HORN_OF_PLENTY },
{ "shield", ARMOR_CLASS, SMALL_SHIELD, SHIELD_OF_REFLECTION },
+ { "hat", ARMOR_CLASS, FEDORA, DUNCE_CAP },
{ "helm", ARMOR_CLASS, ELVEN_LEATHER_HELM, HELM_OF_TELEPATHY },
{ "gloves", ARMOR_CLASS, LEATHER_GLOVES, GAUNTLETS_OF_DEXTERITY },
{ "gauntlets", ARMOR_CLASS, LEATHER_GLOVES, GAUNTLETS_OF_DEXTERITY },
{ "lantern", BRASS_LANTERN },
{ "mattock", DWARVISH_MATTOCK },
{ "amulet of poison resistance", AMULET_VERSUS_POISON },
+ { "potion of sleep", POT_SLEEPING },
{ "stone", ROCK },
#ifdef TOURIST
{ "camera", EXPENSIVE_CAMERA },
{ "can opener", TIN_OPENER },
{ "kelp", KELP_FROND },
{ "eucalyptus", EUCALYPTUS_LEAF },
+ { "hook", GRAPPLING_HOOK },
+ { "grappling iron", GRAPPLING_HOOK },
+ { "grapnel", GRAPPLING_HOOK },
{ "grapple", GRAPPLING_HOOK },
{ (const char *)0, 0 },
};
* if asking explicitly for "nothing" (or "nil") return no_wish;
* if not an object return &zeroobj; if an error (no matching object),
* return null.
- * If from_user is false, we're reading from the wizkit, nothing was typed in.
*/
struct obj *
-readobjnam(bp, no_wish, from_user)
+readobjnam(bp, no_wish)
register char *bp;
struct obj *no_wish;
-boolean from_user;
{
register char *p;
register int i;
) cnt=5000;
if (cnt < 1) cnt=1;
#ifndef GOLDOBJ
- if (from_user)
- pline("%d gold piece%s.", cnt, plur(cnt));
+ pline("%d gold piece%s.", cnt, plur(cnt));
u.ugold += cnt;
context.botl=1;
return (&zeroobj);
}
}
#ifdef WIZARD
- /* Let wizards wish for traps --KAA */
- /* must come after objects check so wizards can still wish for
- * trap objects like beartraps
+ /* Let wizards wish for traps and furniture.
+ * Must come after objects check so wizards can still wish for
+ * trap objects like beartraps.
+ * Disallow such topology tweaks for WIZKIT startup wishes.
*/
- if (wizard && from_user) {
+ if (wizard && !program_state.wizkit_wishing) {
int trap;
for (trap = NO_TRAP+1; trap < TRAPNUM; trap++) {
return(&zeroobj);
}
}
- /* or some other dungeon features -dlc */
+
+ /* furniture and terrain */
p = eos(bp);
if(!BSTRCMP(bp, p-8, "fountain")) {
levl[u.ux][u.uy].typ = FOUNTAIN;
if (oclass == VENOM_CLASS) otmp->spe = 1;
#endif
- if (spesgn == 0) spe = otmp->spe;
+ if (spesgn == 0) {
+ spe = otmp->spe;
#ifdef WIZARD
- else if (wizard) /* no alteration to spe */ ;
+ } else if (wizard) {
+ ; /* no alteration to spe */
#endif
- else if (oclass == ARMOR_CLASS || oclass == WEAPON_CLASS ||
+ } else if (oclass == ARMOR_CLASS || oclass == WEAPON_CLASS ||
is_weptool(otmp) ||
(oclass==RING_CLASS && objects[typ].oc_charged)) {
if(spe > rnd(5) && spe > otmp->spe) spe = 0;
-/* SCCS Id: @(#)pline.c 3.4 2003/11/06 */
+/* SCCS Id: @(#)pline.c 3.4 2004/11/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
/* Do NOT use VA_START and VA_END in here... see above */
if (!line || !*line) return;
+#ifdef WIZARD
+ if (program_state.wizkit_wishing) return;
+#endif
+
if (index(line, '%')) {
Vsprintf(pbuf,line,VA_ARGS);
line = pbuf;
-/* SCCS Id: @(#)questpgr.c 3.4 2000/05/05 */
+/* SCCS Id: @(#)questpgr.c 3.4 2004/11/22 */
/* Copyright 1991, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
STATIC_DCL void NDECL(convert_line);
STATIC_DCL void FDECL(deliver_by_pline, (struct qtmsg *));
STATIC_DCL void FDECL(deliver_by_window, (struct qtmsg *,int));
+STATIC_DCL boolean FDECL(skip_pager, (BOOLEAN_P));
static char in_line[80], cvt_buf[64], out_line[128];
static struct qtlists qt_list;
destroy_nhwindow(datawin);
}
+boolean
+skip_pager(common)
+boolean common;
+{
+#ifdef WIZARD
+ /* WIZKIT: suppress plot feedback if starting with quest artifact */
+ if (program_state.wizkit_wishing) return TRUE;
+#endif
+ if (!(common ? qt_list.common : qt_list.chrole)) {
+ panic("%s: no %s quest text data available",
+ common ? "com_pager" : "qt_pager",
+ common ? "common" : "role-specific");
+ /*NOTREACHED*/
+ return TRUE;
+ }
+ return FALSE;
+}
+
void
com_pager(msgnum)
int msgnum;
{
struct qtmsg *qt_msg;
+ if (skip_pager(TRUE)) return;
+
if (!(qt_msg = msg_in(qt_list.common, msgnum))) {
impossible("com_pager: message %d not found.", msgnum);
return;
{
struct qtmsg *qt_msg;
+ if (skip_pager(FALSE)) return;
+
if (!(qt_msg = msg_in(qt_list.chrole, msgnum))) {
impossible("qt_pager: message %d not found.", msgnum);
return;
-/* SCCS Id: @(#)zap.c 3.4 2004/09/10 */
+/* SCCS Id: @(#)zap.c 3.4 2004/11/22 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
* has been denied. Wishing for "nothing" requires a separate
* value to remain distinct.
*/
- otmp = readobjnam(buf, ¬hing, TRUE);
+ otmp = readobjnam(buf, ¬hing);
if (!otmp) {
pline("Nothing fitting that description exists in the game.");
if (++tries < 5) goto retry;
pline(thats_enough_tries);
- otmp = readobjnam((char *)0, (struct obj *)0, TRUE);
+ otmp = readobjnam((char *)0, (struct obj *)0);
if (!otmp) return; /* for safety; should never happen */
} else if (otmp == ¬hing) {
/* explicitly wished for "nothing", presumeably attempting