trunk only: preserving context (src files)

Pat Rankin wrote:
> collect them all into some new struct and
> save that separately rather than jamming more non-option stuff
> into struct flags.

This patch:
- collects all context/tracking related fields from flags
  into a new structure called "context."
It also adds the following to the new structure:
- stethoscope turn support
- victual support
- tin support
This commit is contained in:
nethack.allison
2003-09-21 11:52:54 +00:00
parent 74b834c774
commit 22ce5ed6f2
58 changed files with 571 additions and 567 deletions
+19 -19
View File
@@ -300,7 +300,7 @@ Helmet_on()
* and the actual enchantment of the hat is irrelevant.
*/
ABON(A_CHA) += (Role_if(PM_WIZARD) ? 1 : -1);
flags.botl = 1;
context.botl = 1;
makeknown(uarmh->otyp);
break;
case HELM_OF_OPPOSITE_ALIGNMENT:
@@ -319,7 +319,7 @@ Helmet_on()
Tobjnam(uarmh, "glow"), hcolor(NH_BLACK));
curse(uarmh);
}
flags.botl = 1; /* reveal new alignment or INT & WIS */
context.botl = 1; /* reveal new alignment or INT & WIS */
if (Hallucination) {
pline("My brain hurts!"); /* Monty Python's Flying Circus */
} else if (uarmh->otyp == DUNCE_CAP) {
@@ -348,12 +348,12 @@ Helmet_off()
case ORCISH_HELM:
break;
case DUNCE_CAP:
flags.botl = 1;
context.botl = 1;
break;
case CORNUTHAUM:
if (!cancelled_don) {
ABON(A_CHA) += (Role_if(PM_WIZARD) ? -1 : 1);
flags.botl = 1;
context.botl = 1;
}
break;
case HELM_OF_TELEPATHY:
@@ -367,7 +367,7 @@ Helmet_off()
case HELM_OF_OPPOSITE_ALIGNMENT:
u.ualign.type = u.ualignbase[A_CURRENT];
u.ublessed = 0; /* lose the other god's protection */
flags.botl = 1;
context.botl = 1;
break;
default: impossible(unknown_type, c_helmet, uarmh->otyp);
}
@@ -392,7 +392,7 @@ Gloves_on()
break;
case GAUNTLETS_OF_POWER:
makeknown(uarmg->otyp);
flags.botl = 1; /* taken care of in attrib.c */
context.botl = 1; /* taken care of in attrib.c */
break;
case GAUNTLETS_OF_DEXTERITY:
adj_abon(uarmg, uarmg->spe);
@@ -417,7 +417,7 @@ Gloves_off()
break;
case GAUNTLETS_OF_POWER:
makeknown(uarmg->otyp);
flags.botl = 1; /* taken care of in attrib.c */
context.botl = 1; /* taken care of in attrib.c */
break;
case GAUNTLETS_OF_DEXTERITY:
if (!cancelled_don) adj_abon(uarmg, -uarmg->spe);
@@ -539,7 +539,7 @@ Amulet_on()
case AMULET_OF_UNCHANGING:
if (Slimed) {
Slimed = 0;
flags.botl = 1;
context.botl = 1;
}
break;
case AMULET_OF_CHANGE:
@@ -553,7 +553,7 @@ Amulet_on()
makeknown(AMULET_OF_CHANGE);
You("are suddenly very %s!", flags.female ? "feminine"
: "masculine");
flags.botl = 1;
context.botl = 1;
} else
/* already polymorphed into single-gender monster; only
changed the character's base sex */
@@ -707,7 +707,7 @@ register struct obj *obj;
if (ACURR(which) != old_attrib ||
(objects[obj->otyp].oc_name_known &&
old_attrib != 25 && old_attrib != 3)) {
flags.botl = 1;
context.botl = 1;
makeknown(obj->otyp);
obj->known = 1;
update_inventory();
@@ -724,7 +724,7 @@ register struct obj *obj;
break;
case RIN_PROTECTION:
if (obj->spe || objects[RIN_PROTECTION].oc_name_known) {
flags.botl = 1;
context.botl = 1;
makeknown(RIN_PROTECTION);
obj->known = 1;
update_inventory();
@@ -809,7 +809,7 @@ boolean gone;
old_attrib = ACURR(which);
ABON(which) -= obj->spe;
if (ACURR(which) != old_attrib) {
flags.botl = 1;
context.botl = 1;
makeknown(obj->otyp);
obj->known = 1;
update_inventory();
@@ -824,7 +824,7 @@ boolean gone;
case RIN_PROTECTION:
/* might have forgotten it due to amnesia */
if (obj->spe) {
flags.botl = 1;
context.botl = 1;
makeknown(RIN_PROTECTION);
obj->known = 1;
update_inventory();
@@ -881,7 +881,7 @@ register struct obj *otmp;
/* blindness has just been toggled */
if (Blind_telepat || Infravision) see_monsters();
vision_full_recalc = 1; /* recalc vision limits */
flags.botl = 1;
context.botl = 1;
}
}
@@ -917,7 +917,7 @@ register struct obj *otmp;
/* blindness has just been toggled */
if (Blind_telepat || Infravision) see_monsters();
vision_full_recalc = 1; /* recalc vision limits */
flags.botl = 1;
context.botl = 1;
}
}
@@ -1349,7 +1349,7 @@ dowear()
You("are suddenly overcome with shame and change your mind.");
u.ublessed = 0; /* lose your god's protection */
makeknown(otmp->otyp);
flags.botl = 1;
context.botl = 1;
return 1;
}
@@ -1527,7 +1527,7 @@ find_ac()
if (uac < -128) uac = -128; /* u.uac is an schar */
if(uac != u.uac){
u.uac = uac;
flags.botl = 1;
context.botl = 1;
}
}
@@ -2072,7 +2072,7 @@ register schar delta;
makeknown(uarmg->otyp);
ABON(A_DEX) += (delta);
}
flags.botl = 1;
context.botl = 1;
}
if (uarmh && uarmh == otmp && otmp->otyp == HELM_OF_BRILLIANCE) {
if (delta) {
@@ -2080,7 +2080,7 @@ register schar delta;
ABON(A_INT) += (delta);
ABON(A_WIS) += (delta);
}
flags.botl = 1;
context.botl = 1;
}
}