* GDBPATH (the path to the system gdb(1) program)
*/
-#ifndef WIZARD /* allow for compile-time or Makefile changes */
-# ifndef KR1ED
-# define WIZARD "wizard" /* the person allowed to use the -D option */
+#ifndef WIZARD_NAME /* allow for compile-time or Makefile changes */
+# define WIZARD_NAME "wizard"
+#endif
+
/* #define SYSCF */ /* use a global configuration */
/* #define SYSCF_FILE "sysconf" */ /* global configuration is in a file */
-# else
-# define WIZARD
-# define WIZARD_NAME "wizard"
-# endif
-#endif
#ifndef GDBPATH
# define GDBPATH "/usr/bin/gdb"
#ifdef PANICLOG
int in_paniclog;
#endif
-#ifdef WIZARD
int wizkit_wishing;
-#endif
} program_state;
E boolean restoring;
E int NDECL(doprev_message);
E int NDECL(timed_occupation);
E int NDECL(doattributes);
-# ifdef WIZARD
E int NDECL(wiz_detect);
E int NDECL(wiz_genesis);
E int NDECL(wiz_identify);
E int NDECL(wiz_map);
E int NDECL(wiz_where);
E int NDECL(wiz_wish);
-# endif /* WIZARD */
#endif /* USE_TRAMPOLI */
E void NDECL(reset_occupations);
E void FDECL(set_occupation, (int (*)(void),const char *,int));
E void FDECL(pushch, (CHAR_P));
E void FDECL(savech, (CHAR_P));
#endif
-#ifdef WIZARD
E void NDECL(add_debug_extended_commands);
-#endif /* WIZARD */
E void FDECL(reset_commands, (BOOLEAN_P));
E void FDECL(rhack, (char *));
E int NDECL(doextlist);
E void NDECL(end_of_input);
#endif
E char NDECL(readchar);
-#ifdef WIZARD
E void NDECL(sanity_check);
-#endif
E char FDECL(yn_function, (const char *, const char *, CHAR_P));
E boolean FDECL(paranoid_query, (BOOLEAN_P,const char *));
E boolean FDECL(Invocation_lev, (d_level *));
E xchar NDECL(level_difficulty);
E schar FDECL(lev_by_name, (const char *));
-#ifdef WIZARD
E schar FDECL(print_dungeon, (BOOLEAN_P,schar *,xchar *));
-#endif
E int NDECL(donamelevel);
E int NDECL(dooverview);
E void FDECL(show_overview, (int,int));
#ifdef INSURANCE
E void FDECL(save_savefile_name, (int));
#endif
-#if defined(WIZARD) && !defined(MICRO)
+#ifndef MICRO
E void NDECL(set_error_savefile);
#endif
E int NDECL(create_savefile);
#endif
E boolean FDECL(read_config_file, (const char *, int));
E void FDECL(check_recordfile, (const char *));
-#if defined(WIZARD)
E void NDECL(read_wizkit);
-#endif
#ifdef LOADSYMSETS
E int FDECL(read_sym_file, (int));
E int FDECL(parse_sym_line, (char *,int));
E int FDECL(candle_light_range, (struct obj *));
E int FDECL(arti_light_radius, (struct obj *));
E const char *FDECL(arti_light_description, (struct obj *));
-#ifdef WIZARD
E int NDECL(wiz_light_sources);
-#endif
/* ### lock.c ### */
E void FDECL(obj_ice_effects, (int, int, BOOLEAN_P));
E long FDECL(peek_at_iced_corpse_age, (struct obj *));
E int FDECL(hornoplenty, (struct obj *,BOOLEAN_P));
-#ifdef WIZARD
E void NDECL(obj_sanity_check);
-#endif
/* ### mkroom.c ### */
E void FDECL(punish, (struct obj *));
E void NDECL(unpunish);
E boolean FDECL(cant_revive, (int *,BOOLEAN_P,struct obj *));
-#ifdef WIZARD
E boolean NDECL(create_particular);
-#endif
/* ### rect.c ### */
E void FDECL(save_oracles, (int,int));
E void FDECL(restore_oracles, (int));
E int FDECL(doconsult, (struct monst *));
-#ifdef WIZARD
E void NDECL(rumor_check);
-#endif
/* ### save.c ### */
E void FDECL(save_timers, (int,int,int));
E void FDECL(restore_timers, (int,int,BOOLEAN_P,long));
E void FDECL(relink_timers, (BOOLEAN_P));
-#ifdef WIZARD
E int NDECL(wiz_timeout_queue);
E void NDECL(timer_sanity_check);
-#endif
/* ### topten.c ### */
coord travelcc; /* coordinates for travel_cache */
boolean window_inited; /* true if init_nhwindows() completed */
boolean vision_inited; /* true if vision is ready */
-#ifdef WIZARD
boolean sanity_check; /* run sanity checks */
boolean mon_polycontrol; /* debug: control monster polymorphs */
-#endif
/* stuff that is related to options and/or user or platform preferences */
unsigned msg_history; /* hint: # of top lines to save */
int menu_headings; /* ATR for menu headings */
#define doprev_message() doprev_message_()
#define timed_occupation() timed_occupation_()
#define wiz_attributes() wiz_attributes_()
-#ifdef WIZARD
#define wiz_detect() wiz_detect_()
#define wiz_genesis() wiz_genesis_()
#define wiz_identify() wiz_identify_()
#define wiz_map() wiz_map_()
#define wiz_where() wiz_where_()
#define wiz_wish() wiz_wish_()
-#endif
/* ### display.c ### */
#define doredraw() doredraw_()
#ifdef HACKDIR
# undef HACKDIR
#endif
-#ifdef WIZARD
-# undef WIZARD
-#endif
#ifdef WIZARD_NAME
# undef WIZARD_NAME
#endif
#define HACKDIR Local_HACKDIR
-#ifndef KR1ED
-# define WIZARD Local_WIZARD
-# define WIZARD_NAME WIZARD
-#else
-# define WIZARD 1
-# define WIZARD_NAME Local_WIZARD
-#endif
+#define WIZARD_NAME Local_WIZARD
#ifndef SYSCF
# define SYSCF
#endif
monstr_init(); /* monster strengths */
objects_init();
-#ifdef WIZARD
if (wizard) add_debug_extended_commands();
-#endif
/* if a save file created in normal mode is now being restored in
explore mode, treat it as normal restore followed by 'X' command
continue;
}
-#ifdef WIZARD
if (iflags.sanity_check)
sanity_check();
-#endif
#ifdef CLIPPING
/* just before rhack */
mklev();
u_on_upstairs();
-#ifdef WIZARD
if (wizard) obj_delivery(FALSE); /* finish wizkit */
-#endif
vision_reset(); /* set up internals for level (after mklev) */
check_special_room(FALSE);
/*
* Restrict the source of the attributes just to debug mode for now
*/
-#ifdef WIZARD
if (wizard) {
static NEARDATA const char because_of[] = " because of %s";
}
} /*wizard*/
-#endif
return buf;
}
if(depth(&u.uz) <= 0 || /* bulletproofing for endgame */
(!rn2(1 + (depth(&u.uz)>>2)) /* fewer ghosts on low levels */
-#ifdef WIZARD
- && !wizard
-#endif
- )) return FALSE;
+ && !wizard)) return FALSE;
/* don't let multiple restarts generate multiple copies of objects
* in bones files */
if (discover) return FALSE;
fd = open_bonesfile(&u.uz, &bonesid);
if (fd >= 0) {
(void) close(fd);
-#ifdef WIZARD
if (wizard) {
if (yn("Bones file already exists. Replace it?") == 'y') {
if (delete_bonesfile(&u.uz)) goto make_bones;
else pline("Cannot unlink old bones.");
}
}
-#endif
/* compression can change the file's name, so must
wait until after any attempt to delete this file */
compress_bonesfile();
return;
}
-#ifdef WIZARD
make_bones:
-#endif
unleash_all();
/* in case these characters are not in their home bases */
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
fd = create_bonesfile(&u.uz, &bonesid, whynot);
if(fd < 0) {
-#ifdef WIZARD
if(wizard)
pline1(whynot);
-#endif
/* bones file creation problems are silent to the player.
* Keep it that way, but place a clue into the paniclog.
*/
savefruitchn(fd, COUNT_SAVE);
bflush(fd);
if (bytes_counted > freediskspace(bones)) { /* not enough room */
-# ifdef WIZARD
if (wizard)
pline("Insufficient space to create bones file.");
-# endif
(void) close(fd);
cancel_bonesfile();
return;
/* wizard check added by GAN 02/05/87 */
if(rn2(3) /* only once in three times do we find bones */
-#ifdef WIZARD
&& !wizard
-#endif
) return(0);
if(no_bones_level(&u.uz)) return(0);
fd = open_bonesfile(&u.uz, &bonesid);
if (fd < 0) return(0);
if (validate(fd, bones) != 0) {
-#ifdef WIZARD
if (!wizard)
-#endif
pline("Discarding unuseable bones; no need to panic...");
ok = FALSE;
} else {
ok = TRUE;
-#ifdef WIZARD
if(wizard) {
if(yn("Get bones?") == 'n') {
(void) close(fd);
return(0);
}
}
-#endif
mread(fd, (genericptr_t) &c, sizeof c); /* length incl. '\0' */
mread(fd, (genericptr_t) oldbonesid, (unsigned) c); /* DD.nnn */
if (strcmp(bonesid, oldbonesid) != 0) {
Sprintf(errbuf, "This is bones level '%s', not '%s'!",
oldbonesid, bonesid);
-#ifdef WIZARD
if (wizard) {
pline1(errbuf);
ok = FALSE; /* won't die of trickery */
}
-#endif
trickery(errbuf);
} else {
register struct monst *mtmp;
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (has_mname(mtmp)) sanitize_name(MNAME(mtmp));
if (mtmp->mhpmax == DEFUNCT_MONSTER) {
-#if defined(DEBUG) && defined(WIZARD)
+#if defined(DEBUG)
if (wizard)
pline("Removing defunct monster %s from bones.",
mtmp->data->mname);
(void) close(fd);
sanitize_engravings();
-#ifdef WIZARD
if(wizard) {
if(yn("Unlink bones?") == 'n') {
compress_bonesfile();
return(ok);
}
}
-#endif
if (!delete_bonesfile(&u.uz)) {
/* When N games try to simultaneously restore the same
* bones file, N-1 of them will fail to delete it
STATIC_PTR int NDECL(dooverview_or_wiz_where);
STATIC_PTR int NDECL(dotravel);
STATIC_PTR int NDECL(doterrain);
-# ifdef WIZARD
STATIC_PTR int NDECL(wiz_wish);
STATIC_PTR int NDECL(wiz_identify);
STATIC_PTR int NDECL(wiz_map);
# endif
STATIC_PTR int NDECL(wiz_rumor_check);
STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*))));
-# endif /* WIZARD */
STATIC_PTR int NDECL(doattributes);
STATIC_PTR int NDECL(doconduct); /**/
enter_explore_mode(VOID_ARGS)
{
if (wizard) {
-#ifdef WIZARD
You("are in debug mode.");
-#endif
} else if (discover) {
You("are already in explore mode.");
} else {
STATIC_PTR int
dooverview_or_wiz_where(VOID_ARGS)
{
-#ifdef WIZARD
if (wizard) return wiz_where();
- else
-#endif
- dooverview();
+ else dooverview();
return 0;
}
-#ifdef WIZARD
-
/* ^W command - wish for something */
STATIC_PTR int
wiz_wish(VOID_ARGS) /* Unlimited wishes for debug mode by Paul Polderman */
rumor_check();
return 0;
}
-#endif /* WIZARD */
/* #terrain command */
STATIC_PTR int
add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
"full map without monsters, objects, and traps",
MENU_UNSELECTED);
-#ifdef WIZARD
if (wizard) {
any.a_int = 3;
add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
"legend of base-36 levl[][].typ codes",
MENU_UNSELECTED);
}
-#endif
end_menu(men, "View which?");
n = select_menu(men, PICK_ONE, &sel);
switch (which) {
case 1: reveal_terrain(FALSE); break; /* known map */
case 2: reveal_terrain(TRUE); break; /* full map */
-#ifdef WIZARD
case 3: wiz_map_levltyp(); break; /* map internals */
case 4: wiz_levltyp_legend(); break; /* internal details */
-#endif
default: break;
}
return 0; /* no time elapses */
you_are("buried", "");
} else {
Strcpy(buf, "being strangled");
-#ifdef WIZARD
if (wizard) Sprintf(eos(buf), " (%ld)", (Strangled & TIMEOUT));
-#endif
you_are(buf, from_what(STRANGLED));
}
}
} /* (u.utrap) */
if (u.uswallow) {
Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
-#ifdef WIZARD
if (wizard) Sprintf(eos(buf), " (%u)", u.uswldtim);
-#endif
you_are(buf, "");
} else if (u.ustuck) {
Sprintf(buf, "%s %s",
/* when mounted, Wounded_legs applies to steed rather than to
hero; we only report steed's wounded legs in wizard mode */
if (u.usteed) { /* not `Riding' here */
-# ifdef WIZARD
if (wizard) {
Strcpy(buf, steedname);
*buf = highc(*buf);
enl_msg(buf, " has", " had", " wounded legs", "");
}
-# endif
} else {
Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
you_have(buf, "");
if (Sleepy) {
if (magic || cause_known(SLEEPY)) {
Strcpy(buf, from_what(SLEEPY));
-#ifdef WIZARD
if (wizard) Sprintf(eos(buf), " (%ld)", (HSleepy & TIMEOUT));
-#endif
enl_msg("You ", "fall", "fell", " asleep uncontrollably", buf);
}
}
else if (u.ualign.record >= -3) you_have("strayed","");
else if (u.ualign.record >= -8) you_have("sinned","");
else you_have("transgressed","");
-#ifdef WIZARD
if (wizard) {
Sprintf(buf, " %d", u.ualign.record);
enl_msg("Your alignment ", "is", "was", buf, "");
}
-#endif
/*** Resistances to troubles ***/
if (Invulnerable) you_are("invulnerable",from_what(INVULNERABLE));
if (Upolyd) {
if (u.umonnum == u.ulycn) Strcpy(buf, "in beast form");
else Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname));
-#ifdef WIZARD
if (wizard) Sprintf(eos(buf), " (%d)", u.mtimedone);
-#endif
you_are(buf,"");
if (lays_eggs(youmonst.data) && flags.female)
you_can("lay eggs", "");
Sprintf(buf, "%s%slucky",
ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
Luck < 0 ? "un" : "");
-#ifdef WIZARD
if (wizard) Sprintf(eos(buf), " (%d)", Luck);
-#endif
you_are(buf,"");
- }
-#ifdef WIZARD
- else if (wizard) enl_msg("Your luck ", "is", "was", " zero","");
-#endif
+ } else if (wizard) enl_msg("Your luck ", "is", "was", " zero","");
if (u.moreluck > 0) you_have("extra luck","");
else if (u.moreluck < 0) you_have("reduced luck","");
if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
if (u.ugangr) {
Sprintf(buf, " %sangry with you",
u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
-#ifdef WIZARD
if (wizard) Sprintf(eos(buf), " (%d)", u.ugangr);
-#endif
enl_msg(u_gname(), " is", " was", buf,"");
} else
/*
#else
Sprintf(buf, "%ssafely pray", can_pray(FALSE) ? "" : "not ");
#endif
-#ifdef WIZARD
if (wizard) Sprintf(eos(buf), " (%d)", u.ublesscnt);
-#endif
you_can(buf,"");
}
if (wizard) {
if (!u.uconduct.weaphit)
you_have_never("hit with a wielded weapon");
-#ifdef WIZARD
else if (wizard) {
Sprintf(buf, "used a wielded weapon %ld time%s",
u.uconduct.weaphit, plur(u.uconduct.weaphit));
you_have_X(buf);
}
-#endif
if (!u.uconduct.killer)
you_have_been("a pacifist");
if (!u.uconduct.literate)
you_have_been("illiterate");
-#ifdef WIZARD
else if (wizard) {
Sprintf(buf, "read items or engraved %ld time%s",
u.uconduct.literate, plur(u.uconduct.literate));
you_have_X(buf);
}
-#endif
ngenocided = num_genocides();
if (ngenocided == 0) {
if (!u.uconduct.polypiles)
you_have_never("polymorphed an object");
-#ifdef WIZARD
else if (wizard) {
Sprintf(buf, "polymorphed %ld item%s",
u.uconduct.polypiles, plur(u.uconduct.polypiles));
you_have_X(buf);
}
-#endif
if (!u.uconduct.polyselfs)
you_have_never("changed form");
-#ifdef WIZARD
else if (wizard) {
Sprintf(buf, "changed form %ld time%s",
u.uconduct.polyselfs, plur(u.uconduct.polyselfs));
you_have_X(buf);
}
-#endif
if (!u.uconduct.wishes)
you_have_X("used no wishes");
static const struct func_tab cmdlist[] = {
{C('d'), FALSE, dokick}, /* "D" is for door!...? Msg is in dokick.c */
-#ifdef WIZARD
{C('e'), TRUE, wiz_detect},
{C('f'), TRUE, wiz_map},
{C('g'), TRUE, wiz_genesis},
{C('i'), TRUE, wiz_identify},
-#endif
{C('l'), TRUE, doredraw}, /* if number_pad is set */
{C('n'), TRUE, donamelevel}, /* if number_pad is set */
{C('o'), TRUE, dooverview_or_wiz_where}, /* depending on wizard status */
{C('p'), TRUE, doprev_message},
{C('r'), TRUE, doredraw},
{C('t'), TRUE, dotele},
-#ifdef WIZARD
{C('v'), TRUE, wiz_level_tele},
{C('w'), TRUE, wiz_wish},
-#endif
{C('x'), TRUE, doattributes},
{C('z'), TRUE, dosuspend_core},
{'a', FALSE, doapply},
doextversion, TRUE},
{"wipe", "wipe off your face", dowipe, FALSE},
{"?", "get this list of extended commands", doextlist, TRUE},
-#if defined(WIZARD)
/*
* There must be a blank entry here for every entry in the table
* below.
#endif
{(char *)0, (char *)0, donull, TRUE}, /* wizrumorcheck */
{(char *)0, (char *)0, donull, TRUE}, /* wmode */
-#endif
{(char *)0, (char *)0, donull, TRUE} /* sentinel */
};
-#ifdef WIZARD
/* there must be a placeholder in the table above for every entry here */
static const struct ext_func_tab debug_extcmdlist[] = {
{"levelchange", "change experience level", wiz_level_change, TRUE},
}
#endif
-#endif /* WIZARD */
-
#define unctrl(c) ((c) <= C('z') ? (0x60 | (c)) : (c))
#define unmeta(c) (0x7f & (c))
sym = highc(sym);
ctrl = (sym - 'A') + 1;
if ((explain = dowhatdoes_core(ctrl, buf2))
- && (!index(wiz_only_list, sym)
-#ifdef WIZARD
- || wizard
-#endif
- )) {
+ && (!index(wiz_only_list, sym) || wizard)) {
Sprintf(buf, "Are you trying to use ^%c%s?", sym,
index(wiz_only_list, sym) ? "" :
" as specified in the Guidebook");
newlevel->dlevel = dunlevs_in_dungeon(newlevel);
if (newdungeon && In_endgame(newlevel)) { /* 1st Endgame Level !!! */
if (!u.uhave.amulet) return; /* must have the Amulet */
-#ifdef WIZARD
if (!wizard) /* wizard ^V can bypass Earth level */
-#endif
assign_level(newlevel, &earth_level); /* (redundant) */
}
new_ledger = ledger_no(newlevel);
mnexto(mtmp);
if ((mtmp = m_at(u.ux, u.uy)) != 0) {
-#ifdef WIZARD
/* there was an unconditional impossible("mnearto failed")
here, but it's not impossible and we're prepared to cope
with the situation, so only say something when debugging */
if (wizard) pline("(monster in hero's way)");
-#endif
if (!rloc(mtmp, TRUE))
/* no room to move it; send it away, to return later */
migrate_to_level(mtmp, ledger_no(&u.uz),
STATIC_DCL int FDECL(possible_places, (int, boolean *, struct proto_dungeon *));
STATIC_DCL xchar FDECL(pick_level, (boolean *, int));
STATIC_DCL boolean FDECL(place_level, (int, struct proto_dungeon *));
-#ifdef WIZARD
STATIC_DCL boolean FDECL(unplaced_floater, (struct dungeon *));
STATIC_DCL boolean FDECL(unreachable_level, (d_level *,BOOLEAN_P));
STATIC_DCL void FDECL(tport_menu, (winid,char *,struct lchoice *,
d_level *,BOOLEAN_P));
STATIC_DCL const char *FDECL(br_string, (int));
STATIC_DCL void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P, struct lchoice *));
-#endif
mapseen *mapseenchn = (struct mapseen *)0;
STATIC_DCL mapseen *FDECL(load_mapseen, (int));
struct tmplevel *tlevel = &pd->tmplevel[proto_index];
pd->final_lev[proto_index] = (s_level *) 0; /* no "real" level */
-#ifdef WIZARD
- if (!wizard)
-#endif
- if (tlevel->chance <= rn2(100)) return;
+ if (!wizard && tlevel->chance <= rn2(100)) return;
pd->final_lev[proto_index] = new_level =
(s_level *) alloc(sizeof(s_level));
for (i = 0; i < n_dgns; i++) {
Fread((genericptr_t)&pd.tmpdungeon[i],
sizeof(struct tmpdungeon), 1, dgn_file);
-#ifdef WIZARD
- if(!wizard)
-#endif
- if(pd.tmpdungeon[i].chance && (pd.tmpdungeon[i].chance <= rn2(100))) {
+ if(!wizard && pd.tmpdungeon[i].chance
+ && (pd.tmpdungeon[i].chance <= rn2(100))) {
int j;
/* skip over any levels or branches */
(u.uz.dnum == medusa_level.dnum &&
dlev.dnum == valley_level.dnum)) &&
( /* either wizard mode or else seen and not forgotten */
-#ifdef WIZARD
wizard ||
-#endif
(level_info[idx].flags & (FORGOTTEN|VISITED)) == VISITED)) {
lev = depth(&slev->dlevel);
}
idxtoo = (idx >> 8) & 0x00FF;
idx &= 0x00FF;
if ( /* either wizard mode, or else _both_ sides of branch seen */
-#ifdef WIZARD
wizard ||
-#endif
((level_info[idx].flags & (FORGOTTEN|VISITED)) == VISITED &&
(level_info[idxtoo].flags & (FORGOTTEN|VISITED)) == VISITED)) {
if (ledger_to_dnum(idxtoo) == u.uz.dnum) idx = idxtoo;
return lev;
}
-#ifdef WIZARD
-
STATIC_OVL boolean
unplaced_floater(dptr)
struct dungeon *dptr;
destroy_nhwindow(win);
return 0;
}
-#endif /* WIZARD */
/* Record that the player knows about a branch from a level. This function
* will determine whether or not it was a "real" branch that was taken.
*/
Sprintf(buf, "%sLevel %d:", TAB, i);
-#ifdef WIZARD
/* wizmode prints out proto dungeon names for clarity */
if (wizard) {
s_level *slev;
if ((slev = Is_special(&mptr->lev)) != 0)
Sprintf(eos(buf), " [%s]", slev->proto);
}
-#endif
/* [perhaps print custom annotation on its own line when it's long] */
if (mptr->custom)
Sprintf(eos(buf), " (%s)", mptr->custom);
/* #define DEBUG */ /* uncomment to enable new eat code debugging */
#ifdef DEBUG
-# ifdef WIZARD
#define debugpline if (wizard) pline
-# else
-#define debugpline pline
-# endif
#endif
STATIC_PTR int NDECL(eatmdone);
}
return 0;
}
-#if defined(WIZARD) && (defined(UNIX) || defined(VMS) || defined(LATTICE))
+#if (defined(UNIX) || defined(VMS) || defined(LATTICE))
if(wizard) {
int c;
# ifdef VMS
!program_state.something_worth_saving ?
"Program initialization has failed." :
"Suddenly, the dungeon collapses.");
-#if defined(WIZARD) && !defined(MICRO)
+#ifndef MICRO
# if defined(NOTIFY_NETHACK_BUGS)
if (!wizard)
raw_printf("Report the following error to \"%s\" or at \"%s\".",
free(tmp);
} else
raw_printf("Report error to \"%s\"%s.",
-# ifdef WIZARD_NAME /*(KR1ED)*/
WIZARD_NAME,
-# else
- WIZARD,
-# endif
!program_state.something_worth_saving ? "" :
" and it may be possible to rebuild.");
}
#ifdef WIN32
interject(INTERJECT_PANIC);
#endif
-#if defined(WIZARD) && (defined(UNIX) || defined(VMS) || defined(LATTICE) || defined(WIN32))
+#if defined(UNIX) || defined(VMS) || defined(LATTICE) || defined(WIN32)
if (wizard)
NH_abort(); /* generate core dump */
#endif
paniclog("trickery", killer.name);
killer.name[0] = 0;
}
-#ifdef WIZARD
if (wizard) {
You("are a very tricky wizard, it seems.");
return;
}
-#endif
}
/* pbuf: holds Sprintf'd output for raw_print and putstr
return;
}
}
- if ((
-#ifdef WIZARD
- wizard ||
-#endif
- discover) && (how <= GENOCIDED)) {
+ if ((wizard || discover) && (how <= GENOCIDED)) {
if (paranoid_query(ParanoidDie, "Die?")) goto die;
pline("OK, so you don't %s.",
(how == CHOKING) ? "choke" : "die");
}
if (bones_ok) {
-#ifdef WIZARD
if (!wizard || paranoid_query(ParanoidBones, "Save bones?"))
-#endif
savebones(how, endtime, corpse);
/* corpse may be invalid pointer now so
ensure that it isn't used again */
break;
case VENOM_CLASS:
-#ifdef WIZARD
if (wizard) {
pline("Writing a poison pen letter??");
break;
}
-#endif
case ILLOBJ_CLASS:
impossible("You're engraving with an illegal object!");
break;
{
register int num;
-#ifdef WIZARD
/* override life-drain resistance when handling an explicit
wizard mode request to reduce level; never fatal though */
if (drainer && !strcmp(drainer, "#levelchange"))
drainer = 0;
else
-#endif
if (resists_drli(&youmonst)) return;
if (u.ulevel > 1) {
# endif
#endif /*HOLD_LOCKFILE_OPEN*/
-#ifdef WIZARD
#define WIZKIT_MAX 128
static char wizkit[WIZKIT_MAX];
STATIC_DCL FILE *NDECL(fopen_wizkit_file);
STATIC_DCL void FDECL(wizkit_addinv, (struct obj *));
-#endif
#ifdef AMIGA
extern char PATH[]; /* see sys/amiga/amidos.c */
#else
ret = rename(tempname, fq_bones);
#endif
-#ifdef WIZARD
if (wizard && ret != 0)
pline("couldn't rename %s to %s.", tempname, fq_bones);
-#endif
}
#endif
-#if defined(WIZARD) && !defined(MICRO)
+#ifndef MICRO
/* change pre-existing savefile name to indicate an error savefile */
void
set_error_savefile()
(void) signal(SIGQUIT, SIG_IGN);
(void) wait((int *)&i);
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
-# ifdef WIZARD
if (wizard) (void) signal(SIGQUIT, SIG_DFL);
-# endif
#else
/* I don't think we can really cope with external compression
* without signals, so we'll declare that compress failed and
#ifdef LOADSYMSETS
switch_symbols(TRUE);
#endif
-#ifdef WIZARD
} else if (match_varname(buf, "WIZKIT", 6)) {
(void) strncpy(wizkit, bufp, WIZKIT_MAX-1);
-#endif
#ifdef AMIGA
} else if (match_varname(buf, "FONT", 4)) {
char *t;
return rv;
}
-#ifdef WIZARD
STATIC_OVL FILE *
fopen_wizkit_file()
{
return;
}
-#endif /*WIZARD*/
-
#ifdef LOADSYMSETS
extern struct symsetentry *symset_list; /* options.c */
extern struct symparse loadsyms[]; /* drawing.c */
if(!mtmp) pline_The("flow reduces to a trickle.");
return;
}
-#ifdef WIZARD
if (isyou && wizard) {
if (yn("Dry up fountain?") == 'n')
return;
}
-#endif
/* replace the fountain with ordinary floor */
levl[x][y].typ = ROOM;
levl[x][y].looted = 0;
static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */
-#ifdef WIZARD
/* wizards can wish for venom, which will become an invisible inventory
* item without this. putting it in inv_order would mean venom would
* suddenly become a choice for all the inventory-class commands, which
* around on a bones level for normal players to find.
*/
static char venom_inv[] = { VENOM_CLASS, 0 }; /* (constant) */
-#endif
void
assigninvlet(otmp)
}
start_menu(win);
-#ifdef WIZARD
if (wizard && iflags.override_ID) {
char prompt[BUFSZ];
any.a_char = -1;
add_menu(win, NO_GLYPH, &any,' ', iflags.override_ID, ATR_NONE,
prompt, MENU_UNSELECTED);
}
-#endif
nextclass:
classcount = 0;
any = zeroany; /* set all bits to zero */
}
if (flags.sortpack) {
if (*++invlet) goto nextclass;
-#ifdef WIZARD
if (--invlet != venom_inv) {
invlet = venom_inv;
goto nextclass;
}
-#endif
}
end_menu(win, (char *) 0);
return "strangely";
}
-#ifdef WIZARD
-
int
wiz_light_sources()
{
return 0;
}
-#endif /* WIZARD */
-
/*light.c*/
mvitals[mndx].born++;
if ((int) mvitals[mndx].born >= lim && !(mons[mndx].geno & G_NOGEN) &&
!(mvitals[mndx].mvflags & G_EXTINCT)) {
-#if defined(DEBUG) && defined(WIZARD)
+#ifdef DEBUG
if (wizard) pline("Automatically extinguished %s.",
makeplural(mons[mndx].mname));
#endif
/* if you are to make a specific monster and it has
already been genocided, return */
if (mvitals[mndx].mvflags & G_GENOD) return((struct monst *) 0);
-#if defined(WIZARD) && defined(DEBUG)
+#ifdef DEBUG
if (wizard && (mvitals[mndx].mvflags & G_EXTINCT))
pline("Explicitly creating extinct monster %s.",
mons[mndx].mname);
int x, y;
struct monst *mon;
boolean known = FALSE;
-#ifdef WIZARD
boolean ask = (wizard && !neverask);
-#endif
while (cnt--) {
-#ifdef WIZARD
if (ask) {
if (create_particular()) {
known = TRUE;
}
else ask = FALSE; /* ESC will shut off prompting */
}
-#endif
x = u.ux, y = u.uy;
/* if in water, try to encourage an aquatic monster
by finding and then specifying another wet location */
/* #define DEBUG */ /* uncomment to enable code debugging */
#ifdef DEBUG
-# ifdef WIZARD
#define debugpline if (wizard) pline
-# else
-#define debugpline pline
-# endif
#endif
/* for UNIX, Rand #def'd to (long)lrand48() or (long)random() */
{
register int u_depth = depth(&u.uz);
-#ifdef WIZARD
if(wizard && nh_getenv("SHOPTYPE")) mkroom(SHOPBASE); else
-#endif
if (u_depth > 1 &&
u_depth < depth(&medusa_level) &&
nroom >= room_threshold &&
}
/* Already set or 2/3 chance of deferring until a later level. */
- if (source->dnum < n_dgns || (rn2(3)
-#ifdef WIZARD
- && !wizard
-#endif
- )) return;
+ if (source->dnum < n_dgns || (rn2(3) && !wizard)) return;
if (! (u.uz.dnum == oracle_level.dnum /* in main dungeon */
&& !at_dgn_entrance("The Quest") /* but not Quest's entry */
} else Strcpy(protofile, "");
-#ifdef WIZARD
/* SPLEVTYPE format is "level-choice,level-choice"... */
if (wizard && *protofile && sp && sp->rndlevs) {
char *ep = getenv("SPLEVTYPE"); /* not nh_getenv */
}
}
}
-#endif
if(*protofile) {
Strcat(protofile, LEV_EXT);
STATIC_DCL void FDECL(obj_timer_checks,(struct obj *, XCHAR_P, XCHAR_P, int));
STATIC_DCL void FDECL(container_weight, (struct obj *));
STATIC_DCL struct obj *FDECL(save_mtraits, (struct obj *, struct monst *));
-#ifdef WIZARD
STATIC_DCL void FDECL(objlist_sanity, (struct obj *,int,const char *));
STATIC_DCL void FDECL(mon_obj_sanity, (struct monst *,const char *));
STATIC_DCL const char *FDECL(where_name, (struct obj *));
STATIC_DCL void FDECL(insane_object,
(struct obj *,const char *,const char *,struct monst *));
STATIC_DCL void FDECL(check_contained, (struct obj *,const char *));
-#endif
/*#define DEBUG_EFFECTS*/ /* show some messages for debugging */
return objcount;
}
-#ifdef WIZARD
/* support for wizard-mode's `sanity_check' option */
static const char NEARDATA /* pline formats for insane_object() */
}
}
}
-#endif /* WIZARD */
/*mkobj.c*/
{
register struct mkroom *sroom;
int i = -1;
-#ifdef WIZARD
char *ep = (char *)0; /* (init == lint suppression) */
/* first determine shoptype */
}
#ifndef MAC
gottype:
-#endif
#endif
for(sroom = &rooms[0]; ; sroom++){
if(sroom->hx < 0) return;
if(sroom->rtype != OROOM) continue;
if(has_dnstairs(sroom) || has_upstairs(sroom))
continue;
- if(
-#ifdef WIZARD
- (wizard && ep && sroom->doorct != 0) ||
-#endif
- sroom->doorct == 1) break;
+ if( (wizard && ep && sroom->doorct != 0) || sroom->doorct == 1)
+ break;
}
if (!sroom->rlit) {
int x, y;
continue;
} else if(has_upstairs(sroom) || has_dnstairs(sroom))
continue;
- if(sroom->doorct == 1 || !rn2(5)
-#ifdef WIZARD
- || wizard
-#endif
- )
+ if(sroom->doorct == 1 || !rn2(5) || wizard)
return sroom;
}
return (struct mkroom *)0;
STATIC_DCL int FDECL(pickvampshape, (struct monst *));
STATIC_DCL boolean FDECL(isspecmon, (struct monst *));
STATIC_DCL boolean FDECL(validspecmon, (struct monst *,int));
-#ifdef WIZARD
STATIC_DCL boolean FDECL(validvamp, (struct monst *,int *,int));
-#endif
STATIC_DCL struct permonst *FDECL(accept_newcham_form, (int));
#define LEVEL_SPECIFIC_NOCORPSE(mdat) \
return TRUE; /* potential new form is ok */
}
-#ifdef WIZARD
/* prevent wizard mode user from specifying invalid vampshifter shape */
STATIC_OVL boolean
validvamp(mon, mndx_p, monclass)
}
return (*mndx_p != NON_PM);
}
-#endif /*WIZARD*/
int
select_newcham_form(mon)
}
break;
}
-#ifdef WIZARD
/* for debugging: allow control of polymorphed monster */
if (wizard && iflags.mon_polycontrol) {
char pprompt[BUFSZ], buf[BUFSZ];
if (is_vampshifter(mon) && !validvamp(mon, &mndx, monclass))
mndx = pickvampshape(mon); /* don't resort to arbitrary */
}
-#endif /*WIZARD*/
/* if no form was specified above, pick one at random now */
if (mndx == NON_PM) {
typ != LUMP_OF_ROYAL_JELLY &&
obj->oclass != AMULET_CLASS &&
obj->oclass != RING_CLASS &&
-#ifdef WIZARD
obj->oclass != VENOM_CLASS &&
-#endif
typ != SACK && typ != BAG_OF_HOLDING &&
typ != BAG_OF_TRICKS && !Is_candle(obj) &&
typ != OILSKIN_SACK && typ != LEASH &&
"boots", "shoes",
"gloves", "lenses", "scales",
"gauntlets",
-#ifdef WIZARD
"iron bars",
-#endif
/* both singular and plural are spelled the same */
"deer", "fish", "tuna", "yaki", "-hai",
"krill", "manes", "ninja", "sheep", "ronin", "roshi", "shito", "tengu",
{ "dragon scale mail",
ARMOR_CLASS, GRAY_DRAGON_SCALE_MAIL, YELLOW_DRAGON_SCALE_MAIL },
{ "sword", WEAPON_CLASS, SHORT_SWORD, KATANA },
-#ifdef WIZARD
{ "venom", VENOM_CLASS, BLINDING_VENOM, ACID_VENOM },
-#endif
{ "gray stone", GEM_CLASS, LUCKSTONE, FLINT },
{ "grey stone", GEM_CLASS, LUCKSTONE, FLINT },
};
}
}
-#ifdef WIZARD
/* Wishing in wizard mode can create traps and furniture.
* Part I: distinguish between trap and object for the two
* types of traps which have corresponding objects: bear trap
the object name and getting a disarmed trap object] */
}
}
-#endif
retry:
/* "grey stone" check must be before general "stone" */
goto typfnd;
}
}
-#ifdef WIZARD
/* Let wizards wish for traps and furniture.
* Must come after objects check so wizards can still wish for
* trap objects like beartraps.
return &zeroobj;
}
}
-#endif /* WIZARD */
if(!oclass) return((struct obj *)0);
any:
|| typ == ROCK || is_missile(otmp)))))
otmp->quan = (long) cnt;
-#ifdef WIZARD
if (oclass == VENOM_CLASS) otmp->spe = 1;
-#endif
if (spesgn == 0) {
spe = otmp->spe;
-#ifdef WIZARD
} else if (wizard) {
; /* no alteration to spe */
-#endif
} else if (oclass == ARMOR_CLASS || oclass == WEAPON_CLASS ||
is_weptool(otmp) ||
(oclass==RING_CLASS && objects[typ].oc_charged)) {
#else
{"mail", (boolean *)0, TRUE, SET_IN_FILE},
#endif
-#ifdef WIZARD
/* for menu debugging only*/
{"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME},
-#else
- {"menu_tab_sep", (boolean *)0, FALSE, SET_IN_FILE},
-#endif
{"mouse_support", &iflags.wc_mouse_support, TRUE, DISP_IN_GAME}, /*WC*/
#ifdef NEWS
{"news", &iflags.news, TRUE, DISP_IN_GAME},
DISP_IN_GAME},
#endif
{"safe_pet", &flags.safe_dog, TRUE, SET_IN_GAME},
-#ifdef WIZARD
{"sanity_check", &iflags.sanity_check, FALSE, SET_IN_GAME},
-#else
- {"sanity_check", (boolean *)0, FALSE, SET_IN_FILE},
-#endif
{"selectsaved", &iflags.wc2_selectsaved, TRUE, DISP_IN_GAME}, /*WC*/
#ifdef EXP_ON_BOTL
{"showexp", &flags.showexp, FALSE, SET_IN_GAME},
MAXOCLASSES, SET_IN_GAME },
{ "pile_limit", "threshold for \"there are many objects here\"",
24, SET_IN_GAME },
- { "playmode",
-#ifdef WIZARD
- "normal play, non-scoring explore mode, or debug mode",
-#else
- "normal play or non-scoring explore mode",
-#endif
+ { "playmode", "normal play, non-scoring explore mode, or debug mode",
8, DISP_IN_GAME },
{ "player_selection", "choose character via dialog or prompts",
12, DISP_IN_GAME },
{ PARANOID_QUIT, "quit", 1, "explore", 1,
"yes vs y to quit or to enter explore mode" },
{ PARANOID_DIE, "die", 1, "death", 2,
-#ifdef WIZARD
"yes vs y to die (explore mode or debug mode)" },
-#else
- "yes vs y to die (explore mode only)" },
-#endif
{ PARANOID_BONES, "bones", 1, 0, 0,
-#ifdef WIZARD
"yes vs y to save bones data when dying in debug mode" },
-#else
- "(only applicable for debug mode)" },
-#endif
{ PARANOID_HIT, "attack", 1, "hit", 1,
"yes vs y to attack a peaceful monster" },
{ PARANOID_PRAY, "pray", 1, 0, 0,
wizard = FALSE, discover = TRUE;
} else if (!strncmpi(op, "debug", 5) ||
!strncmpi(op, "wizard", 6)) {
-#ifdef WIZARD
wizard = TRUE, discover = FALSE;
-#else
- raw_printf("\"%s\":%s -- debug mode not available.",
- fullname, op);
-#endif
} else {
raw_printf("Invalid value for \"%s\":%s.", fullname, op);
}
((boolopt[i].optflags == DISP_IN_GAME && pass == 0) ||
(boolopt[i].optflags == SET_IN_GAME && pass == 1))) {
if (bool_p == &flags.female) continue; /* obsolete */
-#ifdef WIZARD
if (bool_p == &iflags.sanity_check && !wizard) continue;
if (bool_p == &iflags.menu_tab_sep && !wizard) continue;
-#endif
if (is_wc_option(boolopt[i].name) &&
!wc_supported(boolopt[i].name)) continue;
if (is_wc2_option(boolopt[i].name) &&
/* Boolean options */
for (i = 0; boolopt[i].name; i++) {
if (boolopt[i].addr) {
-#ifdef WIZARD
if (boolopt[i].addr == &iflags.sanity_check && !wizard) continue;
if (boolopt[i].addr == &iflags.menu_tab_sep && !wizard) continue;
-#endif
next_opt(datawin, boolopt[i].name);
}
}
set_playmode()
{
if (wizard) {
-#ifdef WIZARD
if (authorize_wizard_mode())
Strcpy(plname, "wizard");
else
-#endif
wizard = FALSE; /* not allowed or not available */
/* force explore mode if we didn't make it into wizard mode */
discover = !wizard;
#else
#define WIZHLP_SLOT 11
#endif
-#ifdef WIZARD
"List of wizard-mode commands.",
-#endif
"",
(char *)0
};
any = zeroany; /* zero all bits */
start_menu(tmpwin);
-#ifdef WIZARD
if (!wizard) help_menu_items[WIZHLP_SLOT] = "",
help_menu_items[WIZHLP_SLOT+1] = (char *)0;
-#endif
for (i = 0; help_menu_items[i]; i++)
#ifdef PORT_HELP
/* port-specific line has a %s in it for the PORT_ID */
case PORT_HELP_ID: port_help(); break;
#endif
default:
-#ifdef WIZARD
/* handle slot 11 or 12 */
display_file(DEBUGHELP, TRUE);
-#endif
break;
}
}
#ifdef HANGUPHANDLING
if (program_state.done_hup) return;
#endif
-#ifdef WIZARD
if (program_state.wizkit_wishing) return;
-#endif
if (index(line, '%')) {
Vsprintf(pbuf,line,VA_ARGS);
info[0] = 0;
if (mtmp->mtame) { Strcat(info, ", tame");
-#ifdef WIZARD
if (wizard) {
Sprintf(eos(info), " (%d", mtmp->mtame);
if (!mtmp->isminion)
EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
Strcat(info, ")");
}
-#endif
}
else if (mtmp->mpeaceful) Strcat(info, ", peaceful");
if (mtmp->cham >= LOW_PM && mtmp->data != &mons[mtmp->cham])
/* set up p_type and p_alignment */
if (!can_pray(TRUE)) return 0;
-#ifdef WIZARD
if (wizard && p_type >= 0) {
if (yn("Force the gods to be pleased?") == 'y') {
u.ublesscnt = 0;
if(p_type < 2) p_type = 3;
}
}
-#endif
nomul(-3);
nomovemsg = "You finish your prayer.";
afternmv = prayer_done;
int purity;
aligntyp original_alignment = u.ualignbase[A_ORIGINAL];
-#ifdef WIZARD
if (wizard && talk) {
if (u.ualign.type != original_alignment) {
You("are currently %s instead of %s.",
u.ualign.record = MIN_QUEST_ALIGN;
}
}
-#endif
purity = (u.ualign.record >= MIN_QUEST_ALIGN &&
u.ualign.type == original_alignment &&
u.ualignbase[A_CURRENT] == original_alignment) ? 1 :
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",
else if (immunecnt || class == S_invisible)
You("aren't permitted to genocide such monsters.");
else
-#ifdef WIZARD /* to aid in topology testing; remove pesky monsters */
if (wizard && buf[0] == '*') {
register struct monst *mtmp, *mtmp2;
pline("Eliminated %d monster%s.", gonecnt, plur(gonecnt));
return;
} else
-#endif
pline("That %s does not represent any monster.",
strlen(buf) == 1 ? "symbol" : "response");
continue;
return FALSE;
}
-#ifdef WIZARD
/*
* Make a new monster with the type controlled by the user.
*
makehostile = TRUE;
}
/* decide whether a valid monster was chosen */
-#ifdef WIZARD
if (wizard && (!strcmp(bufp, "*") || !strcmp(bufp, "random"))) {
randmonst = TRUE;
break;
}
-#endif
which = name_to_mon(bufp);
if (which >= LOW_PM) break; /* got one */
monclass = name_to_monclass(bufp, &which);
if (!randmonst) {
firstchoice = which;
if (cant_revive(&which, FALSE, (struct obj *)0)) {
-#ifdef WIZARD /* intentionally redundant... */
/* wizard mode can override handling of special monsters */
Sprintf(buf, "Creating %s instead; force %s?",
mons[which].mname, mons[firstchoice].mname);
if (yn(buf) == 'y') which = firstchoice;
-#endif
}
whichpm = &mons[which];
}
}
return madeany;
}
-#endif /* WIZARD */
/*read.c*/
NhRect *r;
{
if (rect_cnt >= MAXRECT) {
-#ifdef WIZARD
if (wizard) pline("MAXRECT may be too small.");
-#endif
return;
}
/* Check that this NhRect is not included in another one */
/* for wizard mode, issue a reminder; for others, treat it
as an attempt to cheat and refuse to restore this file */
pline("Saved game was not yours.");
-#ifdef WIZARD
if (!wizard)
-#endif
return FALSE;
}
mread(fd, (genericptr_t) &context, sizeof(struct context_info));
hpid, pid);
else
Sprintf(trickbuf, "This is level %d, not %d!", dlvl, lev);
-#ifdef WIZARD
if (wizard) pline1(trickbuf);
-#endif
trickery(trickbuf);
}
restcemetery(fd, &level.bonesinfo);
return rumor_buf;
}
-#ifdef WIZARD
/*
* test that the true/false rumor boundaries are valid.
*/
true_rumor_size = -1; /* don't try to open it again */
}
}
-#endif
void
outrumor(truth, mechanism)
if (!swapout_oldest())
return FALSE;
}
-# ifdef WIZARD
if (wizard) {
pline("Swapping in `%s'.", from);
wait_synch();
}
-# endif
copyfile(from, to);
(void) unlink(from);
level_info[lev].where = ACTIVE;
Sprintf(to, "%s%s", permbones, alllevels);
set_levelfile_name(from, oldest);
set_levelfile_name(to, oldest);
-# ifdef WIZARD
if (wizard) {
pline("Swapping out `%s'.", from);
wait_synch();
}
-# endif
copyfile(from, to);
(void) unlink(from);
level_info[oldest].where = SWAPPED;
else if(sy == sroom->hy+1) sy--; else {
shk_failed:
#ifdef DEBUG
-# ifdef WIZARD
/* Said to happen sometimes, but I have never seen it. */
/* Supposedly fixed by fdoor change in mklev.c */
if(wizard) {
}
display_nhwindow(WIN_MESSAGE, FALSE);
}
-# endif
#endif
return(-1);
}
/* #define DEBUG */ /* uncomment to enable code debugging */
#ifdef DEBUG
-# ifdef WIZARD
#define debugpline if (wizard) pline
-# else
-#define debugpline pline
-# endif
#endif
#include "sp_lev.h"
if (u.usteed) {
dismount_steed(DISMOUNT_BYCHOICE);
} else if (getdir((char *)0) && isok(u.ux+u.dx, u.uy+u.dy)) {
-#ifdef WIZARD
if (wizard && yn("Force the mount to succeed?") == 'y')
forcemount = TRUE;
-#endif
return (mount_steed(m_at(u.ux+u.dx, u.uy+u.dy), forcemount));
} else {
return 0;
*/
if (Wounded_legs) {
Your("%s are in no shape for riding.", makeplural(body_part(LEG)));
-#ifdef WIZARD
if (force && wizard && yn("Heal your legs?") == 'y')
HWounded_legs = EWounded_legs = 0;
else
-#endif
return (FALSE);
}
/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string;
for usual config, WIZARD is the string; forcing WIZARD_NAME to match it
eliminates conditional testing for which one to use in string ops */
-#ifndef KR1ED
-# undef WIZARD_NAME
-# define WIZARD_NAME WIZARD
-#endif
struct sysopt sysopt;
/* Disable teleportation in stronghold && Vlad's Tower */
if (level.flags.noteleport) {
-#ifdef WIZARD
if (!wizard) {
-#endif
pline("A mysterious force prevents you from teleporting!");
return TRUE;
-#ifdef WIZARD
}
-#endif
}
/* don't show trap if "Sorry..." */
if ((u.uhave.amulet || On_W_tower_level(&u.uz)) && !rn2(3)) {
You_feel("disoriented for a moment.");
-#ifdef WIZARD
if (wizard && yn("Override?") != 'y')
-#endif
return FALSE;
}
if ((Teleport_control && !Stunned)
-#ifdef WIZARD
|| wizard
-#endif
) {
if (unconscious()) {
pline("Being unconscious, you cannot control your teleport.");
castit = TRUE;
break;
}
-#ifdef WIZARD
if (!wizard) {
-#endif
if (!castit) {
if (!Teleportation)
You("don't know that spell.");
else You("are not able to teleport at will.");
return(0);
}
-#ifdef WIZARD
}
-#endif
}
if (u.uhunger <= 100 || ACURR(A_STR) < 6) {
-#ifdef WIZARD
if (!wizard) {
-#endif
You("lack the strength %s.",
castit ? "for a teleport spell" : "to teleport");
return 1;
-#ifdef WIZARD
}
-#endif
}
energy = objects[SPE_TELEPORT_AWAY].oc_level * 7 / 2 - 2;
if (u.uen <= energy) {
-#ifdef WIZARD
if (wizard)
energy = u.uen;
- else
-#endif
- {
+ else {
You("lack the energy %s.",
castit ? "for a teleport spell" : "to teleport");
return 1;
exercise(A_WIS, TRUE);
if (spelleffects(sp_no, TRUE))
return(1);
- else
-#ifdef WIZARD
- if (!wizard)
-#endif
+ else if (!wizard)
return(0);
} else {
u.uen -= energy;
boolean force_dest = FALSE;
if ((u.uhave.amulet || In_endgame(&u.uz) || In_sokoban(&u.uz))
-#ifdef WIZARD
- && !wizard
-#endif
- ) {
+ && !wizard) {
You_feel("very disoriented for a moment.");
return;
}
- if ((Teleport_control && !Stunned)
-#ifdef WIZARD
- || wizard
-#endif
- ) {
+ if ((Teleport_control && !Stunned) || wizard) {
char qbuf[BUFSZ];
int trycnt = 0;
Strcpy(qbuf, "To what level do you want to teleport?");
do {
if (++trycnt == 2) {
-#ifdef WIZARD
if (wizard) Strcat(qbuf, " [type a number or ? for a menu]");
- else
-#endif
- Strcat(qbuf, " [type a number]");
+ else Strcat(qbuf, " [type a number]");
}
getlin(qbuf, buf);
if (!strcmp(buf,"\033")) { /* cancelled */
pline("Oops...");
goto random_levtport;
}
-#ifdef WIZARD
if (wizard && !strcmp(buf,"?")) {
schar destlev = 0;
xchar destdnum = 0;
}
}
force_dest = TRUE;
- } else
-#endif /*WIZARD*/
- if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf);
+ } else if ((newlev = lev_by_name(buf)) == 0) newlev = atoi(buf);
} while (!newlev && !digit(buf[0]) &&
(buf[0] != '-' || !digit(buf[1])) &&
trycnt < 10);
You1(shudder_for_moment);
return;
}
-#ifdef WIZARD
if (In_endgame(&u.uz)) { /* must already be wizard */
int llimit = dunlevs_in_dungeon(&u.uz);
schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0);
return;
}
-#endif
killer.name[0] = 0; /* still alive, so far... */
} else if (u.uz.dnum == medusa_level.dnum &&
newlev >= dungeons[u.uz.dnum].depth_start +
dunlevs_in_dungeon(&u.uz)) {
-#ifdef WIZARD
if (!(wizard && force_dest))
-#endif
find_hell(&newlevel);
} else {
/* if invocation did not yet occur, teleporting into
* the last level of Gehennom is forbidden.
*/
-#ifdef WIZARD
- if (!wizard)
-#endif
- if (Inhell && !u.uevent.invoked &&
+ if (!wizard && Inhell && !u.uevent.invoked &&
newlev >= (dungeons[u.uz.dnum].depth_start +
dunlevs_in_dungeon(&u.uz) - 1)) {
newlev = dungeons[u.uz.dnum].depth_start +
* we must translate newlev to a number relative to the
* current dungeon.
*/
-#ifdef WIZARD
if (!(wizard && force_dest))
-#endif
get_level(&newlevel, newlev);
}
schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0);
* Check whether object has a timer of type timer_type.
*/
-#ifdef WIZARD
STATIC_DCL const char *FDECL(kind_name, (SHORT_P));
STATIC_DCL void FDECL(print_queue, (winid, timer_element *));
-#endif
STATIC_DCL void FDECL(insert_timer, (timer_element *));
STATIC_DCL timer_element *FDECL(remove_timer, (timer_element **, SHORT_P,
ANY_P *));
};
#undef TTAB
-
-#if defined(WIZARD)
-
STATIC_OVL const char *
kind_name(kind)
short kind;
}
}
-#endif /* WIZARD */
-
-
/*
* Pick off timeout elements from the global queue and call their functions.
* Do this until their time is less than or equal to the move count.
if (discover)
ini_inv(Wishing);
-#ifdef WIZARD
if (wizard)
read_wizkit();
-#endif
#ifndef GOLDOBJ
u.ugold0 += hidden_gold(); /* in case sack has gold in it */
{
return !P_RESTRICTED(skill)
&& P_SKILL(skill) < P_MAX_SKILL(skill) && (
-#ifdef WIZARD
(wizard && speedy) ||
-#endif
(P_ADVANCE(skill) >=
(unsigned) practice_needed_to_advance(P_SKILL(skill))
&& u.skills_advanced < P_SKILL_LIMIT
winid win;
boolean speedy = FALSE;
-#ifdef WIZARD
if (wizard && yn("Advance skills without practice?") == 'y')
speedy = TRUE;
-#endif
do {
/* find longest available skill name, count those that can advance */
prefix = (to_advance + eventually_advance +
maxxed_cnt > 0) ? " " : "";
(void) skill_level_name(i, sklnambuf);
-#ifdef WIZARD
if (wizard) {
if (!iflags.menu_tab_sep)
Sprintf(buf, " %s%-*s %-12s %5d(%4d)",
prefix, P_NAME(i), sklnambuf,
P_ADVANCE(i),
practice_needed_to_advance(P_SKILL(i)));
- } else
-#endif
- {
+ } else {
if (!iflags.menu_tab_sep)
Sprintf(buf, " %s %-*s [%s]",
prefix, longest, P_NAME(i), sklnambuf);
Strcpy(buf, (to_advance > 0) ? "Pick a skill to advance:" :
"Current skills:");
-#ifdef WIZARD
if (wizard && !speedy)
Sprintf(eos(buf), " (%d slot%s available)",
u.weapon_slots, plur(u.weapon_slots));
-#endif
end_menu(win, buf);
n = select_menu(win, to_advance ? PICK_ONE : PICK_NONE, &selected);
destroy_nhwindow(win);
argc--;
switch (argv[0][1]) {
case 'D':
-#ifdef WIZARD
wizard = TRUE, discover = FALSE;
break;
-#endif
/* otherwise fall thru to discover */
case 'X':
discover = TRUE, wizard = FALSE;
boolean
authorize_wizard_mode()
{
-#ifdef WIZARD
/* other ports validate user name or character name here */
return TRUE;
-#else
- return FALSE;
-#endif
}
#ifndef __begui__
boolean
authorize_wizard_mode()
{
-#ifdef WIZARD
/* other ports validate user name or character name here */
return TRUE;
-#else
- return FALSE;
-#endif
}
/*macmain.c*/
fatal("\pCannot create mode menu");
AppendMenu(askmenu[RSRC_ASK_MODE], "\pNormal");
AppendMenu(askmenu[RSRC_ASK_MODE], "\pExplore");
-#ifdef WIZARD
AppendMenu(askmenu[RSRC_ASK_MODE], "\pDebug");
-#endif
InsertMenu(askmenu[RSRC_ASK_MODE], hierMenu);
currmode = 0;
/* Adjust the mode popup menu */
CheckMenuItem(askmenu[RSRC_ASK_MODE], 1, currmode == 0);
CheckMenuItem(askmenu[RSRC_ASK_MODE], 2, currmode == 1);
-#ifdef WIZARD
CheckMenuItem(askmenu[RSRC_ASK_MODE], 3, currmode == 2);
-#endif
/* Wait for an action on an item */
ModalDialog(filter, &item);
DisposeUserItemUPP(redraw);
/* Process the mode */
-#ifdef WIZARD
- wizard =
-#endif
- discover = 0;
+ wizard = discover = 0;
switch (currmode) {
case 0: /* Normal */
break;
case 1: /* Explore */
discover = 1;
break;
-#ifdef WIZARD
case 2: /* Debug */
wizard = 1;
- strcpy(plname, WIZARD);
+ strcpy(plname, WIZARD_NAME);
break;
-#endif
default: /* Quit */
ExitToShell();
}
if (newMenubar != mbarRegular)
; /* we've already found its state */
-#ifdef WIZARD
else if (wizard)
{
newMenubar = mbarSpecial;
SetMenuItemText(MHND_FILE, menuFilePlayMode, "\pDebug");
}
}
-#endif
else if (discover)
{
# endif /* MSDOS || WIN32 */
#endif /* PORT_HELP */
-/* for KR1ED config, WIZARD is 0 or 1 and WIZARD_NAME is a string;
- for usual config, WIZARD is the string; forcing WIZARD_NAME to match it
- eliminates conditional testing for which one to use in string ops */
-#ifndef KR1ED
-# undef WIZARD_NAME
-# define WIZARD_NAME WIZARD
-#endif
-
/* validate wizard mode if player has requested access to it */
boolean
authorize_wizard_mode()
{
-#ifdef WIZARD
if (!strcmp(plname, WIZARD_NAME)) return TRUE;
-#endif
return FALSE;
}
or holds a generic user name like "player" or "games" */
plnamesuffix();
-#ifdef WIZARD
if (wizard) {
/* use character name rather than lock letter for file names */
locknum = 0;
- } else
-#endif
- {
+ } else {
/* suppress interrupts while processing lock file */
(void) signal(SIGQUIT,SIG_IGN);
(void) signal(SIGINT,SIG_IGN);
boolean
authorize_wizard_mode()
{
-#ifdef WIZARD
struct passwd *pw = get_unix_pw();
if (pw && sysopt.wizards && sysopt.wizards[0]) {
if(check_user_string(sysopt.wizards)) return TRUE;
}
-#endif /* WIZARD */
wiz_error_flag = TRUE; /* not being allowed into wizard mode */
return FALSE;
}
wd_message()
{
if (wiz_error_flag) {
-#ifdef WIZARD
if (sysopt.wizards && sysopt.wizards[0]) {
char *tmp = build_english_list(sysopt.wizards);
pline("Only user%s %s may access debug (wizard) mode.",
index(sysopt.wizards, ' ')?"s":"", tmp);
free(tmp);
} else
-#else
- pline("Debug mode is not available.");
-#endif
pline("Entering explore/discovery mode instead.");
wizard = 0, discover = 1; /* (paranoia) */
} else if (discover)
#endif
#ifndef NO_SIGNAL
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
-# ifdef WIZARD
if(wizard) (void) signal(SIGQUIT,SIG_DFL);
-# endif
#endif
if(wt) {
raw_print("");
or holds a generic user name like "player" or "games" */
plnamesuffix();
-#ifdef WIZARD
if (wizard) {
/* use character name rather than lock letter for file names */
locknum = 0;
- } else
-#endif
- {
+ } else {
/* suppress interrupts while processing lock file */
(void) signal(SIGQUIT, SIG_IGN);
(void) signal(SIGINT, SIG_IGN);
|| (condition >= SS$_ASTFLT && condition <= SS$_TBIT)
|| (condition >= SS$_ARTRES && condition <= SS$_INHCHME)) {
program_state.done_hup = TRUE; /* pretend hangup has been attempted */
-# if defined(WIZARD) && !defined(BETA)
+# ifndef BETA
if (wizard)
-# endif /*WIZARD && !BETA*/
-# if defined(WIZARD) || defined(BETA)
+# endif /* !BETA */
abort(); /* enter the debugger */
-# endif /*WIZARD || BETA*/
}
return SS$_RESIGNAL;
}
boolean
authorize_wizard_mode()
{
-#ifdef WIZARD
if (!strcmpi(nh_getenv("USER"), WIZARD_NAME)) return TRUE;
-#endif
wiz_error_flag = TRUE; /* not being allowed into wizard mode */
return FALSE;
}
wd_message()
{
if (wiz_error_flag) {
-#ifdef WIZARD
pline("Only user \"%s\" may access debug (wizard) mode.",
WIZARD_NAME);
-#else
- pline("Debug mode is not available.");
-#endif
pline("Entering explore/discovery mode instead.");
wizard = 0, discover = 1; /* (paranoia) */
} else if (discover)
boolean screen_manip;
{
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
-# ifdef WIZARD
if (wizard) (void) signal(SIGQUIT,SIG_DFL);
-# endif
if (screen_manip)
resume_nhwindows(); /* setup terminal modes, redraw screen, &c */
}
{ -1, "X", "X", 13, NH_CELL_LAYOUT_MENU, 1 , 0 }
};
-#ifdef WIZARD
/* wizard mode layout */
NHCmdPadCell cells_layout_wizard[NH_CMDPAD_CELLNUM] =
{
{ -1, "", "", -NH_CMDPAD_FONT_NORMAL, NH_CELL_REG, 1, (void*)-1 },
{ -1, "X", "X", 13, NH_CELL_LAYOUT_MENU, 1 , 0 }
};
-#endif
#else /* !WIN_CE_SMARTPHONE */
nhcmdlayout_init(plt, cells_layout_lookup);
nhcmdset_add(nhcmdset_current, plt);
-#ifdef WIZARD
if( wizard ) {
plt = nhcmdlayout_create("Wizard Mode", NH_CMDPAD_ROWS, NH_CMDPAD_COLS);
nhcmdlayout_init(plt, cells_layout_wizard);
nhcmdset_add(nhcmdset_current, plt);
}
-#endif
#else /* ! WIN_CE_SMARTPHONE */
plt = nhcmdlayout_create("lowercase", NH_CMDPAD_ROWS, NH_CMDPAD_COLS);
void win32_abort()
{
-#ifdef WIZARD
if (wizard)
DebugBreak();
-#endif
abort();
}
static void
really_move_cursor()
{
-#if defined(PORT_DEBUG) && defined(WIZARD)
+#ifdef PORT_DEBUG
char oldtitle[BUFSZ], newtitle[BUFSZ];
if (display_cursor_info && wizard) {
oldtitle[0] = '\0';
void win32_abort()
{
-#ifdef WIZARD
if (wizard) {
# ifdef WIN32CON
int c, ci, ct;
DebugBreak();
# endif
}
-#endif
abort();
}
#ifdef DLB
"data librarian",
#endif
-#ifdef WIZARD
- "debug mode",
-#endif
#ifdef EXP_ON_BOTL
"experience points on status line",
#endif
#else
{"WIN_CE_SMARTPHONE", 0},
#endif
-#if defined(WIZARD)
{"WIZARD", 1},
-#else
- {"WIZARD", 0},
-#endif
#if defined(X11_GRAPHICS)
{"X11_GRAPHICS", 1},
#else
# Game Features:
@feature = qw/ZEROCOMP USE_TILES ASCIIGRAPH CLIPPING TEXTCOLOR
- COMPRESS ZLIB_COMP RANDOM SECURE USER_SOUNDS WIZARD
+ COMPRESS ZLIB_COMP RANDOM SECURE USER_SOUNDS
SAFERHANGUP MFLOPPY NOCWD_ASSUMPTIONS
VAR_PLAYGROUND DLB SHELL SUSPEND NOSAVEONHANGUP HANGUPHANDLING
BSD_JOB_CONTROL MAIL POSIX_JOB_CONTROL INSURANCE