mthrowu, nhlan, options, regions, rip and role globals moved to g.

This commit is contained in:
Bart House
2018-12-25 16:26:27 -08:00
parent 64be5fd35a
commit 769ad91cc3
48 changed files with 679 additions and 649 deletions

View File

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

View File

@@ -592,7 +592,21 @@ struct repo { /* repossession context */
coord location;
};
/* from options.c */
#define MAX_MENU_MAPPED_CMDS 32 /* some number */
/* player selection constants */
#define BP_ALIGN 0
#define BP_GEND 1
#define BP_RACE 2
#define BP_ROLE 3
#define NUM_BP 4
#define NUM_ROLES (13)
struct role_filter {
boolean roles[NUM_ROLES+1];
short mask;
};
/* instance_globals holds engine state that does not need to be
* persisted upon game exit. The initialization state is well defined
@@ -924,6 +938,11 @@ struct instance_globals {
short *animal_list; /* list of PM values for animal monsters */
int animal_list_count;
/* mthrowu.c */
int mesg_given; /* for m_throw()/thitu() 'miss' message */
struct monst *mtarget; /* monster being shot by another monster */
struct monst *marcher; /* monster that is shooting */
/* muse.c */
boolean m_using; /* kludge to use mondided instead of killed */
int trapx;
@@ -936,6 +955,10 @@ struct instance_globals {
* remember who zapped the wand. */
struct musable m;
/* nhlan.c */
char lusername[MAX_LAN_USERNAME];
int lusername_size;
/* o_init.c */
short disco[NUM_OBJECTS];
@@ -949,6 +972,16 @@ struct instance_globals {
/* options.c */
struct symsetentry *symset_list; /* files.c will populate this with
list of available sets */
/*
* Allow the user to map incoming characters to various menu commands.
* The accelerator list must be a valid C string.
*/
char mapped_menu_cmds[MAX_MENU_MAPPED_CMDS + 1]; /* exported */
char mapped_menu_op[MAX_MENU_MAPPED_CMDS + 1];
short n_menu_mapped;
boolean opt_initial;
boolean opt_from_file;
boolean opt_need_redraw; /* for doset() */
/* pickup.c */
int oldcap; /* last encumberance */
@@ -1006,6 +1039,11 @@ struct instance_globals {
/* read.c */
boolean known;
/* region.c */
NhRegion **regions;
int n_regions;
int max_regions;
/* restore.c */
int n_ids_mapped;
struct bucket *id_map;
@@ -1013,6 +1051,16 @@ struct instance_globals {
struct fruit *oldfruit;
long omoves;
/* rip.c */
char **rip;
/* role.c */
struct Role urole; /* player's role. May be munged in role_init() */
struct Race urace; /* player's race. May be munged in role_init() */
char role_pa[NUM_BP];
char role_post_attribs;
struct role_filter rfilter;
/* rumors.c */
long true_rumor_size; /* rumor size variables are signed so that value -1
can be used as a flag */

View File

@@ -332,9 +332,9 @@
#define hero_glyph \
monnum_to_glyph((Upolyd || !flags.showrace) \
? u.umonnum \
: (flags.female && urace.femalenum != NON_PM) \
? urace.femalenum \
: urace.malenum)
: (flags.female && g.urace.femalenum != NON_PM) \
? g.urace.femalenum \
: g.urace.malenum)
/*
* Change the given glyph into it's given type. Note:

View File

@@ -211,6 +211,8 @@ typedef struct {
#define SYM_OFF_X (SYM_OFF_W + WARNCOUNT)
#define SYM_MAX (SYM_OFF_X + MAXOTHER)
#include "rect.h"
#include "region.h"
#include "decl.h"
#include "timeout.h"
@@ -258,8 +260,6 @@ typedef struct sortloot_item Loot;
#include "vision.h"
#include "display.h"
#include "engrave.h"
#include "rect.h"
#include "region.h"
#ifdef USE_TRAMPOLI /* this doesn't belong here, but we have little choice */
#undef NDECL

View File

@@ -84,7 +84,7 @@
#define is_gnome(ptr) (((ptr)->mflags2 & M2_GNOME) != 0L)
#define is_orc(ptr) (((ptr)->mflags2 & M2_ORC) != 0L)
#define is_human(ptr) (((ptr)->mflags2 & M2_HUMAN) != 0L)
#define your_race(ptr) (((ptr)->mflags2 & urace.selfmask) != 0L)
#define your_race(ptr) (((ptr)->mflags2 & g.urace.selfmask) != 0L)
#define is_bat(ptr) \
((ptr) == &mons[PM_BAT] || (ptr) == &mons[PM_GIANT_BAT] \
|| (ptr) == &mons[PM_VAMPIRE_BAT])
@@ -100,8 +100,8 @@
#define is_wanderer(ptr) (((ptr)->mflags2 & M2_WANDER) != 0L)
#define always_hostile(ptr) (((ptr)->mflags2 & M2_HOSTILE) != 0L)
#define always_peaceful(ptr) (((ptr)->mflags2 & M2_PEACEFUL) != 0L)
#define race_hostile(ptr) (((ptr)->mflags2 & urace.hatemask) != 0L)
#define race_peaceful(ptr) (((ptr)->mflags2 & urace.lovemask) != 0L)
#define race_hostile(ptr) (((ptr)->mflags2 & g.urace.hatemask) != 0L)
#define race_peaceful(ptr) (((ptr)->mflags2 & g.urace.lovemask) != 0L)
#define extra_nasty(ptr) (((ptr)->mflags2 & M2_NASTY) != 0L)
#define strongmonst(ptr) (((ptr)->mflags2 & M2_STRONG) != 0L)
#define can_breathe(ptr) attacktype(ptr, AT_BREA)

View File

@@ -23,8 +23,8 @@ struct RoleName {
struct RoleAdvance {
/* "fix" is the fixed amount, "rnd" is the random amount */
xchar infix, inrnd; /* at character initialization */
xchar lofix, lornd; /* gained per level < urole.xlev */
xchar hifix, hirnd; /* gained per level >= urole.xlev */
xchar lofix, lornd; /* gained per level < g.urole.xlev */
xchar hifix, hirnd; /* gained per level >= g.urole.xlev */
};
struct u_have {
@@ -167,9 +167,8 @@ struct Role {
};
extern const struct Role roles[]; /* table of available roles */
extern struct Role urole;
#define Role_if(X) (urole.malenum == (X))
#define Role_switch (urole.malenum)
#define Role_if(X) (g.urole.malenum == (X))
#define Role_switch (g.urole.malenum)
/* used during initialization for race, gender, and alignment
as well as for character class */
@@ -219,9 +218,8 @@ struct Race {
};
extern const struct Race races[]; /* Table of available races */
extern struct Race urace;
#define Race_if(X) (urace.malenum == (X))
#define Race_switch (urace.malenum)
#define Race_if(X) (g.urace.malenum == (X))
#define Race_switch (g.urace.malenum)
/*** Unified structure specifying gender information ***/
struct Gender {