#define getlogin() ((char *)0)
#endif /* MICRO */
-#if defined(OVERLAY)&&(defined(OVL0)||defined(OVL1)||defined(OVL2)||defined(OVL3)||defined(OVLB))
+#if defined(OVERLAY)
# define USE_OVLx
# define STATIC_DCL extern
# define STATIC_OVL
-# ifdef OVLB
-# define STATIC_VAR
-# else
-# define STATIC_VAR extern
-# endif
+# define STATIC_VAR
+
+#else /* !OVERLAY */
-#else /* !OVERLAY || (!OVL0 && !OVL1 && !OVL2 && !OVL3 && !OVLB) */
# define STATIC_DCL static
# define STATIC_OVL static
# define STATIC_VAR static
-/* If not compiling an overlay, compile everything. */
-# define OVL0 /* highest priority */
-# define OVL1
-# define OVL2
-# define OVL3 /* lowest specified priority */
-# define OVLB /* the base overlay segment */
-#endif /* OVERLAY && (OVL0 || OVL1 || OVL2 || OVL3 || OVLB) */
+#endif /* OVERLAY */
/* Macro for a few items that are only static if we're not overlaid.... */
#if defined(USE_TRAMPOLI) || defined(USE_OVLx)
#if defined(FUNCTION_LEVEL_LINKING)
#define OVERLAY
-#define OVL0
-#define OVL1
-#define OVL2
-#define OVL3
-#define OVLB
#endif
#if defined(OVERLAY) && !defined(MOVERLAY) && !defined(VROOMM) && !defined(FUNCTION_LEVEL_LINKING)
STATIC_DCL void NDECL(do_positionbar);
#endif
-#ifdef OVL0
-
void
moveloop()
{
}
}
-#endif /* OVL0 */
-#ifdef OVL1
-
void
stop_occupation()
{
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
display_gamewindows()
{
}
#endif
-#endif /* OVLB */
-
/*allmain.c*/
#include "hack.h"
#include "edog.h"
-#ifdef OVLB
static const char tools[] = { TOOL_CLASS, WEAPON_CLASS, WAND_CLASS, 0 };
static const char tools_too[] = { ALL_CLASSES, TOOL_CLASS, POTION_CLASS,
return((struct obj *)0);
}
-#endif /* OVLB */
-#ifdef OVL1
boolean
next_to_u()
return(TRUE);
}
-#endif /* OVL1 */
-#ifdef OVL0
-
void
check_leash(x, y)
register xchar x, y;
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
#define WEAK 3 /* from eat.c */
static const char look_str[] = "look %s.";
return unfixable_trbl;
}
-#endif /* OVLB */
-
/*apply.c*/
#include "hack.h"
#include "artifact.h"
-#ifdef OVLB
#include "artilist.h"
-#else
-STATIC_DCL struct artifact artilist[];
-#endif
+
/*
* Note: both artilist[] and artiexist[] have a dummy element #0,
* so loops over them should normally start at #1. The primary
of hit points that will fit in a 15 bit integer. */
#define FATAL_DAMAGE_MODIFIER 200
-#ifndef OVLB
-STATIC_DCL int spec_dbon_applies;
-STATIC_DCL xchar artidisco[NROFARTIFACTS];
-#else /* OVLB */
/* coordinate effects from spec_dbon() with messages in artifact_hit() */
STATIC_OVL int spec_dbon_applies = 0;
return a;
}
-#endif /* OVLB */
-#ifdef OVL0
boolean
spec_ability(otmp, abil)
return FALSE;
}
-#endif /* OVL0 */
-#ifdef OVLB
-
boolean
restrict_name(otmp, name) /* returns 1 if name is restricted for otmp->otyp */
register struct obj *otmp;
return 1;
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* decide whether an artifact's special attacks apply against mtmp */
STATIC_OVL int
spec_applies(weap, mtmp)
return i;
}
-#endif /* OVL1 */
-
-#ifdef OVLB
-
-
/*
* Magicbane's intrinsic magic is incompatible with normal
* enchantment magic. Thus, its effects have a negative
return (100L * (long)objects[otmp->otyp].oc_cost);
}
-#endif /* OVLB */
-
/*artifact.c*/
/* #define DEBUG */ /* uncomment for debugging info */
-#ifdef OVLB
-
/* part of the output on gain or loss of attribute */
static
const char * const plusattr[] = {
else u.moreluck = -LUCKADD;
}
-#endif /* OVLB */
-#ifdef OVL1
-
void
restore_attrib()
{
(void)encumber_msg();
}
-#endif /* OVL1 */
-#ifdef OVLB
-
#define AVAL 50 /* tune value for exercise gains */
void
return((hp <= 0) ? 1 : hp);
}
-#endif /* OVLB */
-#ifdef OVL0
-
schar
acurr(x)
int x;
else return((schar)(str - 100));
}
-#endif /* OVL0 */
-#ifdef OVL2
-
/* avoid possible problems with alignment overflow, and provide a centralized
* location for any future alignment limits
*/
}
}
-#endif /* OVL2 */
-
/*attrib.c*/
#include "hack.h"
-#ifdef OVL0
extern const char *hu_stat[]; /* defined in eat.c */
const char * const enc_stat[] = {
STATIC_DCL void NDECL(bot1);
STATIC_DCL void NDECL(bot2);
-#endif /* OVL0 */
/* MAXCO must hold longest uncompressed status line, and must be larger
* than COLNO
#define MAXCO (COLNO+20)
#endif
-#ifndef OVLB
-STATIC_DCL int mrank_sz;
-#else /* OVLB */
STATIC_OVL NEARDATA int mrank_sz = 0; /* loaded by max_rank_sz (from u_init) */
-#endif /* OVLB */
-
STATIC_DCL const char *NDECL(rank);
-#ifdef OVL1
-
/* convert experience level (1..30) to rank index (0..8) */
int
xlev_to_rank(xlev)
return NON_PM;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
max_rank_sz()
{
return;
}
-#endif /* OVLB */
-#ifdef OVL0
-
#ifdef SCORE_ON_BOTL
long
botl_score()
flags.botl = flags.botlx = 0;
}
-#endif /* OVL0 */
-
/*botl.c*/
extern int NDECL(doorganize); /**/
#endif /* DUMB */
-#ifdef OVL1
static int NDECL((*timed_occ_fn));
-#endif /* OVL1 */
STATIC_PTR int NDECL(doprev_message);
STATIC_PTR int NDECL(timed_occupation);
STATIC_PTR int NDECL(doconduct); /**/
STATIC_PTR boolean NDECL(minimal_enlightenment);
-#ifdef OVLB
STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *));
STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *));
#ifdef UNIX
static void NDECL(end_of_input);
#endif
-#endif /* OVLB */
static const char* readchar_queue="";
static coord clicklook_cc;
STATIC_DCL char *NDECL(parse);
STATIC_DCL boolean FDECL(help_dir, (CHAR_P,const char *));
-#ifdef OVL1
-
STATIC_PTR int
doprev_message()
{
}
#endif /* REDO */
-#endif /* OVL1 */
-#ifdef OVLB
-
STATIC_PTR int
doextcmd() /* here after # - now read a full-word command */
{
destroy_nhwindow(en_win);
}
-#endif /* OVLB */
-#ifdef OVL1
-
#ifndef M
# ifndef NHSTDC
# define M(c) (0x80 | (c))
return TRUE;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
confdir()
{
return;
}
-#endif /* OVLB */
-#ifdef OVL0
-
int
isok(x,y)
register int x, y;
return(in_line);
}
-#endif /* OVL0 */
-#ifdef OVLB
-
#ifdef UNIX
static
void
}
#endif
-#endif /* OVLB */
-#ifdef OVL0
-
char
readchar()
{
}
# endif /*PORT_DEBUG*/
-#endif /* OVL0 */
-#ifdef OVLB
/*
* Parameter validator for generic yes/no function to prevent
* the core from sending too long a prompt string to the
Strcat(qbuf,"...");
return (*windowprocs.win_yn_function)(qbuf, resp, def);
}
-#endif
/*cmd.c*/
#include "hack.h"
-#ifdef OVLB
STATIC_DCL void FDECL(get_wall_for_db, (int *, int *));
STATIC_DCL struct entity *FDECL(e_at, (int, int));
STATIC_DCL void FDECL(m_to_e, (struct monst *, int, int, struct entity *));
STATIC_DCL boolean FDECL(e_missed, (struct entity *, BOOLEAN_P));
STATIC_DCL boolean FDECL(e_jumps, (struct entity *));
STATIC_DCL void FDECL(do_entity, (struct entity *));
-#endif /* OVLB */
-
-#ifdef OVL0
boolean
is_pool(x,y)
return FALSE;
}
-#endif /* OVL0 */
-
-#ifdef OVL1
-
/*
* We want to know whether a wall (or a door) is the portcullis (passageway)
* of an eventual drawbridge.
return FALSE;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/*
* Find the drawbridge wall associated with a drawbridge.
*/
}
}
-#endif /* OVLB */
-
/*dbridge.c*/
#include "edog.h"
/* #define DEBUG */ /* turn on for diagnostics */
-#ifdef OVLB
-
static NEARDATA boolean did_dig_msg;
STATIC_DCL boolean NDECL(rm_waslit);
}
}
-#endif /* OVLB */
-#ifdef OVL0
-
/* Return TRUE if monster died, FALSE otherwise. Called from m_move(). */
boolean
mdig_tunnel(mtmp)
return FALSE;
}
-#endif /* OVL0 */
-#ifdef OVL3
-
/* digging via wand zap or spell cast */
void
zap_dig()
if (isok(x,y)) bury_objs(x,y);
return 0;
}
-
#endif /* DEBUG */
-#endif /* OVL3 */
/*dig.c*/
#include "lev.h"
#ifdef SINKS
-# ifdef OVLB
STATIC_DCL void FDECL(trycall, (struct obj *));
-# endif /* OVLB */
STATIC_DCL void FDECL(dosinkring, (struct obj *));
#endif /* SINKS */
STATIC_PTR int FDECL(drop, (struct obj *));
STATIC_PTR int NDECL(wipeoff);
-#ifdef OVL0
STATIC_DCL int FDECL(menu_drop, (int));
-#endif
-#ifdef OVL2
STATIC_DCL int NDECL(currentlevel_rewrite);
STATIC_DCL void NDECL(final_level);
/* static boolean FDECL(badspot, (XCHAR_P,XCHAR_P)); */
-#endif
-
-#ifdef OVLB
static NEARDATA const char drop_types[] =
{ ALLOW_COUNT, COIN_CLASS, ALL_CLASSES, 0 };
return result;
}
-#endif /* OVLB */
-#ifdef OVL0
-
/* Called when a boulder is dropped, thrown, or pushed. If it ends up
* in a pool, it either fills the pool up or sinks away. In either case,
* it's gone for good... If the destination is not a pool, returns FALSE.
return FALSE;
}
-#endif /* OVL0 */
-#ifdef OVLB
-
void
doaltarobj(obj) /* obj is an object dropped on an altar */
register struct obj *obj;
}
#endif
-#endif /* OVLB */
-#ifdef OVL0
-
/* some common tests when trying to drop or throw items */
boolean
canletgo(obj,word)
return n_dropped;
}
-#endif /* OVL0 */
-#ifdef OVL2
-
/* on a ladder, used in goto_level */
static NEARDATA boolean at_ladder = FALSE;
free((genericptr_t)dfr_post_msg), dfr_post_msg = 0;
}
-#endif /* OVL2 */
-#ifdef OVL3
-
/*
* Return TRUE if we created a monster for the corpse. If successful, the
* corpse is gone.
return(1); /* Do nothing, but let other things happen */
}
-#endif /* OVL3 */
-#ifdef OVLB
-
STATIC_PTR int
wipeoff()
{
(void)encumber_msg();
}
-#endif /* OVLB */
-
/*do.c*/
#include "hack.h"
-#ifdef OVLB
-
STATIC_DCL void FDECL(do_oname, (struct obj *));
static void FDECL(getpos_help, (BOOLEAN_P,const char *));
}
}
-#endif /*OVLB*/
-#ifdef OVL0
-
static const char * const ghostnames[] = {
/* these names should have length < PL_NSIZ */
/* Capitalize the names for aesthetics -dgk */
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
char *
l_monnam(mtmp)
register struct monst *mtmp;
mtmp->mnamelth ? SUPPRESS_SADDLE : 0, TRUE));
}
-#endif /* OVLB */
-#ifdef OVL0
-
char *
mon_nam(mtmp)
register struct monst *mtmp;
return x_monnam(mtmp, prefix, (char *)0, suppression_flag, FALSE);
}
-#endif /* OVL0 */
-#ifdef OVLB
-
char *
Adjmonnam(mtmp, adj)
register struct monst *mtmp;
: "Glenn Wichman";
}
#endif /* REINCARNATION */
-#endif /* OVLB */
-
-#ifdef OVL2
static NEARDATA const char * const hcolors[] = {
"ultraviolet", "infrared", "bluish-orange",
}
return buf;
}
-#endif /* OVL2 */
/*do_name.c*/
#include "hack.h"
-#ifndef OVLB
-
-STATIC_DCL long takeoff_mask, taking_off;
-
-#else /* OVLB */
-
STATIC_OVL NEARDATA long takeoff_mask = 0L;
static NEARDATA long taking_off = 0L;
return(1);
}
-#endif /* OVLB */
-
-#ifdef OVL0
-
void
find_ac()
{
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
void
glibr()
{
}
}
-#endif /* OVLB */
-
/*do_wear.c*/
#include "hack.h"
#include "edog.h"
-#ifdef OVLB
-
STATIC_DCL int NDECL(pet_type);
void
else mtmp->mhp += imv;
}
-#endif /* OVLB */
-#ifdef OVL2
-
/* called when you move to another level */
void
keepdogs(pets_only)
}
}
-#endif /* OVL2 */
-#ifdef OVLB
-
void
migrate_to_level(mtmp, tolev, xyloc, cc)
register struct monst *mtmp;
mtmp->mx = mtmp->my = 0; /* this implies migration */
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* return quality of food; the lower the better */
/* fungi will eat even tainted food */
int
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
struct monst *
tamedog(mtmp, obj)
register struct monst *mtmp;
}
}
-#endif /* OVLB */
-
/*dog.c*/
extern boolean notonhead;
-#ifdef OVL0
-
STATIC_DCL boolean FDECL(dog_hunger,(struct monst *,struct edog *));
STATIC_DCL int FDECL(dog_invent,(struct monst *,struct edog *,int));
STATIC_DCL int FDECL(dog_goal,(struct monst *,struct edog *,int,int,int));
static NEARDATA const char nofetch[] = { BALL_CLASS, CHAIN_CLASS, ROCK_CLASS, 0 };
-#endif /* OVL0 */
-
STATIC_OVL boolean FDECL(cursed_object_at, (int, int));
STATIC_VAR xchar gtyp, gx, gy; /* type and position of dog's current goal */
STATIC_PTR void FDECL(wantdoor, (int, int, genericptr_t));
-#ifdef OVLB
STATIC_OVL boolean
cursed_object_at(x, y)
int x, y;
return 1;
}
-#endif /* OVLB */
-#ifdef OVL0
-
/* hunger effects -- returns TRUE on starvation */
STATIC_OVL boolean
dog_hunger(mtmp, edog)
return FALSE;
}
-#endif /* OVL0 */
-#ifdef OVLB
-
/*ARGSUSED*/ /* do_clear_area client */
STATIC_PTR void
wantdoor(x, y, distance)
}
}
-#endif /* OVLB */
-
/*dogmove.c*/
#include "dgn_file.h"
#include "dlb.h"
-#ifdef OVL1
-
#define DUNGEON_FILE "dungeon"
#define X_START "x-strt"
return((xchar)(ledgerno - dungeons[ledger_to_dnum(ledgerno)].ledger_start));
}
-#endif /* OVL1 */
-#ifdef OVL0
-
/* returns the depth of a level, in floors below the surface */
/* (note levels in different dungeons can have the same depth). */
schar
return((boolean)((lev1->dnum == lev2->dnum) && (lev1->dlevel == lev2->dlevel)));
}
-#endif /* OVL0 */
-#ifdef OVL1
-
/* is this level referenced in the special level chain? */
s_level *
Is_special(lev)
newlevel->dlevel = levnum;
}
-#endif /* OVL1 */
-#ifdef OVL0
-
boolean
In_quest(lev) /* are you in the quest dungeon? */
d_level *lev;
return((boolean)(lev->dnum == quest_dnum));
}
-#endif /* OVL0 */
-#ifdef OVL1
-
boolean
In_mines(lev) /* are you in the mines dungeon? */
d_level *lev;
return FALSE;
}
-#endif /* OVL1 */
-#ifdef OVL0
-
boolean
In_hell(lev) /* are you in one of the Hell levels? */
d_level *lev;
return((boolean)(dungeons[lev->dnum].flags.hellish));
}
-#endif /* OVL0 */
-#ifdef OVL1
-
void
find_hell(lev) /* sets *lev to be the gateway to Gehennom... */
d_level *lev;
dest->dlevel = 1;
}
-#endif /* OVL1 */
-#ifdef OVL0
-
int
induced_align(pct)
int pct;
return(Align2amask(al));
}
-#endif /* OVL0 */
-#ifdef OVL1
-
boolean
Invocation_lev(lev)
d_level *lev;
}
#endif /* WIZARD */
-#endif /* OVL1 */
-
/*dungeon.c*/
STATIC_PTR int NDECL(opentin);
STATIC_PTR int NDECL(unfaint);
-#ifdef OVLB
STATIC_DCL const char *FDECL(food_xname, (struct obj *,BOOLEAN_P));
STATIC_DCL void FDECL(choke, (struct obj *));
STATIC_DCL void NDECL(recalc_wt);
char msgbuf[BUFSZ];
-#endif /* OVLB */
-
/* hunger texts used on bottom line (each 8 chars long) */
#define SATIATED 0
#define NOT_HUNGRY 1
/* also used to see if you're allowed to eat cats and dogs */
#define CANNIBAL_ALLOWED() (Role_if(PM_CAVEMAN) || Race_if(PM_ORC))
-#ifndef OVLB
-
-STATIC_DCL NEARDATA const char comestibles[];
-STATIC_DCL NEARDATA const char allobj[];
-STATIC_DCL boolean force_save_hs;
-
-#else
-
STATIC_OVL NEARDATA const char comestibles[] = { FOOD_CLASS, 0 };
/* Gold must come first for getobj(). */
"Starved "
};
-#endif /* OVLB */
-#ifdef OVL1
-
/*
* Decide whether a particular object can be eaten by the possibly
* polymorphed character. Not used for monster checks.
return (boolean)(obj->oclass == FOOD_CLASS);
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
init_uhunger()
{
return 0;
}
-#endif /* OVLB */
-#ifdef OVL0
-
void
gethungry() /* as time goes by - called by moveloop() and domove() */
{
newuhs(TRUE);
}
-#endif /* OVL0 */
-#ifdef OVLB
-
void
morehungry(num) /* called after vomiting and after performing feats of magic */
register int num;
return 0;
}
-#endif /* OVLB */
-#ifdef OVL0
-
boolean
is_fainted()
{
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
/* Returns an object representing food. Object may be either on floor or
* in inventory.
*/
}
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* called when eatfood occupation has been interrupted,
or in the case of theft, is about to be interrupted */
boolean
return FALSE;
}
-#endif /* OVL1 */
-
/*eat.c*/
STATIC_VAR NEARDATA struct engr *head_engr;
-#ifdef OVLB
/* random engravings */
static const char *random_mesg[] = {
"Elbereth",
(!Levitation ||
Is_airlevel(&u.uz) || Is_waterlevel(&u.uz)));
}
-#endif /* OVLB */
-#ifdef OVL0
const char *
surface(x, y)
}
#endif /* ELBERETH */
-#endif /* OVL0 */
-#ifdef OVL2
-
void
u_wipe_engr(cnt)
register int cnt;
wipe_engr_at(u.ux, u.uy, cnt);
}
-#endif /* OVL2 */
-#ifdef OVL1
-
void
wipe_engr_at(x,y,cnt)
register xchar x,y,cnt;
}
}
-#endif /* OVL1 */
-#ifdef OVL2
-
void
read_engr_at(x,y)
register int x,y;
}
}
-#endif /* OVL2 */
-#ifdef OVLB
-
void
make_engr_at(x,y,s,e_time,e_type)
register int x,y;
return;
}
-
-#endif /* OVLB */
-
/*engrave.c*/
#include "hack.h"
-#ifdef OVL0
-
/* Note: Arrays are column first, while the screen is row first */
static int expl[3][3] = {
{ S_explode1, S_explode4, S_explode7 },
if (i < 50) i = 50; /* in case random damage is very small */
wake_nearto(x, y, i);
}
-#endif /* OVL0 */
-#ifdef OVL1
struct scatter_chain {
struct scatter_chain *next; /* pointer to next scatter item */
explode(x, y, ZT_SPELL_O_FIRE, d(4,4), BURNING_OIL, EXPL_FIERY);
}
-#endif /* OVL1 */
-
/*explode.c*/
#include "hack.h"
-#ifdef OVL1
STATIC_DCL void NDECL(maybe_wail);
-#endif /*OVL1*/
STATIC_DCL int NDECL(moverock);
STATIC_DCL int FDECL(still_chewing,(XCHAR_P,XCHAR_P));
#ifdef SINKS
#define IS_SHOP(x) (rooms[x].rtype >= SHOPBASE)
-#ifdef OVL2
-
boolean
revive_nasty(x, y, msg)
int x,y;
return 0;
}
-#endif /* OVL2 */
-#ifdef OVLB
-
void
movobj(obj, ox, oy)
register struct obj *obj;
(levl[x][y].wall_info & W_NONPASSWALL)));
}
-#endif /* OVLB */
-#ifdef OVL1
-
boolean
bad_rock(mdat,x,y)
struct permonst *mdat;
return((boolean)(Invocation_lev(&u.uz) && x == inv_pos.x && y == inv_pos.y));
}
-#endif /* OVL1 */
-#ifdef OVL3
-
/* return TRUE if (dx,dy) is an OK place to move
* mode is one of DO_MOVE, TEST_MOVE or TEST_TRAV
*/
}
}
-#endif /* OVL3 */
-#ifdef OVL2
-
void
spoteffects(pick)
boolean pick;
return;
}
-#endif /* OVL2 */
-#ifdef OVLB
-
int
dopickup()
{
return (pickup(-count));
}
-#endif /* OVLB */
-#ifdef OVL2
-
/* stop running if we see something interesting */
/* turn around a corner if that is the only way we can proceed */
/* do not turn left or right twice */
afternmv = 0;
}
-#endif /* OVL2 */
-#ifdef OVL1
-
STATIC_OVL void
maybe_wail()
{
return 0;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
int
inv_cnt()
{
return 0;
}
#endif
-#endif /* OVLB */
/*hack.c*/
# define Static static
#endif
-#ifdef OVLB
boolean
digit(c) /* is 'c' a digit? */
char c;
{
return((boolean)(('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z')));
}
-#endif /* OVLB */
-#ifdef OVL1
char
highc(c) /* force 'c' into uppercase */
char c;
{
return((char)(('A' <= c && c <= 'Z') ? (c | 040) : c));
}
-#endif /* OVL1 */
-#ifdef OVLB
char *
lcase(s) /* convert a string into all lowercase */
char *s;
return bp;
}
-#endif /* OVLB */
-
-#ifdef OVL0
char *
eos(s) /* return the end of a string (pointing at '\0') */
register char *s;
*q = '\0';
return buf;
}
-#endif /* OVL0 */
-#ifdef OVL2
boolean
onlyspace(s) /* is a string entirely whitespace? */
const char *s;
if (*s != ' ' && *s != '\t') return FALSE;
return TRUE;
}
-#endif /* OVL2 */
-#ifdef OVLB
char *
tabexpand(sbuf) /* expand tabs into proper number of spaces */
char *sbuf;
}
return ccc;
}
-#endif /* OVLB */
-#ifdef OVL2
const char *
ordin(n) /* return the ordinal suffix of a number */
int n; /* note: should be non-negative */
return (dd == 0 || dd > 3 || (n % 100) / 10 == 1) ? "th" :
(dd == 1) ? "st" : (dd == 2) ? "nd" : "rd";
}
-#endif /* OVL2 */
-#ifdef OVL1
char *
sitoa(n) /* make a signed digit string from a number */
int n;
{
return (n < 0) ? -1 : (n != 0);
}
-#endif /* OVL1 */
-#ifdef OVLB
int
rounddiv(x, y) /* calculate x/y, rounding as appropriate */
long x;
return divsgn * r;
}
-#endif /* OVLB */
-#ifdef OVL0
int
distmin(x0, y0, x1, y1) /* distance between two points, in moves */
int x0, y0, x1, y1;
return((boolean)(!dy || !dx || (dy == dx) || (dy + dx == 0))); /* (dy == -dx) */
}
-#endif /* OVL0 */
-#ifdef OVLB
-
boolean
pmatch(patrn, strng) /* match a string against a pattern */
const char *patrn, *strng;
else /* return pmatch(patrn, strng); */
goto pmatch_top; /* optimize tail recursion */
}
-#endif /* OVLB */
-#ifdef OVL2
#ifndef STRNCMPI
int
strncmpi(s1, s2, n) /* case insensitive counted string comparison */
return 0; /* s1 == s2 */
}
#endif /* STRNCMPI */
-#endif /* OVL2 */
-#ifdef OVLB
#ifndef STRSTRI
char *
return (boolean)(!c1 && !c2);
}
-#endif /* OVLB */
-#ifdef OVL2
-
/*
* Time routines
*
{
return(getlt()->tm_hour == 0);
}
-#endif /* OVL2 */
/*hacklib.c*/
#define NOINVSYM '#'
#define CONTAINED_SYM '>' /* designator for inside a container */
-#ifdef OVL1
STATIC_DCL void NDECL(reorder_invent);
STATIC_DCL boolean FDECL(mergable,(struct obj *,struct obj *));
STATIC_DCL void FDECL(invdisp_nothing, (const char *,const char *));
STATIC_DCL boolean FDECL(worn_wield_only, (struct obj *));
STATIC_DCL boolean FDECL(only_here, (struct obj *));
-#endif /* OVL1 */
STATIC_DCL void FDECL(compactify,(char *));
STATIC_DCL boolean FDECL(taking_off, (const char *));
STATIC_DCL boolean FDECL(putting_on, (const char *));
STATIC_PTR int FDECL(ckunpaid,(struct obj *));
STATIC_PTR int FDECL(ckvalidcat,(struct obj *));
static char FDECL(display_pickinv, (const char *,BOOLEAN_P, long *));
-#ifdef OVLB
STATIC_DCL boolean FDECL(this_type_only, (struct obj *));
STATIC_DCL void NDECL(dounpaid);
STATIC_DCL struct obj *FDECL(find_unpaid,(struct obj *,struct obj **));
STATIC_DCL void FDECL(menu_identify, (int));
STATIC_DCL boolean FDECL(tool_in_use, (struct obj *));
-#endif /* OVLB */
STATIC_DCL char FDECL(obj_to_let,(struct obj *));
-#ifdef OVLB
-
static int lastinvnr = 51; /* 0 ... 51 (never saved&restored) */
#ifdef WIZARD
lastinvnr = i;
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* note: assumes ASCII; toggling a bit puts lowercase in front of uppercase */
#define inv_rank(o) ((o)->invlet ^ 040)
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* Add an item to the inventory unless we're fumbling or it refuses to be
* held (via touch_artifact), and give a message.
* If there aren't any free inventory slots, we'll drop it instead.
if (obj->known) update_inventory();
}
-#endif /* OVLB */
-#ifdef OVL3
-
/*
Adjust hero's attributes as if this object was being removed from the
hero's inventory. This should only be called from freeinv() and
}
}
-#endif /* OVL3 */
-#ifdef OVL2
-
/* destroy object in fobj chain (if unpaid, it remains on the bill) */
void
delobj(obj)
obfree(obj, (struct obj *) 0); /* frees contents also */
}
-#endif /* OVL2 */
-#ifdef OVL0
-
struct obj *
sobj_at(n,x,y)
register int n, x, y;
return((struct obj *)0);
}
-#endif /* OVL0 */
-#ifdef OVLB
-
struct obj *
carrying(type)
register int type;
return(FALSE);
}
-#endif /* OVLB */
-#ifdef OVL2
-
struct obj *
g_at(x,y)
register int x, y;
return((struct obj *)0);
}
-#endif /* OVL2 */
-#ifdef OVLB
#ifndef GOLDOBJ
/* Make a gold object from the hero's gold. */
struct obj *
return(otmp);
}
#endif
-#endif /* OVLB */
-#ifdef OVL1
STATIC_OVL void
compactify(buf)
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
STATIC_PTR int
ckvalidcat(otmp)
register struct obj *otmp;
update_inventory();
}
-#endif /* OVLB */
-#ifdef OVL2
-
STATIC_OVL char
obj_to_let(obj) /* should of course only be called for things in invent */
register struct obj *obj;
xprname(obj, (char *)0, obj_to_let(obj), TRUE, 0L, quan));
}
-#endif /* OVL2 */
-#ifdef OVL1
-
char *
xprname(obj, txt, let, dot, cost, quan)
struct obj *obj;
return li;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* the 'i' command */
int
ddoinv()
}
}
-#endif /* OVLB */
-#ifdef OVL1
-
void
stackobj(obj)
struct obj *obj;
return 0;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
int
doprwep()
{
u.uundetected = OBJ_AT(u.ux, u.uy);
}
-#endif /* OVLB */
-
-
-#ifdef OVL1
-
/*
* Conversion from a class to a string for printing.
* This must match the object class order.
invbufsiz = 0;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
reassign()
{
lastinvnr = i;
}
-#endif /* OVLB */
-#ifdef OVL1
-
int
doorganize() /* inventory organizer by Del Lamb */
{
return n;
}
-#endif /* OVL1 */
-
/*invent.c*/
* across saves and restores.
*/
-#ifdef OVL3
-
/* flags */
#define LSF_SHOW 0x1 /* display the light source */
#define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */
#endif /* WIZARD */
-#endif /* OVL3 */
-
/*light.c*/
int picktyp, chance, usedtime;
} xlock;
-#ifdef OVLB
-
STATIC_DCL const char *NDECL(lock_action);
STATIC_DCL boolean FDECL(obstructed,(int,int));
STATIC_DCL void FDECL(chest_shatter_msg, (struct obj *));
return((xlock.usedtime = 0));
}
-#endif /* OVLB */
-#ifdef OVL0
-
void
reset_pick()
{
xlock.box = 0;
}
-#endif /* OVL0 */
-#ifdef OVLB
-
int
pick_lock(pick) /* pick a lock with a given object */
register struct obj *pick;
pline("%s %s!", An(thing), disposition);
}
-#endif /* OVLB */
-
/*lock.c*/
extern char *viz_rmin, *viz_rmax; /* line-of-sight limits (vision.c) */
-#ifdef OVL0
-
# if !defined(UNIX) && !defined(VMS) && !defined(LAN_MAIL)
int mustgetmail = -1;
# endif
-#endif /* OVL0 */
-#ifdef OVLB
-
# ifdef UNIX
#include <sys/stat.h>
#include <pwd.h>
}
# endif /* UNIX */
-#endif /* OVLB */
-#ifdef OVL0
-
/*
* Pick coordinates for a starting position for the mail daemon. Called
* from newmail() and newphone().
# endif /* LAN_MAIL */
-#endif /* OVL0 */
-
#endif /* MAIL */
/*mail.c*/
(mptr->mlet == S_HUMAN && Role_if(role_pm) && \
(mptr->msound == MS_LEADER || mptr->msound == MS_NEMESIS))
-#ifdef OVL0
STATIC_DCL boolean FDECL(uncommon, (int));
STATIC_DCL int FDECL(align_shift, (struct permonst *));
-#endif /* OVL0 */
STATIC_DCL boolean FDECL(wrong_elem_type, (struct permonst *));
STATIC_DCL void FDECL(m_initgrp,(struct monst *,int,int,int));
STATIC_DCL void FDECL(m_initthrow,(struct monst *,int,int));
STATIC_DCL void FDECL(m_initweap,(struct monst *));
-#ifdef OVL1
STATIC_DCL void FDECL(m_initinv,(struct monst *));
-#endif /* OVL1 */
extern const int monstr[];
#define toostrong(monindx, lev) (monstr[monindx] > lev)
#define tooweak(monindx, lev) (monstr[monindx] < lev)
-#ifdef OVLB
boolean
is_home_elemental(ptr)
register struct permonst *ptr;
(void) mpickobj(mtmp, otmp);
}
-#endif /* OVLB */
-#ifdef OVL2
-
STATIC_OVL void
m_initweap(mtmp)
register struct monst *mtmp;
(void) mongets(mtmp, rnd_offensive_item(mtmp));
}
-#endif /* OVL2 */
-#ifdef OVL1
-
#ifdef GOLDOBJ
/*
* Makes up money for monster's inventory.
return known;
}
-#endif /* OVL1 */
-#ifdef OVL0
-
STATIC_OVL boolean
uncommon(mndx)
int mndx;
} /* note: safe to ignore extinction of unique monsters */
}
-#endif /* OVL0 */
-#ifdef OVL1
-
/* The routine below is used to make one of the multiple types
* of a given monster class. The second parameter specifies a
* special casing bit mask to allow the normal genesis
return((tmp > tmp2) ? tmp2 : (tmp > 0 ? tmp : 0)); /* 0 lower limit */
}
-#endif /* OVL1 */
-#ifdef OVLB
-
struct permonst *
grow_up(mtmp, victim) /* `mtmp' might "grow up" into a bigger version */
struct monst *mtmp, *victim;
return ptr;
}
-#endif /* OVLB */
-#ifdef OVL1
-
int
mongets(mtmp, otyp)
register struct monst *mtmp;
} else return(0);
}
-#endif /* OVL1 */
-#ifdef OVLB
-
int
golemhp(type)
int type;
}
}
-#endif /* OVLB */
-#ifdef OVL1
-
/*
* Alignment vs. yours determines monster's attitude to you.
* ( some "animal" types are co-aligned, but also hungry )
mtmp->malign = abs(mal);
}
-#endif /* OVL1 */
-#ifdef OVLB
-
static NEARDATA char syms[] = {
MAXOCLASSES, MAXOCLASSES+1, RING_CLASS, WAND_CLASS, WEAPON_CLASS,
FOOD_CLASS, COIN_CLASS, SCROLL_CLASS, POTION_CLASS, ARMOR_CLASS,
}
}
-#endif /* OVLB */
-
/*makemon.c*/
STATIC_DCL boolean FDECL(is_undirected_spell,(unsigned int,int));
STATIC_DCL boolean FDECL(spell_would_be_useless,(struct monst *,unsigned int,int));
-#ifdef OVL0
-
extern const char * const flash_types[]; /* from zap.c */
/* feedback when frustrated monster couldn't cast a spell */
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
/* convert a level based random selection into a specific mage spell;
inappropriate choices will be screened out by spell_would_be_useless() */
STATIC_OVL int
return FALSE;
}
-#endif /* OVLB */
-#ifdef OVL0
-
/* convert 1..10 to 0..9; add 10 for second group (spell casting) */
#define ad_to_typ(k) (10 + (int)k - 1)
return(1);
}
-#endif /* OVL0 */
-
/*mcastu.c*/
extern boolean notonhead;
-#ifdef OVLB
-
static NEARDATA boolean vis, far_noise;
static NEARDATA long noisetime;
static NEARDATA struct obj *otmp;
return(MM_HIT);
}
-#endif /* OVLB */
-
-
-#ifdef OVL0
-
int
noattacks(ptr) /* returns 1 if monster doesn't attack */
struct permonst *ptr;
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
STATIC_OVL void
mrustm(magr, mdef, obj)
register struct monst *magr, *mdef;
return w_mask;
}
-#endif /* OVLB */
-
/*mhitm.c*/
STATIC_VAR NEARDATA struct obj *otmp;
STATIC_DCL void FDECL(urustm, (struct monst *, struct obj *));
-# ifdef OVL1
STATIC_DCL boolean FDECL(u_slip_free, (struct monst *,struct attack *));
STATIC_DCL int FDECL(passiveum, (struct permonst *,struct monst *,struct attack *));
-# endif /* OVL1 */
-#ifdef OVLB
-# ifdef SEDUCE
+#ifdef SEDUCE
STATIC_DCL void FDECL(mayberem, (struct obj *, const char *));
-# endif
-#endif /* OVLB */
+#endif
STATIC_DCL boolean FDECL(diseasemu, (struct permonst *));
STATIC_DCL int FDECL(hitmu, (struct monst *,struct attack *));
/* changed to a parameter to mhitu. */
static int dieroll;
-#ifdef OVL1
-
-
STATIC_OVL void
hitmsg(mtmp, mattk)
register struct monst *mtmp;
exercise(A_DEX, FALSE);
}
-#endif /* OVL1 */
-#ifdef OVLB
-
STATIC_OVL void
wildmiss(mtmp, mattk) /* monster attacked your displaced image */
register struct monst *mtmp;
pline("Brrooaa... You land hard at some distance.");
}
-#endif /* OVLB */
-#ifdef OVL0
-
/* select a monster's next attack, possibly substituting for its usual one */
struct attack *
getmattk(mptr, indx, prev_result, alt_attk_buf)
return(0);
}
-#endif /* OVL0 */
-#ifdef OVLB
-
/*
* helper function for some compilers that have trouble with hitmu
*/
}
}
-#endif /* OVLB */
-#ifdef OVL1
-
STATIC_OVL boolean
diseasemu(mdat)
struct permonst *mdat;
return res;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* An interface for use when taking a blindfold off, for example,
* to see if an engulfing attack should immediately take affect, like
* a passive attack. TRUE if engulfing blindness occurred */
return(0);
}
-#endif /* OVLB */
-#ifdef OVL1
-
void
mdamageu(mtmp, n) /* mtmp hits you for n points damage */
register struct monst *mtmp;
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
STATIC_OVL void
urustm(mon, obj)
register struct monst *mon;
}
}
-#endif /* OVLB */
-#ifdef OVL1
-
int
could_seduce(magr,mdef,mattk)
struct monst *magr, *mdef;
return (pagr->mlet == S_NYMPH) ? 2 : 0;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
#ifdef SEDUCE
/* Returns 1 if monster teleported */
int
}
#endif /* SEDUCE */
-#endif /* OVLB */
-
-#ifdef OVL1
-
STATIC_OVL int
passiveum(olduasmon,mtmp,mattk)
struct permonst *olduasmon;
return 1;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
#include "edog.h"
struct monst *
cloneu()
return(mon);
}
-#endif /* OVLB */
-
/*mhitu.c*/
STATIC_DCL void FDECL(mkbox_cnts,(struct obj *));
STATIC_DCL void FDECL(obj_timer_checks,(struct obj *, XCHAR_P, XCHAR_P, int));
-#ifdef OVL1
STATIC_DCL void FDECL(container_weight, (struct obj *));
STATIC_DCL struct obj *FDECL(save_mtraits, (struct obj *, struct monst *));
#ifdef WIZARD
STATIC_DCL const char *FDECL(where_name, (int));
STATIC_DCL void FDECL(check_contained, (struct obj *,const char *));
#endif
-#endif /* OVL1 */
extern struct obj *thrownobj; /* defined in dothrow.c */
char iclass; /* item class */
};
-#ifdef OVL1
-
const struct icp mkobjprobs[] = {
{10, WEAPON_CLASS},
{10, ARMOR_CLASS},
return;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
static const char dknowns[] = {
WAND_CLASS, RING_CLASS, POTION_CLASS, SCROLL_CLASS,
GEM_CLASS, SPBOOK_CLASS, WEAPON_CLASS, TOOL_CLASS, 0
return;
}
-#endif /* OVLB */
-#ifdef OVL1
-
void
blessorcurse(otmp, chance)
register struct obj *otmp;
return;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
int
bcsign(otmp)
register struct obj *otmp;
return(!!otmp->blessed - !!otmp->cursed);
}
-#endif /* OVLB */
-#ifdef OVL0
-
/*
* Calculate the weight of the given object. This will recursively follow
* and calculate the weight of any containers.
{
return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE);
}
-#endif /* OVL0 */
-#ifdef OVLB
struct obj *
mkgold(amount, x, y)
return (gold);
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* return TRUE if the corpse has special timing */
#define special_corpse(num) (((num) == PM_LIZARD) \
|| ((num) == PM_LICHEN) \
return mnew;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* make an object named after someone listed in the scoreboard file */
struct obj *
mk_tt_object(objtype, x, y)
objects[otyp].oc_material != LIQUID));
}
-#endif /* OVLB */
-#ifdef OVL1
-
/*
* These routines maintain the single-linked lists headed in level.objects[][]
* and threaded through the nexthere fields in the object-instance structure.
}
#endif /* WIZARD */
-#endif /* OVL1 */
-
/*mkobj.c*/
#include "hack.h"
-#ifdef OVLB
STATIC_DCL boolean FDECL(isbig, (struct mkroom *));
STATIC_DCL struct mkroom * FDECL(pick_room,(BOOLEAN_P));
STATIC_DCL void NDECL(mkshop), FDECL(mkzoo,(int)), NDECL(mkswamp);
STATIC_DCL struct permonst * NDECL(squadmon);
STATIC_DCL void FDECL(save_room, (int,struct mkroom *));
STATIC_DCL void FDECL(rest_room, (int,struct mkroom *));
-#endif /* OVLB */
#define sq(x) ((x)*(x))
extern const struct shclass shtypes[]; /* defined in shknam.c */
-#ifdef OVLB
-
STATIC_OVL boolean
isbig(sroom)
register struct mkroom *sroom;
return FALSE;
}
-#endif /* OVLB */
-#ifdef OVL0
-
int
somex(croom)
register struct mkroom *croom;
return (struct mkroom *) 0;
}
-#endif /* OVL0 */
-#ifdef OVLB
-
struct permonst *
courtmon()
{
rooms[nroom].hx = -1; /* restore ending flags */
subrooms[nsubroom].hx = -1;
}
-#endif /* OVLB */
/*mkroom.c*/
STATIC_DCL boolean FDECL(restrap,(struct monst *));
STATIC_DCL long FDECL(mm_aggression, (struct monst *,struct monst *));
-#ifdef OVL2
STATIC_DCL int NDECL(pick_animal);
STATIC_DCL int FDECL(select_newcham_form, (struct monst *));
STATIC_DCL void FDECL(kill_eggs, (struct obj *));
-#endif
#ifdef REINCARNATION
#define LEVEL_SPECIFIC_NOCORPSE(mdat) \
#if 0
/* part of the original warning code which was replaced in 3.3.1 */
-#ifdef OVL1
#define warnDelay 10
long lastwarntime;
int lastwarnlev;
};
STATIC_DCL void NDECL(warn_effects);
-#endif /* OVL1 */
#endif /* 0 */
-#ifndef OVLB
-STATIC_VAR short cham_to_pm[];
-#else
STATIC_DCL struct obj *FDECL(make_corpse,(struct monst *));
STATIC_DCL void FDECL(m_detach, (struct monst *, struct permonst *));
STATIC_DCL void FDECL(lifesaved_monster, (struct monst *));
return obj;
}
-#endif /* OVLB */
-#ifdef OVL1
-
#if 0
/* part of the original warning code which was replaced in 3.3.1 */
STATIC_OVL void
return somebody_can_move;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
#define mstoning(obj) (ofood(obj) && \
(touch_petrifies(&mons[(obj)->corpsenm]) || \
(obj)->corpsenm == PM_MEDUSA))
}
}
}
-#endif /* OVLB */
-#ifdef OVL2
boolean
mpickstuff(mtmp, str)
return FALSE;
}
-#endif /* OVL2 */
-#ifdef OVL0
-
int
curr_mon_load(mtmp)
register struct monst *mtmp;
return(cnt);
}
-#endif /* OVL0 */
-#ifdef OVL1
-
/* Monster against monster special attacks; for the specified monster
combinations, this allows one monster to attack another adjacent one
in the absence of Conflict. There is no provision for targetting
iflags.purge_monsters = 0;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* called when monster is moved to larger structure */
void
replmon(mtmp, mtmp2)
}
}
-#endif /* OVLB */
-#ifdef OVL2
-
void
setmangry(mtmp)
register struct monst *mtmp;
kill_eggs(level.buriedobjlist);
}
-#endif /* OVL2 */
-#ifdef OVLB
-
void
golemeffects(mon, damtype, dam)
register struct monst *mon;
break;
}
}
-#endif /* OVLB */
/*mon.c*/
/* These routines provide basic data for any type of monster. */
-#ifdef OVLB
-
void
set_mon_data(mon, ptr, flag)
struct monst *mon;
return;
}
-#endif /* OVLB */
-#ifdef OVL0
-
struct attack *
attacktype_fordmg(ptr, atyp, dtyp)
struct permonst *ptr;
return attacktype_fordmg(ptr, atyp, AD_ANY) ? TRUE : FALSE;
}
-#endif /* OVL0 */
-#ifdef OVLB
-
boolean
poly_when_stoned(ptr)
struct permonst *ptr;
return TRUE;
}
-#endif /* OVLB */
-#ifdef OVL0
-
boolean
ranged_attk(ptr) /* returns TRUE if monster can attack at range */
struct permonst *ptr;
(slithy(mptr) && !bigmonst(mptr)));
}
-#endif /* OVL0 */
-#ifdef OVL1
-
boolean
can_track(ptr) /* returns TRUE if monster can track well */
register struct permonst *ptr;
return((boolean)haseyes(ptr));
}
-#endif /* OVL1 */
-#ifdef OVLB
-
boolean
sliparm(ptr) /* creature will slide out of armor */
register struct permonst *ptr;
ptr == &mons[PM_MARILITH] || ptr == &mons[PM_WINGED_GARGOYLE])
&& !sliparm(ptr));
}
-#endif /* OVLB */
-#ifdef OVL1
boolean
sticks(ptr) /* creature sticks other creatures it hits */
return 0;
}
-#endif /* OVL1 */
-#ifdef OVL0
-
int
monsndx(ptr) /* return an index into the mons array */
struct permonst *ptr;
return(i);
}
-#endif /* OVL0 */
-#ifdef OVL1
-
-
int
name_to_mon(in_str)
const char *in_str;
return mntmp;
}
-#endif /* OVL1 */
-#ifdef OVL2
-
/* returns 3 values (0=male, 1=female, 2=none) */
int
gender(mtmp)
type_is_pname(mtmp->data)) ? (int)mtmp->female : 2;
}
-#endif /* OVL2 */
-#ifdef OVLB
-
/* used for nearby monsters when you go to another level */
boolean
levl_follower(mtmp)
return what;
}
-#endif /* OVLB */
-
/*mondata.c*/
extern boolean notonhead;
-#ifdef OVL0
-
STATIC_DCL int FDECL(disturb,(struct monst *));
STATIC_DCL void FDECL(distfleeck,(struct monst *,int *,int *,int *));
STATIC_DCL int FDECL(m_arrival, (struct monst *));
STATIC_DCL void FDECL(watch_on_duty,(struct monst *));
-#endif /* OVL0 */
-#ifdef OVLB
-
boolean /* TRUE : mtmp died */
mb_trapped(mtmp)
register struct monst *mtmp;
return(FALSE);
}
-#endif /* OVLB */
-#ifdef OVL0
-
STATIC_OVL void
watch_on_duty(mtmp)
register struct monst *mtmp;
}
}
-#endif /* OVL0 */
-#ifdef OVL1
-
int
dochugw(mtmp)
register struct monst *mtmp;
return(rd);
}
-#endif /* OVL1 */
-#ifdef OVL2
-
boolean
onscary(x, y, mtmp)
int x, y;
&& IS_ALTAR(levl[x][y].typ)));
}
-#endif /* OVL2 */
-#ifdef OVL0
-
/* regenerate lost hit points */
void
mon_regen(mon, digest_meal)
return(mmoved);
}
-#endif /* OVL0 */
-#ifdef OVL2
-
boolean
closed_door(x, y)
register int x, y;
return((boolean)(ACCESSIBLE(levl[x][y].typ) && !closed_door(x, y)));
}
-#endif /* OVL2 */
-#ifdef OVL0
-
/* decide where the monster thinks you are standing */
void
set_apparxy(mtmp)
return TRUE;
}
-#endif /* OVL0 */
-
/*monmove.c*/
#define POLE_LIM 5 /* How far monsters can use pole-weapons */
-#ifndef OVLB
-
-STATIC_DCL const char *breathwep[];
-
-#else /* OVLB */
-
/*
* Keep consistent with breath weapons in zap.c, and AD_* in monattk.h.
*/
return retvalu;
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* an object launched by someone/thing other than player attacks a monster;
return 1 if the object has stopped moving (hit or its range used up) */
int
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* Remove an item from the monster's inventory and destroy it. */
void
m_useup(mon, obj)
}
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* monster attempts ranged weapon attack against player */
void
thrwmu(mtmp)
nomul(0);
}
-#endif /* OVL1 */
-#ifdef OVLB
-
int
spitmu(mtmp, mattk) /* monster spits substance at you */
register struct monst *mtmp;
return 0;
}
-#endif /* OVLB */
-#ifdef OVL1
-
int
breamu(mtmp, mattk) /* monster breathes at you (ranged) */
register struct monst *mtmp;
return(linedup(mtmp->mux,mtmp->muy,mtmp->mx,mtmp->my));
}
-#endif /* OVL1 */
-#ifdef OVL0
-
/* Check if a monster is carrying a particular item.
*/
struct obj *
return hits;
}
-#endif /* OVL0 */
-
/*mthrowu.c*/
#define NUMOBUF 12
STATIC_DCL char *FDECL(strprepend,(char *,const char *));
-#ifdef OVLB
static boolean FDECL(wishymatch, (const char *,const char *,BOOLEAN_P));
-#endif
static char *NDECL(nextobuf);
static void FDECL(add_erosion_words, (struct obj *, char *));
typ != BLACK_OPAL && \
typ != EMERALD && typ != OPAL)))
-#ifndef OVLB
-
-STATIC_DCL struct Jitem Japanese_items[];
-
-#else /* OVLB */
-
STATIC_OVL struct Jitem Japanese_items[] = {
{ SHORT_SWORD, "wakizashi" },
{ BROADSWORD, "ninja-to" },
{0, "" }
};
-#endif /* OVLB */
-
STATIC_DCL const char *FDECL(Japanese_item_name,(int i));
-#ifdef OVL1
-
STATIC_OVL char *
strprepend(s,pref)
register char *s;
return(s);
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* manage a pool of BUFSZ buffers, so callers don't have to */
static char *
nextobuf()
return buf;
}
-#endif /* OVLB */
-#ifdef OVL1
-
char *
xname(obj)
register struct obj *obj;
return onm;
}
-#endif /* OVL1 */
-#ifdef OVL0
/* used for naming "the unique_item" instead of "a unique_item" */
boolean
return(bp);
}
-#endif /* OVL0 */
-#ifdef OVLB
-
/* used from invent.c */
boolean
not_fully_identified(otmp)
FOOD_CLASS
};
-#endif /* OVLB */
-#ifdef OVL0
-
/* Plural routine; chiefly used for user-defined fruits. We have to try to
* account for everything reasonable the player has; something unreasonable
* can still break the code. However, it's still a lot more accurate than
return str;
}
-#endif /* OVL0 */
-
struct o_range {
const char *name, oclass;
int f_o_range, l_o_range;
};
-#ifndef OVLB
-
-STATIC_DCL const struct o_range o_ranges[];
-
-#else /* OVLB */
-
/* wishable subranges of objects */
STATIC_OVL NEARDATA const struct o_range o_ranges[] = {
{ "bag", TOOL_CLASS, SACK, BAG_OF_TRICKS },
}
return "whatcha-may-callit";
}
-#endif /* OVLB */
/*objnam.c*/
#include "edog.h"
#endif
-#ifdef OVLB
-
static boolean no_repeat = FALSE;
static char *FDECL(You_buf, (int));
"can't see yourself");
}
-#endif /* OVLB */
/*pline.c*/
#include "hack.h"
-#ifdef OVLB
STATIC_DCL void FDECL(polyman, (const char *,const char *));
STATIC_DCL void NDECL(break_armor);
STATIC_DCL void FDECL(drop_weapon,(int));
}
}
-#endif /* OVLB */
-#ifdef OVL1
-
const char *
mbodypart(mon, part)
struct monst *mon;
return mbodypart(&youmonst, part);
}
-#endif /* OVL1 */
-#ifdef OVL0
-
int
poly_gender()
{
return flags.female;
}
-#endif /* OVL0 */
-#ifdef OVLB
-
void
ugolemeffects(damtype, dam)
int damtype, dam;
}
}
-#endif /* OVLB */
-
/*polyself.c*/
#include "hack.h"
-#ifdef OVLB
boolean notonhead = FALSE;
static NEARDATA int nothing, unkn;
return mtmp2;
}
-#endif /* OVLB */
-
/*potion.c*/
/* this matches the categorizations shown by enlightenment */
#define ALGN_SINNED (-4) /* worse than strayed */
-#ifdef OVLB
-
STATIC_DCL boolean FDECL(histemple_at,(struct monst *,XCHAR_P,XCHAR_P));
STATIC_DCL boolean FDECL(has_shrine,(struct monst *));
return(0);
}
-#endif /* OVLB */
-
-#ifdef OVL0
-
char
temple_occupied(array)
register char *array;
return('\0');
}
-#endif /* OVL0 */
-#ifdef OVLB
-
STATIC_OVL boolean
histemple_at(priest, x, y)
register struct monst *priest;
}
}
-#endif /* OVLB */
-
/*priest.c*/
((mndx) == urace.malenum || \
(urace.femalenum != NON_PM && (mndx) == urace.femalenum))
-#ifdef OVLB
-
boolean known;
static NEARDATA const char readable[] =
}
#endif /* WIZARD */
-#endif /* OVLB */
-
/*read.c*/
# endif
#endif /* LINT */
-#ifdef OVL0
-
int
rn2(x) /* 0 <= rn2(x) < x */
register int x;
#endif
}
-#endif /* OVL0 */
-#ifdef OVLB
-
int
rnl(x) /* 0 <= rnl(x) < x; sometimes subtracting Luck */
register int x; /* good luck approaches 0, bad luck approaches (x-1) */
return i;
}
-#endif /* OVLB */
-#ifdef OVL0
-
int
rnd(x) /* 1 <= rnd(x) <= x */
register int x;
#endif
}
-#endif /* OVL0 */
-#ifdef OVL1
-
int
d(n,x) /* n <= d(n,x) <= (n*x) */
register int n, x;
return(tmp); /* Alea iacta est. -- J.C. */
}
-#endif /* OVL1 */
-#ifdef OVLB
-
int
rne(x)
register int x;
return((int)x);
}
-#endif /* OVLB */
-
/*rnd.c*/
#ifdef KOPS
STATIC_DCL void FDECL(makekops, (coord *));
STATIC_DCL void FDECL(call_kops, (struct monst *,BOOLEAN_P));
-# ifdef OVLB
STATIC_DCL void FDECL(kops_gone, (BOOLEAN_P));
-# endif /* OVLB */
#endif /* KOPS */
#define IS_SHOP(x) (rooms[x].rtype >= SHOPBASE)
STATIC_DCL void FDECL(add_to_billobjs, (struct obj *));
STATIC_DCL void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P,
struct monst *));
-#ifdef OVL1
static boolean FDECL(rob_shop, (struct monst *));
-#endif
-#ifdef OVLB
/*
invariants: obj->unpaid iff onbill(obj) [unless bp->useup]
obj->quan <= bp->bquan
}
}
-#endif /* OVLB */
-#ifdef OVL3
-
/* Clear the unpaid bit on all of the objects in the list. */
STATIC_OVL void
clear_unpaid(list)
list = list->nobj;
}
}
-#endif /*OVL3*/
-#ifdef OVLB
/* either you paid or left the shop or the shopkeeper died */
STATIC_OVL void
return(total);
}
-#endif /* OVLB */
-#ifdef OVL1
-
#ifdef KOPS
STATIC_OVL void
call_kops(shkp, nearshop)
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
int
inhishop(mtmp)
register struct monst *mtmp;
}
dealloc_obj(obj);
}
-#endif /* OVLB */
-#ifdef OVL3
STATIC_OVL long
check_credit(tmp, shkp)
ESHK(shkp)->robbed = robbed;
}
}
-#endif /*OVL3*/
-#ifdef OVLB
/* return shkp to home position */
void
STATIC_VAR const char not_enough_money[] =
"Besides, you don't have enough to interest %s.";
-#else
-STATIC_VAR const char no_money[];
-STATIC_VAR const char not_enough_money[];
-#endif /*OVLB*/
-
-#ifdef OVL3
-
STATIC_OVL long
cheapest_item(shkp) /* delivers the cheapest item on the list */
register struct monst *shkp;
}
return(gmin);
}
-#endif /*OVL3*/
-#ifdef OVL0
int
dopay()
shtypes[eshkp->shoptype - SHOPBASE].name);
return(1);
}
-#endif /*OVL0*/
-#ifdef OVL3
/* return 2 if used-up portion paid */
/* 1 if paid successfully */
update_inventory(); /* Done just once in dopay() if !itemize. */
return buy;
}
-#endif /*OVL3*/
-#ifdef OVLB
static coord repo_location; /* repossession context */
/* not found at all */
return (struct obj *)0;
}
-#endif /*OVLB*/
-#ifdef OVL3
/* calculate the value that the shk will charge for [one of] an object */
STATIC_OVL long
if (shkp && ESHK(shkp)->surcharge) tmp += (tmp + 2L) / 3L;
return tmp;
}
-#endif /*OVL3*/
-#ifdef OVLB
/* returns the price of a container's content. the price
* of the "top" container is added in the calling functions.
picked_container(otmp);
}
}
-#endif /*OVLB*/
-#ifdef OVL3
/* calculate how much the shk will pay when buying [all of] an object */
STATIC_OVL long
return tmp;
}
-#endif /*OVL3*/
-#ifdef OVLB
-
/* called from doinv(invent.c) for inventory of unpaid objects */
long
unpaid_cost(unp_obj)
}
}
-#endif /*OVLB*/
-#ifdef OVL3
-
STATIC_OVL long
stolen_container(obj, shkp, price, ininv)
register struct obj *obj;
return(price);
}
-#endif /*OVL3*/
-#ifdef OVLB
long
stolen_value(obj, x, y, peaceful, silent)
levl[x][y].seenv = SVALL;
}
-#endif /*OVLB*/
-#ifdef OVL0
-
/*
* Do something about damage. Either (!croaked) try to repair it, or
* (croaked) just discard damage structs for non-shared locations, since
#undef vert
#undef horiz
}
-#endif /*OVL0*/
-#ifdef OVL3
+
/*
* shk_move: return 1: moved 0: didn't -1: let m_move do it -2: died
*/
}
}
-#endif /*OVL3*/
-#ifdef OVLB
-
/* for use in levl_follower (mondata.c) */
boolean
is_fshk(mtmp)
adjalign(-sgn(u.ualign.type));
}
}
-#endif /*OVLB*/
-#ifdef OVL0
+
/* called in dokick.c when we kick an object that might be in a store */
boolean
costly_spot(x, y)
!(x == ESHK(shkp)->shk.x &&
y == ESHK(shkp)->shk.y)));
}
-#endif /*OVL0*/
-#ifdef OVLB
/* called by dotalk(sounds.c) when #chatting; returns obj if location
contains shop goods and shopkeeper is willing & able to speak */
}
destroy_nhwindow(tmpwin);
}
-#endif /*OVLB*/
-#ifdef OVL3
STATIC_OVL const char *
shk_embellish(itm, cost)
}
return ".";
}
-#endif /*OVL3*/
-#ifdef OVLB
/* First 4 supplied by Ronen and Tamar, remainder by development team */
const char *Izchak_speaks[]={
}
#endif /* KOPS */
-#endif /*OVLB*/
-#ifdef OVL3
-
STATIC_OVL long
cost_per_charge(shkp, otmp, altusage)
struct monst *shkp;
}
return(tmp);
}
-#endif /*OVL3*/
-#ifdef OVLB
/* Charge the player for partial use of an unpaid object.
*
return(FALSE);
}
-#endif /* OVLB */
-#ifdef OVL2
-
char *
shk_your(buf, obj)
char *buf;
return (char *)0;
}
-#endif /* OVL2 */
-#ifdef OVLB
-
#ifdef __SASC
void
sasc_bug(struct obj *op, unsigned x){
}
#endif
-#endif /* OVLB */
-
/*shk.c*/
#include "hack.h"
#include "eshk.h"
-#ifndef OVLB
-extern const struct shclass shtypes[];
-
-#else
-
STATIC_DCL void FDECL(mkshobj_at, (const struct shclass *,int,int));
STATIC_DCL void FDECL(nameshk, (struct monst *,const char * const *));
STATIC_DCL int FDECL(shkinit, (const struct shclass *,struct mkroom *));
level.flags.has_shop = TRUE;
}
-#endif /* OVLB */
-#ifdef OVL0
-
/* does shkp's shop stock this item type? */
boolean
saleable(shkp, obj)
return shp->iprobs[i].itype;
}
-#endif /* OVL0 */
-
/*shknam.c*/
# endif
#endif
-#ifdef OVLB
-
static int FDECL(domonnoise,(struct monst *));
static int NDECL(dochat);
-
-#endif /* OVLB */
-
-#ifdef OVL0
-
static int FDECL(mon_in_room, (struct monst *,int));
/* this easily could be a macro, but it might overtax dumb compilers */
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
static const char * const h_sounds[] = {
"beep", "boing", "sing", "belche", "creak", "cough", "rattle",
"ululate", "pop", "jingle", "sniffle", "tinkle", "eep"
#endif /* USER_SOUNDS */
-#endif /* OVLB */
-
/*sounds.c*/
STATIC_PTR int NDECL(stealarm);
-#ifdef OVLB
STATIC_DCL const char *FDECL(equipname, (struct obj *));
STATIC_OVL const char *
return((multi < 0) ? 0 : 1);
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* Returns 1 if otmp is free'd, 0 otherwise. */
int
mpickobj(mtmp,otmp)
return freed_otmp;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
stealamulet(mtmp)
struct monst *mtmp;
}
}
-#endif /* OVLB */
-#ifdef OVL0
-
/* release the objects the creature is carrying */
void
relobj(mtmp,show,is_pet)
newsym(omx, omy);
}
-#endif /* OVL0 */
-
/*steal.c*/
STATIC_DCL void FDECL(lantern_message, (struct obj *));
STATIC_DCL void FDECL(cleanup_burn, (genericptr_t,long));
-#ifdef OVLB
-
/* He is being petrified - dialogue by inmet!tower */
static NEARDATA const char * const stoned_texts[] = {
"You are slowing down.", /* 5 */
}
-#endif /* OVLB */
-#ifdef OVL0
-
void
nh_timeout()
{
run_timers();
}
-#endif /* OVL0 */
-#ifdef OVL1
-
void
fall_asleep(how_long, wakeup_msg)
int how_long;
impossible("end_burn: obj %s not timed!", xname(obj));
}
-#endif /* OVL1 */
-#ifdef OVL0
-
/*
* Cleanup a burning object if timer stopped.
*/
update_inventory();
}
-#endif /* OVL0 */
-#ifdef OVL1
-
void
do_storms()
{
} else
You_hear("a rumbling noise.");
}
-#endif /* OVL1 */
-
-#ifdef OVL0
/* ------------------------------------------------------------------------- */
/*
* Generic Timeout Functions.
}
}
-#endif /* OVL0 */
-
/*timeout.c*/
STATIC_VAR NEARDATA int utcnt, utpnt;
STATIC_VAR NEARDATA coord utrack[UTSZ];
-#ifdef OVLB
-
void
initrack()
{
utcnt = utpnt = 0;
}
-#endif /* OVLB */
-#ifdef OVL1
-
/* add to track */
void
settrack()
utpnt++;
}
-#endif /* OVL1 */
-#ifdef OVL0
-
coord *
gettrack(x, y)
register int x, y;
return (coord *)0;
}
-#endif /* OVL0 */
-
/*track.c*/
(unsigned, struct obj *, struct obj *));
#endif
-#ifndef OVLB
-STATIC_VAR const char *a_your[2];
-STATIC_VAR const char *A_Your[2];
-STATIC_VAR const char *the_your[2];
-STATIC_VAR const char tower_of_flame[];
-STATIC_VAR const char *A_gush_of_water_hits;
-STATIC_VAR const char * const blindgas[6];
-
-#else
-
STATIC_VAR const char * const a_your[2] = { "a", "your" };
STATIC_VAR const char * const A_Your[2] = { "A", "Your" };
STATIC_VAR const char * const the_your[2] = { "the", "your" };
STATIC_VAR const char * const blindgas[6] =
{"humid", "odorless", "pungent", "chilling", "acrid", "biting"};
-#endif /* OVLB */
-
-#ifdef OVLB
-
/* called when you're hit by fire (dofiretrap,buzz,zapyourself,explode) */
boolean /* returns TRUE if hit on torso */
burnarmor(victim)
seetrap(trap); /* and it isn't concealed */
}
-#endif /* OVLB */
-#ifdef OVL3
-
/*
* Move obj from (x1,y1) to (x2,y2)
*
return 2;
}
-#endif /* OVL3 */
-#ifdef OVLB
-
void
seetrap(trap)
register struct trap *trap;
}
}
-#endif /* OVLB */
-#ifdef OVL3
-
STATIC_OVL int
mkroll_launch(ttmp, x, y, otyp, ocount)
struct trap *ttmp;
cc->y = y;
return TRUE;
}
-#endif /* OVL3 */
-#ifdef OVL1
int
mintrap(mtmp)
return mtmp->mtrapped;
}
-#endif /* OVL1 */
-#ifdef OVLB
-
/* Combine cockatrice checks into single functions to avoid repeating code. */
void
instapetrify(str)
}
return untrap(FALSE);
}
-#endif /* OVLB */
-#ifdef OVL2
/* Probability of disabling a trap. Helge Hafting */
STATIC_OVL int
return(1);
}
}
-#endif /* OVL2 */
-#ifdef OVLB
/* only called when the player is doing something to the chest directly */
boolean
return FALSE;
}
-#endif /* OVLB */
-#ifdef OVL0
-
struct trap *
t_at(x,y)
register int x, y;
return((struct trap *)0);
}
-#endif /* OVL0 */
-#ifdef OVLB
-
void
deltrap(trap)
register struct trap *trap;
return(FALSE);
}
-#endif /* OVLB */
-
/*trap.c*/
#define g_monnam(mtmp) \
x_monnam(mtmp, ARTICLE_NONE, (char *)0, SUPPRESS_IT, FALSE)
-#ifdef OVLB
-
STATIC_DCL boolean FDECL(clear_fcorr, (struct monst *,BOOLEAN_P));
STATIC_DCL void FDECL(restfakecorr,(struct monst *));
STATIC_DCL boolean FDECL(in_fcorridor, (struct monst *,int,int));
return((struct monst *)0);
}
-#endif /* OVLB */
-#ifdef OVL0
-
char
vault_occupied(array)
char *array;
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
STATIC_OVL void
move_gold(gold, vroom)
struct obj *gold;
else return((boolean)(grd == (struct monst *)0));
}
-#endif /* OVLB */
-
/*vault.c*/
STATIC_DCL void FDECL(give_may_advance_msg, (int));
-#ifndef OVLB
-
-STATIC_DCL NEARDATA const short skill_names_indices[];
-STATIC_DCL NEARDATA const char *odd_skill_names[];
-STATIC_DCL NEARDATA const char *barehands_or_martial[];
-
-#else /* OVLB */
-
STATIC_VAR NEARDATA const short skill_names_indices[P_NUM_SKILLS] = {
0, DAGGER, KNIFE, AXE,
PICK_AXE, SHORT_SWORD, BROADSWORD, LONG_SWORD,
"fighting ");
}
-#endif /* OVLB */
-
STATIC_DCL boolean FDECL(can_advance, (int, BOOLEAN_P));
STATIC_DCL boolean FDECL(could_advance, (int));
STATIC_DCL boolean FDECL(peaked_skill, (int));
STATIC_DCL int FDECL(slots_required, (int));
-
-#ifdef OVL1
-
STATIC_DCL char *FDECL(skill_level_name, (int,char *));
STATIC_DCL void FDECL(skill_advance, (int));
-#endif /* OVL1 */
-
#define P_NAME(type) ((skill_names_indices[type] > 0) ? \
OBJ_NAME(objects[skill_names_indices[type]]) : \
(type == P_BARE_HANDED_COMBAT) ? \
barehands_or_martial[martial_bonus()] : \
odd_skill_names[-skill_names_indices[type]])
-#ifdef OVLB
static NEARDATA const char kebabable[] = {
S_XORN, S_DRAGON, S_JABBERWOCK, S_NAGA, S_GIANT, '\0'
};
return(tmp);
}
-#endif /* OVLB */
-#ifdef OVL0
-
STATIC_DCL struct obj *FDECL(oselect, (struct monst *,int));
#define Oselect(x) if ((otmp = oselect(mtmp, x)) != 0) return(otmp);
else return(sbon + dex-14);
}
-#endif /* OVL0 */
-#ifdef OVL1
-
int
dbon() /* damage bonus for strength */
{
}
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
use_skill(skill,degree)
int skill;
obj->owornmask &= ~W_WEP;
}
-#endif /* OVLB */
-
/*weapon.c*/
#include "hack.h"
-#ifdef OVL0
-
void
were_change(mon)
register struct monst *mon;
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
STATIC_DCL int FDECL(counter_were,(int));
STATIC_OVL int
rehumanize();
}
-#endif /* OVLB */
-
/*were.c*/
extern const int monstr[];
-#ifdef OVLB
-
STATIC_DCL short FDECL(which_arti, (int));
STATIC_DCL boolean FDECL(mon_has_arti, (struct monst *,SHORT_P));
STATIC_DCL struct monst *FDECL(other_mon_has_arti, (struct monst *,SHORT_P));
PM_TRAPPER
};
-#endif /* OVLB */
-#ifdef OVL0
-
/* If you've found the Amulet, make the Wizard appear after some time */
/* Also, give hints about portal locations, if amulet is worn/wielded -dlc */
void
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
int
mon_has_amulet(mtmp)
register struct monst *mtmp;
}
}
-#endif /* OVLB */
-
/*wizard.c*/
*/
#define MAGIC_COOKIE 1000
-#ifdef OVLB
static NEARDATA boolean obj_zapped;
static NEARDATA int poly_zapped;
-#endif
extern boolean notonhead; /* for long worms */
STATIC_DCL boolean FDECL(zap_steed, (struct obj *));
#endif
-#ifdef OVLB
STATIC_DCL int FDECL(zap_hit, (int,int));
-#endif
-#ifdef OVL0
STATIC_DCL void FDECL(backfire, (struct obj *));
STATIC_DCL int FDECL(spell_hit_bonus, (int));
-#endif
#define ZT_MAGIC_MISSILE (AD_MAGM-1)
#define ZT_FIRE (AD_FIRE-1)
#define is_hero_spell(type) ((type) >= 10 && (type) < 20)
-#ifndef OVLB
-STATIC_VAR const char are_blinded_by_the_flash[];
-extern const char * const flash_types[];
-#else
STATIC_VAR const char are_blinded_by_the_flash[] = "are blinded by the flash!";
const char * const flash_types[] = { /* also used in buzzmu(mcastu.c) */
}
}
-#endif /*OVLB*/
-#ifdef OVL1
-
/*
* Return the object's physical location. This only makes sense for
* objects that are currently on the level (i.e. migrating objects
}
return res;
}
-#endif /*OVL1*/
-#ifdef OVLB
static const char charged_objs[] = { WAND_CLASS, WEAPON_CLASS, ARMOR_CLASS, 0 };
STATIC_OVL void
return (TRUE);
}
-#endif /*OVLB*/
-#ifdef OVL0
-
boolean
obj_resists(obj, ochance, achance)
struct obj *obj;
return((boolean)(! rn2(zap_odds)));
}
-#endif /*OVL0*/
-#ifdef OVLB
/* Use up at least minwt number of things made of material mat.
* There's also a chance that other stuff will be used up. Finally,
return hitanything;
}
-#endif /*OVLB*/
-#ifdef OVL1
/*
* zappable - returns 1 if zap is available, 0 otherwise.
more_experienced(0,10);
}
}
-#endif /*OVL1*/
-#ifdef OVL0
STATIC_OVL void
backfire(otmp)
}
#endif
-#endif /*OVL0*/
-#ifdef OVL3
-
/*
* cancel a monster (possibly the hero). inventory is cancelled only
* if the monster is zapping itself directly, since otherwise the
return disclose;
}
-#endif /*OVL3*/
-#ifdef OVLB
-
/* called for various wand and spell effects - M. Stephenson */
void
weffects(obj)
}
return;
}
-#endif /*OVLB*/
-#ifdef OVL0
/*
* Generate the to damage bonus for a spell. Based on the hero's intelligence
&& flags.verbose) ?
mon_nam(mtmp) : "it");
}
-#endif /*OVL0*/
-#ifdef OVL1
/*
* Called for the following distance effects:
return;
}
-#endif /*OVL1*/
-#ifdef OVLB
-
/*
* burn scrolls and spellbooks on floor at position x,y
* return the number of scrolls and spellbooks burned
abstype == ZT_DEATH ? "disintegrate" : "destroy", FALSE);
bhitpos = save_bhitpos;
}
-#endif /*OVLB*/
-#ifdef OVL0
void
melt_ice(x, y)
return rangemod;
}
-#endif /*OVL0*/
-#ifdef OVL3
-
void
fracture_rock(obj) /* fractured by pick-axe or wand of striking */
register struct obj *obj; /* no texts here! */
return(tmp);
}
-#endif /*OVL3*/
-#ifdef OVL2
-
int
resist(mtmp, oclass, damage, tell)
struct monst *mtmp;
}
}
-#endif /*OVL2*/
-
/*zap.c*/
void FDECL(get_cursor,(int *, int *));
-#ifdef OVL0
-
/* direct bios calls are used only when iflags.BIOS is set */
static char NDECL(DOSgetch);
return (regs.x.dx);
}
-# endif /* OVLB */
-
#endif /* MSDOS */
extern int total_tiles_used; /* tile.c */
#endif
-# ifdef OVLB
-
/*
* Read the header/palette information at the start of the
* NetHack.tib file.
}
#endif
}
-# endif /* OVLB */
-
-# ifdef OVL0
struct planar_cell_struct plancell;
struct overview_planar_cell_struct oplancell;
return 0;
}
# endif
-# endif /* OVL0 */
#endif /* USE_TILES */
/* pctiles.c */
*/
-#ifdef OVLB
void
get_scr_size()
{
# endif
txt_get_scr_size();
}
-#endif /*OVLB*/
/*
* --------------------------------------------------------------
void FDECL(nocmov, (int, int));
STATIC_DCL void NDECL(init_ttycolor);
-# ifdef OVLB
int savevmode; /* store the original video mode in here */
int curcol,currow; /* graphics mode current cursor locations */
int g_attribute; /* Current attribute to use */
# ifdef TEXTCOLOR
char ttycolors[CLR_MAX]; /* also used/set in options.c */
# endif /* TEXTCOLOR */
-# else
-extern int savevmode;
-extern int curcol,currow;
-extern int g_attribute;
-extern int monoflag;
-extern int attrib_text_normal;
-extern int attrib_gr_normal;
-extern int attrib_text_intense;
-extern int attrib_gr_intense;
-extern boolean traditonal;
-extern boolean inmap;
-# ifdef TEXTCOLOR
-extern char ttycolors[CLR_MAX]; /* also used/set in options.c */
-# endif /* TEXTCOLOR */
-# endif /* OVLB */
-# ifdef OVLB
void
backsp()
{
# endif
}
}
-# endif /* OVLB */
-# ifdef OVL0
void
clear_screen()
{
# endif
}
}
-# endif /* OVL0 */
-# ifdef OVLB
int
has_color(int color)
{
return 0;
# endif
}
-# endif /* OVLB */
-# ifdef OVL0
void
home()
{
g_attribute = iflags.grmode ? attrib_gr_normal
: attrib_text_normal;
}
-# endif /* OVL0 */
-
-# ifdef OVLB
void
term_end_attr(int attr)
{
{
standoutbeg();
}
-# endif /* OVLB */
-# ifdef OVL0
void
tty_delay_output()
{
#endif
}
-# endif /* OVL0 */
-
-# ifdef OVLB
void
tty_end_screen()
{
}
}
-# endif /* OVLB */
-
/*
* Screen output routines (these are heavily used).
*
* (that include wintty.h) are actually using these routines.
*/
-# ifdef OVL0
void
xputs(s)
const char *s;
}
# endif /* SIMULATE_CURSOR */
-# endif /* OVL0 */
# ifdef TEXTCOLOR
/*
/* assign_videocolors() is prototyped in extern.h */
/* assign_video() is prototyped in extern.h */
-# ifdef OVLB
int shadeflag; /* shades are initialized */
int colorflag; /* colors are initialized */
char *schoice[3] = {"dark","normal","light"};
char *shade[3];
-# else
-extern int shadeflag;
-extern int colorflag;
-extern char *schoice[3];
-extern char *shade[3];
-# endif /* OVLB */
-
# endif /* VIDEOSHADES */
-# ifdef OVLB
STATIC_OVL void
init_ttycolor()
{
}
# endif
}
-# endif /* OVLB */
-# ifdef OVL1
static int FDECL(convert_uchars,(char *, uchar *, int));
# ifdef VIDEOSHADES
int assign_videoshades(char *choiceptr)
}
# endif /* VIDEOSHADES */
-# endif /* OVL1 */
# endif /* TEXTCOLOR */
/*
* default (force use of the default video method for environment)
* vga (use vga adapter code)
*/
-# ifdef OVL1
int
assign_video(sopt)
char *sopt;
}
return 1;
}
-# endif /* OVL1 */
-# ifdef OVL0
void tileview(enable)
boolean enable;
if (iflags.grmode) vga_traditional(enable ? FALSE : TRUE);
#endif
}
-# endif /* OVL0 */
#endif /* NO_TERMS */
+
#else /* STUBVIDEO */
+
void tileview(enable)
boolean enable;
{
}
#endif /* STUBVIDEO */
+/*video.c*/
+
extern int attrib_text_intense; /* text mode intense attribute */
extern int attrib_gr_intense; /* graphics mode intense attribute */
-#ifdef OVLB
-
void
txt_get_scr_size()
{
CO = regs.h.ah;
# endif /* PC9800 */
}
-#endif /*OVLB*/
/*
* --------------------------------------------------------------
extern int g_attribute; /* Current attribute to use */
extern int monoflag; /* 0 = not monochrome, else monochrome */
-# ifdef OVLB
void
txt_backsp()
{
regs.h.ah = 0x02; /* Character Output function */
(void) int86(DOSCALL, ®s, ®s);
}
-# endif /* OVLB */
-# ifdef OVL0
void
txt_clear_screen()
/* djgpp provides ScreenClear(), but in version 1.09 it is broken
(void) int86(VIDEO_BIOS, ®s, ®s); /* Scroll or initialize window */
# endif
}
-# endif /* OVL0 */
-# ifdef OVLB
void
txt_startup(wid, hgt)
int *wid, *hgt;
attrib_gr_intense = attrib_text_intense;
g_attribute = attrib_text_normal; /* Give it a starting value */
}
-# endif /* OVLB */
/*
* Screen output routines (these are heavily used).
* (that include wintty.h) are actually using these routines.
*/
-# ifdef OVL0
void
txt_xputs(s,col,row)
const char *s;
txt_gotoxy(col,row);
# endif /* PC9800 */
}
-# endif /* OVL0 */
/*
* This marks the end of the general screen output routines that are
* the location of the player on the NetHack level.
*/
-# ifdef OVL0
# if defined(SCREEN_BIOS) && !defined(PC9800)
/*
* This is implemented as a macro under DJGPPFAST.
* returns nothing. -3.
*/
}
-# endif /* OVL0 */
/*
* This marks the end of the cursor manipulation/information routines.
* -------------------------------------------------------------------
*/
-# ifdef OVLB
# ifdef MONO_CHECK
int txt_monoadapt_check()
{
return (regs.h.al == 7) ? 1 : 0; /* 7 means monochrome mode */
}
# endif /* MONO_CHECK */
-# endif /* OVLB */
#endif /* NO_TERMS */
/* vidtxt.c */
* the Video BIOS ROM on board the VGA adapter. Code in vga_WriteChar
* copies the appropriate pixels from the video ROM to the Video buffer.
*
- * - Currently, most of the routines are in an ifdef OVLB.
- * If you change that, you may have to muck with some of the
- * variable declarations which now assume this. This is not a
- * problem in a non-overlaid environment (djgpp for example).
- *
* - VGA 640 by 480, 16 colour mode (0x12) uses an odd method to
* represent a colour value from the palette. There are four
* planes of video memory, all overlaid at the same memory location.
for (x=0; x < COLNO; ++x) { map[y][x].glyph = cmap_to_glyph(S_stone); \
map[y][x].ch = S_stone; map[y][x].attr = 0; map[y][x].special = 0;} }
# define TOP_MAP_ROW 1
-# if defined(OVLB)
+
STATIC_VAR int vgacmap[CLR_MAX] = {0,3,5,9,4,8,12,14,11,2,6,7,1,8,12,13};
STATIC_VAR int viewport_size = 40;
/* STATIC_VAR char masktable[8]={0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01}; */
int vp[SCREENPLANES] = {8,4,2,1};
# endif
int vp2[SCREENPLANES] = {1,2,4,8};
-# else
-extern int vgacmap[CLR_MAX];
-extern int viewport_size;
-extern char masktable[8];
-extern char bittable[8];
-extern char defpalette[];
-# ifndef ALTERNATE_VIDEO_METHOD
-extern int vp[SCREENPLANES];
-# endif
-extern int vp2[SCREENPLANES];
-# endif /* OVLB */
STATIC_VAR struct planar_cell_struct *planecell;
STATIC_VAR struct overview_planar_cell_struct *planecell_O;
/* STATIC_VAR int g_attribute; */ /* Current attribute to use */
-#ifdef OVLB
void
vga_get_scr_size()
{
CO = 80;
LI = 29;
}
-#endif /*OVLB*/
-
-
-
-# ifdef OVLB
void
vga_backsp()
vga_gotoloc(col,row);
}
-# endif /* OVLB */
-# ifdef OVL0
-
void
vga_clear_screen(colour)
int colour;
}
}
-
-# endif /* OVL0 */
-
-# ifdef OVLB
void
vga_tty_end_screen()
{
attrib_gr_intense = ATTRIB_VGA_INTENSE;
g_attribute = attrib_gr_normal; /* Give it a starting value */
}
-# endif /* OVLB */
/*
* Screen output routines (these are heavily used).
*
*/
-# ifdef OVL0
void
vga_xputs(s,col,row)
const char *s;
}
}
# endif /* USE_TILES && CLIPPING */
-# endif /* OVL0 */
-# ifdef OVL2
void
vga_userpan(left)
}
}
# endif /* SCROLLMAP */
-# endif /* OVL2 */
-# ifdef OVLB
STATIC_OVL void
decal_planar(gp, special)
struct planar_cell_struct *gp;
}
}
-# endif /* OVLB */
-
-
-# ifdef OVLB
/*
* Initialize the VGA palette with the desired colours. This
* must be a series of 48 bytes for use with a card in
egawriteplane(15);
}
# endif /* SIMULATE_CURSOR */
-# endif /* OVLB */
#endif /* SCREEN_VGA */
/* vidvga.c */
#include <unistd.h> /* for getcwd() prototype */
#endif
-#ifdef OVL0
-#define SHARED_DCL
-#else
-#define SHARED_DCL extern
-#endif
-
-
-SHARED_DCL char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */
+char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */
#ifdef TOS
boolean run_from_desktop = TRUE; /* should we pause before exiting?? */
STATIC_DCL char *FDECL(exepath,(char *));
#endif
-#ifdef OVL0
int FDECL(main, (int,char **));
-#endif
extern void FDECL(pcmain, (int,char **));
#if defined(__BORLANDC__) && !defined(_WIN32)
void NDECL( startup );
-# ifdef OVLB
unsigned _stklen = STKSIZ;
-# else
-extern unsigned _stklen;
-# endif
#endif
-#ifdef OVL0
/* If the graphics version is built, we don't need a main; it is skipped
* to help MinGW decide which entry point to choose. If both main and
* WinMain exist, the resulting executable won't work correctly.
return 0;
}
#endif /*MSWIN_GRAPHICS*/
-#endif /*OVL0*/
-#ifdef OVL1
void
pcmain(argc,argv)
if (wr) check_recordfile(dir ? dir : thisdir);
}
#endif /* CHDIR */
-#endif /*OVL1*/
-#ifdef OVLB
#ifdef PORT_HELP
# if defined(MSDOS) || defined(WIN32)
return tmp;
}
#endif /* EXEPATH */
-#endif /*OVLB*/
+
/*pcmain.c*/
extern void NDECL(clear_screen);
#endif
-#ifdef OVLB
-
#if 0
static struct stat buf;
#endif
*lp = '_';
}
# endif /* WIN32 */
-#endif /* OVLB */
-
#ifdef __EMX__
void seteuid(int i){;}
#include "mhmain.h"
#include "mhmap.h"
-#ifdef OVL0
-#define SHARED_DCL
-#else
-#define SHARED_DCL extern
-#endif
-
-SHARED_DCL char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */
+extern char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */
extern void FDECL(nethack_exit,(int));
static TCHAR* _get_cmd_arg(TCHAR* pCmdLine);
#include "wintty.h"
#include "func_tab.h"
-#ifdef OVL1
char morc = 0; /* tell the outside world what char you chose */
-#endif /* OVL1 */
STATIC_DCL boolean FDECL(ext_cmd_getlin_hook, (char *));
typedef boolean FDECL((*getlin_hook_proc), (char *));
extern char erase_char, kill_char; /* from appropriate tty.c file */
-#ifdef OVL1
-
/*
* Read a line closed with '\n' into the array char bufp[BUFSZ].
* (The '\n' is not stored. The string is closed with a '\0'.)
}
-#endif /* OVL1 */
-#ifdef OVL2
-
/*
* Implement extended command completion by using this hook into
* tty_getlin. Check the characters already typed, if they uniquely
return i;
}
-#endif /* OVL2 */
-
#endif /* TTY_GRAPHICS */
/*getline.c*/
void FDECL(cmov, (int, int));
void FDECL(nocmov, (int, int));
#if defined(TEXTCOLOR) && defined(TERMLIB)
-# ifdef OVLB
-# if !defined(UNIX) || !defined(TERMINFO)
-# ifndef TOS
+# if !defined(UNIX) || !defined(TERMINFO)
+# ifndef TOS
static void FDECL(analyze_seq, (char *, int *, int *));
-# endif
# endif
+# endif
static void NDECL(init_hilite);
static void NDECL(kill_hilite);
-# endif /* OVLB */
#endif
-#ifdef OVLB
/* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE,
ul_hack */
struct tc_lcl_data tc_lcl_data = { 0, 0, 0, 0,0, 0,0, FALSE };
-#endif /* OVLB */
STATIC_VAR char *HO, *CL, *CE, *UP, *XD, *BC, *SO, *SE, *TI, *TE;
STATIC_VAR char *VS, *VE;
STATIC_VAR char *MB, *MH;
STATIC_VAR char *MD; /* may already be in use below */
#endif
+
#ifdef TERMLIB
# ifdef TEXTCOLOR
STATIC_VAR char *MD;
# endif
STATIC_VAR int SG;
-#ifdef OVLB
STATIC_OVL char PC = '\0';
-#else /* OVLB */
-STATIC_DCL char PC;
-#endif /* OVLB */
STATIC_VAR char tbuf[512];
-#endif
+#endif /*TERMLIB*/
#ifdef TEXTCOLOR
# ifdef TOS
# endif
#endif
-#ifdef OVLB
static char *KS = (char *)0, *KE = (char *)0; /* keypad sequences */
static char nullstr[] = "";
-#endif /* OVLB */
#if defined(ASCIIGRAPH) && !defined(NO_TERMS)
extern boolean HE_resets_AS;
# endif
#endif /* TERMLIB */
-#ifdef OVLB
-
void
tty_startup(wid, hgt)
int *wid, *hgt;
/* Cursor movements */
-#endif /* OVLB */
-
-#ifdef OVL0
-/* Note to OVLx tinkerers. The placement of this overlay controls the location
+/* Note to overlay tinkerers. The placement of this overlay controls the location
of the function xputc(). This function is not currently in trampoli.[ch]
files for what is deemed to be performance reasons. If this define is moved
and or xputc() is taken out of the ROOT overlay, then action must be taken
ttyDisplay->curx = x;
}
-/* See note at OVLx ifdef above. xputc() is a special function. */
+/* See note above. xputc() is a special function. */
void
xputc(c)
#if defined(apollo)
}
}
-#endif /* OVL0 */
-#ifdef OVLB
-
void
clear_screen()
{
}
}
-#endif /* OVLB */
-#ifdef OVL0
-
void
home()
{
}
#endif
-#endif /* OVL0 */
-#ifdef OVLB
-
void
backsp()
{
(void) fflush(stdout);
}
-#endif /* OVLB */
-#ifdef OVL0
-
#ifdef ASCIIGRAPH
void
graph_on() {
}
#endif
-#endif /* OVL0 */
-#ifdef OVL1
-
#if !defined(MICRO)
# ifdef VMS
static const short tmspc10[] = { /* from termcap */
#endif /* MICRO */
}
-#endif /* OVL1 */
-#ifdef OVLB
-
void
cl_eos() /* free after Robert Viduya */
{ /* must only be called with curx = 1 */
#endif /* TEXTCOLOR */
-#endif /* OVLB */
-
#endif /* TTY_GRAPHICS */
/*termcap.c*/
STATIC_DCL void NDECL(remember_topl);
STATIC_DCL void FDECL(removetopl, (int));
-#ifdef OVLB
-
int
tty_doprev_message()
{
return 0;
}
-#endif /* OVLB */
-#ifdef OVL1
-
STATIC_OVL void
redotoplin(str)
const char *str;
ttyDisplay->toplin = 1;
}
-#endif /* OVL1 */
-#ifdef OVL2
-
void
more()
{
return q;
}
-
-#endif /* OVL2 */
-
#endif /* TTY_GRAPHICS */
/*topl.c*/
#endif
-#ifdef OVL0
-#define SHARED_DCL
-#else
-#define SHARED_DCL extern
-#endif
-
/* Minimal common control library version
Version _WIN_32IE Platform/IE
======= ========= ===========