First set of changes to move globals to instance_globals.

This commit is contained in:
Bart House
2018-11-23 21:29:19 -08:00
parent a93066ba83
commit ed9082a99a
51 changed files with 680 additions and 565 deletions

View File

@@ -12,8 +12,6 @@
((mndx) == urace.malenum \
|| (urace.femalenum != NON_PM && (mndx) == urace.femalenum))
boolean known;
static NEARDATA const char readable[] = { ALL_CLASSES, SCROLL_CLASS,
SPBOOK_CLASS, 0 };
static const char all_count[] = { ALLOW_COUNT, ALL_CLASSES, 0 };
@@ -189,7 +187,7 @@ doread()
register struct obj *scroll;
boolean confused, nodisappear;
known = FALSE;
g.known = FALSE;
if (check_capacity((char *) 0))
return 0;
scroll = getobj(readable, "read");
@@ -396,7 +394,7 @@ doread()
}
if (!seffects(scroll)) {
if (!objects[scroll->otyp].oc_name_known) {
if (known)
if (g.known)
learnscroll(scroll);
else if (!objects[scroll->otyp].oc_uname)
docall(scroll);
@@ -801,7 +799,7 @@ int howmuch;
if (Sokoban)
return;
known = TRUE;
g.known = TRUE;
for (zx = 0; zx < COLNO; zx++)
for (zy = 0; zy < ROWNO; zy++)
if (howmuch & ALL_MAP || rn2(7)) {
@@ -1013,7 +1011,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
switch (otyp) {
#ifdef MAIL
case SCR_MAIL:
known = TRUE;
g.known = TRUE;
if (sobj->spe == 2)
/* "stamped scroll" created via magic marker--without a stamp */
pline("This scroll is marked \"postage due\".");
@@ -1142,7 +1140,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
if (s) {
otmp->spe += s;
adj_abon(otmp, s);
known = otmp->known;
g.known = otmp->known;
/* update shop bill to reflect new higher price */
if (s > 0 && otmp->unpaid)
alter_cost(otmp, 0L);
@@ -1184,7 +1182,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
exercise(A_CON, FALSE);
break;
} else
known = TRUE;
g.known = TRUE;
} else { /* armor and scroll both cursed */
pline("%s.", Yobjnam2(otmp, "vibrate"));
if (otmp->spe >= -6) {
@@ -1264,7 +1262,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
You("don't remember there being any magic words on this scroll.");
else
pline("This scroll seems to be blank.");
known = TRUE;
g.known = TRUE;
break;
case SCR_REMOVE_CURSE:
case SPE_REMOVE_CURSE: {
@@ -1350,7 +1348,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
confused ? &mons[PM_ACID_BLOB]
: (struct permonst *) 0,
FALSE))
known = TRUE;
g.known = TRUE;
/* no need to flush monsters; we ask for identification only if the
* monsters are not visible
*/
@@ -1430,14 +1428,14 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
vis_results ? "is" : "seems",
(results < 0) ? "un" : "");
if (vis_results > 0)
known = TRUE;
g.known = TRUE;
}
break;
}
case SCR_GENOCIDE:
if (!already_known)
You("have found a scroll of genocide!");
known = TRUE;
g.known = TRUE;
if (sblessed)
do_class_genocide();
else
@@ -1446,11 +1444,11 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
case SCR_LIGHT:
if (!confused || rn2(5)) {
if (!Blind)
known = TRUE;
g.known = TRUE;
litroom(!confused && !scursed, sobj);
if (!confused && !scursed) {
if (lightdamage(sobj, TRUE, 5))
known = TRUE;
g.known = TRUE;
}
} else {
/* could be scroll of create monster, don't set known ...*/
@@ -1463,7 +1461,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
if (confused || scursed) {
level_tele();
} else {
known = scrolltele(sobj);
g.known = scrolltele(sobj);
}
break;
case SCR_GOLD_DETECTION:
@@ -1556,7 +1554,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
cvt_sdoor_to_door(&levl[x][y]);
/* do_mapping() already reveals secret passages */
}
known = TRUE;
g.known = TRUE;
/*FALLTHRU*/
case SPE_MAGIC_MAPPING:
if (level.flags.nommap) {
@@ -1576,7 +1574,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
}
break;
case SCR_AMNESIA:
known = TRUE;
g.known = TRUE;
forget((!sblessed ? ALL_SPELLS : 0)
| (!confused || scursed ? ALL_MAP : 0));
if (Hallucination) /* Ommmmmm! */
@@ -1657,7 +1655,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
else
pline_The("%s rumbles %s you!", ceiling(u.ux, u.uy),
sblessed ? "around" : "above");
known = 1;
g.known = 1;
sokoban_guilt();
/* Loop through the surrounding squares */
@@ -1682,7 +1680,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
}
break;
case SCR_PUNISHMENT:
known = TRUE;
g.known = TRUE;
if (confused || sblessed) {
You_feel("guilty.");
break;
@@ -1694,7 +1692,7 @@ struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
if (!already_known)
You("have found a scroll of stinking cloud!");
known = TRUE;
g.known = TRUE;
pline("Where do you want to center the %scloud?",
already_known ? "stinking " : "");
cc.x = u.ux;