From 3b127d31d9064dea53f13b85427fdb006dc033d3 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 12 Jan 2006 06:06:33 +0000 Subject: [PATCH] mextra.h comments (trunk only) Add an introductory comment for each type of extension. Also move ANGRY/NOTANGRY shopkeeper macros from old eshk.h out of the common header and into shk.c so that their use doesn't end up spreading into other code. Not fixed: entry #9 in the block comment at the top is truncated mid-sentence. --- include/mextra.h | 28 ++++++++++++++++++++-------- src/shk.c | 4 +++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/include/mextra.h b/include/mextra.h index 964af13b7..99a6dcb10 100644 --- a/include/mextra.h +++ b/include/mextra.h @@ -57,10 +57,13 @@ * packaged up. */ +/*** + ** formerly vault.h -- vault guard extension + */ #define FCSIZ (ROWNO+COLNO) struct fakecorridor { - xchar fx,fy,ftyp; + xchar fx, fy, ftyp; }; struct egd { @@ -75,17 +78,21 @@ struct egd { struct fakecorridor fakecorr[FCSIZ]; }; +/*** + ** formerly epri.h -- temple priest extension + */ struct epri { aligntyp shralign; /* alignment of priest's shrine */ - /* leave as first field to match emin */ schar shroom; /* index in rooms */ coord shrpos; /* position of shrine */ d_level shrlevel; /* level (& dungeon) of shrine */ }; - /* note: roaming priests (no shrine) switch from ispriest to isminion (and emin extension) */ +/*** + ** formerly eshk.h -- shopkeeper extension + */ #define REPAIR_DELAY 5 /* minimum delay between shop damage & repair */ #define BILLSZ 200 @@ -117,16 +124,18 @@ struct eshk { char shknam[PL_NSIZ]; }; -#define NOTANGRY(mon) ((mon)->mpeaceful) -#define ANGRY(mon) (!NOTANGRY(mon)) - +/*** + ** formerly emin.h -- minion extension + */ struct emin { aligntyp min_align; /* alignment of minion */ boolean renegade; /* hostile co-aligned priest or Angel */ }; -/* various types of pet food, the lower, the better liked. */ - +/*** + ** formerly edog.h -- pet extension + */ +/* various types of pet food, the lower, the better liked */ #define DOGFOOD 0 #define CADAVER 1 #define ACCFOOD 2 @@ -149,6 +158,9 @@ struct edog { Bitfield(killed_by_u, 1); /* you attempted to kill him */ }; +/*** + ** mextra.h -- collection of all monster extensions + */ struct mextra { char *mname; struct egd *egd; diff --git a/src/shk.c b/src/shk.c index 29c270dfe..1293a9bc7 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)shk.c 3.5 2005/07/06 */ +/* SCCS Id: @(#)shk.c 3.5 2006/01/09 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -18,6 +18,8 @@ STATIC_DCL void FDECL(call_kops, (struct monst *,BOOLEAN_P)); STATIC_DCL void FDECL(kops_gone, (BOOLEAN_P)); #endif /* KOPS */ +#define NOTANGRY(mon) ((mon)->mpeaceful) +#define ANGRY(mon) (!NOTANGRY(mon)) #define IS_SHOP(x) (rooms[x].rtype >= SHOPBASE) extern const struct shclass shtypes[]; /* defined in shknam.c */ -- 2.40.0