Merge branch 'NetHack-3.7'

This commit is contained in:
nhmall
2018-12-25 22:15:02 -05:00
60 changed files with 741 additions and 692 deletions
+13 -4
View File
@@ -19,6 +19,15 @@ STATIC_DCL void FDECL(regen_hp, (int));
STATIC_DCL void FDECL(interrupt_multi, (const char *));
STATIC_DCL void FDECL(debug_fields, (const char *));
void
early_init()
{
decl_globals_init();
objects_globals_init();
monst_globals_init();
sys_early_init();
}
void
moveloop(resuming)
boolean resuming;
@@ -656,16 +665,16 @@ boolean new_game; /* false => restoring an old game */
*buf = '\0';
if (new_game || u.ualignbase[A_ORIGINAL] != u.ualignbase[A_CURRENT])
Sprintf(eos(buf), " %s", align_str(u.ualignbase[A_ORIGINAL]));
if (!urole.name.f
if (!g.urole.name.f
&& (new_game
? (urole.allow & ROLE_GENDMASK) == (ROLE_MALE | ROLE_FEMALE)
? (g.urole.allow & ROLE_GENDMASK) == (ROLE_MALE | ROLE_FEMALE)
: currentgend != flags.initgend))
Sprintf(eos(buf), " %s", genders[currentgend].adj);
pline(new_game ? "%s %s, welcome to NetHack! You are a%s %s %s."
: "%s %s, the%s %s %s, welcome back to NetHack!",
Hello((struct monst *) 0), g.plname, buf, urace.adj,
(currentgend && urole.name.f) ? urole.name.f : urole.name.m);
Hello((struct monst *) 0), g.plname, buf, g.urace.adj,
(currentgend && g.urole.name.f) ? g.urole.name.f : g.urole.name.m);
}
#ifdef POSITIONBAR
+4 -4
View File
@@ -59,9 +59,9 @@ hack_artifacts()
artilist[ART_EXCALIBUR].role = NON_PM;
/* Fix up the quest artifact */
if (urole.questarti) {
artilist[urole.questarti].alignment = alignmnt;
artilist[urole.questarti].role = Role_switch;
if (g.urole.questarti) {
artilist[g.urole.questarti].alignment = alignmnt;
artilist[g.urole.questarti].role = Role_switch;
}
return;
}
@@ -763,7 +763,7 @@ struct monst *mtmp;
} else if (weap->spfx & SPFX_DFLAG2) {
return ((ptr->mflags2 & weap->mtype)
|| (yours
&& ((!Upolyd && (urace.selfmask & weap->mtype))
&& ((!Upolyd && (g.urace.selfmask & weap->mtype))
|| ((weap->mtype & M2_WERE) && u.ulycn >= LOW_PM))));
} else if (weap->spfx & SPFX_DALIGN) {
return yours ? (u.ualign.type != weap->alignment)
+21 -21
View File
@@ -599,15 +599,15 @@ register int np;
register int i, x, tryct;
for (i = 0; i < A_MAX; i++) {
ABASE(i) = AMAX(i) = urole.attrbase[i];
ABASE(i) = AMAX(i) = g.urole.attrbase[i];
ATEMP(i) = ATIME(i) = 0;
np -= urole.attrbase[i];
np -= g.urole.attrbase[i];
}
tryct = 0;
while (np > 0 && tryct < 100) {
x = rn2(100);
for (i = 0; (i < A_MAX) && ((x -= urole.attrdist[i]) > 0); i++)
for (i = 0; (i < A_MAX) && ((x -= g.urole.attrdist[i]) > 0); i++)
;
if (i >= A_MAX)
continue; /* impossible */
@@ -626,7 +626,7 @@ register int np;
while (np < 0 && tryct < 100) { /* for redistribution */
x = rn2(100);
for (i = 0; (i < A_MAX) && ((x -= urole.attrdist[i]) > 0); i++)
for (i = 0; (i < A_MAX) && ((x -= g.urole.attrdist[i]) > 0); i++)
;
if (i >= A_MAX)
continue; /* impossible */
@@ -966,30 +966,30 @@ newhp()
if (u.ulevel == 0) {
/* Initialize hit points */
hp = urole.hpadv.infix + urace.hpadv.infix;
if (urole.hpadv.inrnd > 0)
hp += rnd(urole.hpadv.inrnd);
if (urace.hpadv.inrnd > 0)
hp += rnd(urace.hpadv.inrnd);
hp = g.urole.hpadv.infix + g.urace.hpadv.infix;
if (g.urole.hpadv.inrnd > 0)
hp += rnd(g.urole.hpadv.inrnd);
if (g.urace.hpadv.inrnd > 0)
hp += rnd(g.urace.hpadv.inrnd);
if (g.moves <= 1L) { /* initial hero; skip for polyself to new man */
/* Initialize alignment stuff */
u.ualign.type = aligns[flags.initalign].value;
u.ualign.record = urole.initrecord;
u.ualign.record = g.urole.initrecord;
}
/* no Con adjustment for initial hit points */
} else {
if (u.ulevel < urole.xlev) {
hp = urole.hpadv.lofix + urace.hpadv.lofix;
if (urole.hpadv.lornd > 0)
hp += rnd(urole.hpadv.lornd);
if (urace.hpadv.lornd > 0)
hp += rnd(urace.hpadv.lornd);
if (u.ulevel < g.urole.xlev) {
hp = g.urole.hpadv.lofix + g.urace.hpadv.lofix;
if (g.urole.hpadv.lornd > 0)
hp += rnd(g.urole.hpadv.lornd);
if (g.urace.hpadv.lornd > 0)
hp += rnd(g.urace.hpadv.lornd);
} else {
hp = urole.hpadv.hifix + urace.hpadv.hifix;
if (urole.hpadv.hirnd > 0)
hp += rnd(urole.hpadv.hirnd);
if (urace.hpadv.hirnd > 0)
hp += rnd(urace.hpadv.hirnd);
hp = g.urole.hpadv.hifix + g.urace.hpadv.hifix;
if (g.urole.hpadv.hirnd > 0)
hp += rnd(g.urole.hpadv.hirnd);
if (g.urace.hpadv.hirnd > 0)
hp += rnd(g.urace.hpadv.hirnd);
}
if (ACURR(A_CON) <= 3)
conplus = -2;
+2 -2
View File
@@ -478,8 +478,8 @@ make_bones:
/* format name+role,&c, death reason, and date+time;
gender and alignment reflect final values rather than what the
character started out as, same as topten and logfile entries */
Sprintf(newbones->who, "%s-%.3s-%.3s-%.3s-%.3s", g.plname, urole.filecode,
urace.filecode, genders[flags.female].filecode,
Sprintf(newbones->who, "%s-%.3s-%.3s-%.3s-%.3s", g.plname, g.urole.filecode,
g.urace.filecode, genders[flags.female].filecode,
aligns[1 - u.ualign.type].filecode);
formatkiller(newbones->how, sizeof newbones->how, how, TRUE);
Strcpy(newbones->when, yyyymmddhhmmss(when));
+7 -7
View File
@@ -40,7 +40,7 @@ get_strength_str()
void
check_gold_symbol()
{
nhsym goldch = showsyms[COIN_CLASS + SYM_OFF_O];
nhsym goldch = g.showsyms[COIN_CLASS + SYM_OFF_O];
iflags.invis_goldsym = (goldch <= (nhsym) ' ');
}
@@ -278,7 +278,7 @@ boolean female;
if (monnum == role->malenum || monnum == role->femalenum)
break;
if (!role->name.m)
role = &urole;
role = &g.urole;
/* Find the rank */
for (i = xlev_to_rank((int) lev); i >= 0; i--) {
@@ -340,9 +340,9 @@ max_rank_sz()
{
register int i, r, maxr = 0;
for (i = 0; i < 9; i++) {
if (urole.rank[i].m && (r = strlen(urole.rank[i].m)) > maxr)
if (g.urole.rank[i].m && (r = strlen(g.urole.rank[i].m)) > maxr)
maxr = r;
if (urole.rank[i].f && (r = strlen(urole.rank[i].f)) > maxr)
if (g.urole.rank[i].f && (r = strlen(g.urole.rank[i].f)) > maxr)
maxr = r;
}
g.mrank_sz = maxr;
@@ -3157,9 +3157,9 @@ choose_value:
int i, j, rv;
for (i = j = 0; i < 9; i++) {
Sprintf(mbuf, "\"%s\"", urole.rank[i].m);
if (urole.rank[i].f) {
Sprintf(fbuf, "\"%s\"", urole.rank[i].f);
Sprintf(mbuf, "\"%s\"", g.urole.rank[i].m);
if (g.urole.rank[i].f) {
Sprintf(fbuf, "\"%s\"", g.urole.rank[i].f);
Sprintf(obuf, "%s or %s",
flags.female ? fbuf : mbuf,
flags.female ? mbuf : fbuf);
+15 -15
View File
@@ -1705,9 +1705,9 @@ int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */
/* as in background_enlightenment, when poly'd we need to use the saved
gender in u.mfemale rather than the current you-as-monster gender */
Sprintf(buf, "%s the %s's attributes:", tmpbuf,
((Upolyd ? u.mfemale : flags.female) && urole.name.f)
? urole.name.f
: urole.name.m);
((Upolyd ? u.mfemale : flags.female) && g.urole.name.f)
? g.urole.name.f
: g.urole.name.m);
/* title */
enlght_out(buf); /* "Conan the Archeologist's attributes:" */
@@ -1761,7 +1761,7 @@ int final;
/* note that if poly'd, we need to use u.mfemale instead of flags.female
to access hero's saved gender-as-human/elf/&c rather than current one */
innategend = (Upolyd ? u.mfemale : flags.female) ? 1 : 0;
role_titl = (innategend && urole.name.f) ? urole.name.f : urole.name.m;
role_titl = (innategend && g.urole.name.f) ? g.urole.name.f : g.urole.name.m;
rank_titl = rank_of(u.ulevel, Role_switch, innategend);
enlght_out(""); /* separator after title */
@@ -1787,8 +1787,8 @@ int final;
/* report role; omit gender if it's redundant (eg, "female priestess") */
tmpbuf[0] = '\0';
if (!urole.name.f
&& ((urole.allow & ROLE_GENDMASK) == (ROLE_MALE | ROLE_FEMALE)
if (!g.urole.name.f
&& ((g.urole.allow & ROLE_GENDMASK) == (ROLE_MALE | ROLE_FEMALE)
|| innategend != flags.initgend))
Sprintf(tmpbuf, "%s ", genders[innategend].adj);
buf[0] = '\0';
@@ -1797,10 +1797,10 @@ int final;
if (!strcmpi(rank_titl, role_titl)) {
/* omit role when rank title matches it */
Sprintf(eos(buf), "%s, level %d %s%s", an(rank_titl), u.ulevel,
tmpbuf, urace.noun);
tmpbuf, g.urace.noun);
} else {
Sprintf(eos(buf), "%s, a level %d %s%s %s", an(rank_titl), u.ulevel,
tmpbuf, urace.adj, role_titl);
tmpbuf, g.urace.adj, role_titl);
}
you_are(buf, "");
@@ -2927,10 +2927,10 @@ minimal_enlightenment()
/* Starting name, race, role, gender */
Sprintf(buf, fmtstr, "name", g.plname);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
Sprintf(buf, fmtstr, "race", urace.noun);
Sprintf(buf, fmtstr, "race", g.urace.noun);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
Sprintf(buf, fmtstr, "role",
(flags.initgend && urole.name.f) ? urole.name.f : urole.name.m);
(flags.initgend && g.urole.name.f) ? g.urole.name.f : g.urole.name.m);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
Sprintf(buf, fmtstr, "gender", genders[flags.initgend].adj);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
@@ -2943,17 +2943,17 @@ minimal_enlightenment()
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
"Current", FALSE);
Sprintf(buf, fmtstr, "race", Upolyd ? g.youmonst.data->mname : urace.noun);
Sprintf(buf, fmtstr, "race", Upolyd ? g.youmonst.data->mname : g.urace.noun);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
if (Upolyd) {
Sprintf(buf, fmtstr, "role (base)",
(u.mfemale && urole.name.f) ? urole.name.f
: urole.name.m);
(u.mfemale && g.urole.name.f) ? g.urole.name.f
: g.urole.name.m);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
} else {
Sprintf(buf, fmtstr, "role",
(flags.female && urole.name.f) ? urole.name.f
: urole.name.m);
(flags.female && g.urole.name.f) ? g.urole.name.f
: g.urole.name.m);
add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
}
/* don't want poly_gender() here; it forces `2' for non-humanoids */
+89
View File
@@ -151,6 +151,53 @@ unsigned nhUse_dummy = 0;
#pragma GCC diagnostic ignored "-Wmissing-braces"
#endif
const struct Role urole_init_data = {
{ "Undefined", 0 },
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
"L", "N", "C",
"Xxx", "home", "locate",
NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM,
0, 0, 0, 0,
/* Str Int Wis Dex Con Cha */
{ 7, 7, 7, 7, 7, 7 },
{ 20, 15, 15, 20, 20, 10 },
/* Init Lower Higher */
{ 10, 0, 0, 8, 1, 0 }, /* Hit points */
{ 2, 0, 0, 2, 0, 3 },
14, /* Energy */
0,
10,
0,
0,
4,
A_INT,
0,
-3
};
const struct Race urace_init_data = {
"something",
"undefined",
"something",
"Xxx",
{ 0, 0 },
NON_PM,
NON_PM,
NON_PM,
NON_PM,
0,
0,
0,
0,
/* Str Int Wis Dex Con Cha */
{ 3, 3, 3, 3, 3, 3 },
{ STR18(100), 18, 18, 18, 18, 18 },
/* Init Lower Higher */
{ 2, 0, 0, 2, 1, 0 }, /* Hit points */
{ 1, 0, 2, 0, 2, 0 } /* Energy */
};
const struct instance_globals g_init = {
/* apply.c */
0, /* jumping_is_magic */
@@ -443,6 +490,11 @@ const struct instance_globals g_init = {
NULL, /* animal_list */
UNDEFINED_VALUE, /* animal_list_count */
/* mthrowu.c */
UNDEFINED_VALUE, /* mesg_given */
NULL, /* mtarget */
NULL, /* marcher */
/* muse.c */
FALSE, /* m_using */
UNDEFINED_VALUE, /* trapx */
@@ -450,6 +502,12 @@ const struct instance_globals g_init = {
UNDEFINED_VALUE, /* zap_oseen */
UNDEFINED_VALUES, /* m */
/* nhlan.c */
#ifdef MAX_LAN_USERNAME
UNDEFINED_VALUES, /* lusername */
MAX_LAN_USERNAME, /* lusername_size */
#endif /* MAX_LAN_USERNAME */
/* o_init.c */
DUMMY, /* disco */
@@ -458,6 +516,12 @@ const struct instance_globals g_init = {
/* options.c */
NULL, /* symset_list */
UNDEFINED_VALUES, /* mapped_menu_cmds */
UNDEFINED_VALUES, /* mapped_menu_op */
0, /* n_menu_mapped */
UNDEFINED_VALUE, /* opt_initial */
UNDEFINED_VALUE, /* opt_from_file */
UNDEFINED_VALUE, /* opt_need_redraw */
/* pickup.c */
0, /* oldcap */
@@ -504,6 +568,11 @@ const struct instance_globals g_init = {
/* read.c */
UNDEFINED_VALUE, /* known */
/* region.c */
NULL, /* regions */
0, /* n_regions */
0, /* max_regions */
/* restore.c */
0, /* n_ids_mapped */
0, /* id_map */
@@ -511,6 +580,16 @@ const struct instance_globals g_init = {
UNDEFINED_PTR, /* oldfruit */
UNDEFINED_VALUE, /* omoves */
/* rip.c */
UNDEFINED_PTR, /* rip */
/* role.c */
UNDEFINED_VALUES, /* urole */
UNDEFINED_VALUES, /* urace */
UNDEFINED_VALUES, /* role_pa */
UNDEFINED_VALUE, /* role_post_attrib */
UNDEFINED_VALUES, /* rfilter */
/* rumors.c */
0, /* true_rumor_size */
0, /* false_rumor_size */
@@ -532,6 +611,7 @@ const struct instance_globals g_init = {
SELL_NORMAL, /* sell_how */
FALSE, /* auto_credit */
UNDEFINED_VALUES, /* repo */
UNDEFINED_VALUE, /* followmsg */
/* sp_lev.c */
NULL, /* lev_message */
@@ -555,12 +635,18 @@ const struct instance_globals g_init = {
0, /* spl_sortmode */
NULL, /* spl_orderindx */
/* teleport.c */
NULL, /* telescroll */
/* timeout.c */
UNDEFINED_PTR, /* timer_base */
1, /* timer_id */
/* topten.c */
WIN_ERR, /* topten */
#ifdef UPDATE_RECORD_IN_PLACE
UNDEFINED_VALUE, /* final_fpos */
#endif
/* trap.c */
0, /* force_mintrap */
@@ -635,6 +721,9 @@ decl_globals_init()
WIN_MESSAGE = WIN_STATUS = WIN_MAP = WIN_INVEN = WIN_ERR;
g.urole = urole_init_data;
g.urace = urace_init_data;
}
+3 -3
View File
@@ -1528,9 +1528,9 @@ namefloorobj()
char tmpbuf[BUFSZ];
/* straight role name */
unames[0] = ((Upolyd ? u.mfemale : flags.female) && urole.name.f)
? urole.name.f
: urole.name.m;
unames[0] = ((Upolyd ? u.mfemale : flags.female) && g.urole.name.f)
? g.urole.name.f
: g.urole.name.m;
/* random rank title for hero's role */
unames[1] = rank_of(rnd(30), Role_switch, flags.female);
/* random fake monster */
+2 -2
View File
@@ -61,8 +61,8 @@ register struct monst *mtmp;
STATIC_OVL int
pet_type()
{
if (urole.petnum != NON_PM)
return urole.petnum;
if (g.urole.petnum != NON_PM)
return g.urole.petnum;
else if (g.preferred_pet == 'c')
return PM_KITTEN;
else if (g.preferred_pet == 'd')
+1 -1
View File
@@ -923,7 +923,7 @@ init_dungeons()
/* This is where the name substitution on the
* levels of the quest dungeon occur.
*/
Sprintf(x->proto, "%s%s", urole.filecode,
Sprintf(x->proto, "%s%s", g.urole.filecode,
&lev_map->lev_name[1]);
} else if (lev_map->lev_spec == &knox_level) {
branch *br;
+2 -2
View File
@@ -1030,7 +1030,7 @@ int pm;
Hallucination
? "You suddenly dread being peeled and mimic %s again!"
: "You now prefer mimicking %s again.",
an(Upolyd ? g.youmonst.data->mname : urace.noun));
an(Upolyd ? g.youmonst.data->mname : g.urace.noun));
g.eatmbuf = dupstr(buf);
g.nomovemsg = g.eatmbuf;
g.afternmv = eatmdone;
@@ -3041,7 +3041,7 @@ boolean incr;
|| Role_if(PM_VALKYRIE)))
pline("%s needs food, badly!",
(Role_if(PM_WIZARD) || Role_if(PM_VALKYRIE))
? urole.name.m
? g.urole.name.m
: "Elf");
else
You((!incr)
+10 -10
View File
@@ -480,8 +480,8 @@ int how;
Strcpy(g.killer.name, buf);
if (mptr->mlet == S_WRAITH)
u.ugrave_arise = PM_WRAITH;
else if (mptr->mlet == S_MUMMY && urace.mummynum != NON_PM)
u.ugrave_arise = urace.mummynum;
else if (mptr->mlet == S_MUMMY && g.urace.mummynum != NON_PM)
u.ugrave_arise = g.urace.mummynum;
else if (mptr->mlet == S_VAMPIRE && Race_if(PM_HUMAN))
u.ugrave_arise = PM_VAMPIRE;
else if (mptr == &mons[PM_GHOUL])
@@ -718,8 +718,8 @@ time_t when; /* date+time at end of game */
Sprintf(pbuf, "%s, %s %s %s %s", g.plname,
aligns[1 - u.ualign.type].adj,
genders[flags.female].adj,
urace.adj,
(flags.female && urole.name.f) ? urole.name.f : urole.name.m);
g.urace.adj,
(flags.female && g.urole.name.f) ? g.urole.name.f : g.urole.name.m);
putstr(0, 0, pbuf);
putstr(0, 0, "");
@@ -1266,9 +1266,9 @@ int how;
* u.umonnum is based on role, and all role monsters
* are human.
*/
mnum = (flags.female && urace.femalenum != NON_PM)
? urace.femalenum
: urace.malenum;
mnum = (flags.female && g.urace.femalenum != NON_PM)
? g.urace.femalenum
: g.urace.malenum;
}
corpse = mk_named_object(CORPSE, &mons[mnum], u.ux, u.uy, g.plname);
Sprintf(pbuf, "%s, ", g.plname);
@@ -1376,9 +1376,9 @@ int how;
Sprintf(pbuf, "%s %s the %s...", Goodbye(), g.plname,
(how != ASCENDED)
? (const char *) ((flags.female && urole.name.f)
? urole.name.f
: urole.name.m)
? (const char *) ((flags.female && g.urole.name.f)
? g.urole.name.f
: g.urole.name.m)
: (const char *) (flags.female ? "Demigoddess" : "Demigod"));
dump_forward_putstr(endwin, 0, pbuf, done_stopprint);
dump_forward_putstr(endwin, 0, "", done_stopprint);
+10 -10
View File
@@ -47,19 +47,19 @@ newpw()
int en = 0, enrnd, enfix;
if (u.ulevel == 0) {
en = urole.enadv.infix + urace.enadv.infix;
if (urole.enadv.inrnd > 0)
en += rnd(urole.enadv.inrnd);
if (urace.enadv.inrnd > 0)
en += rnd(urace.enadv.inrnd);
en = g.urole.enadv.infix + g.urace.enadv.infix;
if (g.urole.enadv.inrnd > 0)
en += rnd(g.urole.enadv.inrnd);
if (g.urace.enadv.inrnd > 0)
en += rnd(g.urace.enadv.inrnd);
} else {
enrnd = (int) ACURR(A_WIS) / 2;
if (u.ulevel < urole.xlev) {
enrnd += urole.enadv.lornd + urace.enadv.lornd;
enfix = urole.enadv.lofix + urace.enadv.lofix;
if (u.ulevel < g.urole.xlev) {
enrnd += g.urole.enadv.lornd + g.urace.enadv.lornd;
enfix = g.urole.enadv.lofix + g.urace.enadv.lofix;
} else {
enrnd += urole.enadv.hirnd + urace.enadv.hirnd;
enfix = urole.enadv.hifix + urace.enadv.hifix;
enrnd += g.urole.enadv.hirnd + g.urace.enadv.hirnd;
enfix = g.urole.enadv.hifix + g.urace.enadv.hifix;
}
en = enermod(rn1(enrnd, enfix));
}
+1 -1
View File
@@ -696,7 +696,7 @@ d_level *lev;
first letter of the role's filecode; bones loading still worked
because the bonesid used for validation had the same error */
Sprintf(dptr, "%c%s", g.dungeons[lev->dnum].boneid,
In_quest(lev) ? urole.filecode : "0");
In_quest(lev) ? g.urole.filecode : "0");
if ((sptr = Is_special(lev)) != 0)
Sprintf(eos(dptr), ".%c", sptr->boneid);
else
+1 -1
View File
@@ -2871,7 +2871,7 @@ maybe_wail()
const char *who;
int i, powercnt;
who = (Role_if(PM_WIZARD) || Role_if(PM_VALKYRIE)) ? urole.name.m
who = (Role_if(PM_WIZARD) || Role_if(PM_VALKYRIE)) ? g.urole.name.m
: "Elf";
if (u.uhp == 1) {
pline("%s is about to die.", who);
+2 -2
View File
@@ -670,10 +670,10 @@ makelevel()
char fillname[9];
s_level *loc_lev;
Sprintf(fillname, "%s-loca", urole.filecode);
Sprintf(fillname, "%s-loca", g.urole.filecode);
loc_lev = find_level(fillname);
Sprintf(fillname, "%s-fil", urole.filecode);
Sprintf(fillname, "%s-fil", g.urole.filecode);
Strcat(fillname,
(u.uz.dlevel < loc_lev->dlevel.dlevel) ? "a" : "b");
makemaz(fillname);
+1 -1
View File
@@ -1055,7 +1055,7 @@ boolean artif;
if (otmp->corpsenm == NON_PM) {
otmp->corpsenm = undead_to_corpse(rndmonnum());
if (g.mvitals[otmp->corpsenm].mvflags & (G_NOCORPSE | G_GONE))
otmp->corpsenm = urole.malenum;
otmp->corpsenm = g.urole.malenum;
}
/*FALLTHRU*/
case STATUE:
+1 -1
View File
@@ -3323,7 +3323,7 @@ struct monst *mon;
} else if (!rn2(3)) { /* quest guardians */
mndx = rn1(PM_APPRENTICE - PM_STUDENT + 1, PM_STUDENT);
/* avoid own role's guardian */
if (mndx == urole.guardnum)
if (mndx == g.urole.guardnum)
mndx = NON_PM;
} else { /* general humanoids */
tryct = 5;
+1 -1
View File
@@ -1076,7 +1076,7 @@ raceptr(mtmp)
struct monst *mtmp;
{
if (mtmp == &g.youmonst && !Upolyd)
return &mons[urace.malenum];
return &mons[g.urace.malenum];
else
return mtmp->data;
}
+2 -2
View File
@@ -3237,8 +3237,8 @@ monst_globals_init()
return;
}
struct attack sa_yes[NATTK] = SEDUCTION_ATTACKS_YES;
struct attack sa_no[NATTK] = SEDUCTION_ATTACKS_NO;
const struct attack c_sa_yes[NATTK] = SEDUCTION_ATTACKS_YES;
const struct attack c_sa_no[NATTK] = SEDUCTION_ATTACKS_NO;
#endif
/*monst.c*/
+2 -2
View File
@@ -376,8 +376,8 @@ register struct monst *mtmp;
if (mtmp->mpeaceful)
return; /* will drop to humanoid talk */
pline("Talk? -- %s", (mtmp->data == &mons[urole.malenum]
|| mtmp->data == &mons[urole.femalenum])
pline("Talk? -- %s", (mtmp->data == &mons[g.urole.malenum]
|| mtmp->data == &mons[g.urole.femalenum])
? same_class_msg[rn2(3)]
: other_class_msg[rn2(3)]);
}
+21 -28
View File
@@ -26,8 +26,6 @@ STATIC_OVL NEARDATA const char *breathwep[] = {
"strange breath #9"
};
STATIC_VAR int mesg_given; /* for m_throw()/thitu() 'miss' message */
/* hero is hit by something other than a monster */
int
thitu(tlev, dam, objp, name)
@@ -61,7 +59,7 @@ const char *name; /* if null, then format `*objp' */
is_acid = (obj && obj->otyp == ACID_VENOM);
if (u.uac + tlev <= (dieroll = rnd(20))) {
++mesg_given;
++g.mesg_given;
if (Blind || !flags.verbose) {
pline("It misses.");
} else if (u.uac + tlev <= dieroll - 2) {
@@ -146,11 +144,6 @@ int x, y;
return retvalu;
}
/* The monster that's being shot at when one monster shoots at another */
STATIC_OVL struct monst *target = 0;
/* The monster that's doing the shooting/throwing */
STATIC_OVL struct monst *archer = 0;
/* calculate multishot volley count for mtmp throwing otmp (if not ammo) or
shooting otmp with mwep (if otmp is ammo and mwep appropriate launcher) */
STATIC_OVL int
@@ -243,7 +236,7 @@ monshoot(mtmp, otmp, mwep)
struct monst *mtmp;
struct obj *otmp, *mwep;
{
struct monst *mtarg = target;
struct monst *mtarg = g.mtarget;
int dm = distmin(mtmp->mx, mtmp->my,
mtarg ? mtarg->mx : mtmp->mux,
mtarg ? mtarg->my : mtmp->muy),
@@ -309,7 +302,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
int damage, tmp;
boolean vis, ismimic;
int objgone = 1;
struct obj *mon_launcher = archer ? MON_WEP(archer) : NULL;
struct obj *mon_launcher = g.marcher ? MON_WEP(g.marcher) : NULL;
g.notonhead = (g.bhitpos.x != mtmp->mx || g.bhitpos.y != mtmp->my);
ismimic = mtmp->m_ap_type && mtmp->m_ap_type != M_AP_MONSTER;
@@ -319,9 +312,9 @@ boolean verbose; /* give message(s) even when you can't see what happened */
/* High level monsters will be more likely to hit */
/* This check applies only if this monster is the target
* the archer was aiming at. */
if (archer && target == mtmp) {
if (archer->m_lev > 5)
tmp += archer->m_lev - 5;
if (g.marcher && g.mtarget == mtmp) {
if (g.marcher->m_lev > 5)
tmp += g.marcher->m_lev - 5;
if (mon_launcher && mon_launcher->oartifact)
tmp += spec_abon(mon_launcher, mtmp);
}
@@ -329,7 +322,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
if (!ismimic) {
if (vis)
miss(distant_name(otmp, mshot_xname), mtmp);
else if (verbose && !target)
else if (verbose && !g.mtarget)
pline("It is missed.");
}
if (!range) { /* Last position; object drops */
@@ -359,7 +352,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
otmp->known ? an(mons[otmp->corpsenm].mname) : "an");
else
hit(distant_name(otmp, mshot_xname), mtmp, exclam(damage));
} else if (verbose && !target)
} else if (verbose && !g.mtarget)
pline("%s%s is hit%s", (otmp->otyp == EGG) ? "Splat! " : "",
Monnam(mtmp), exclam(damage));
@@ -382,17 +375,17 @@ boolean verbose; /* give message(s) even when you can't see what happened */
&& mon_hates_silver(mtmp)) {
if (vis)
pline_The("silver sears %s flesh!", s_suffix(mon_nam(mtmp)));
else if (verbose && !target)
else if (verbose && !g.mtarget)
pline("Its flesh is seared!");
}
if (otmp->otyp == ACID_VENOM && cansee(mtmp->mx, mtmp->my)) {
if (resists_acid(mtmp)) {
if (vis || (verbose && !target))
if (vis || (verbose && !g.mtarget))
pline("%s is unaffected.", Monnam(mtmp));
} else {
if (vis)
pline_The("%s burns %s!", hliquid("acid"), mon_nam(mtmp));
else if (verbose && !target)
else if (verbose && !g.mtarget)
pline("It is burned!");
}
}
@@ -406,7 +399,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
if (!DEADMONSTER(mtmp)) { /* might already be dead (if petrified) */
mtmp->mhp -= damage;
if (DEADMONSTER(mtmp)) {
if (vis || (verbose && !target))
if (vis || (verbose && !g.mtarget))
pline("%s is %s!", Monnam(mtmp),
(nonliving(mtmp->data) || is_vampshifter(mtmp)
|| !canspotmon(mtmp)) ? "destroyed" : "killed");
@@ -524,7 +517,7 @@ struct obj *obj; /* missile (or stack providing it) */
(void) drop_throw(singleobj, 0, g.bhitpos.x, g.bhitpos.y);
return;
}
mesg_given = 0; /* a 'missile misses' message has not yet been shown */
g.mesg_given = 0; /* a 'missile misses' message has not yet been shown */
/* Note: drop_throw may destroy singleobj. Since obj must be destroyed
* early to avoid the dagger bug, anyone who modifies this code should
@@ -654,9 +647,9 @@ struct obj *obj; /* missile (or stack providing it) */
|| MT_FLIGHTCHECK(FALSE)) {
if (singleobj) { /* hits_bars might have destroyed it */
if (g.m_shot.n > 1
&& (!mesg_given || g.bhitpos.x != u.ux || g.bhitpos.y != u.uy)
&& (!g.mesg_given || g.bhitpos.x != u.ux || g.bhitpos.y != u.uy)
&& (cansee(g.bhitpos.x, g.bhitpos.y)
|| (archer && canseemon(archer))))
|| (g.marcher && canseemon(g.marcher))))
pline("%s misses.", The(mshot_xname(singleobj)));
(void) drop_throw(singleobj, 0, g.bhitpos.x, g.bhitpos.y);
}
@@ -668,7 +661,7 @@ struct obj *obj; /* missile (or stack providing it) */
tmp_at(g.bhitpos.x, g.bhitpos.y);
delay_output();
tmp_at(DISP_END, 0);
mesg_given = 0; /* reset */
g.mesg_given = 0; /* reset */
if (blindinc) {
u.ucreamed += blindinc;
@@ -717,10 +710,10 @@ struct monst *mtmp, *mtarg;
> PET_MISSILE_RANGE2)
return 0; /* Out of range */
/* Set target monster */
target = mtarg;
archer = mtmp;
g.mtarget = mtarg;
g.marcher = mtmp;
monshoot(mtmp, otmp, mwep); /* multishot shooting or throwing */
archer = target = (struct monst *) 0;
g.marcher = g.mtarget = (struct monst *) 0;
nomul(0);
return 1;
}
@@ -758,10 +751,10 @@ struct attack *mattk;
if (!rn2(BOLT_LIM-distmin(mtmp->mx,mtmp->my,mtarg->mx,mtarg->my))) {
if (canseemon(mtmp))
pline("%s spits venom!", Monnam(mtmp));
target = mtarg;
g.mtarget = mtarg;
m_throw(mtmp, mtmp->mx, mtmp->my, sgn(g.tbx), sgn(g.tby),
distmin(mtmp->mx,mtmp->my,mtarg->mx,mtarg->my), otmp);
target = (struct monst *)0;
g.mtarget = (struct monst *)0;
nomul(0);
/* If this is a pet, it'll get hungry. Minions and
+52 -64
View File
@@ -459,7 +459,6 @@ static struct Bool_Opt boolopt[SIZE(boolopt_init)];
extern char configfile[]; /* for messages */
extern struct symparse loadsyms[];
static boolean need_redraw; /* for doset() */
#if defined(TOS) && defined(TEXTCOLOR)
extern boolean colors_changed; /* in tos.c */
@@ -470,7 +469,7 @@ extern char *shade[3]; /* in sys/msdos/video.c */
extern char ttycolors[CLR_MAX]; /* in sys/msdos/video.c */
#endif
static char def_inv_order[MAXOCLASSES] = {
static const char def_inv_order[MAXOCLASSES] = {
COIN_CLASS, AMULET_CLASS, WEAPON_CLASS, ARMOR_CLASS, FOOD_CLASS,
SCROLL_CLASS, SPBOOK_CLASS, POTION_CLASS, RING_CLASS, WAND_CLASS,
TOOL_CLASS, GEM_CLASS, ROCK_CLASS, BALL_CLASS, CHAIN_CLASS, 0,
@@ -523,17 +522,6 @@ static const menu_cmd_t default_menu_cmd_info[] = {
{ "menu_search", MENU_SEARCH, "Search and toggle matching items" },
};
/*
* Allow the user to map incoming characters to various menu commands.
* The accelerator list must be a valid C string.
*/
#define MAX_MENU_MAPPED_CMDS 32 /* some number */
char mapped_menu_cmds[MAX_MENU_MAPPED_CMDS + 1]; /* exported */
static char mapped_menu_op[MAX_MENU_MAPPED_CMDS + 1];
static short n_menu_mapped = 0;
static boolean initial, from_file;
STATIC_DCL void FDECL(nmcpy, (char *, const char *, int));
STATIC_DCL void FDECL(escapes, (const char *, char *));
STATIC_DCL void FDECL(rejectoption, (const char *));
@@ -1059,7 +1047,7 @@ const char *optname;
char *opts;
boolean val_optional;
{
if (!initial) {
if (!g.opt_initial) {
rejectoption(optname);
return (char *) 0;
}
@@ -1176,7 +1164,7 @@ const char *optn;
if (fnv == 0L)
return 0;
if (fnv > get_current_feature_ver()) {
if (!initial) {
if (!g.opt_initial) {
You_cant("disable new feature alerts for future versions.");
} else {
config_error_add(
@@ -1187,7 +1175,7 @@ const char *optn;
}
flags.suppress_alert = fnv;
if (!initial) {
if (!g.opt_initial) {
Sprintf(buf, "%lu.%lu.%lu", FEATURE_NOTICE_VER_MAJ,
FEATURE_NOTICE_VER_MIN, FEATURE_NOTICE_VER_PATCH);
pline(
@@ -1236,7 +1224,7 @@ int iscompound; /* 0 == boolean option, 1 == compound */
{
int i, *optptr;
if (!iscompound && iflags.opt_booldup && initial && from_file) {
if (!iscompound && iflags.opt_booldup && g.opt_initial && g.opt_from_file) {
for (i = 0; boolopt[i].name; i++) {
if (match_optname(opts, boolopt[i].name, 3, FALSE)) {
optptr = iflags.opt_booldup + i;
@@ -1247,7 +1235,7 @@ int iscompound; /* 0 == boolean option, 1 == compound */
return FALSE;
}
}
} else if (iscompound && iflags.opt_compdup && initial && from_file) {
} else if (iscompound && iflags.opt_compdup && g.opt_initial && g.opt_from_file) {
for (i = 0; compopt[i].name; i++) {
if (match_optname(opts, compopt[i].name, strlen(compopt[i].name),
TRUE)) {
@@ -1992,11 +1980,11 @@ boolean tinitial, tfrom_file;
const char *fullname;
boolean retval = TRUE;
initial = tinitial;
from_file = tfrom_file;
g.opt_initial = tinitial;
g.opt_from_file = tfrom_file;
if ((op = index(opts, ',')) != 0) {
*op++ = 0;
if (!parseoptions(op, initial, from_file))
if (!parseoptions(op, g.opt_initial, g.opt_from_file))
retval = FALSE;
}
if (strlen(opts) > BUFSZ / 2) {
@@ -2035,7 +2023,7 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, "female", 3, FALSE)) {
if (duplicate_opt_detection(opts, 0))
complain_about_duplicate(opts, 0);
if (!initial && flags.female == negated) {
if (!g.opt_initial && flags.female == negated) {
config_error_add("That is not anatomically possible.");
return FALSE;
} else
@@ -2046,7 +2034,7 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, "male", 4, FALSE)) {
if (duplicate_opt_detection(opts, 0))
complain_about_duplicate(opts, 0);
if (!initial && flags.female != negated) {
if (!g.opt_initial && flags.female != negated) {
config_error_add("That is not anatomically possible.");
return FALSE;
} else
@@ -2217,9 +2205,9 @@ boolean tinitial, tfrom_file;
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, (compat || !initial));
op = string_for_opt(opts, (compat || !g.opt_initial));
if (!op) {
if (compat || negated || initial) {
if (compat || negated || g.opt_initial) {
/* for backwards compatibility, "mouse_support" without a
value is a synonym for mouse_support:1 */
iflags.wc_mouse_support = !negated;
@@ -2246,9 +2234,9 @@ boolean tinitial, tfrom_file;
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, (compat || !initial));
op = string_for_opt(opts, (compat || !g.opt_initial));
if (!op) {
if (compat || negated || initial) {
if (compat || negated || g.opt_initial) {
/* for backwards compatibility, "number_pad" without a
value is a synonym for number_pad:1 */
iflags.num_pad = !negated;
@@ -2299,9 +2287,9 @@ boolean tinitial, tfrom_file;
op, SYMBOLS);
return FALSE;
} else {
if (!initial && Is_rogue_level(&u.uz))
if (!g.opt_initial && Is_rogue_level(&u.uz))
assign_graphics(ROGUESET);
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
}
} else
return FALSE;
@@ -2325,7 +2313,7 @@ boolean tinitial, tfrom_file;
return FALSE;
} else {
switch_symbols(g.symset[PRIMARY].name != (char *) 0);
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
}
} else
return FALSE;
@@ -2578,8 +2566,8 @@ boolean tinitial, tfrom_file;
}
}
#endif /* !WIN32 */
if (!initial) {
need_redraw = TRUE;
if (!g.opt_initial) {
g.opt_need_redraw = TRUE;
}
return retval;
}
@@ -2591,7 +2579,7 @@ boolean tinitial, tfrom_file;
if (duplicate)
complain_about_duplicate(opts, 1);
op = string_for_opt(opts, negated || !initial);
op = string_for_opt(opts, negated || !g.opt_initial);
if (negated) {
if (op) {
bad_negation("fruit", TRUE);
@@ -2604,7 +2592,7 @@ boolean tinitial, tfrom_file;
return FALSE;
/* 3.6.2: strip leading and trailing spaces, condense internal ones */
mungspaces(op);
if (!initial) {
if (!g.opt_initial) {
struct fruit *f;
int fnum = 0;
@@ -2629,7 +2617,7 @@ boolean tinitial, tfrom_file;
initialization; it gets changed to generic "fruit" */
if (!*g.pl_fruit)
nmcpy(g.pl_fruit, "slime mold", PL_FSIZ);
if (!initial) {
if (!g.opt_initial) {
/* if 'forig' is nonNull, we replace it rather than add
a new fruit; it can only be nonNull if no fruits have
been created since the previous name was put in place */
@@ -2744,9 +2732,9 @@ boolean tinitial, tfrom_file;
}
/* for 'initial', update_bouldersym() is done in initoptions_finish(),
after all symset options have been processed */
if (!initial) {
if (!g.opt_initial) {
update_bouldersym();
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
}
return retval;
#else
@@ -2975,9 +2963,9 @@ boolean tinitial, tfrom_file;
complain_about_duplicate(opts, 1);
oc_to_str(flags.pickup_types, tbuf);
flags.pickup_types[0] = '\0'; /* all */
op = string_for_opt(opts, (compat || !initial));
op = string_for_opt(opts, (compat || !g.opt_initial));
if (!op) {
if (compat || negated || initial) {
if (compat || negated || g.opt_initial) {
/* for backwards compatibility, "pickup" without a
value is a synonym for autopickup of all types
(and during initialization, we can't prompt yet) */
@@ -3833,7 +3821,7 @@ boolean tinitial, tfrom_file;
return FALSE;
} else {
switch_symbols(TRUE);
if (!initial && Is_rogue_level(&u.uz))
if (!g.opt_initial && Is_rogue_level(&u.uz))
assign_graphics(ROGUESET);
}
}
@@ -3867,7 +3855,7 @@ boolean tinitial, tfrom_file;
return FALSE;
} else {
switch_symbols(TRUE);
if (!initial && Is_rogue_level(&u.uz))
if (!g.opt_initial && Is_rogue_level(&u.uz))
assign_graphics(ROGUESET);
}
}
@@ -3892,13 +3880,13 @@ boolean tinitial, tfrom_file;
if (match_optname(opts, boolopt[i].name, 3, TRUE)) {
/* options that don't exist */
if (!boolopt[i].addr) {
if (!initial && !negated)
if (!g.opt_initial && !negated)
pline_The("\"%s\" option is not available.",
boolopt[i].name);
return retval;
}
/* options that must come from config file */
if (!initial && (boolopt[i].optflags == SET_IN_FILE)) {
if (!g.opt_initial && (boolopt[i].optflags == SET_IN_FILE)) {
rejectoption(boolopt[i].name);
return retval;
}
@@ -3947,7 +3935,7 @@ boolean tinitial, tfrom_file;
iflags.wc_ascii_map = negated;
}
/* only do processing below if setting with doset() */
if (initial)
if (g.opt_initial)
return retval;
if (boolopt[i].addr == &flags.time
@@ -3974,26 +3962,26 @@ boolean tinitial, tfrom_file;
vision_recalc(2); /* shut down vision */
g.vision_full_recalc = 1; /* delayed recalc */
if (iflags.use_color)
need_redraw = TRUE; /* darkroom refresh */
g.opt_need_redraw = TRUE; /* darkroom refresh */
} else if (boolopt[i].addr == &flags.showrace
|| boolopt[i].addr == &iflags.use_inverse
|| boolopt[i].addr == &iflags.hilite_pile
|| boolopt[i].addr == &iflags.hilite_pet
|| boolopt[i].addr == &iflags.wc_ascii_map
|| boolopt[i].addr == &iflags.wc_tiled_map) {
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
#ifdef STATUS_HILITES
} else if (boolopt[i].addr == &iflags.wc2_hitpointbar) {
status_initialize(REASSESS_ONLY);
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
#endif
#ifdef CURSES_GRAPHICS
} else if ((boolopt[i].addr) == &iflags.cursesgraphics) {
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
#endif
#ifdef TEXTCOLOR
} else if (boolopt[i].addr == &iflags.use_color) {
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
#ifdef TOS
if (iflags.BIOS) {
if (colors_changed)
@@ -4113,14 +4101,14 @@ void
add_menu_cmd_alias(from_ch, to_ch)
char from_ch, to_ch;
{
if (n_menu_mapped >= MAX_MENU_MAPPED_CMDS) {
if (g.n_menu_mapped >= MAX_MENU_MAPPED_CMDS) {
pline("out of menu map space.");
} else {
mapped_menu_cmds[n_menu_mapped] = from_ch;
mapped_menu_op[n_menu_mapped] = to_ch;
n_menu_mapped++;
mapped_menu_cmds[n_menu_mapped] = 0;
mapped_menu_op[n_menu_mapped] = 0;
g.mapped_menu_cmds[g.n_menu_mapped] = from_ch;
g.mapped_menu_op[g.n_menu_mapped] = to_ch;
g.n_menu_mapped++;
g.mapped_menu_cmds[g.n_menu_mapped] = 0;
g.mapped_menu_op[g.n_menu_mapped] = 0;
}
}
@@ -4128,12 +4116,12 @@ char
get_menu_cmd_key(ch)
char ch;
{
char *found = index(mapped_menu_op, ch);
char *found = index(g.mapped_menu_op, ch);
if (found) {
int idx = (int) (found - mapped_menu_op);
int idx = (int) (found - g.mapped_menu_op);
ch = mapped_menu_cmds[idx];
ch = g.mapped_menu_cmds[idx];
}
return ch;
}
@@ -4146,12 +4134,12 @@ char
map_menu_cmd(ch)
char ch;
{
char *found = index(mapped_menu_cmds, ch);
char *found = index(g.mapped_menu_cmds, ch);
if (found) {
int idx = (int) (found - mapped_menu_cmds);
int idx = (int) (found - g.mapped_menu_cmds);
ch = mapped_menu_op[idx];
ch = g.mapped_menu_op[idx];
}
return ch;
}
@@ -4453,7 +4441,7 @@ doset() /* changing options via menu by Per Liboriussen */
doset_add_menu(tmpwin, fqn_prefix_names[i], 0);
#endif
end_menu(tmpwin, "Set what options?");
need_redraw = FALSE;
g.opt_need_redraw = FALSE;
if ((pick_cnt = select_menu(tmpwin, PICK_ANY, &pick_list)) > 0) {
/*
* Walk down the selection list and either invert the booleans
@@ -4514,7 +4502,7 @@ doset() /* changing options via menu by Per Liboriussen */
}
destroy_nhwindow(tmpwin);
if (need_redraw) {
if (g.opt_need_redraw) {
check_gold_symbol();
reglyph_darkroom();
(void) doredraw();
@@ -5365,7 +5353,7 @@ boolean setinitial, setfromfile;
} else if (!rogueflag)
assign_graphics(PRIMARY);
preference_update("symset");
need_redraw = TRUE;
g.opt_need_redraw = TRUE;
return TRUE;
} else {
+1 -1
View File
@@ -82,7 +82,7 @@ char *outbuf;
/* include race with role unless polymorphed */
race[0] = '\0';
if (!Upolyd)
Sprintf(race, "%s ", urace.adj);
Sprintf(race, "%s ", g.urace.adj);
Sprintf(outbuf, "%s%s%s called %s",
/* being blinded may hide invisibility from self */
(Invis && (senseself() || !Blind)) ? "invisible " : "", race,
+21 -21
View File
@@ -250,14 +250,14 @@ change_sex()
if (already_polyd) /* poly'd: also change saved sex */
u.mfemale = !u.mfemale;
max_rank_sz(); /* [this appears to be superfluous] */
if ((already_polyd ? u.mfemale : flags.female) && urole.name.f)
Strcpy(g.pl_character, urole.name.f);
if ((already_polyd ? u.mfemale : flags.female) && g.urole.name.f)
Strcpy(g.pl_character, g.urole.name.f);
else
Strcpy(g.pl_character, urole.name.m);
Strcpy(g.pl_character, g.urole.name.m);
u.umonster = ((already_polyd ? u.mfemale : flags.female)
&& urole.femalenum != NON_PM)
? urole.femalenum
: urole.malenum;
&& g.urole.femalenum != NON_PM)
? g.urole.femalenum
: g.urole.malenum;
if (!already_polyd) {
u.umonnum = u.umonster;
} else if (u.umonnum == PM_SUCCUBUS || u.umonnum == PM_INCUBUS) {
@@ -369,11 +369,11 @@ newman()
newuhs(FALSE);
polyman("feel like a new %s!",
/* use saved gender we're about to revert to, not current */
((Upolyd ? u.mfemale : flags.female) && urace.individual.f)
? urace.individual.f
: (urace.individual.m)
? urace.individual.m
: urace.noun);
((Upolyd ? u.mfemale : flags.female) && g.urace.individual.f)
? g.urace.individual.f
: (g.urace.individual.m)
? g.urace.individual.m
: g.urace.noun);
if (Slimed) {
Your("body transforms, but there is still slime on you.");
make_slimed(10L, (const char *) 0);
@@ -460,8 +460,8 @@ int psflags;
* want if they specified a human.... */
} else if (!polyok(&mons[mntmp])
&& !(mntmp == PM_HUMAN || your_race(&mons[mntmp])
|| mntmp == urole.malenum
|| mntmp == urole.femalenum)) {
|| mntmp == g.urole.malenum
|| mntmp == g.urole.femalenum)) {
const char *pm_name;
/* mkclass_poly() can pick a !polyok()
@@ -1043,13 +1043,13 @@ rehumanize()
if (emits_light(g.youmonst.data))
del_light_source(LS_MONSTER, monst_to_any(&g.youmonst));
polyman("return to %s form!", urace.adj);
polyman("return to %s form!", g.urace.adj);
if (u.uhp < 1) {
/* can only happen if some bit of code reduces u.uhp
instead of u.mh while poly'd */
Your("old form was not healthy enough to survive.");
Sprintf(g.killer.name, "reverting to unhealthy %s form", urace.adj);
Sprintf(g.killer.name, "reverting to unhealthy %s form", g.urace.adj);
g.killer.format = KILLED_BY;
done(DIED);
}
@@ -1839,12 +1839,12 @@ polysense()
boolean
ugenocided()
{
return (boolean) ((g.mvitals[urole.malenum].mvflags & G_GENOD)
|| (urole.femalenum != NON_PM
&& (g.mvitals[urole.femalenum].mvflags & G_GENOD))
|| (g.mvitals[urace.malenum].mvflags & G_GENOD)
|| (urace.femalenum != NON_PM
&& (g.mvitals[urace.femalenum].mvflags & G_GENOD)));
return (boolean) ((g.mvitals[g.urole.malenum].mvflags & G_GENOD)
|| (g.urole.femalenum != NON_PM
&& (g.mvitals[g.urole.femalenum].mvflags & G_GENOD))
|| (g.mvitals[g.urace.malenum].mvflags & G_GENOD)
|| (g.urace.femalenum != NON_PM
&& (g.mvitals[g.urace.femalenum].mvflags & G_GENOD)));
}
/* how hero feels "inside" after self-genocide of role or race */
+7 -7
View File
@@ -1355,7 +1355,7 @@ dosacrifice()
goto desecrate_high_altar;
} else if (altaralign != A_CHAOTIC && altaralign != A_NONE) {
/* curse the lawful/neutral altar */
pline_The("altar is stained with %s blood.", urace.adj);
pline_The("altar is stained with %s blood.", g.urace.adj);
levl[u.ux][u.uy].altarmask = AM_CHAOTIC;
angry_priest();
} else {
@@ -2043,13 +2043,13 @@ aligntyp alignment;
gnam = Moloch;
break;
case A_LAWFUL:
gnam = urole.lgod;
gnam = g.urole.lgod;
break;
case A_NEUTRAL:
gnam = urole.ngod;
gnam = g.urole.ngod;
break;
case A_CHAOTIC:
gnam = urole.cgod;
gnam = g.urole.cgod;
break;
default:
impossible("unknown alignment.");
@@ -2137,13 +2137,13 @@ aligntyp alignment;
switch (alignment) {
case A_LAWFUL:
gnam = urole.lgod;
gnam = g.urole.lgod;
break;
case A_NEUTRAL:
gnam = urole.ngod;
gnam = g.urole.ngod;
break;
case A_CHAOTIC:
gnam = urole.cgod;
gnam = g.urole.cgod;
break;
default:
gnam = 0;
+18 -18
View File
@@ -117,10 +117,10 @@ load_qtlist()
for (i = 0; i < n_classes; i++) {
if (!strncmp(COMMON_ID, qt_classes[i], LEN_HDR))
g.qt_list.common = construct_qtlist(qt_offsets[i]);
else if (!strncmp(urole.filecode, qt_classes[i], LEN_HDR))
else if (!strncmp(g.urole.filecode, qt_classes[i], LEN_HDR))
g.qt_list.chrole = construct_qtlist(qt_offsets[i]);
#if 0 /* UNUSED but available */
else if (!strncmp(urace.filecode, qt_classes[i], LEN_HDR))
else if (!strncmp(g.urace.filecode, qt_classes[i], LEN_HDR))
g.qt_list.chrace = construct_qtlist(qt_offsets[i]);
#endif
}
@@ -150,13 +150,13 @@ int typ;
{
switch (typ) {
case 0:
return urole.questarti;
return g.urole.questarti;
case MS_LEADER:
return urole.ldrnum;
return g.urole.ldrnum;
case MS_NEMESIS:
return urole.neminum;
return g.urole.neminum;
case MS_GUARDIAN:
return urole.guardnum;
return g.urole.guardnum;
default:
impossible("quest_info(%d)", typ);
}
@@ -167,7 +167,7 @@ int typ;
const char *
ldrname()
{
int i = urole.ldrnum;
int i = g.urole.ldrnum;
Sprintf(g.nambuf, "%s%s", type_is_pname(&mons[i]) ? "" : "the ",
mons[i].mname);
@@ -178,14 +178,14 @@ ldrname()
STATIC_OVL const char *
intermed()
{
return urole.intermed;
return g.urole.intermed;
}
boolean
is_quest_artifact(otmp)
struct obj *otmp;
{
return (boolean) (otmp->oartifact == urole.questarti);
return (boolean) (otmp->oartifact == g.urole.questarti);
}
STATIC_OVL struct obj *
@@ -244,7 +244,7 @@ unsigned whichchains;
STATIC_OVL const char *
neminame()
{
int i = urole.neminum;
int i = g.urole.neminum;
Sprintf(g.nambuf, "%s%s", type_is_pname(&mons[i]) ? "" : "the ",
mons[i].mname);
@@ -254,7 +254,7 @@ neminame()
STATIC_OVL const char *
guardname() /* return your role leader's guard monster name */
{
int i = urole.guardnum;
int i = g.urole.guardnum;
return mons[i].mname;
}
@@ -262,7 +262,7 @@ guardname() /* return your role leader's guard monster name */
STATIC_OVL const char *
homebase() /* return your role leader's location */
{
return urole.homebase;
return g.urole.homebase;
}
/* replace deity, leader, nemesis, or artifact name with pronoun;
@@ -329,7 +329,7 @@ char c;
str = g.plname;
break;
case 'c':
str = (flags.female && urole.name.f) ? urole.name.f : urole.name.m;
str = (flags.female && g.urole.name.f) ? g.urole.name.f : g.urole.name.m;
break;
case 'r':
str = rank_of(u.ulevel, Role_switch, flags.female);
@@ -351,7 +351,7 @@ char c;
break;
case 'O':
case 'o':
str = the(artiname(urole.questarti));
str = the(artiname(g.urole.questarti));
if (c == 'O') {
/* shorten "the Foo of Bar" to "the Foo"
(buffer returned by the() is modifiable) */
@@ -649,15 +649,15 @@ qt_montype()
int qpm;
if (rn2(5)) {
qpm = urole.enemy1num;
qpm = g.urole.enemy1num;
if (qpm != NON_PM && rn2(5) && !(g.mvitals[qpm].mvflags & G_GENOD))
return &mons[qpm];
return mkclass(urole.enemy1sym, 0);
return mkclass(g.urole.enemy1sym, 0);
}
qpm = urole.enemy2num;
qpm = g.urole.enemy2num;
if (qpm != NON_PM && rn2(5) && !(g.mvitals[qpm].mvflags & G_GENOD))
return &mons[qpm];
return mkclass(urole.enemy2sym, 0);
return mkclass(g.urole.enemy2sym, 0);
}
/* special levels can include a custom arrival message; display it */
+19 -19
View File
@@ -6,11 +6,11 @@
#include "hack.h"
#define Your_Own_Role(mndx) \
((mndx) == urole.malenum \
|| (urole.femalenum != NON_PM && (mndx) == urole.femalenum))
((mndx) == g.urole.malenum \
|| (g.urole.femalenum != NON_PM && (mndx) == g.urole.femalenum))
#define Your_Own_Race(mndx) \
((mndx) == urace.malenum \
|| (urace.femalenum != NON_PM && (mndx) == urace.femalenum))
((mndx) == g.urace.malenum \
|| (g.urace.femalenum != NON_PM && (mndx) == g.urace.femalenum))
static NEARDATA const char readable[] = { ALL_CLASSES, SCROLL_CLASS,
SPBOOK_CLASS, 0 };
@@ -2060,8 +2060,8 @@ do_class_genocide()
goodcnt++;
}
}
if (!goodcnt && class != mons[urole.malenum].mlet
&& class != mons[urace.malenum].mlet) {
if (!goodcnt && class != mons[g.urole.malenum].mlet
&& class != mons[g.urace.malenum].mlet) {
if (gonecnt)
pline("All such monsters are already nonexistent.");
else if (immunecnt || class == S_invisible)
@@ -2118,7 +2118,7 @@ do_class_genocide()
/* Self-genocide if it matches either your race
or role. Assumption: male and female forms
share same monster class. */
if (i == urole.malenum || i == urace.malenum) {
if (i == g.urole.malenum || i == g.urace.malenum) {
u.uhp = -1;
if (Upolyd) {
if (!feel_dead++)
@@ -2259,8 +2259,8 @@ int how;
if (Upolyd)
Strcpy(buf, g.youmonst.data->mname);
else {
Strcpy(buf, (flags.female && urole.name.f) ? urole.name.f
: urole.name.m);
Strcpy(buf, (flags.female && g.urole.name.f) ? g.urole.name.f
: g.urole.name.m);
buf[0] = lowc(buf[0]);
}
} else {
@@ -2276,14 +2276,14 @@ int how;
if (killplayer) {
/* might need to wipe out dual role */
if (urole.femalenum != NON_PM && mndx == urole.malenum)
g.mvitals[urole.femalenum].mvflags |= (G_GENOD | G_NOCORPSE);
if (urole.femalenum != NON_PM && mndx == urole.femalenum)
g.mvitals[urole.malenum].mvflags |= (G_GENOD | G_NOCORPSE);
if (urace.femalenum != NON_PM && mndx == urace.malenum)
g.mvitals[urace.femalenum].mvflags |= (G_GENOD | G_NOCORPSE);
if (urace.femalenum != NON_PM && mndx == urace.femalenum)
g.mvitals[urace.malenum].mvflags |= (G_GENOD | G_NOCORPSE);
if (g.urole.femalenum != NON_PM && mndx == g.urole.malenum)
g.mvitals[g.urole.femalenum].mvflags |= (G_GENOD | G_NOCORPSE);
if (g.urole.femalenum != NON_PM && mndx == g.urole.femalenum)
g.mvitals[g.urole.malenum].mvflags |= (G_GENOD | G_NOCORPSE);
if (g.urace.femalenum != NON_PM && mndx == g.urace.malenum)
g.mvitals[g.urace.femalenum].mvflags |= (G_GENOD | G_NOCORPSE);
if (g.urace.femalenum != NON_PM && mndx == g.urace.femalenum)
g.mvitals[g.urace.malenum].mvflags |= (G_GENOD | G_NOCORPSE);
u.uhp = -1;
if (how & PLAYER) {
@@ -2440,7 +2440,7 @@ struct _create_particular_data *d;
char *tmpp;
d->monclass = MAXMCLASSES;
d->which = urole.malenum; /* an arbitrary index into mons[] */
d->which = g.urole.malenum; /* an arbitrary index into mons[] */
d->fem = -1; /* gender not specified */
d->randmonst = FALSE;
d->maketame = d->makepeaceful = d->makehostile = FALSE;
@@ -2492,7 +2492,7 @@ struct _create_particular_data *d;
d->monclass = MAXMCLASSES; /* matters below */
return TRUE;
} else if (d->monclass > 0) {
d->which = urole.malenum; /* reset from NON_PM */
d->which = g.urole.malenum; /* reset from NON_PM */
return TRUE;
}
return FALSE;
+198 -202
View File
@@ -11,10 +11,6 @@
* structure eventually.
*/
static NhRegion **regions;
static int n_regions = 0;
static int max_regions = 0;
#define NO_CALLBACK (-1)
boolean FDECL(inside_gas_cloud, (genericptr, genericptr));
@@ -294,19 +290,19 @@ NhRegion *reg;
NhRegion **tmp_reg;
int i, j;
if (max_regions <= n_regions) {
tmp_reg = regions;
regions =
(NhRegion **) alloc((max_regions + 10) * sizeof (NhRegion *));
if (max_regions > 0) {
(void) memcpy((genericptr_t) regions, (genericptr_t) tmp_reg,
max_regions * sizeof (NhRegion *));
if (g.max_regions <= g.n_regions) {
tmp_reg = g.regions;
g.regions =
(NhRegion **) alloc((g.max_regions + 10) * sizeof (NhRegion *));
if (g.max_regions > 0) {
(void) memcpy((genericptr_t) g.regions, (genericptr_t) tmp_reg,
g.max_regions * sizeof (NhRegion *));
free((genericptr_t) tmp_reg);
}
max_regions += 10;
g.max_regions += 10;
}
regions[n_regions] = reg;
n_regions++;
g.regions[g.n_regions] = reg;
g.n_regions++;
/* Check for monsters inside the region */
for (i = reg->bounding_box.lx; i <= reg->bounding_box.hx; i++)
for (j = reg->bounding_box.ly; j <= reg->bounding_box.hy; j++) {
@@ -334,10 +330,10 @@ NhRegion *reg;
{
register int i, x, y;
for (i = 0; i < n_regions; i++)
if (regions[i] == reg)
for (i = 0; i < g.n_regions; i++)
if (g.regions[i] == reg)
break;
if (i == n_regions)
if (i == g.n_regions)
return;
/* Update screen if necessary */
@@ -349,9 +345,9 @@ NhRegion *reg;
newsym(x, y);
free_region(reg);
regions[i] = regions[n_regions - 1];
regions[n_regions - 1] = (NhRegion *) 0;
n_regions--;
g.regions[i] = g.regions[g.n_regions - 1];
g.regions[g.n_regions - 1] = (NhRegion *) 0;
g.n_regions--;
}
/*
@@ -363,13 +359,13 @@ clear_regions()
{
register int i;
for (i = 0; i < n_regions; i++)
free_region(regions[i]);
n_regions = 0;
if (max_regions > 0)
free((genericptr_t) regions);
max_regions = 0;
regions = (NhRegion **) 0;
for (i = 0; i < g.n_regions; i++)
free_region(g.regions[i]);
g.n_regions = 0;
if (g.max_regions > 0)
free((genericptr_t) g.regions);
g.max_regions = 0;
g.regions = (NhRegion **) 0;
}
/*
@@ -385,35 +381,35 @@ run_regions()
/* End of life ? */
/* Do it backward because the array will be modified */
for (i = n_regions - 1; i >= 0; i--) {
if (regions[i]->ttl == 0L) {
if ((f_indx = regions[i]->expire_f) == NO_CALLBACK
|| (*callbacks[f_indx])(regions[i], (genericptr_t) 0))
remove_region(regions[i]);
for (i = g.n_regions - 1; i >= 0; i--) {
if (g.regions[i]->ttl == 0L) {
if ((f_indx = g.regions[i]->expire_f) == NO_CALLBACK
|| (*callbacks[f_indx])(g.regions[i], (genericptr_t) 0))
remove_region(g.regions[i]);
}
}
/* Process remaining regions */
for (i = 0; i < n_regions; i++) {
for (i = 0; i < g.n_regions; i++) {
/* Make the region age */
if (regions[i]->ttl > 0L)
regions[i]->ttl--;
if (g.regions[i]->ttl > 0L)
g.regions[i]->ttl--;
/* Check if player is inside region */
f_indx = regions[i]->inside_f;
if (f_indx != NO_CALLBACK && hero_inside(regions[i]))
(void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0);
f_indx = g.regions[i]->inside_f;
if (f_indx != NO_CALLBACK && hero_inside(g.regions[i]))
(void) (*callbacks[f_indx])(g.regions[i], (genericptr_t) 0);
/* Check if any monster is inside region */
if (f_indx != NO_CALLBACK) {
for (j = 0; j < regions[i]->n_monst; j++) {
for (j = 0; j < g.regions[i]->n_monst; j++) {
struct monst *mtmp =
find_mid(regions[i]->monsters[j], FM_FMON);
find_mid(g.regions[i]->monsters[j], FM_FMON);
if (!mtmp || DEADMONSTER(mtmp)
|| (*callbacks[f_indx])(regions[i], mtmp)) {
|| (*callbacks[f_indx])(g.regions[i], mtmp)) {
/* The monster died, remove it from list */
k = (regions[i]->n_monst -= 1);
regions[i]->monsters[j] = regions[i]->monsters[k];
regions[i]->monsters[k] = 0;
k = (g.regions[i]->n_monst -= 1);
g.regions[i]->monsters[j] = g.regions[i]->monsters[k];
g.regions[i]->monsters[k] = 0;
--j; /* current slot has been reused; recheck it next */
}
}
@@ -431,40 +427,40 @@ xchar x, y;
int i, f_indx;
/* First check if we can do the move */
for (i = 0; i < n_regions; i++) {
if (inside_region(regions[i], x, y) && !hero_inside(regions[i])
&& !regions[i]->attach_2_u) {
if ((f_indx = regions[i]->can_enter_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(regions[i], (genericptr_t) 0))
for (i = 0; i < g.n_regions; i++) {
if (inside_region(g.regions[i], x, y) && !hero_inside(g.regions[i])
&& !g.regions[i]->attach_2_u) {
if ((f_indx = g.regions[i]->can_enter_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(g.regions[i], (genericptr_t) 0))
return FALSE;
} else if (hero_inside(regions[i]) && !inside_region(regions[i], x, y)
&& !regions[i]->attach_2_u) {
if ((f_indx = regions[i]->can_leave_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(regions[i], (genericptr_t) 0))
} else if (hero_inside(g.regions[i]) && !inside_region(g.regions[i], x, y)
&& !g.regions[i]->attach_2_u) {
if ((f_indx = g.regions[i]->can_leave_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(g.regions[i], (genericptr_t) 0))
return FALSE;
}
}
/* Callbacks for the regions we do leave */
for (i = 0; i < n_regions; i++)
if (hero_inside(regions[i]) && !regions[i]->attach_2_u
&& !inside_region(regions[i], x, y)) {
clear_hero_inside(regions[i]);
if (regions[i]->leave_msg != (const char *) 0)
pline1(regions[i]->leave_msg);
if ((f_indx = regions[i]->leave_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0);
for (i = 0; i < g.n_regions; i++)
if (hero_inside(g.regions[i]) && !g.regions[i]->attach_2_u
&& !inside_region(g.regions[i], x, y)) {
clear_hero_inside(g.regions[i]);
if (g.regions[i]->leave_msg != (const char *) 0)
pline1(g.regions[i]->leave_msg);
if ((f_indx = g.regions[i]->leave_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(g.regions[i], (genericptr_t) 0);
}
/* Callbacks for the regions we do enter */
for (i = 0; i < n_regions; i++)
if (!hero_inside(regions[i]) && !regions[i]->attach_2_u
&& inside_region(regions[i], x, y)) {
set_hero_inside(regions[i]);
if (regions[i]->enter_msg != (const char *) 0)
pline1(regions[i]->enter_msg);
if ((f_indx = regions[i]->enter_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], (genericptr_t) 0);
for (i = 0; i < g.n_regions; i++)
if (!hero_inside(g.regions[i]) && !g.regions[i]->attach_2_u
&& inside_region(g.regions[i], x, y)) {
set_hero_inside(g.regions[i]);
if (g.regions[i]->enter_msg != (const char *) 0)
pline1(g.regions[i]->enter_msg);
if ((f_indx = g.regions[i]->enter_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(g.regions[i], (genericptr_t) 0);
}
return TRUE;
}
@@ -480,38 +476,38 @@ xchar x, y;
int i, f_indx;
/* First check if we can do the move */
for (i = 0; i < n_regions; i++) {
if (inside_region(regions[i], x, y) && !mon_in_region(regions[i], mon)
&& regions[i]->attach_2_m != mon->m_id) {
if ((f_indx = regions[i]->can_enter_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(regions[i], mon))
for (i = 0; i < g.n_regions; i++) {
if (inside_region(g.regions[i], x, y) && !mon_in_region(g.regions[i], mon)
&& g.regions[i]->attach_2_m != mon->m_id) {
if ((f_indx = g.regions[i]->can_enter_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(g.regions[i], mon))
return FALSE;
} else if (mon_in_region(regions[i], mon)
&& !inside_region(regions[i], x, y)
&& regions[i]->attach_2_m != mon->m_id) {
if ((f_indx = regions[i]->can_leave_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(regions[i], mon))
} else if (mon_in_region(g.regions[i], mon)
&& !inside_region(g.regions[i], x, y)
&& g.regions[i]->attach_2_m != mon->m_id) {
if ((f_indx = g.regions[i]->can_leave_f) != NO_CALLBACK)
if (!(*callbacks[f_indx])(g.regions[i], mon))
return FALSE;
}
}
/* Callbacks for the regions we do leave */
for (i = 0; i < n_regions; i++)
if (mon_in_region(regions[i], mon)
&& regions[i]->attach_2_m != mon->m_id
&& !inside_region(regions[i], x, y)) {
remove_mon_from_reg(regions[i], mon);
if ((f_indx = regions[i]->leave_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], mon);
for (i = 0; i < g.n_regions; i++)
if (mon_in_region(g.regions[i], mon)
&& g.regions[i]->attach_2_m != mon->m_id
&& !inside_region(g.regions[i], x, y)) {
remove_mon_from_reg(g.regions[i], mon);
if ((f_indx = g.regions[i]->leave_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(g.regions[i], mon);
}
/* Callbacks for the regions we do enter */
for (i = 0; i < n_regions; i++)
if (!hero_inside(regions[i]) && !regions[i]->attach_2_u
&& inside_region(regions[i], x, y)) {
add_mon_to_reg(regions[i], mon);
if ((f_indx = regions[i]->enter_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(regions[i], mon);
for (i = 0; i < g.n_regions; i++)
if (!hero_inside(g.regions[i]) && !g.regions[i]->attach_2_u
&& inside_region(g.regions[i], x, y)) {
add_mon_to_reg(g.regions[i], mon);
if ((f_indx = g.regions[i]->enter_f) != NO_CALLBACK)
(void) (*callbacks[f_indx])(g.regions[i], mon);
}
return TRUE;
}
@@ -524,11 +520,11 @@ update_player_regions()
{
register int i;
for (i = 0; i < n_regions; i++)
if (!regions[i]->attach_2_u && inside_region(regions[i], u.ux, u.uy))
set_hero_inside(regions[i]);
for (i = 0; i < g.n_regions; i++)
if (!g.regions[i]->attach_2_u && inside_region(g.regions[i], u.ux, u.uy))
set_hero_inside(g.regions[i]);
else
clear_hero_inside(regions[i]);
clear_hero_inside(g.regions[i]);
}
/*
@@ -540,13 +536,13 @@ struct monst *mon;
{
register int i;
for (i = 0; i < n_regions; i++) {
if (inside_region(regions[i], mon->mx, mon->my)) {
if (!mon_in_region(regions[i], mon))
add_mon_to_reg(regions[i], mon);
for (i = 0; i < g.n_regions; i++) {
if (inside_region(g.regions[i], mon->mx, mon->my)) {
if (!mon_in_region(g.regions[i], mon))
add_mon_to_reg(g.regions[i], mon);
} else {
if (mon_in_region(regions[i], mon))
remove_mon_from_reg(regions[i], mon);
if (mon_in_region(g.regions[i], mon))
remove_mon_from_reg(g.regions[i], mon);
}
}
}
@@ -555,7 +551,7 @@ struct monst *mon;
/* not yet used */
/*
* Change monster pointer in regions
* Change monster pointer in g.regions
* This happens, for instance, when a monster grows and
* need a new structure (internally that is).
*/
@@ -565,10 +561,10 @@ struct monst *monold, *monnew;
{
register int i;
for (i = 0; i < n_regions; i++)
if (mon_in_region(regions[i], monold)) {
remove_mon_from_reg(regions[i], monold);
add_mon_to_reg(regions[i], monnew);
for (i = 0; i < g.n_regions; i++)
if (mon_in_region(g.regions[i], monold)) {
remove_mon_from_reg(g.regions[i], monold);
add_mon_to_reg(g.regions[i], monnew);
}
}
@@ -581,9 +577,9 @@ struct monst *mon;
{
register int i;
for (i = 0; i < n_regions; i++)
if (mon_in_region(regions[i], mon))
remove_mon_from_reg(regions[i], mon);
for (i = 0; i < g.n_regions; i++)
if (mon_in_region(g.regions[i], mon))
remove_mon_from_reg(g.regions[i], mon);
}
#endif /*0*/
@@ -598,10 +594,10 @@ xchar x, y;
{
register int i;
for (i = 0; i < n_regions; i++)
if (inside_region(regions[i], x, y) && regions[i]->visible
&& regions[i]->ttl != -2L)
return regions[i];
for (i = 0; i < g.n_regions; i++)
if (inside_region(g.regions[i], x, y) && g.regions[i]->visible
&& g.regions[i]->ttl != -2L)
return g.regions[i];
return (NhRegion *) 0;
}
@@ -628,43 +624,43 @@ int mode;
goto skip_lots;
bwrite(fd, (genericptr_t) &g.moves, sizeof(g.moves)); /* timestamp */
bwrite(fd, (genericptr_t) &n_regions, sizeof(n_regions));
for (i = 0; i < n_regions; i++) {
bwrite(fd, (genericptr_t) &regions[i]->bounding_box, sizeof(NhRect));
bwrite(fd, (genericptr_t) &regions[i]->nrects, sizeof(short));
for (j = 0; j < regions[i]->nrects; j++)
bwrite(fd, (genericptr_t) &regions[i]->rects[j], sizeof(NhRect));
bwrite(fd, (genericptr_t) &regions[i]->attach_2_u, sizeof(boolean));
bwrite(fd, (genericptr_t) &g.n_regions, sizeof(g.n_regions));
for (i = 0; i < g.n_regions; i++) {
bwrite(fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof(NhRect));
bwrite(fd, (genericptr_t) &g.regions[i]->nrects, sizeof(short));
for (j = 0; j < g.regions[i]->nrects; j++)
bwrite(fd, (genericptr_t) &g.regions[i]->rects[j], sizeof(NhRect));
bwrite(fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof(boolean));
n = 0;
bwrite(fd, (genericptr_t) &regions[i]->attach_2_m, sizeof(unsigned));
n = regions[i]->enter_msg != (const char *) 0
? strlen(regions[i]->enter_msg)
bwrite(fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof(unsigned));
n = g.regions[i]->enter_msg != (const char *) 0
? strlen(g.regions[i]->enter_msg)
: 0;
bwrite(fd, (genericptr_t) &n, sizeof n);
if (n > 0)
bwrite(fd, (genericptr_t) regions[i]->enter_msg, n);
n = regions[i]->leave_msg != (const char *) 0
? strlen(regions[i]->leave_msg)
bwrite(fd, (genericptr_t) g.regions[i]->enter_msg, n);
n = g.regions[i]->leave_msg != (const char *) 0
? strlen(g.regions[i]->leave_msg)
: 0;
bwrite(fd, (genericptr_t) &n, sizeof n);
if (n > 0)
bwrite(fd, (genericptr_t) regions[i]->leave_msg, n);
bwrite(fd, (genericptr_t) &regions[i]->ttl, sizeof(long));
bwrite(fd, (genericptr_t) &regions[i]->expire_f, sizeof(short));
bwrite(fd, (genericptr_t) &regions[i]->can_enter_f, sizeof(short));
bwrite(fd, (genericptr_t) &regions[i]->enter_f, sizeof(short));
bwrite(fd, (genericptr_t) &regions[i]->can_leave_f, sizeof(short));
bwrite(fd, (genericptr_t) &regions[i]->leave_f, sizeof(short));
bwrite(fd, (genericptr_t) &regions[i]->inside_f, sizeof(short));
bwrite(fd, (genericptr_t) &regions[i]->player_flags,
bwrite(fd, (genericptr_t) g.regions[i]->leave_msg, n);
bwrite(fd, (genericptr_t) &g.regions[i]->ttl, sizeof(long));
bwrite(fd, (genericptr_t) &g.regions[i]->expire_f, sizeof(short));
bwrite(fd, (genericptr_t) &g.regions[i]->can_enter_f, sizeof(short));
bwrite(fd, (genericptr_t) &g.regions[i]->enter_f, sizeof(short));
bwrite(fd, (genericptr_t) &g.regions[i]->can_leave_f, sizeof(short));
bwrite(fd, (genericptr_t) &g.regions[i]->leave_f, sizeof(short));
bwrite(fd, (genericptr_t) &g.regions[i]->inside_f, sizeof(short));
bwrite(fd, (genericptr_t) &g.regions[i]->player_flags,
sizeof(unsigned int));
bwrite(fd, (genericptr_t) &regions[i]->n_monst, sizeof(short));
for (j = 0; j < regions[i]->n_monst; j++)
bwrite(fd, (genericptr_t) &regions[i]->monsters[j],
bwrite(fd, (genericptr_t) &g.regions[i]->n_monst, sizeof(short));
for (j = 0; j < g.regions[i]->n_monst; j++)
bwrite(fd, (genericptr_t) &g.regions[i]->monsters[j],
sizeof(unsigned));
bwrite(fd, (genericptr_t) &regions[i]->visible, sizeof(boolean));
bwrite(fd, (genericptr_t) &regions[i]->glyph, sizeof(int));
bwrite(fd, (genericptr_t) &regions[i]->arg, sizeof(anything));
bwrite(fd, (genericptr_t) &g.regions[i]->visible, sizeof(boolean));
bwrite(fd, (genericptr_t) &g.regions[i]->glyph, sizeof(int));
bwrite(fd, (genericptr_t) &g.regions[i]->arg, sizeof(anything));
}
skip_lots:
@@ -688,79 +684,79 @@ boolean ghostly; /* If a bones file restore */
tmstamp = 0;
else
tmstamp = (g.moves - tmstamp);
mread(fd, (genericptr_t) &n_regions, sizeof(n_regions));
max_regions = n_regions;
if (n_regions > 0)
regions = (NhRegion **) alloc(sizeof(NhRegion *) * n_regions);
for (i = 0; i < n_regions; i++) {
regions[i] = (NhRegion *) alloc(sizeof(NhRegion));
mread(fd, (genericptr_t) &regions[i]->bounding_box, sizeof(NhRect));
mread(fd, (genericptr_t) &regions[i]->nrects, sizeof(short));
mread(fd, (genericptr_t) &g.n_regions, sizeof(g.n_regions));
g.max_regions = g.n_regions;
if (g.n_regions > 0)
g.regions = (NhRegion **) alloc(sizeof(NhRegion *) * g.n_regions);
for (i = 0; i < g.n_regions; i++) {
g.regions[i] = (NhRegion *) alloc(sizeof(NhRegion));
mread(fd, (genericptr_t) &g.regions[i]->bounding_box, sizeof(NhRect));
mread(fd, (genericptr_t) &g.regions[i]->nrects, sizeof(short));
if (regions[i]->nrects > 0)
regions[i]->rects =
(NhRect *) alloc(sizeof(NhRect) * regions[i]->nrects);
for (j = 0; j < regions[i]->nrects; j++)
mread(fd, (genericptr_t) &regions[i]->rects[j], sizeof(NhRect));
mread(fd, (genericptr_t) &regions[i]->attach_2_u, sizeof(boolean));
mread(fd, (genericptr_t) &regions[i]->attach_2_m, sizeof(unsigned));
if (g.regions[i]->nrects > 0)
g.regions[i]->rects =
(NhRect *) alloc(sizeof(NhRect) * g.regions[i]->nrects);
for (j = 0; j < g.regions[i]->nrects; j++)
mread(fd, (genericptr_t) &g.regions[i]->rects[j], sizeof(NhRect));
mread(fd, (genericptr_t) &g.regions[i]->attach_2_u, sizeof(boolean));
mread(fd, (genericptr_t) &g.regions[i]->attach_2_m, sizeof(unsigned));
mread(fd, (genericptr_t) &n, sizeof n);
if (n > 0) {
msg_buf = (char *) alloc(n + 1);
mread(fd, (genericptr_t) msg_buf, n);
msg_buf[n] = '\0';
regions[i]->enter_msg = (const char *) msg_buf;
g.regions[i]->enter_msg = (const char *) msg_buf;
} else
regions[i]->enter_msg = (const char *) 0;
g.regions[i]->enter_msg = (const char *) 0;
mread(fd, (genericptr_t) &n, sizeof n);
if (n > 0) {
msg_buf = (char *) alloc(n + 1);
mread(fd, (genericptr_t) msg_buf, n);
msg_buf[n] = '\0';
regions[i]->leave_msg = (const char *) msg_buf;
g.regions[i]->leave_msg = (const char *) msg_buf;
} else
regions[i]->leave_msg = (const char *) 0;
g.regions[i]->leave_msg = (const char *) 0;
mread(fd, (genericptr_t) &regions[i]->ttl, sizeof(long));
mread(fd, (genericptr_t) &g.regions[i]->ttl, sizeof(long));
/* check for expired region */
if (regions[i]->ttl >= 0L)
regions[i]->ttl =
(regions[i]->ttl > tmstamp) ? regions[i]->ttl - tmstamp : 0L;
mread(fd, (genericptr_t) &regions[i]->expire_f, sizeof(short));
mread(fd, (genericptr_t) &regions[i]->can_enter_f, sizeof(short));
mread(fd, (genericptr_t) &regions[i]->enter_f, sizeof(short));
mread(fd, (genericptr_t) &regions[i]->can_leave_f, sizeof(short));
mread(fd, (genericptr_t) &regions[i]->leave_f, sizeof(short));
mread(fd, (genericptr_t) &regions[i]->inside_f, sizeof(short));
mread(fd, (genericptr_t) &regions[i]->player_flags,
if (g.regions[i]->ttl >= 0L)
g.regions[i]->ttl =
(g.regions[i]->ttl > tmstamp) ? g.regions[i]->ttl - tmstamp : 0L;
mread(fd, (genericptr_t) &g.regions[i]->expire_f, sizeof(short));
mread(fd, (genericptr_t) &g.regions[i]->can_enter_f, sizeof(short));
mread(fd, (genericptr_t) &g.regions[i]->enter_f, sizeof(short));
mread(fd, (genericptr_t) &g.regions[i]->can_leave_f, sizeof(short));
mread(fd, (genericptr_t) &g.regions[i]->leave_f, sizeof(short));
mread(fd, (genericptr_t) &g.regions[i]->inside_f, sizeof(short));
mread(fd, (genericptr_t) &g.regions[i]->player_flags,
sizeof(unsigned int));
if (ghostly) { /* settings pertained to old player */
clear_hero_inside(regions[i]);
clear_heros_fault(regions[i]);
clear_hero_inside(g.regions[i]);
clear_heros_fault(g.regions[i]);
}
mread(fd, (genericptr_t) &regions[i]->n_monst, sizeof(short));
if (regions[i]->n_monst > 0)
regions[i]->monsters =
(unsigned *) alloc(sizeof(unsigned) * regions[i]->n_monst);
mread(fd, (genericptr_t) &g.regions[i]->n_monst, sizeof(short));
if (g.regions[i]->n_monst > 0)
g.regions[i]->monsters =
(unsigned *) alloc(sizeof(unsigned) * g.regions[i]->n_monst);
else
regions[i]->monsters = (unsigned int *) 0;
regions[i]->max_monst = regions[i]->n_monst;
for (j = 0; j < regions[i]->n_monst; j++)
mread(fd, (genericptr_t) &regions[i]->monsters[j],
g.regions[i]->monsters = (unsigned int *) 0;
g.regions[i]->max_monst = g.regions[i]->n_monst;
for (j = 0; j < g.regions[i]->n_monst; j++)
mread(fd, (genericptr_t) &g.regions[i]->monsters[j],
sizeof(unsigned));
mread(fd, (genericptr_t) &regions[i]->visible, sizeof(boolean));
mread(fd, (genericptr_t) &regions[i]->glyph, sizeof(int));
mread(fd, (genericptr_t) &regions[i]->arg, sizeof(anything));
mread(fd, (genericptr_t) &g.regions[i]->visible, sizeof(boolean));
mread(fd, (genericptr_t) &g.regions[i]->glyph, sizeof(int));
mread(fd, (genericptr_t) &g.regions[i]->arg, sizeof(anything));
}
/* remove expired regions, do not trigger the expire_f callback (yet!);
also update monster lists if this data is coming from a bones file */
for (i = n_regions - 1; i >= 0; i--)
if (regions[i]->ttl == 0L)
remove_region(regions[i]);
else if (ghostly && regions[i]->n_monst > 0)
reset_region_mids(regions[i]);
for (i = g.n_regions - 1; i >= 0; i--)
if (g.regions[i]->ttl == 0L)
remove_region(g.regions[i]);
else if (ghostly && g.regions[i]->n_monst > 0)
reset_region_mids(g.regions[i]);
}
/* to support '#stats' wizard-mode command */
@@ -775,10 +771,10 @@ long *count, *size;
/* other stats formats take one parameter; this takes two */
Sprintf(hdrbuf, hdrfmt, (long) sizeof (NhRegion), (long) sizeof (NhRect));
*count = (long) n_regions; /* might be 0 even though max_regions isn't */
*size = (long) max_regions * (long) sizeof (NhRegion);
for (i = 0; i < n_regions; ++i) {
rg = regions[i];
*count = (long) g.n_regions; /* might be 0 even though g.max_regions isn't */
*size = (long) g.max_regions * (long) sizeof (NhRegion);
for (i = 0; i < g.n_regions; ++i) {
rg = g.regions[i];
*size += (long) rg->nrects * (long) sizeof (NhRect);
if (rg->enter_msg)
*size += (long) (strlen(rg->enter_msg) + 1);
@@ -1056,11 +1052,11 @@ region_danger()
{
int i, f_indx, n = 0;
for (i = 0; i < n_regions; i++) {
for (i = 0; i < g.n_regions; i++) {
/* only care about regions that hero is in */
if (!hero_inside(regions[i]))
if (!hero_inside(g.regions[i]))
continue;
f_indx = regions[i]->inside_f;
f_indx = g.regions[i]->inside_f;
/* the only type of region we understand is gas_cloud */
if (f_indx == INSIDE_GAS_CLOUD) {
/* completely harmless if you don't need to breathe */
@@ -1084,15 +1080,15 @@ region_safety()
NhRegion *r = 0;
int i, f_indx, n = 0;
for (i = 0; i < n_regions; i++) {
for (i = 0; i < g.n_regions; i++) {
/* only care about regions that hero is in */
if (!hero_inside(regions[i]))
if (!hero_inside(g.regions[i]))
continue;
f_indx = regions[i]->inside_f;
f_indx = g.regions[i]->inside_f;
/* the only type of region we understand is gas_cloud */
if (f_indx == INSIDE_GAS_CLOUD) {
if (!n++ && regions[i]->ttl >= 0)
r = regions[i];
if (!n++ && g.regions[i]->ttl >= 0)
r = g.regions[i];
}
}
+5 -7
View File
@@ -69,8 +69,6 @@ static const char *rip_txt[] = {
#define DEATH_LINE 8 /* *char[] line # for death description */
#define YEAR_LINE 12 /* *char[] line # for year */
static char **rip;
STATIC_OVL void
center(line, text)
int line;
@@ -78,7 +76,7 @@ char *text;
{
register char *ip, *op;
ip = text;
op = &rip[line][STONE_LINE_CENT - ((strlen(text) + 1) >> 1)];
op = &g.rip[line][STONE_LINE_CENT - ((strlen(text) + 1) >> 1)];
while (*ip)
*op++ = *ip++;
}
@@ -96,7 +94,7 @@ time_t when;
register int x;
int line;
rip = dp = (char **) alloc(sizeof(rip_txt));
g.rip = dp = (char **) alloc(sizeof(rip_txt));
for (x = 0; rip_txt[x]; ++x)
dp[x] = dupstr(rip_txt[x]);
dp[x] = (char *) 0;
@@ -158,10 +156,10 @@ time_t when;
putstr(tmpwin, 0, "");
for (x = 0; rip_txt[x]; x++) {
free((genericptr_t) rip[x]);
free((genericptr_t) g.rip[x]);
}
free((genericptr_t) rip);
rip = 0;
free((genericptr_t) g.rip);
g.rip = 0;
}
#endif /* TEXT_TOMBSTONE */
+68 -135
View File
@@ -24,7 +24,7 @@
*
* God names use a leading underscore to flag goddesses.
*/
const struct Role roles[] = {
const struct Role roles[NUM_ROLES+1] = {
{ { "Archeologist", 0 },
{ { "Digger", 0 },
{ "Field Worker", 0 },
@@ -585,34 +585,6 @@ const struct Role roles[] = {
{ { 0, 0 } }
};
/* The player's role, created at runtime from initial
* choices. This may be munged in role_init().
*/
struct Role urole = {
{ "Undefined", 0 },
{ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 },
{ 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } },
"L", "N", "C",
"Xxx", "home", "locate",
NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM, NON_PM,
0, 0, 0, 0,
/* Str Int Wis Dex Con Cha */
{ 7, 7, 7, 7, 7, 7 },
{ 20, 15, 15, 20, 20, 10 },
/* Init Lower Higher */
{ 10, 0, 0, 8, 1, 0 }, /* Hit points */
{ 2, 0, 0, 2, 0, 3 },
14, /* Energy */
0,
10,
0,
0,
4,
A_INT,
0,
-3
};
/* Table of all races */
const struct Race races[] = {
{
@@ -725,31 +697,6 @@ const struct Race races[] = {
{ 0, 0, 0, 0 }
};
/* The player's race, created at runtime from initial
* choices. This may be munged in role_init().
*/
struct Race urace = {
"something",
"undefined",
"something",
"Xxx",
{ 0, 0 },
NON_PM,
NON_PM,
NON_PM,
NON_PM,
0,
0,
0,
0,
/* Str Int Wis Dex Con Cha */
{ 3, 3, 3, 3, 3, 3 },
{ STR18(100), 18, 18, 18, 18, 18 },
/* Init Lower Higher */
{ 2, 0, 0, 2, 1, 0 }, /* Hit points */
{ 1, 0, 2, 0, 2, 0 } /* Energy */
};
/* Table of all genders */
const struct Gender genders[] = {
{ "male", "he", "him", "his", "Mal", ROLE_MALE },
@@ -765,12 +712,6 @@ const struct Align aligns[] = {
{ "evil", "unaligned", "Una", 0, A_NONE }
};
/* Filters */
static struct {
boolean roles[SIZE(roles)];
short mask;
} rfilter = { UNDEFINED_VALUES, UNDEFINED_VALUE};
STATIC_DCL int NDECL(randrole_filtered);
STATIC_DCL char *FDECL(promptsep, (char *, int));
STATIC_DCL int FDECL(role_gendercount, (int));
@@ -1047,7 +988,7 @@ int rolenum, racenum, gendnum, alignnum;
short allow;
if (rolenum >= 0 && rolenum < SIZE(roles) - 1) {
if (rfilter.roles[rolenum])
if (g.rfilter.roles[rolenum])
return FALSE;
allow = roles[rolenum].allow;
if (racenum >= 0 && racenum < SIZE(races) - 1
@@ -1063,7 +1004,7 @@ int rolenum, racenum, gendnum, alignnum;
} else {
/* random; check whether any selection is possible */
for (i = 0; i < SIZE(roles) - 1; i++) {
if (rfilter.roles[i])
if (g.rfilter.roles[i])
continue;
allow = roles[i].allow;
if (racenum >= 0 && racenum < SIZE(races) - 1
@@ -1115,7 +1056,7 @@ int rolenum, racenum, gendnum, alignnum;
short allow;
if (racenum >= 0 && racenum < SIZE(races) - 1) {
if (rfilter.mask & races[racenum].selfmask)
if (g.rfilter.mask & races[racenum].selfmask)
return FALSE;
allow = races[racenum].allow;
if (rolenum >= 0 && rolenum < SIZE(roles) - 1
@@ -1131,7 +1072,7 @@ int rolenum, racenum, gendnum, alignnum;
} else {
/* random; check whether any selection is possible */
for (i = 0; i < SIZE(races) - 1; i++) {
if (rfilter.mask & races[i].selfmask)
if (g.rfilter.mask & races[i].selfmask)
continue;
allow = races[i].allow;
if (rolenum >= 0 && rolenum < SIZE(roles) - 1
@@ -1188,7 +1129,7 @@ int alignnum UNUSED;
short allow;
if (gendnum >= 0 && gendnum < ROLE_GENDERS) {
if (rfilter.mask & genders[gendnum].allow)
if (g.rfilter.mask & genders[gendnum].allow)
return FALSE;
allow = genders[gendnum].allow;
if (rolenum >= 0 && rolenum < SIZE(roles) - 1
@@ -1201,7 +1142,7 @@ int alignnum UNUSED;
} else {
/* random; check whether any selection is possible */
for (i = 0; i < ROLE_GENDERS; i++) {
if (rfilter.mask & genders[i].allow)
if (g.rfilter.mask & genders[i].allow)
continue;
allow = genders[i].allow;
if (rolenum >= 0 && rolenum < SIZE(roles) - 1
@@ -1257,7 +1198,7 @@ int alignnum;
short allow;
if (alignnum >= 0 && alignnum < ROLE_ALIGNS) {
if (rfilter.mask & aligns[alignnum].allow)
if (g.rfilter.mask & aligns[alignnum].allow)
return FALSE;
allow = aligns[alignnum].allow;
if (rolenum >= 0 && rolenum < SIZE(roles) - 1
@@ -1270,7 +1211,7 @@ int alignnum;
} else {
/* random; check whether any selection is possible */
for (i = 0; i < ROLE_ALIGNS; i++) {
if (rfilter.mask & aligns[i].allow)
if (g.rfilter.mask & aligns[i].allow)
return FALSE;
allow = aligns[i].allow;
if (rolenum >= 0 && rolenum < SIZE(roles) - 1
@@ -1371,13 +1312,13 @@ const char *bufp;
boolean reslt = TRUE;
if ((i = str2role(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
rfilter.roles[i] = TRUE;
g.rfilter.roles[i] = TRUE;
else if ((i = str2race(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
rfilter.mask |= races[i].selfmask;
g.rfilter.mask |= races[i].selfmask;
else if ((i = str2gend(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
rfilter.mask |= genders[i].allow;
g.rfilter.mask |= genders[i].allow;
else if ((i = str2align(bufp)) != ROLE_NONE && i != ROLE_RANDOM)
rfilter.mask |= aligns[i].allow;
g.rfilter.mask |= aligns[i].allow;
else
reslt = FALSE;
return reslt;
@@ -1388,10 +1329,10 @@ gotrolefilter()
{
int i;
if (rfilter.mask)
if (g.rfilter.mask)
return TRUE;
for (i = 0; i < SIZE(roles); ++i)
if (rfilter.roles[i])
if (g.rfilter.roles[i])
return TRUE;
return FALSE;
}
@@ -1402,18 +1343,10 @@ clearrolefilter()
int i;
for (i = 0; i < SIZE(roles); ++i)
rfilter.roles[i] = FALSE;
rfilter.mask = 0;
g.rfilter.roles[i] = FALSE;
g.rfilter.mask = 0;
}
#define BP_ALIGN 0
#define BP_GEND 1
#define BP_RACE 2
#define BP_ROLE 3
#define NUM_BP 4
STATIC_VAR char pa[NUM_BP], post_attribs;
STATIC_OVL char *
promptsep(buf, num_post_attribs)
char *buf;
@@ -1421,12 +1354,12 @@ int num_post_attribs;
{
const char *conjuct = "and ";
if (num_post_attribs > 1 && post_attribs < num_post_attribs
&& post_attribs > 1)
if (num_post_attribs > 1 && g.role_post_attribs < num_post_attribs
&& g.role_post_attribs > 1)
Strcat(buf, ",");
Strcat(buf, " ");
--post_attribs;
if (!post_attribs && num_post_attribs > 1)
--g.role_post_attribs;
if (!g.role_post_attribs && num_post_attribs > 1)
Strcat(buf, conjuct);
return buf;
}
@@ -1480,9 +1413,9 @@ int buflen, rolenum, racenum, gendnum, alignnum;
return err_ret;
/* initialize these static variables each time this is called */
post_attribs = 0;
g.role_post_attribs = 0;
for (k = 0; k < NUM_BP; ++k)
pa[k] = 0;
g.role_pa[k] = 0;
buf[0] = '\0';
*suppliedbuf = '\0';
@@ -1515,8 +1448,8 @@ int buflen, rolenum, racenum, gendnum, alignnum;
&& ok_race(rolenum, racenum, gendnum, alignnum))
&& (aligncount > 1))
|| (racenum == ROLE_NONE || racenum == ROLE_RANDOM)) {
pa[BP_ALIGN] = 1;
post_attribs++;
g.role_pa[BP_ALIGN] = 1;
g.role_post_attribs++;
}
}
/* <your lawful> */
@@ -1548,8 +1481,8 @@ int buflen, rolenum, racenum, gendnum, alignnum;
don't include it in the later list */
if ((validrole(rolenum) && (gendercount > 1))
|| !validrole(rolenum)) {
pa[BP_GEND] = 1;
post_attribs++;
g.role_pa[BP_GEND] = 1;
g.role_post_attribs++;
}
}
/* <your lawful female> */
@@ -1568,12 +1501,12 @@ int buflen, rolenum, racenum, gendnum, alignnum;
Strcat(buf, races[racenum].noun);
donefirst = TRUE;
} else {
pa[BP_RACE] = 1;
post_attribs++;
g.role_pa[BP_RACE] = 1;
g.role_post_attribs++;
}
} else {
pa[BP_RACE] = 1;
post_attribs++;
g.role_pa[BP_RACE] = 1;
g.role_post_attribs++;
}
/* <your lawful female gnomish> || <your lawful female gnome> */
@@ -1595,8 +1528,8 @@ int buflen, rolenum, racenum, gendnum, alignnum;
}
donefirst = TRUE;
} else if (rolenum == ROLE_NONE) {
pa[BP_ROLE] = 1;
post_attribs++;
g.role_pa[BP_ROLE] = 1;
g.role_post_attribs++;
}
if ((racenum == ROLE_NONE || racenum == ROLE_RANDOM)
@@ -1653,34 +1586,34 @@ int buflen, rolenum, racenum, gendnum, alignnum;
*
* Now append the post attributes to it
*/
num_post_attribs = post_attribs;
num_post_attribs = g.role_post_attribs;
if (!num_post_attribs) {
/* some constraints might have been mutually exclusive, in which case
some prompting that would have been omitted is needed after all */
if (flags.initrole == ROLE_NONE && !pa[BP_ROLE])
pa[BP_ROLE] = ++post_attribs;
if (flags.initrace == ROLE_NONE && !pa[BP_RACE])
pa[BP_RACE] = ++post_attribs;
if (flags.initalign == ROLE_NONE && !pa[BP_ALIGN])
pa[BP_ALIGN] = ++post_attribs;
if (flags.initgend == ROLE_NONE && !pa[BP_GEND])
pa[BP_GEND] = ++post_attribs;
num_post_attribs = post_attribs;
if (flags.initrole == ROLE_NONE && !g.role_pa[BP_ROLE])
g.role_pa[BP_ROLE] = ++g.role_post_attribs;
if (flags.initrace == ROLE_NONE && !g.role_pa[BP_RACE])
g.role_pa[BP_RACE] = ++g.role_post_attribs;
if (flags.initalign == ROLE_NONE && !g.role_pa[BP_ALIGN])
g.role_pa[BP_ALIGN] = ++g.role_post_attribs;
if (flags.initgend == ROLE_NONE && !g.role_pa[BP_GEND])
g.role_pa[BP_GEND] = ++g.role_post_attribs;
num_post_attribs = g.role_post_attribs;
}
if (num_post_attribs) {
if (pa[BP_RACE]) {
if (g.role_pa[BP_RACE]) {
(void) promptsep(eos(buf), num_post_attribs);
Strcat(buf, "race");
}
if (pa[BP_ROLE]) {
if (g.role_pa[BP_ROLE]) {
(void) promptsep(eos(buf), num_post_attribs);
Strcat(buf, "role");
}
if (pa[BP_GEND]) {
if (g.role_pa[BP_GEND]) {
(void) promptsep(eos(buf), num_post_attribs);
Strcat(buf, "gender");
}
if (pa[BP_ALIGN]) {
if (g.role_pa[BP_ALIGN]) {
(void) promptsep(eos(buf), num_post_attribs);
Strcat(buf, "alignment");
}
@@ -1864,7 +1797,7 @@ boolean preselect;
what = "role";
f = r;
for (i = 0; i < SIZE(roles); ++i)
if (i != f && !rfilter.roles[i])
if (i != f && !g.rfilter.roles[i])
break;
if (i == SIZE(roles)) {
constrainer = "filter";
@@ -1883,7 +1816,7 @@ boolean preselect;
constrainer = "role";
forcedvalue = races[c].noun;
} else if (f >= 0
&& (allowmask & ~rfilter.mask) == races[f].selfmask) {
&& (allowmask & ~g.rfilter.mask) == races[f].selfmask) {
/* if there is only one race choice available due to user
options disallowing others, race menu entry is disabled */
constrainer = "filter";
@@ -1905,7 +1838,7 @@ boolean preselect;
constrainer = "role";
forcedvalue = genders[gend].adj;
} else if (f >= 0
&& (allowmask & ~rfilter.mask) == genders[f].allow) {
&& (allowmask & ~g.rfilter.mask) == genders[f].allow) {
/* if there is only one gender choice available due to user
options disallowing other, gender menu entry is disabled */
constrainer = "filter";
@@ -1940,7 +1873,7 @@ boolean preselect;
constrainer = "race";
}
if (f >= 0 && !constrainer
&& (ROLE_ALIGNMASK & ~rfilter.mask) == aligns[f].allow) {
&& (ROLE_ALIGNMASK & ~g.rfilter.mask) == aligns[f].allow) {
/* if there is only one alignment choice available due to user
options disallowing others, algn menu entry is disabled */
constrainer = "filter";
@@ -2041,13 +1974,13 @@ role_init()
flags.initalign = randalign(flags.initrole, flags.initrace);
alignmnt = aligns[flags.initalign].value;
/* Initialize urole and urace */
urole = roles[flags.initrole];
urace = races[flags.initrace];
/* Initialize g.urole and g.urace */
g.urole = roles[flags.initrole];
g.urace = races[flags.initrace];
/* Fix up the quest leader */
if (urole.ldrnum != NON_PM) {
pm = &mons[urole.ldrnum];
if (g.urole.ldrnum != NON_PM) {
pm = &mons[g.urole.ldrnum];
pm->msound = MS_LEADER;
pm->mflags2 |= (M2_PEACEFUL);
pm->mflags3 |= M3_CLOSE;
@@ -2061,15 +1994,15 @@ role_init()
}
/* Fix up the quest guardians */
if (urole.guardnum != NON_PM) {
pm = &mons[urole.guardnum];
if (g.urole.guardnum != NON_PM) {
pm = &mons[g.urole.guardnum];
pm->mflags2 |= (M2_PEACEFUL);
pm->maligntyp = alignmnt * 3;
}
/* Fix up the quest nemesis */
if (urole.neminum != NON_PM) {
pm = &mons[urole.neminum];
if (g.urole.neminum != NON_PM) {
pm = &mons[g.urole.neminum];
pm->msound = MS_NEMESIS;
pm->mflags2 &= ~(M2_PEACEFUL);
pm->mflags2 |= (M2_NASTY | M2_STALK | M2_HOSTILE);
@@ -2087,16 +2020,16 @@ role_init()
while (!roles[flags.pantheon].lgod) /* unless they're missing */
flags.pantheon = randrole();
}
if (!urole.lgod) {
urole.lgod = roles[flags.pantheon].lgod;
urole.ngod = roles[flags.pantheon].ngod;
urole.cgod = roles[flags.pantheon].cgod;
if (!g.urole.lgod) {
g.urole.lgod = roles[flags.pantheon].lgod;
g.urole.ngod = roles[flags.pantheon].ngod;
g.urole.cgod = roles[flags.pantheon].cgod;
}
/* 0 or 1; no gods are neuter, nor is gender randomized */
g.quest_status.godgend = !strcmpi(align_gtitle(alignmnt), "goddess");
/* Fix up infravision */
if (mons[urace.malenum].mflags3 & M3_INFRAVISION) {
if (mons[g.urace.malenum].mflags3 & M3_INFRAVISION) {
/* although an infravision intrinsic is possible, infravision
* is purely a property of the physical race. This means that we
* must put the infravision flag in the player's current race
@@ -2106,9 +2039,9 @@ role_init()
* but since infravision has no effect for NPCs anyway we can
* ignore this.
*/
mons[urole.malenum].mflags3 |= M3_INFRAVISION;
if (urole.femalenum != NON_PM)
mons[urole.femalenum].mflags3 |= M3_INFRAVISION;
mons[g.urole.malenum].mflags3 |= M3_INFRAVISION;
if (g.urole.femalenum != NON_PM)
mons[g.urole.femalenum].mflags3 |= M3_INFRAVISION;
}
/* Artifacts are fixed in hack_artifacts() */
+2 -3
View File
@@ -25,7 +25,6 @@ STATIC_DCL void FDECL(kops_gone, (BOOLEAN_P));
extern const struct shclass shtypes[]; /* defined in shknam.c */
STATIC_VAR NEARDATA long int followmsg; /* last time of follow message */
STATIC_VAR const char and_its_contents[] = " and its contents";
STATIC_VAR const char the_contents_of[] = "the contents of ";
@@ -3690,7 +3689,7 @@ struct monst *shkp;
eshkp->following = 0;
return 0;
}
if (g.moves > followmsg + 4) {
if (g.moves > g.followmsg + 4) {
if (!Deaf && !muteshk(shkp))
verbalize("%s, %s! Didn't you forget to pay?",
Hello(shkp), g.plname);
@@ -3698,7 +3697,7 @@ struct monst *shkp;
pline("%s holds out %s upturned %s.",
Shknam(shkp), noit_mhis(shkp),
mbodypart(shkp, HAND));
followmsg = g.moves;
g.followmsg = g.moves;
if (!rn2(9)) {
pline("%s doesn't like customers who don't pay.",
Shknam(shkp));
+4 -4
View File
@@ -508,7 +508,7 @@ register struct monst *mtmp;
if (mtmp->m_id == g.quest_status.leader_m_id && msound > MS_ANIMAL)
msound = MS_LEADER;
/* make sure it's your role's quest guardian; adjust if not */
else if (msound == MS_GUARDIAN && ptr != &mons[urole.guardnum])
else if (msound == MS_GUARDIAN && ptr != &mons[g.urole.guardnum])
msound = mons[genus(monsndx(ptr), 1)].msound;
/* some normally non-speaking types can/will speak if hero is similar */
else if (msound == MS_ORC /* note: MS_ORC is same as MS_GRUNT */
@@ -557,9 +557,9 @@ register struct monst *mtmp;
(Upolyd && (u.umonnum == PM_WOLF || u.umonnum == PM_WINTER_WOLF
|| u.umonnum == PM_WINTER_WOLF_CUB));
const char *racenoun =
(flags.female && urace.individual.f)
? urace.individual.f
: (urace.individual.m) ? urace.individual.m : urace.noun;
(flags.female && g.urace.individual.f)
? g.urace.individual.f
: (g.urace.individual.m) ? g.urace.individual.m : g.urace.noun;
if (mtmp->mtame) {
if (kindred) {
+10 -10
View File
@@ -1660,17 +1660,17 @@ int spell;
/* Calculate intrinsic ability (splcaster) */
splcaster = urole.spelbase;
special = urole.spelheal;
statused = ACURR(urole.spelstat);
splcaster = g.urole.spelbase;
special = g.urole.spelheal;
statused = ACURR(g.urole.spelstat);
if (uarm && is_metallic(uarm))
splcaster += (uarmc && uarmc->otyp == ROBE) ? urole.spelarmr / 2
: urole.spelarmr;
splcaster += (uarmc && uarmc->otyp == ROBE) ? g.urole.spelarmr / 2
: g.urole.spelarmr;
else if (uarmc && uarmc->otyp == ROBE)
splcaster -= urole.spelarmr;
splcaster -= g.urole.spelarmr;
if (uarms)
splcaster += urole.spelshld;
splcaster += g.urole.spelshld;
if (uarmh && is_metallic(uarmh) && uarmh->otyp != HELM_OF_BRILLIANCE)
splcaster += uarmhbon;
@@ -1679,8 +1679,8 @@ int spell;
if (uarmf && is_metallic(uarmf))
splcaster += uarmfbon;
if (spellid(spell) == urole.spelspec)
splcaster += urole.spelsbon;
if (spellid(spell) == g.urole.spelspec)
splcaster += g.urole.spelsbon;
/* `healing spell' bonus */
if (spellid(spell) == SPE_HEALING || spellid(spell) == SPE_EXTRA_HEALING
@@ -1738,7 +1738,7 @@ int spell;
* player's role-specific spell.
*/
if (uarms && weight(uarms) > (int) objects[SMALL_SHIELD].oc_weight) {
if (spellid(spell) == urole.spelspec) {
if (spellid(spell) == g.urole.spelspec) {
chance /= 2;
} else {
chance /= 4;
+3 -7
View File
@@ -20,10 +20,6 @@ struct sysopt sysopt;
void
sys_early_init()
{
decl_globals_init();
objects_globals_init();
monst_globals_init();
sysopt.support = (char *) 0;
sysopt.recover = (char *) 0;
#ifdef SYSCF
@@ -124,14 +120,14 @@ sysopt_release()
return;
}
extern struct attack sa_yes[NATTK];
extern struct attack sa_no[NATTK];
extern const struct attack c_sa_yes[NATTK];
extern const struct attack c_sa_no[NATTK];
void
sysopt_seduce_set(val)
int val;
{
struct attack *setval = val ? sa_yes : sa_no;
const struct attack *setval = val ? c_sa_yes : c_sa_no;
int x;
for (x = 0; x < NATTK; x++) {
+7 -10
View File
@@ -11,9 +11,6 @@ STATIC_DCL void NDECL(vault_tele);
STATIC_DCL boolean FDECL(rloc_pos_ok, (int, int, struct monst *));
STATIC_DCL void FDECL(mvault_tele, (struct monst *));
/* non-null when teleporting via having read this scroll */
STATIC_VAR struct obj *telescroll = 0;
/*
* Is (x,y) a good position of mtmp? If mtmp is NULL, then is (x,y) good
* for an object?
@@ -345,14 +342,14 @@ boolean allow_drag;
been updated for new location instead of right after u_on_newpos() */
if (levl[u.ux][u.uy].typ != levl[u.ux0][u.uy0].typ)
switch_terrain();
if (telescroll) {
if (g.telescroll) {
/* when teleporting by scroll, we need to handle discovery
now before getting feedback about any objects at our
destination since we might land on another such scroll */
if (distu(u.ux0, u.uy0) >= 16 || !couldsee(u.ux0, u.uy0))
learnscroll(telescroll);
learnscroll(g.telescroll);
else
telescroll = 0; /* no discovery by scrolltele()'s caller */
g.telescroll = 0; /* no discovery by scrolltele()'s caller */
}
spoteffects(TRUE);
invocation_message();
@@ -486,13 +483,13 @@ struct obj *scroll;
result = TRUE;
}
telescroll = scroll;
g.telescroll = scroll;
(void) safe_teleds(FALSE);
/* teleds() will leave telescroll intact iff random destination
/* teleds() will leave g.telescroll intact iff random destination
is far enough away for scroll discovery to be warranted */
if (telescroll)
if (g.telescroll)
result = TRUE;
telescroll = 0; /* reset */
g.telescroll = 0; /* reset */
return result;
}
+4 -7
View File
@@ -23,9 +23,6 @@
* way to truncate it). The trailing junk is harmless and the code
* which reads the scores will ignore it.
*/
#ifdef UPDATE_RECORD_IN_PLACE
static long final_fpos;
#endif
#define done_stopprint g.program_state.stopprint
@@ -232,7 +229,7 @@ struct toptenentry *tt;
#ifdef UPDATE_RECORD_IN_PLACE
/* note: input below must read the record's terminating newline */
final_fpos = tt->fpos = ftell(rfile);
g.final_fpos = tt->fpos = ftell(rfile);
#endif
#define TTFIELDS 13
if (fscanf(rfile, fmt, &tt->ver_major, &tt->ver_minor, &tt->patchlevel,
@@ -547,8 +544,8 @@ time_t when;
t0->maxhp = u.uhpmax;
t0->deaths = u.umortality;
t0->uid = uid;
copynchars(t0->plrole, urole.filecode, ROLESZ);
copynchars(t0->plrace, urace.filecode, ROLESZ);
copynchars(t0->plrole, g.urole.filecode, ROLESZ);
copynchars(t0->plrace, g.urace.filecode, ROLESZ);
copynchars(t0->plgend, genders[flags.female].filecode, ROLESZ);
copynchars(t0->plalign, aligns[1 - u.ualign.type].filecode, ROLESZ);
copynchars(t0->name, g.plname, NAMSZ);
@@ -676,7 +673,7 @@ time_t when;
}
if (flg) { /* rewrite record file */
#ifdef UPDATE_RECORD_IN_PLACE
(void) fseek(rfile, (t0->fpos >= 0 ? t0->fpos : final_fpos),
(void) fseek(rfile, (t0->fpos >= 0 ? t0->fpos : g.final_fpos),
SEEK_SET);
#else
(void) fclose(rfile);
+5 -5
View File
@@ -625,9 +625,9 @@ u_init()
u.umortality = 0;
u.ugrave_arise = NON_PM;
u.umonnum = u.umonster = (flags.female && urole.femalenum != NON_PM)
? urole.femalenum
: urole.malenum;
u.umonnum = u.umonster = (flags.female && g.urole.femalenum != NON_PM)
? g.urole.femalenum
: g.urole.malenum;
u.ulycn = NON_PM;
set_uasmon();
@@ -1047,13 +1047,13 @@ register struct trobj *trop;
g.nocreate4 = otyp;
}
if (urace.malenum != PM_HUMAN) {
if (g.urace.malenum != PM_HUMAN) {
/* substitute race-specific items; this used to be in
the 'if (otyp != UNDEF_TYP) { }' block above, but then
substitutions didn't occur for randomly generated items
(particularly food) which have racial substitutes */
for (i = 0; inv_subs[i].race_pm != NON_PM; ++i)
if (inv_subs[i].race_pm == urace.malenum
if (inv_subs[i].race_pm == g.urace.malenum
&& otyp == inv_subs[i].item_otyp) {
debugpline3("ini_inv: substituting %s for %s%s",
OBJ_NAME(objects[inv_subs[i].subs_otyp]),
+1 -1
View File
@@ -288,7 +288,7 @@ int *attk_count, *role_roll_penalty;
/* role/race adjustments */
if (Role_if(PM_MONK) && !Upolyd) {
if (uarm)
tmp -= (*role_roll_penalty = urole.spelarmr);
tmp -= (*role_roll_penalty = g.urole.spelarmr);
else if (!uwep && !uarms)
tmp += (u.ulevel / 3) + 2;
}
+13 -12
View File
@@ -23,7 +23,7 @@
* @...X +4
*
*/
char circle_data[] = {
const char circle_data[] = {
/* 0*/ 1, 1,
/* 2*/ 2, 2, 1,
/* 5*/ 3, 3, 2, 1,
@@ -46,7 +46,7 @@ char circle_data[] = {
* These are the starting indexes into the circle_data[] array for a
* circle of a given radius.
*/
char circle_start[] = {
const char circle_start[] = {
/* */ 0, /* circles of radius zero are not used */
/* 1*/ 0,
/* 2*/ 2,
@@ -496,7 +496,7 @@ int control;
char *old_row; /* row pointer for the old array */
char *next_rmin; /* min pointer for the new array */
char *next_rmax; /* max pointer for the new array */
char *ranges; /* circle ranges -- used for xray & night vision */
const char *ranges; /* circle ranges -- used for xray & night vision */
int row = 0; /* row counter (outer loop) */
int start, stop; /* inner loop starting/stopping index */
int dx, dy; /* one step from a lit door or lit wall (see below) */
@@ -1602,8 +1602,9 @@ static close2d *close_dy[CLOSE_MAX_BC_DY];
static far2d *far_dy[FAR_MAX_BC_DY];
STATIC_DCL void FDECL(right_side, (int, int, int, int, int,
int, int, char *));
STATIC_DCL void FDECL(left_side, (int, int, int, int, int, int, int, char *));
int, int, const char *));
STATIC_DCL void FDECL(left_side, (int, int, int, int, int, int, int,
const char *));
STATIC_DCL int FDECL(close_shadow, (int, int, int, int));
STATIC_DCL int FDECL(far_shadow, (int, int, int, int));
@@ -1994,7 +1995,7 @@ int cb_row, cb_col; /* close block row and col */
int fb_row, fb_col; /* far block row and col */
int left_mark; /* left mark of previous row */
int right; /* right mark of the previous row */
char *limits;
const char *limits;
{
register int i;
register char *rowp = NULL;
@@ -2285,8 +2286,8 @@ genericptr_t arg;
/*
* Defines local to Algorithm C.
*/
STATIC_DCL void FDECL(right_side, (int, int, int, char *));
STATIC_DCL void FDECL(left_side, (int, int, int, char *));
STATIC_DCL void FDECL(right_side, (int, int, int, const char *));
STATIC_DCL void FDECL(left_side, (int, int, int, const char *));
/* Initialize algorithm C (nothing). */
STATIC_OVL void
@@ -2303,7 +2304,7 @@ right_side(row, left, right_mark, limits)
int row; /* current row */
int left; /* first (left side) visible spot on prev row */
int right_mark; /* last (right side) visible spot on prev row */
char *limits; /* points at range limit for current row, or NULL */
const char *limits; /* points at range limit for current row, or NULL */
{
int right; /* right limit of "could see" */
int right_edge; /* right edge of an opening */
@@ -2493,7 +2494,7 @@ char *limits; /* points at range limit for current row, or NULL */
STATIC_OVL void
left_side(row, left_mark, right, limits)
int row, left_mark, right;
char *limits;
const char *limits;
{
int left, left_edge, nrow, deeper, result;
register int i;
@@ -2641,7 +2642,7 @@ genericptr_t arg;
int nrow; /* the next row */
int left; /* the left-most visible column */
int right; /* the right-most visible column */
char *limits; /* range limit for next row */
const char *limits; /* range limit for next row */
/* Set globals for q?_path(), left_side(), and right_side() to use. */
start_col = scol;
@@ -2745,7 +2746,7 @@ genericptr_t arg;
} else {
register int x;
int y, min_x, max_x, max_y, offset;
char *limits;
const char *limits;
boolean override_vision;
/* vision doesn't pass through water or clouds, detection should
+2 -2
View File
@@ -1488,7 +1488,7 @@ const struct def_skill *class_skill;
P_SKILL(P_BARE_HANDED_COMBAT) = P_BASIC;
/* Roles that start with a horse know how to ride it */
if (urole.petnum == PM_PONY)
if (g.urole.petnum == PM_PONY)
P_SKILL(P_RIDING) = P_BASIC;
/*
@@ -1507,7 +1507,7 @@ const struct def_skill *class_skill;
/* each role has a special spell; allow at least basic for its type
(despite the function name, this works for spell skills too) */
unrestrict_weapon_skill(spell_skilltype(urole.spelspec));
unrestrict_weapon_skill(spell_skilltype(g.urole.spelspec));
}
void
+2 -2
View File
@@ -606,8 +606,8 @@ can_twoweapon()
You_cant("use two weapons in your current form.");
else
pline("%s aren't able to use two weapons at once.",
makeplural((flags.female && urole.name.f) ? urole.name.f
: urole.name.m));
makeplural((flags.female && g.urole.name.f) ? g.urole.name.f
: g.urole.name.m));
} else if (!uwep || !uswapwep)
Your("%s%s%s empty.", uwep ? "left " : uswapwep ? "right " : "",
body_part(HAND), (!uwep && !uswapwep) ? "s are" : " is");