invent, youmonst, hackdir moved to g.

This commit is contained in:
Bart House
2018-12-24 21:04:15 -08:00
parent 90547edb83
commit 8c1a4d9a97
79 changed files with 1093 additions and 1091 deletions

View File

@@ -41,7 +41,7 @@ struct attribs {
};
#define ATTRMAX(x) \
((x == A_STR && Upolyd && strongmonst(youmonst.data)) \
((x == A_STR && Upolyd && strongmonst(g.youmonst.data)) \
? STR18(100) \
: urace.attrmax[x])
#define ATTRMIN(x) (urace.attrmin[x])

View File

@@ -80,7 +80,7 @@
#ifdef __BEOS__
#define BEOS_GRAPHICS /* (optional) */
#define DEFAULT_WINDOW_SYS "BeOS" /* "tty" */
#ifndef HACKDIR /* override the default hackdir below */
#ifndef HACKDIR /* override the default g.hackdir below */
#define HACKDIR "/boot/apps/NetHack"
#endif
#endif

View File

@@ -169,7 +169,7 @@ E const struct class_sym def_monsyms[MAXMCLASSES]; /* default class symbols */
E uchar monsyms[MAXMCLASSES]; /* current class symbols */
#include "obj.h"
E NEARDATA struct obj *invent, *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
E NEARDATA struct obj *uarm, *uarmc, *uarmh, *uarms, *uarmg, *uarmf,
*uarmu, /* under-wear, so to speak */
*uskin, *uamul, *uleft, *uright, *ublindf, *uwep, *uswapwep, *uquiver;
@@ -191,7 +191,6 @@ E NEARDATA struct u_realtime urealtime;
#endif
E NEARDATA struct monst zeromonst; /* for init of new or temp monsters */
E NEARDATA struct monst youmonst; /* monster details when hero is poly'd */
struct mvitals {
uchar born;
@@ -694,6 +693,12 @@ struct instance_globals {
long wailmsg;
struct obj *migrating_objs; /* objects moving to another dungeon level */
struct obj *billobjs; /* objects not yet paid for */
#if defined(MICRO) || defined(WIN32)
char hackdir[PATHLEN]; /* where rumors, help, record are */
#endif /* MICRO || WIN32 */
struct monst youmonst;
struct obj *invent;
/* dig.c */

View File

@@ -202,14 +202,14 @@
#define display_self() \
show_glyph(u.ux, u.uy, \
maybe_display_usteed((youmonst.m_ap_type == M_AP_NOTHING) \
maybe_display_usteed((g.youmonst.m_ap_type == M_AP_NOTHING) \
? hero_glyph \
: (youmonst.m_ap_type == M_AP_FURNITURE) \
? cmap_to_glyph(youmonst.mappearance) \
: (youmonst.m_ap_type == M_AP_OBJECT) \
? objnum_to_glyph(youmonst.mappearance) \
: (g.youmonst.m_ap_type == M_AP_FURNITURE) \
? cmap_to_glyph(g.youmonst.mappearance) \
: (g.youmonst.m_ap_type == M_AP_OBJECT) \
? objnum_to_glyph(g.youmonst.mappearance) \
/* else M_AP_MONSTER */ \
: monnum_to_glyph(youmonst.mappearance)))
: monnum_to_glyph(g.youmonst.mappearance)))
/*
* A glyph is an abstraction that represents a _unique_ monster, object,

View File

@@ -207,7 +207,6 @@ extern void FDECL(interject, (int));
/* this was part of the MICRO stuff in the past */
extern const char *alllevels, *allbones;
extern char hackdir[];
#define ABORT C('a')
#define getuid() 1
#define getlogin() ((char *) 0)

View File

@@ -87,13 +87,13 @@
/* ...means blind because of a cover */
#define Blind \
((u.uroleplay.blind || Blinded || Blindfolded \
|| !haseyes(youmonst.data)) \
|| !haseyes(g.youmonst.data)) \
&& !(ublindf && ublindf->oartifact == ART_EYES_OF_THE_OVERWORLD))
/* ...the Eyes operate even when you really are blind
or don't have any eyes */
#define Blindfolded_only \
(Blindfolded && ublindf->oartifact != ART_EYES_OF_THE_OVERWORLD \
&& !u.uroleplay.blind && !Blinded && haseyes(youmonst.data))
&& !u.uroleplay.blind && !Blinded && haseyes(g.youmonst.data))
/* ...blind because of a blindfold, and *only* that */
#define Sick u.uprops[SICK].intrinsic
@@ -248,11 +248,11 @@
#define HMagical_breathing u.uprops[MAGICAL_BREATHING].intrinsic
#define EMagical_breathing u.uprops[MAGICAL_BREATHING].extrinsic
#define Amphibious \
(HMagical_breathing || EMagical_breathing || amphibious(youmonst.data))
(HMagical_breathing || EMagical_breathing || amphibious(g.youmonst.data))
/* Get wet, may go under surface */
#define Breathless \
(HMagical_breathing || EMagical_breathing || breathless(youmonst.data))
(HMagical_breathing || EMagical_breathing || breathless(g.youmonst.data))
#define Underwater (u.uinwater)
/* Note that Underwater and u.uinwater are both used in code.
@@ -372,6 +372,6 @@
redundant but allows the function calls to be skipped most of the time */
#define Unaware (g.multi < 0 && (unconscious() || is_fainted()))
#define Hate_silver (u.ulycn >= LOW_PM || hates_silver(youmonst.data))
#define Hate_silver (u.ulycn >= LOW_PM || hates_silver(g.youmonst.data))
#endif /* YOUPROP_H */