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
+29 -27
View File
@@ -63,7 +63,7 @@ moveloop()
do_positionbar();
#endif
didmove = flags.move;
didmove = context.move;
if(didmove) {
/* actual time passed */
youmonst.movement -= NORMAL_SPEED;
@@ -71,13 +71,13 @@ moveloop()
do { /* hero can't move this turn loop */
wtcap = encumber_msg();
flags.mon_moving = TRUE;
context.mon_moving = TRUE;
do {
monscanmove = movemon();
if (youmonst.movement > NORMAL_SPEED)
break; /* it's now your turn */
} while (monscanmove);
flags.mon_moving = FALSE;
context.mon_moving = FALSE;
if (!monscanmove && youmonst.movement < NORMAL_SPEED) {
/* both you and the monsters are out of steam this round */
@@ -133,14 +133,14 @@ moveloop()
/* once-per-turn things go here */
/********************************/
if (flags.bypasses) clear_bypasses();
if (context.bypasses) clear_bypasses();
if(Glib) glibr();
nh_timeout();
run_regions();
if (u.ublesscnt) u.ublesscnt--;
if(flags.time && !flags.run)
flags.botl = 1;
if(flags.time && !context.run)
context.botl = 1;
/* One possible result of prayer is healing. Whether or
* not you get healed depends on your current hit points.
@@ -155,7 +155,7 @@ moveloop()
} else if (Upolyd && youmonst.data->mlet == S_EEL && !is_pool(u.ux,u.uy) && !Is_waterlevel(&u.uz)) {
if (u.mh > 1) {
u.mh--;
flags.botl = 1;
context.botl = 1;
} else if (u.mh < 1)
rehumanize();
} else if (Upolyd && u.mh < u.mhmax) {
@@ -163,7 +163,7 @@ moveloop()
rehumanize();
else if (Regeneration ||
(wtcap < MOD_ENCUMBER && !(moves%20))) {
flags.botl = 1;
context.botl = 1;
u.mh++;
}
} else if (u.uhp < u.uhpmax &&
@@ -177,14 +177,14 @@ moveloop()
heal = rnd(Con);
if (heal > u.ulevel-9) heal = u.ulevel-9;
}
flags.botl = 1;
context.botl = 1;
u.uhp += heal;
if(u.uhp > u.uhpmax)
u.uhp = u.uhpmax;
} else if (Regeneration ||
(u.ulevel <= 9 &&
!(moves % ((MAXULEV+12) / (u.ulevel+2) + 1)))) {
flags.botl = 1;
context.botl = 1;
u.uhp++;
}
}
@@ -211,7 +211,7 @@ moveloop()
|| Energy_regeneration)) {
u.uen += rn1((int)(ACURR(A_WIS) + ACURR(A_INT)) / 15 + 1,1);
if (u.uen > u.uenmax) u.uen = u.uenmax;
flags.botl = 1;
context.botl = 1;
}
if(!u.uinvulnerable) {
@@ -300,7 +300,7 @@ moveloop()
/****************************************/
find_ac();
if(!flags.mv || Blind) {
if(!context.mv || Blind) {
/* redo monsters if hallu or wearing a helm of telepathy */
if (Hallucination) { /* update screen randomly */
see_monsters();
@@ -314,9 +314,9 @@ moveloop()
if (vision_full_recalc) vision_recalc(0); /* vision! */
}
if(flags.botl || flags.botlx) bot();
if(context.botl || context.botlx) bot();
flags.move = 1;
context.move = 1;
if(multi >= 0 && occupation) {
#if defined(MICRO) || defined(WIN32)
@@ -387,13 +387,13 @@ moveloop()
lookaround();
if (!multi) {
/* lookaround may clear multi */
flags.move = 0;
if (flags.time) flags.botl = 1;
context.move = 0;
if (flags.time) context.botl = 1;
continue;
}
if (flags.mv) {
if (context.mv) {
if(multi < COLNO && !--multi)
flags.travel = flags.mv = flags.run = 0;
context.travel = context.mv = context.run = 0;
domove();
} else {
--multi;
@@ -407,15 +407,15 @@ moveloop()
}
if (u.utotype) /* change dungeon level */
deferred_goto(); /* after rhack() */
/* !flags.move here: multiple movement command stopped */
else if (flags.time && (!flags.move || !flags.mv))
flags.botl = 1;
/* !context.move here: multiple movement command stopped */
else if (flags.time && (!context.move || !context.mv))
context.botl = 1;
if (vision_full_recalc) vision_recalc(0); /* vision! */
/* when running in non-tport mode, this gets done through domove() */
if ((!flags.run || flags.runmode == RUN_TPORT) &&
(multi && (!flags.travel ? !(multi % 7) : !(moves % 7L)))) {
if (flags.time && flags.run) flags.botl = 1;
if ((!context.run || flags.runmode == RUN_TPORT) &&
(multi && (!context.travel ? !(multi % 7) : !(moves % 7L)))) {
if (flags.time && context.run) context.botl = 1;
display_nhwindow(WIN_MAP, FALSE);
}
}
@@ -428,7 +428,7 @@ stop_occupation()
if (!maybe_finished_meal(TRUE))
You("stop %s.", occtxt);
occupation = 0;
flags.botl = 1; /* in case u.uhs changed */
context.botl = 1; /* in case u.uhs changed */
/* fainting stops your occupation, there's no reason to sync.
sync_hunger();
*/
@@ -477,7 +477,10 @@ newgame()
gameDiskPrompt();
#endif
flags.ident = 1;
context.botlx = 1;
context.ident = 1;
context.stethoscope_move = -1L;
context.warnlevel = 1;
for (i = 0; i < NUMMONS; i++)
mvitals[i].mvflags = mons[i].geno & G_NOCORPSE;
@@ -509,7 +512,6 @@ newgame()
vision_reset(); /* set up internals for level (after mklev) */
check_special_room(FALSE);
flags.botlx = 1;
/* Move the monster from under you or else
* makedog() will fail when it calls makemon().
+12 -14
View File
@@ -203,9 +203,7 @@ STATIC_OVL int
use_stethoscope(obj)
register struct obj *obj;
{
static long last_used_move = -1;
static short last_used_movement = 0;
struct monst *mtmp;
struct monst *mtmp;
struct rm *lev;
int rx, ry, res;
boolean interference = (u.uswallow && is_whirly(u.ustuck->data) &&
@@ -220,10 +218,10 @@ use_stethoscope(obj)
}
if (!getdir((char *)0)) return 0;
res = (moves == last_used_move) &&
(youmonst.movement == last_used_movement);
last_used_move = moves;
last_used_movement = youmonst.movement;
res = (moves == context.stethoscope_move) &&
(youmonst.movement == context.stethoscope_movement);
context.stethoscope_move = moves;
context.stethoscope_movement = youmonst.movement;
#ifdef STEED
if (u.usteed && u.dz > 0) {
@@ -1579,7 +1577,7 @@ struct obj *obj;
else if (!did_prop)
pline("Nothing seems to happen.");
flags.botl = (did_attr || did_prop);
context.botl = (did_attr || did_prop);
#undef PROP_COUNT
#undef ATTR_COUNT
#undef prop2trbl
@@ -1729,7 +1727,7 @@ struct obj **optr;
return;
}
if(!getdir((char *)0)) {
flags.move = multi = 0;
context.move = multi = 0;
return;
}
x = u.ux + u.dx; y = u.uy + u.dy;
@@ -2183,7 +2181,7 @@ struct obj *obj;
You("hit your %s with your bullwhip.", body_part(FOOT));
Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis());
losehp(dam, buf, NO_KILLER_PREFIX);
flags.botl = 1;
context.botl = 1;
return 1;
} else if ((Fumbling || Glib) && !rn2(5)) {
@@ -2713,21 +2711,21 @@ do_break_wand(obj)
if (obj->otyp == WAN_TELEPORTATION &&
affects_objects && level.objects[x][y]) {
(void) bhitpile(obj, bhito, x, y);
if (flags.botl) bot(); /* potion effects */
if (context.botl) bot(); /* potion effects */
}
damage = zapyourself(obj, FALSE);
if (damage) {
Sprintf(buf, "killed %sself by breaking a wand", uhim());
losehp(damage, buf, NO_KILLER_PREFIX);
}
if (flags.botl) bot(); /* blindness */
if (context.botl) bot(); /* blindness */
} else if ((mon = m_at(x, y)) != 0) {
(void) bhitm(mon, obj);
/* if (flags.botl) bot(); */
/* if (context.botl) bot(); */
}
if (affects_objects && level.objects[x][y]) {
(void) bhitpile(obj, bhito, x, y);
if (flags.botl) bot(); /* potion effects */
if (context.botl) bot(); /* potion effects */
}
}
}
+6 -6
View File
@@ -431,10 +431,10 @@ long wp_mask;
if (spec_m2(otmp)) {
if (on) {
EWarn_of_mon |= wp_mask;
flags.warntype |= spec_m2(otmp);
context.warntype |= spec_m2(otmp);
} else {
EWarn_of_mon &= ~wp_mask;
flags.warntype &= ~spec_m2(otmp);
context.warntype &= ~spec_m2(otmp);
}
see_monsters();
} else {
@@ -816,7 +816,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
You("lose magical energy!");
u.uenmax--;
if (u.uen > 0) u.uen--;
flags.botl = 1;
context.botl = 1;
}
} else {
if (mdef->data == &mons[PM_CLAY_GOLEM])
@@ -825,7 +825,7 @@ char *hittee; /* target's name: "you" or mon_nam(mdef) */
You("absorb magical energy!");
u.uenmax++;
u.uen++;
flags.botl = 1;
context.botl = 1;
}
}
}
@@ -1212,7 +1212,7 @@ arti_invoke(obj)
if(Sick) make_sick(0L,(char *)0,FALSE,SICK_ALL);
if(Slimed) Slimed = 0L;
if (Blinded > creamed) make_blinded(creamed, FALSE);
flags.botl = 1;
context.botl = 1;
break;
}
case ENERGY_BOOST: {
@@ -1222,7 +1222,7 @@ arti_invoke(obj)
if(epboost) {
You_feel("re-energized.");
u.uen += epboost;
flags.botl = 1;
context.botl = 1;
} else
goto nothing_special;
break;
+1 -1
View File
@@ -152,7 +152,7 @@ adjattrib(ndx, incr, msgflg)
You_feel("%s%s!",
(incr > 1 || incr < -1) ? "very ": "",
(incr > 0) ? plusattr[ndx] : minusattr[ndx]);
flags.botl = 1;
context.botl = 1;
if (moves > 1 && (ndx == A_STR || ndx == A_CON))
(void)encumber_msg();
return TRUE;
+1 -1
View File
@@ -286,7 +286,7 @@ bot()
{
bot1();
bot2();
flags.botl = flags.botlx = 0;
context.botl = context.botlx = 0;
}
/*botl.c*/
+28 -28
View File
@@ -922,10 +922,10 @@ int final; /* 0 => still in progress; 1 => over, survived; 2 => dead */
if (See_invisible) enl_msg(You_, "see", "saw", " invisible");
if (Blind_telepat) you_are("telepathic");
if (Warning) you_are("warned");
if (Warn_of_mon && flags.warntype) {
if (Warn_of_mon && context.warntype) {
Sprintf(buf, "aware of the presence of %s",
(flags.warntype & M2_ORC) ? "orcs" :
(flags.warntype & M2_DEMON) ? "demons" :
(context.warntype & M2_ORC) ? "orcs" :
(context.warntype & M2_DEMON) ? "demons" :
something);
you_are(buf);
}
@@ -1798,11 +1798,11 @@ register char *cmd;
if (program_state.done_hup) end_of_input();
#endif
if (firsttime) {
flags.nopick = 0;
context.nopick = 0;
cmd = parse();
}
if (*cmd == '\033') {
flags.move = FALSE;
context.move = FALSE;
return;
}
#ifdef REDO
@@ -1820,7 +1820,7 @@ register char *cmd;
#endif
{
nhbell();
flags.move = FALSE;
context.move = FALSE;
return; /* probably we just had an interrupt */
}
if (iflags.num_pad && iflags.num_pad_mode == 1) {
@@ -1837,17 +1837,17 @@ register char *cmd;
}
/* handle most movement commands */
do_walk = do_rush = prefix_seen = FALSE;
flags.travel = 0;
context.travel = 0;
switch (*cmd) {
case 'g': if (movecmd(cmd[1])) {
flags.run = 2;
context.run = 2;
do_rush = TRUE;
} else
prefix_seen = TRUE;
break;
case '5': if (!iflags.num_pad) break; /* else FALLTHRU */
case 'G': if (movecmd(lowc(cmd[1]))) {
flags.run = 3;
context.run = 3;
do_rush = TRUE;
} else
prefix_seen = TRUE;
@@ -1859,55 +1859,55 @@ register char *cmd;
* normal movement: attack if 'I', move otherwise
*/
case 'F': if (movecmd(cmd[1])) {
flags.forcefight = 1;
context.forcefight = 1;
do_walk = TRUE;
} else
prefix_seen = TRUE;
break;
case 'm': if (movecmd(cmd[1]) || u.dz) {
flags.run = 0;
flags.nopick = 1;
context.run = 0;
context.nopick = 1;
if (!u.dz) do_walk = TRUE;
else cmd[0] = cmd[1]; /* "m<" or "m>" */
} else
prefix_seen = TRUE;
break;
case 'M': if (movecmd(lowc(cmd[1]))) {
flags.run = 1;
flags.nopick = 1;
context.run = 1;
context.nopick = 1;
do_rush = TRUE;
} else
prefix_seen = TRUE;
break;
case '0': if (!iflags.num_pad) break;
(void)ddoinv(); /* a convenience borrowed from the PC */
flags.move = FALSE;
context.move = FALSE;
multi = 0;
return;
case CMD_CLICKLOOK:
if (iflags.clicklook) {
flags.move = FALSE;
context.move = FALSE;
do_look(2, &clicklook_cc);
}
return;
case CMD_TRAVEL:
if (flags.travelcmd) {
flags.travel = 1;
flags.run = 8;
flags.nopick = 1;
context.travel = 1;
context.run = 8;
context.nopick = 1;
do_rush = TRUE;
break;
}
/*FALLTHRU*/
default: if (movecmd(*cmd)) { /* ordinary movement */
flags.run = 0; /* only matters here if it was 8 */
context.run = 0; /* only matters here if it was 8 */
do_walk = TRUE;
} else if (movecmd(iflags.num_pad ?
unmeta(*cmd) : lowc(*cmd))) {
flags.run = 1;
context.run = 1;
do_rush = TRUE;
} else if (movecmd(unctrl(*cmd))) {
flags.run = 3;
context.run = 3;
do_rush = TRUE;
}
break;
@@ -1921,16 +1921,16 @@ register char *cmd;
}
if (do_walk) {
if (multi) flags.mv = TRUE;
if (multi) context.mv = TRUE;
domove();
flags.forcefight = 0;
context.forcefight = 0;
return;
} else if (do_rush) {
if (firsttime) {
if (!multi) multi = max(COLNO,ROWNO);
u.last_str_turn = 0;
}
flags.mv = TRUE;
context.mv = TRUE;
domove();
return;
} else if (prefix_seen && cmd[1] == '\033') { /* <prefix><escape> */
@@ -1959,7 +1959,7 @@ register char *cmd;
res = (*func)(); /* perform the command */
}
if (!res) {
flags.move = FALSE;
context.move = FALSE;
multi = 0;
}
return;
@@ -1990,7 +1990,7 @@ register char *cmd;
Norep("Unknown command '%s'.", expcmd);
}
/* didn't move */
flags.move = FALSE;
context.move = FALSE;
multi = 0;
return;
}
@@ -2323,7 +2323,7 @@ parse()
boolean prezero = FALSE;
multi = 0;
flags.move = 1;
context.move = 1;
flush_screen(1); /* Flush screen buffer. Put the cursor on the hero. */
if (!iflags.num_pad || (foo = readchar()) == 'n')
+1 -1
View File
@@ -404,7 +404,7 @@ int dest, how;
#define mk_message(dest) ((dest & 1) ? "" : (char *)0)
#define mk_corpse(dest) ((dest & 2) ? AD_DGST : AD_PHYS)
/* if monsters are moving, one of them caused the destruction */
if (flags.mon_moving)
if (context.mon_moving)
monkilled(etmp->emon, mk_message(dest), mk_corpse(dest));
else /* you caused it */
xkilled(etmp->emon, dest);
+1 -2
View File
@@ -110,8 +110,6 @@ NEARDATA schar tbx = 0, tby = 0; /* mthrowu: target */
number of shots, index of current one, validity check, shoot vs throw */
NEARDATA struct multishot m_shot = { 0, 0, STRANGE_OBJECT, FALSE };
NEARDATA struct dig_info digging;
NEARDATA dungeon dungeons[MAXDUNGEON]; /* ini'ed by init_dungeon() */
NEARDATA s_level *sp_levchn;
NEARDATA stairway upstair = { 0, 0 }, dnstair = { 0, 0 };
@@ -140,6 +138,7 @@ struct mkroom *upstairs_room, *dnstairs_room, *sstairs_room;
dlevel_t level; /* level map */
struct trap *ftrap = (struct trap *)0;
NEARDATA struct monst youmonst = DUMMY;
NEARDATA struct context_info context = DUMMY;
NEARDATA struct flag flags = DUMMY;
NEARDATA struct instance_flags iflags = DUMMY;
NEARDATA struct you u = DUMMY;
+53 -50
View File
@@ -208,7 +208,7 @@ STATIC_OVL int
dig()
{
register struct rm *lev;
register xchar dpx = digging.pos.x, dpy = digging.pos.y;
register xchar dpx = context.digging.pos.x, dpy = context.digging.pos.y;
register boolean ispick = uwep && is_pick(uwep);
const char *verb =
(!uwep || is_pick(uwep)) ? "dig into" : "chop through";
@@ -217,14 +217,14 @@ dig()
/* perhaps a nymph stole your pick-axe while you were busy digging */
/* or perhaps you teleported away */
if (u.uswallow || !uwep || (!ispick && !is_axe(uwep)) ||
!on_level(&digging.level, &u.uz) ||
((digging.down ? (dpx != u.ux || dpy != u.uy)
!on_level(&context.digging.level, &u.uz) ||
((context.digging.down ? (dpx != u.ux || dpy != u.uy)
: (distu(dpx,dpy) > 2))))
return(0);
if (digging.down) {
if (context.digging.down) {
if(!dig_check(BY_YOU, TRUE, u.ux, u.uy)) return(0);
} else { /* !digging.down */
} else { /* !context.digging.down */
if (IS_TREE(lev->typ) && !may_dig(dpx,dpy) &&
dig_typ(uwep, dpx, dpy) == DIGTYP_TREE) {
pline("This tree seems to be petrified.");
@@ -265,20 +265,21 @@ dig()
return(0);
}
digging.effort += 10 + rn2(5) + abon() +
context.digging.effort += 10 + rn2(5) + abon() +
uwep->spe - greatest_erosion(uwep) + u.udaminc;
if (Race_if(PM_DWARF))
digging.effort *= 2;
if (digging.down) {
context.digging.effort *= 2;
if (context.digging.down) {
register struct trap *ttmp;
if (digging.effort > 250) {
if (context.digging.effort > 250) {
(void) dighole(FALSE);
(void) memset((genericptr_t)&digging, 0, sizeof digging);
(void) memset((genericptr_t)&context.digging, 0,
sizeof (struct dig_info));
return(0); /* done with digging */
}
if (digging.effort <= 50 ||
if (context.digging.effort <= 50 ||
((ttmp = t_at(dpx,dpy)) != 0 &&
(ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT ||
ttmp->ttyp == TRAPDOOR || ttmp->ttyp == HOLE)))
@@ -290,13 +291,13 @@ dig()
}
if (dighole(TRUE)) { /* make pit at <u.ux,u.uy> */
digging.level.dnum = 0;
digging.level.dlevel = -1;
context.digging.level.dnum = 0;
context.digging.level.dlevel = -1;
}
return(0);
}
if (digging.effort > 100) {
if (context.digging.effort > 100) {
register const char *digtxt, *dmgtxt = (const char*) 0;
register struct obj *obj;
register boolean shopedge = *in_rooms(dpx, dpy, SHOPBASE);
@@ -375,7 +376,7 @@ dig()
feel_location(dpx, dpy);
else
newsym(dpx, dpy);
if(digtxt && !digging.quiet) pline(digtxt); /* after newsym */
if(digtxt && !context.digging.quiet) pline(digtxt); /* after newsym */
if(dmgtxt)
pay_for_damage(dmgtxt, FALSE);
@@ -400,10 +401,10 @@ dig()
newsym(dpx, dpy);
}
cleanup:
digging.lastdigtime = moves;
digging.quiet = FALSE;
digging.level.dnum = 0;
digging.level.dlevel = -1;
context.digging.lastdigtime = moves;
context.digging.quiet = FALSE;
context.digging.level.dnum = 0;
context.digging.level.dlevel = -1;
return(0);
} else { /* not enough effort has been spent yet */
static const char *const d_target[6] = {
@@ -433,7 +434,7 @@ int
holetime()
{
if(occupation != dig || !*u.ushops) return(-1);
return ((250 - digging.effort) / 20);
return ((250 - context.digging.effort) / 20);
}
/* Return typ of liquid to fill a hole with, or ROOM, if no liquid nearby */
@@ -888,7 +889,7 @@ struct obj *obj;
Sprintf(buf, "%s own %s", uhis(),
OBJ_NAME(objects[obj->otyp]));
losehp(dam, buf, KILLED_BY);
flags.botl=1;
context.botl=1;
return(1);
} else if(u.dz == 0) {
if(Stunned || (Confusion && !rn2(5))) confdir();
@@ -945,31 +946,33 @@ struct obj *obj;
"cutting the tree"
};
did_dig_msg = FALSE;
digging.quiet = FALSE;
if (digging.pos.x != rx || digging.pos.y != ry ||
!on_level(&digging.level, &u.uz) || digging.down) {
context.digging.quiet = FALSE;
if (context.digging.pos.x != rx ||
context.digging.pos.y != ry ||
!on_level(&context.digging.level, &u.uz) ||
context.digging.down) {
if (flags.autodig &&
dig_target == DIGTYP_ROCK && !digging.down &&
digging.pos.x == u.ux &&
digging.pos.y == u.uy &&
(moves <= digging.lastdigtime+2 &&
moves >= digging.lastdigtime)) {
dig_target == DIGTYP_ROCK && !context.digging.down &&
context.digging.pos.x == u.ux &&
context.digging.pos.y == u.uy &&
(moves <= context.digging.lastdigtime+2 &&
moves >= context.digging.lastdigtime)) {
/* avoid messages if repeated autodigging */
did_dig_msg = TRUE;
digging.quiet = TRUE;
context.digging.quiet = TRUE;
}
digging.down = digging.chew = FALSE;
digging.warned = FALSE;
digging.pos.x = rx;
digging.pos.y = ry;
assign_level(&digging.level, &u.uz);
digging.effort = 0;
if (!digging.quiet)
context.digging.down = context.digging.chew = FALSE;
context.digging.warned = FALSE;
context.digging.pos.x = rx;
context.digging.pos.y = ry;
assign_level(&context.digging.level, &u.uz);
context.digging.effort = 0;
if (!context.digging.quiet)
You("start %s.", d_action[dig_target]);
} else {
You("%s %s.", digging.chew ? "begin" : "continue",
You("%s %s.", context.digging.chew ? "begin" : "continue",
d_action[dig_target]);
digging.chew = FALSE;
context.digging.chew = FALSE;
}
set_occupation(dig, verbing, 0);
}
@@ -987,15 +990,15 @@ struct obj *obj;
Yobjnam2(obj, (char *)0), surface(u.ux,u.uy));
u_wipe_engr(3);
} else {
if (digging.pos.x != u.ux || digging.pos.y != u.uy ||
!on_level(&digging.level, &u.uz) || !digging.down) {
digging.chew = FALSE;
digging.down = TRUE;
digging.warned = FALSE;
digging.pos.x = u.ux;
digging.pos.y = u.uy;
assign_level(&digging.level, &u.uz);
digging.effort = 0;
if (context.digging.pos.x != u.ux || context.digging.pos.y != u.uy ||
!on_level(&context.digging.level, &u.uz) || !context.digging.down) {
context.digging.chew = FALSE;
context.digging.down = TRUE;
context.digging.warned = FALSE;
context.digging.pos.x = u.ux;
context.digging.pos.y = u.uy;
assign_level(&context.digging.level, &u.uz);
context.digging.effort = 0;
You("start %s downward.", verbing);
if (*u.ushops) shopdig(0);
} else
@@ -1035,7 +1038,7 @@ watch_dig(mtmp, x, y, zap)
}
if (mtmp) {
if(zap || digging.warned) {
if(zap || context.digging.warned) {
verbalize("Halt, vandal! You're under arrest!");
(void) angry_guards(!(flags.soundok));
} else {
@@ -1050,7 +1053,7 @@ watch_dig(mtmp, x, y, zap)
else
str = "fountain";
verbalize("Hey, stop damaging that %s!", str);
digging.warned = TRUE;
context.digging.warned = TRUE;
}
if (is_digging())
stop_occupation();
+3 -3
View File
@@ -1191,7 +1191,7 @@ docrt()
/* overlay with monsters */
see_monsters();
flags.botlx = 1; /* force a redraw of the bottom line */
context.botlx = 1; /* force a redraw of the bottom line */
}
@@ -1327,7 +1327,7 @@ void
cls()
{
display_nhwindow(WIN_MESSAGE, FALSE); /* flush messages */
flags.botlx = 1; /* force update of botl window */
context.botlx = 1; /* force update of botl window */
clear_nhwindow(WIN_MAP); /* clear physical screen */
clear_glyph_buffer(); /* this is sort of an extra effort, but OK */
@@ -1362,7 +1362,7 @@ flush_screen(cursor_on_u)
display_nhwindow(WIN_MAP, FALSE);
reset_glyph_bbox();
flushing = 0;
if(flags.botl || flags.botlx) bot();
if(context.botl || context.botlx) bot();
}
/* ========================================================================= */
+5 -5
View File
@@ -477,7 +477,7 @@ register struct obj *obj;
if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
#else
/* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS) flags.botl = 1;
if (obj->oclass == COIN_CLASS) context.botl = 1;
freeinv(obj);
#endif
hitfloor(obj);
@@ -500,7 +500,7 @@ register struct obj *obj;
if (obj->oclass != COIN_CLASS || obj == invent) freeinv(obj);
#else
/* Ensure update when we drop gold objects */
if (obj->oclass == COIN_CLASS) flags.botl = 1;
if (obj->oclass == COIN_CLASS) context.botl = 1;
freeinv(obj);
#endif
if (!u.uswallow) {
@@ -761,7 +761,7 @@ dodown()
(trap->ttyp != TRAPDOOR && trap->ttyp != HOLE)
|| !Can_fall_thru(&u.uz) || !trap->tseen) {
if (flags.autodig && !flags.nopick &&
if (flags.autodig && !context.nopick &&
uwep && is_pick(uwep)) {
return use_pick_axe2(uwep);
} else {
@@ -1608,7 +1608,7 @@ register int timex;
if(!Wounded_legs) {
ATEMP(A_DEX)--;
flags.botl = 1;
context.botl = 1;
}
if(!Wounded_legs || (HWounded_legs & TIMEOUT))
@@ -1623,7 +1623,7 @@ heal_legs()
if(Wounded_legs) {
if (ATEMP(A_DEX) < 0) {
ATEMP(A_DEX)++;
flags.botl = 1;
context.botl = 1;
}
#ifdef STEED
+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;
}
}
+3 -3
View File
@@ -734,9 +734,9 @@ dokick()
mtmp = m_at(x, y);
mdat = mtmp->data;
if (!mtmp->mpeaceful || !canspotmon(mtmp))
flags.forcefight = TRUE; /* attack even if invisible */
context.forcefight = TRUE; /* attack even if invisible */
kick_monster(x, y);
flags.forcefight = FALSE;
context.forcefight = FALSE;
/* see comment in attack_checks() */
if (!DEADMONSTER(mtmp) &&
!canspotmon(mtmp) &&
@@ -746,7 +746,7 @@ dokick()
!glyph_is_invisible(levl[x][y].glyph) &&
!(u.uswallow && mtmp == u.ustuck))
map_invisible(x, y);
if((Is_airlevel(&u.uz) || Levitation) && flags.move) {
if((Is_airlevel(&u.uz) || Levitation) && context.move) {
int range;
range = ((int)youmonst.data->cwt + (weight_cap() + inv_weight()));
+2 -2
View File
@@ -49,7 +49,7 @@ int shotlimit;
if (!getdir((char *)0)) {
if (obj->oclass == COIN_CLASS) {
u.ugold += obj->quan;
flags.botl = 1;
context.botl = 1;
dealloc_obj(obj);
}
return(0);
@@ -1695,7 +1695,7 @@ struct obj *obj;
if(!u.dx && !u.dy && !u.dz) {
#ifndef GOLDOBJ
u.ugold += obj->quan;
flags.botl = 1;
context.botl = 1;
dealloc_obj(obj);
#endif
You("cannot throw gold at yourself.");
+151 -164
View File
@@ -134,28 +134,6 @@ static const struct { const char *txt; int nut; } tintxts[] = {
};
#define TTSZ SIZE(tintxts)
static NEARDATA struct {
struct obj *tin;
int usedtime, reqtime;
} tin;
static NEARDATA struct {
struct obj *piece; /* the thing being eaten, or last thing that
* was partially eaten, unless that thing was
* a tin, which uses the tin structure above,
* in which case this should be 0 */
/* doeat() initializes these when piece is valid */
int usedtime, /* turns spent eating */
reqtime; /* turns required to eat */
int nmod; /* coded nutrition per turn */
Bitfield(canchoke,1); /* was satiated at beginning */
/* start_eating() initializes these */
Bitfield(fullwarn,1); /* have warned about being full */
Bitfield(eating,1); /* victual currently being eaten */
Bitfield(doreset,1); /* stop eating at end of turn */
} victual;
static char *eatmbuf = 0; /* set by cpostfx() */
STATIC_PTR
@@ -260,12 +238,12 @@ choke(food) /* To a full belly all food is bad. (It.) */
STATIC_OVL void
recalc_wt()
{
struct obj *piece = victual.piece;
struct obj *piece = context.victual.piece;
#ifdef DEBUG
debugpline("Old weight = %d", piece->owt);
debugpline("Used time = %d, Req'd time = %d",
victual.usedtime, victual.reqtime);
context.victual.usedtime, context.victual.reqtime);
#endif
piece->owt = weight(piece);
#ifdef DEBUG
@@ -279,11 +257,11 @@ reset_eat() /* called when eating interrupted by an event */
/* we only set a flag here - the actual reset process is done after
* the round is spent eating.
*/
if(victual.eating && !victual.doreset) {
if(context.victual.eating && !context.victual.doreset) {
#ifdef DEBUG
debugpline("reset_eat...");
#endif
victual.doreset = TRUE;
context.victual.doreset = TRUE;
}
return;
}
@@ -339,7 +317,10 @@ void
food_disappears(obj)
register struct obj *obj;
{
if (obj == victual.piece) victual.piece = (struct obj *)0;
if (obj == context.victual.piece) {
context.victual.piece = (struct obj *)0;
context.victual.o_id = 0;
}
if (obj->timed) obj_stop_timers(obj);
}
@@ -350,8 +331,11 @@ void
food_substitution(old_obj, new_obj)
struct obj *old_obj, *new_obj;
{
if (old_obj == victual.piece) victual.piece = new_obj;
if (old_obj == tin.tin) tin.tin = new_obj;
if (old_obj == context.victual.piece) {
context.victual.piece = new_obj;
context.victual.o_id = new_obj->o_id;
}
if (old_obj == context.tin.tin) context.tin.tin = new_obj;
}
STATIC_OVL void
@@ -360,11 +344,12 @@ do_reset_eat()
#ifdef DEBUG
debugpline("do_reset_eat...");
#endif
if (victual.piece) {
victual.piece = touchfood(victual.piece);
if (context.victual.piece) {
context.victual.o_id = 0;
context.victual.piece = touchfood(context.victual.piece);
recalc_wt();
}
victual.fullwarn = victual.eating = victual.doreset = FALSE;
context.victual.fullwarn = context.victual.eating = context.victual.doreset = FALSE;
/* Do not set canchoke to FALSE; if we continue eating the same object
* we need to know if canchoke was set when they started eating it the
* previous time. And if we don't continue eating the same object
@@ -378,15 +363,16 @@ STATIC_PTR
int
eatfood() /* called each move during eating process */
{
if(!victual.piece ||
(!carried(victual.piece) && !obj_here(victual.piece, u.ux, u.uy))) {
if(!context.victual.piece ||
(!carried(context.victual.piece) &&
!obj_here(context.victual.piece, u.ux, u.uy))) {
/* maybe it was stolen? */
do_reset_eat();
return(0);
}
if(!victual.eating) return(0);
if(!context.victual.eating) return(0);
if(++victual.usedtime <= victual.reqtime) {
if(++context.victual.usedtime <= context.victual.reqtime) {
if(bite()) return(0);
return(1); /* still busy */
} else { /* done */
@@ -399,24 +385,25 @@ STATIC_OVL void
done_eating(message)
boolean message;
{
victual.piece->in_use = TRUE;
context.victual.piece->in_use = TRUE;
occupation = 0; /* do this early, so newuhs() knows we're done */
newuhs(FALSE);
if (nomovemsg) {
if (message) pline(nomovemsg);
nomovemsg = 0;
} else if (message)
You("finish eating %s.", food_xname(victual.piece, TRUE));
You("finish eating %s.", food_xname(context.victual.piece, TRUE));
if(victual.piece->otyp == CORPSE)
cpostfx(victual.piece->corpsenm);
if(context.victual.piece->otyp == CORPSE)
cpostfx(context.victual.piece->corpsenm);
else
fpostfx(victual.piece);
fpostfx(context.victual.piece);
if (carried(victual.piece)) useup(victual.piece);
else useupf(victual.piece, 1L);
victual.piece = (struct obj *) 0;
victual.fullwarn = victual.eating = victual.doreset = FALSE;
if (carried(context.victual.piece)) useup(context.victual.piece);
else useupf(context.victual.piece, 1L);
context.victual.piece = (struct obj *) 0;
context.victual.o_id = 0;
context.victual.fullwarn = context.victual.eating = context.victual.doreset = FALSE;
}
STATIC_OVL void
@@ -439,8 +426,8 @@ register int pm;
killer = killer_buf;
You("turn to stone.");
done(STONING);
if (victual.piece)
victual.eating = FALSE;
if (context.victual.piece)
context.victual.eating = FALSE;
return; /* lifesaved */
}
}
@@ -471,10 +458,10 @@ register int pm;
killer_format = NO_KILLER_PREFIX;
done(DIED);
/* It so happens that since we know these monsters */
/* cannot appear in tins, victual.piece will always */
/* cannot appear in tins, context.victual.piece will always */
/* be what we want, which is not generally true. */
if (revive_corpse(victual.piece))
victual.piece = (struct obj *)0;
if (revive_corpse(context.victual.piece))
context.victual.piece = (struct obj *)0;
return;
}
case PM_GREEN_SLIME:
@@ -485,7 +472,7 @@ register int pm;
youmonst.data != &mons[PM_GREEN_SLIME]) {
You("don't feel very well.");
Slimed = 10L;
flags.botl = 1;
context.botl = 1;
}
/* Fall through */
default:
@@ -776,7 +763,7 @@ register int pm;
}
if (old_uen != u.uen) {
You_feel("a mild buzz.");
flags.botl = 1;
context.botl = 1;
}
}
break;
@@ -798,7 +785,7 @@ register int pm;
case PM_NURSE:
if (Upolyd) u.mh = u.mhmax;
else u.uhp = u.uhpmax;
flags.botl = 1;
context.botl = 1;
break;
case PM_STALKER:
if(!Invis) {
@@ -975,74 +962,74 @@ opentin() /* called during each move whilst opening a tin */
const char *what;
int which;
if(!carried(tin.tin) && !obj_here(tin.tin, u.ux, u.uy))
if(!carried(context.tin.tin) && !obj_here(context.tin.tin, u.ux, u.uy))
/* perhaps it was stolen? */
return(0); /* %% probably we should use tinoid */
if(tin.usedtime++ >= 50) {
if(context.tin.usedtime++ >= 50) {
You("give up your attempt to open the tin.");
return(0);
}
if(tin.usedtime < tin.reqtime)
if(context.tin.usedtime < context.tin.reqtime)
return(1); /* still busy */
if(tin.tin->otrapped ||
(tin.tin->cursed && tin.tin->spe != -1 && !rn2(8))) {
if(context.tin.tin->otrapped ||
(context.tin.tin->cursed && context.tin.tin->spe != -1 && !rn2(8))) {
b_trapped("tin", 0);
goto use_me;
}
You("succeed in opening the tin.");
if(tin.tin->spe != 1) {
if (tin.tin->corpsenm == NON_PM) {
if(context.tin.tin->spe != 1) {
if (context.tin.tin->corpsenm == NON_PM) {
pline("It turns out to be empty.");
tin.tin->dknown = tin.tin->known = TRUE;
context.tin.tin->dknown = context.tin.tin->known = TRUE;
goto use_me;
}
r = tin.tin->cursed ? ROTTEN_TIN : /* always rotten if cursed */
(tin.tin->spe == -1) ? HOMEMADE_TIN : /* player made it */
r = context.tin.tin->cursed ? ROTTEN_TIN : /* always rotten if cursed */
(context.tin.tin->spe == -1) ? HOMEMADE_TIN : /* player made it */
rn2(TTSZ-1); /* else take your pick */
if (r == ROTTEN_TIN && (tin.tin->corpsenm == PM_LIZARD ||
tin.tin->corpsenm == PM_LICHEN))
if (r == ROTTEN_TIN && (context.tin.tin->corpsenm == PM_LIZARD ||
context.tin.tin->corpsenm == PM_LICHEN))
r = HOMEMADE_TIN; /* lizards don't rot */
else if (tin.tin->spe == -1 && !tin.tin->blessed && !rn2(7))
else if (context.tin.tin->spe == -1 && !context.tin.tin->blessed && !rn2(7))
r = ROTTEN_TIN; /* some homemade tins go bad */
which = 0; /* 0=>plural, 1=>as-is, 2=>"the" prefix */
if (Hallucination) {
what = rndmonnam();
} else {
what = mons[tin.tin->corpsenm].mname;
if (mons[tin.tin->corpsenm].geno & G_UNIQ)
which = type_is_pname(&mons[tin.tin->corpsenm]) ? 1 : 2;
what = mons[context.tin.tin->corpsenm].mname;
if (mons[context.tin.tin->corpsenm].geno & G_UNIQ)
which = type_is_pname(&mons[context.tin.tin->corpsenm]) ? 1 : 2;
}
if (which == 0) what = makeplural(what);
pline("It smells like %s%s.", (which == 2) ? "the " : "", what);
if (yn("Eat it?") == 'n') {
if (!Hallucination) tin.tin->dknown = tin.tin->known = TRUE;
if (!Hallucination) context.tin.tin->dknown = context.tin.tin->known = TRUE;
if (flags.verbose) You("discard the open tin.");
goto use_me;
}
/* in case stop_occupation() was called on previous meal */
victual.piece = (struct obj *)0;
victual.fullwarn = victual.eating = victual.doreset = FALSE;
context.victual.piece = (struct obj *)0;
context.victual.fullwarn = context.victual.eating = context.victual.doreset = FALSE;
You("consume %s %s.", tintxts[r].txt,
mons[tin.tin->corpsenm].mname);
mons[context.tin.tin->corpsenm].mname);
/* KMH, conduct */
u.uconduct.food++;
if (!vegan(&mons[tin.tin->corpsenm]))
if (!vegan(&mons[context.tin.tin->corpsenm]))
u.uconduct.unvegan++;
if (!vegetarian(&mons[tin.tin->corpsenm]))
if (!vegetarian(&mons[context.tin.tin->corpsenm]))
violated_vegetarian();
tin.tin->dknown = tin.tin->known = TRUE;
cprefx(tin.tin->corpsenm); cpostfx(tin.tin->corpsenm);
context.tin.tin->dknown = context.tin.tin->known = TRUE;
cprefx(context.tin.tin->corpsenm); cpostfx(context.tin.tin->corpsenm);
if(((!carried(tin.tin) && costly_spot(tin.tin->ox, tin.tin->oy) &&
!tin.tin->no_charge)
|| tin.tin->unpaid)) {
if(((!carried(context.tin.tin) && costly_spot(context.tin.tin->ox, context.tin.tin->oy) &&
!context.tin.tin->no_charge)
|| context.tin.tin->unpaid)) {
verbalize("You open it, you bought it!");
/* charge for one at pre-eating cost */
if(tin.tin->quan > 1L) tin.tin = splitobj(tin.tin, 1L);
bill_dummy_object(tin.tin);
if(context.tin.tin->quan > 1L) context.tin.tin = splitobj(context.tin.tin, 1L);
bill_dummy_object(context.tin.tin);
}
/* check for vomiting added by GAN 01/16/87 */
@@ -1056,41 +1043,41 @@ opentin() /* called during each move whilst opening a tin */
makeplural(body_part(FINGER)));
}
} else {
if (tin.tin->cursed)
if (context.tin.tin->cursed)
pline("It contains some decaying%s%s substance.",
Blind ? "" : " ", Blind ? "" : hcolor(NH_GREEN));
else
pline("It contains spinach.");
if (yn("Eat it?") == 'n') {
if (!Hallucination && !tin.tin->cursed)
tin.tin->dknown = tin.tin->known = TRUE;
if (!Hallucination && !context.tin.tin->cursed)
context.tin.tin->dknown = context.tin.tin->known = TRUE;
if (flags.verbose)
You("discard the open tin.");
goto use_me;
}
tin.tin->dknown = tin.tin->known = TRUE;
if(((!carried(tin.tin) && costly_spot(tin.tin->ox, tin.tin->oy) &&
!tin.tin->no_charge)
|| tin.tin->unpaid)) {
context.tin.tin->dknown = context.tin.tin->known = TRUE;
if(((!carried(context.tin.tin) && costly_spot(context.tin.tin->ox, context.tin.tin->oy) &&
!context.tin.tin->no_charge)
|| context.tin.tin->unpaid)) {
verbalize("You open it, you bought it!");
/* charge for one at pre-eating cost */
if(tin.tin->quan > 1L) tin.tin = splitobj(tin.tin, 1L);
bill_dummy_object(tin.tin);
if(context.tin.tin->quan > 1L) context.tin.tin = splitobj(context.tin.tin, 1L);
bill_dummy_object(context.tin.tin);
}
if (!tin.tin->cursed)
if (!context.tin.tin->cursed)
pline("This makes you feel like %s!",
Hallucination ? "Swee'pea" : "Popeye");
lesshungry(600);
gainstr(tin.tin, 0);
gainstr(context.tin.tin, 0);
u.uconduct.food++;
}
use_me:
if (carried(tin.tin)) useup(tin.tin);
else useupf(tin.tin, 1L);
tin.tin = (struct obj *) 0;
if (carried(context.tin.tin)) useup(context.tin.tin);
else useupf(context.tin.tin, 1L);
context.tin.tin = (struct obj *) 0;
return(0);
}
@@ -1146,9 +1133,9 @@ no_opener:
}
tmp = rn1(1 + 500/((int)(ACURR(A_DEX) + ACURRSTR)), 10);
}
tin.reqtime = tmp;
tin.usedtime = 0;
tin.tin = otmp;
context.tin.reqtime = tmp;
context.tin.usedtime = 0;
context.tin.tin = otmp;
set_occupation(opentin, "opening the tin", 0);
return;
}
@@ -1265,7 +1252,7 @@ eatcorpse(otmp) /* called when a corpse is selected as food */
}
/* delay is weight dependent */
victual.reqtime = 3 + (mons[mnum].cwt >> 6);
context.victual.reqtime = 3 + (mons[mnum].cwt >> 6);
if (!tp && mnum != PM_LIZARD && mnum != PM_LICHEN &&
(otmp->orotten || !rn2(7))) {
@@ -1302,18 +1289,18 @@ start_eating(otmp) /* called as you start to eat */
register struct obj *otmp;
{
#ifdef DEBUG
debugpline("start_eating: %lx (victual = %lx)", otmp, victual.piece);
debugpline("reqtime = %d", victual.reqtime);
debugpline("start_eating: %lx (victual = %lx)", otmp, context.victual.piece);
debugpline("reqtime = %d", context.victual.reqtime);
debugpline("(original reqtime = %d)", objects[otmp->otyp].oc_delay);
debugpline("nmod = %d", victual.nmod);
debugpline("nmod = %d", context.victual.nmod);
debugpline("oeaten = %d", otmp->oeaten);
#endif
victual.fullwarn = victual.doreset = FALSE;
victual.eating = TRUE;
context.victual.fullwarn = context.victual.doreset = FALSE;
context.victual.eating = TRUE;
if (otmp->otyp == CORPSE) {
cprefx(victual.piece->corpsenm);
if (!victual.piece || !victual.eating) {
cprefx(context.victual.piece->corpsenm);
if (!context.victual.piece || !context.victual.eating) {
/* rider revived, or died and lifesaved */
return;
}
@@ -1321,9 +1308,9 @@ start_eating(otmp) /* called as you start to eat */
if (bite()) return;
if (++victual.usedtime >= victual.reqtime) {
if (++context.victual.usedtime >= context.victual.reqtime) {
/* print "finish eating" message if they just resumed -dlc */
done_eating(victual.reqtime > 1 ? TRUE : FALSE);
done_eating(context.victual.reqtime > 1 ? TRUE : FALSE);
return;
}
@@ -1361,7 +1348,7 @@ struct obj *otmp;
/* not cannibalism, but we use similar criteria
for deciding whether to be sickened by this meal */
if (rn2(2) && !CANNIBAL_ALLOWED())
make_vomiting((long)rn1(victual.reqtime, 14), FALSE);
make_vomiting((long)rn1(context.victual.reqtime, 14), FALSE);
}
break;
case MEATBALL:
@@ -1372,7 +1359,7 @@ struct obj *otmp;
/* break; */
case CLOVE_OF_GARLIC:
if (is_undead(youmonst.data)) {
make_vomiting((long)rn1(victual.reqtime, 5), FALSE);
make_vomiting((long)rn1(context.victual.reqtime, 5), FALSE);
break;
}
/* Fall through otherwise */
@@ -1512,7 +1499,7 @@ struct obj *otmp;
accessory_has_effect(otmp);
HProtection |= FROMOUTSIDE;
u.ublessed += otmp->spe;
flags.botl = 1;
context.botl = 1;
break;
case RIN_FREE_ACTION:
/* Give sleep resistance instead */
@@ -1528,7 +1515,7 @@ struct obj *otmp;
change_sex();
You("are suddenly very %s!",
flags.female ? "feminine" : "masculine");
flags.botl = 1;
context.botl = 1;
break;
case AMULET_OF_STRANGULATION: /* bad idea! */
/* no message--this gives no permanent effect */
@@ -1554,14 +1541,14 @@ struct obj *otmp;
STATIC_OVL void
eatspecial() /* called after eating non-food */
{
register struct obj *otmp = victual.piece;
register struct obj *otmp = context.victual.piece;
/* lesshungry wants an occupation to handle choke messages correctly */
set_occupation(eatfood, "eating non-food", 0);
lesshungry(victual.nmod);
lesshungry(context.victual.nmod);
occupation = 0;
victual.piece = (struct obj *)0;
victual.eating = 0;
context.victual.piece = (struct obj *)0;
context.victual.eating = 0;
if (otmp->oclass == COIN_CLASS) {
#ifdef GOLDOBJ
if (carried(otmp))
@@ -1899,11 +1886,11 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
}
if (otmp->oclass != FOOD_CLASS) {
int material;
victual.reqtime = 1;
victual.piece = otmp;
context.victual.reqtime = 1;
context.victual.piece = otmp;
/* Don't split it, we don't need to if it's 1 move */
victual.usedtime = 0;
victual.canchoke = (u.uhs == SATIATED);
context.victual.usedtime = 0;
context.victual.canchoke = (u.uhs == SATIATED);
/* Note: gold weighs 1 pt. for each 1000 pieces (see */
/* pickup.c) so gold and non-gold is consistent. */
if (otmp->oclass == COIN_CLASS)
@@ -1913,8 +1900,8 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
basenutrit = weight(otmp);
/* oc_nutrition is usually weight anyway */
else basenutrit = objects[otmp->otyp].oc_nutrition;
victual.nmod = basenutrit;
victual.eating = TRUE; /* needed for lesshungry() */
context.victual.nmod = basenutrit;
context.victual.eating = TRUE; /* needed for lesshungry() */
material = objects[otmp->otyp].oc_material;
if (material == LEATHER ||
@@ -1944,16 +1931,16 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
return 1;
}
if(otmp == victual.piece) {
if(otmp == context.victual.piece) {
/* If they weren't able to choke, they don't suddenly become able to
* choke just because they were interrupted. On the other hand, if
* they were able to choke before, if they lost food it's possible
* they shouldn't be able to choke now.
*/
if (u.uhs != SATIATED) victual.canchoke = FALSE;
victual.piece = touchfood(otmp);
if (u.uhs != SATIATED) context.victual.canchoke = FALSE;
context.victual.piece = touchfood(otmp);
You("resume your meal.");
start_eating(victual.piece);
start_eating(context.victual.piece);
return(1);
}
@@ -1968,8 +1955,8 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
/* KMH, conduct */
u.uconduct.food++;
victual.piece = otmp = touchfood(otmp);
victual.usedtime = 0;
context.victual.piece = otmp = touchfood(otmp);
context.victual.usedtime = 0;
/* Now we need to calculate delay and nutritional info.
* The base nutrition calculated here and in eatcorpse() accounts
@@ -1980,7 +1967,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
int tmp = eatcorpse(otmp);
if (tmp == 2) {
/* used up */
victual.piece = (struct obj *)0;
context.victual.piece = (struct obj *)0;
return(1);
} else if (tmp)
dont_start = TRUE;
@@ -2007,7 +1994,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
break;
}
victual.reqtime = objects[otmp->otyp].oc_delay;
context.victual.reqtime = objects[otmp->otyp].oc_delay;
if (otmp->otyp != FORTUNE_COOKIE &&
(otmp->cursed ||
(((monstermoves - otmp->age) > (int) otmp->blessed ? 50:30) &&
@@ -2026,13 +2013,13 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
else basenutrit = objects[otmp->otyp].oc_nutrition;
#ifdef DEBUG
debugpline("before rounddiv: victual.reqtime == %d", victual.reqtime);
debugpline("before rounddiv: context.victual.reqtime == %d", context.victual.reqtime);
debugpline("oeaten == %d, basenutrit == %d", otmp->oeaten, basenutrit);
#endif
victual.reqtime = (basenutrit == 0 ? 0 :
rounddiv(victual.reqtime * (long)otmp->oeaten, basenutrit));
context.victual.reqtime = (basenutrit == 0 ? 0 :
rounddiv(context.victual.reqtime * (long)otmp->oeaten, basenutrit));
#ifdef DEBUG
debugpline("after rounddiv: victual.reqtime == %d", victual.reqtime);
debugpline("after rounddiv: context.victual.reqtime == %d", context.victual.reqtime);
#endif
/* calculate the modulo value (nutrit. units per round eating)
* note: this isn't exact - you actually lose a little nutrition
@@ -2040,14 +2027,14 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
* TODO: add in a "remainder" value to be given at the end of the
* meal.
*/
if (victual.reqtime == 0 || otmp->oeaten == 0)
if (context.victual.reqtime == 0 || otmp->oeaten == 0)
/* possible if most has been eaten before */
victual.nmod = 0;
else if ((int)otmp->oeaten >= victual.reqtime)
victual.nmod = -((int)otmp->oeaten / victual.reqtime);
context.victual.nmod = 0;
else if ((int)otmp->oeaten >= context.victual.reqtime)
context.victual.nmod = -((int)otmp->oeaten / context.victual.reqtime);
else
victual.nmod = victual.reqtime % otmp->oeaten;
victual.canchoke = (u.uhs == SATIATED);
context.victual.nmod = context.victual.reqtime % otmp->oeaten;
context.victual.canchoke = (u.uhs == SATIATED);
if (!dont_start) start_eating(otmp);
return(1);
@@ -2059,21 +2046,21 @@ doeat() /* generic "eat" command funtion (see cmd.c) */
STATIC_OVL int
bite()
{
if(victual.canchoke && u.uhunger >= 2000) {
choke(victual.piece);
if(context.victual.canchoke && u.uhunger >= 2000) {
choke(context.victual.piece);
return 1;
}
if (victual.doreset) {
if (context.victual.doreset) {
do_reset_eat();
return 0;
}
force_save_hs = TRUE;
if(victual.nmod < 0) {
lesshungry(-victual.nmod);
consume_oeaten(victual.piece, victual.nmod); /* -= -nmod */
} else if(victual.nmod > 0 && (victual.usedtime % victual.nmod)) {
if(context.victual.nmod < 0) {
lesshungry(-context.victual.nmod);
consume_oeaten(context.victual.piece, context.victual.nmod); /* -= -nmod */
} else if(context.victual.nmod > 0 && (context.victual.usedtime % context.victual.nmod)) {
lesshungry(1);
consume_oeaten(victual.piece, -1); /* -= 1 */
consume_oeaten(context.victual.piece, -1); /* -= 1 */
}
force_save_hs = FALSE;
recalc_wt();
@@ -2141,12 +2128,12 @@ register int num;
#endif
u.uhunger += num;
if(u.uhunger >= 2000) {
if (!iseating || victual.canchoke) {
if (!iseating || context.victual.canchoke) {
if (iseating) {
choke(victual.piece);
choke(context.victual.piece);
reset_eat();
} else
choke(occupation == opentin ? tin.tin : (struct obj *)0);
choke(occupation == opentin ? context.tin.tin : (struct obj *)0);
/* no reset_eat() */
}
} else {
@@ -2154,14 +2141,14 @@ register int num;
* warns when you're about to choke.
*/
if (u.uhunger >= 1500) {
if (!victual.eating || (victual.eating && !victual.fullwarn)) {
if (!context.victual.eating || (context.victual.eating && !context.victual.fullwarn)) {
pline("You're having a hard time getting all of it down.");
nomovemsg = "You're finally finished.";
if (!victual.eating)
if (!context.victual.eating)
multi = -2;
else {
victual.fullwarn = TRUE;
if (victual.canchoke && victual.reqtime > 1) {
context.victual.fullwarn = TRUE;
if (context.victual.canchoke && context.victual.reqtime > 1) {
/* a one-gulp food will not survive a stop */
if (yn_function("Stop eating?",ynchars,'y')=='y') {
reset_eat();
@@ -2183,7 +2170,7 @@ unfaint()
if(u.uhs > FAINTING)
u.uhs = FAINTING;
stop_occupation();
flags.botl = 1;
context.botl = 1;
return 0;
}
@@ -2280,7 +2267,7 @@ boolean incr;
} else
if(u.uhunger < -(int)(200 + 20*ACURR(A_CON))) {
u.uhs = STARVED;
flags.botl = 1;
context.botl = 1;
bot();
You("die from starvation.");
killer_format = KILLED_BY;
@@ -2331,7 +2318,7 @@ boolean incr;
break;
}
u.uhs = newhs;
flags.botl = 1;
context.botl = 1;
bot();
if ((Upolyd ? u.mh : u.uhp) < 1) {
You("die from hunger and exhaustion.");
@@ -2474,7 +2461,7 @@ int amt;
* victual handling mechanism from scratch using a less complex
* model. Alternatively, this routine could call done_eating()
* or food_disappears() but its callers would need revisions to
* cope with victual.piece unexpectedly going away.
* cope with context.victual.piece unexpectedly going away.
*
* Multi-turn eating operates by setting the food's oeaten field
* to its full nutritional value and then running a counter which
@@ -2506,8 +2493,8 @@ int amt;
}
if (obj->oeaten == 0) {
if (obj == victual.piece) /* always true unless wishing... */
victual.reqtime = victual.usedtime; /* no bites left */
if (obj == context.victual.piece) /* always true unless wishing... */
context.victual.reqtime = context.victual.usedtime; /* no bites left */
obj->oeaten = 1; /* smallest possible positive value */
}
}
@@ -2519,9 +2506,9 @@ maybe_finished_meal(stopping)
boolean stopping;
{
/* in case consume_oeaten() has decided that the food is all gone */
if (occupation == eatfood && victual.usedtime >= victual.reqtime) {
if (occupation == eatfood && context.victual.usedtime >= context.victual.reqtime) {
if (stopping) occupation = 0; /* for do_reset_eat */
(void) eatfood(); /* calls done_eating() to use up victual.piece */
(void) eatfood(); /* calls done_eating() to use up context.victual.piece */
return TRUE;
}
return FALSE;
+2 -2
View File
@@ -422,10 +422,10 @@ int how;
}
if (how == CHOKING) init_uhunger();
nomovemsg = "You survived that attempt on your life.";
flags.move = 0;
context.move = 0;
if(multi > 0) multi = 0; else multi = -1;
if(u.utrap && u.utraptype == TT_LAVA) u.utrap = 0;
flags.botl = 1;
context.botl = 1;
u.ugrave_arise = NON_PM;
HUnchanging = 0L;
curs_on_u();
+1 -1
View File
@@ -331,7 +331,7 @@ register int x,y;
et = ep->engr_txt;
You("%s: \"%s\".",
(Blind) ? "feel the words" : "read", et);
if(flags.run > 1) nomul(0);
if(context.run > 1) nomul(0);
}
}
}
+3 -3
View File
@@ -105,7 +105,7 @@ more_experienced(exp, rexp)
#ifdef SCORE_ON_BOTL
|| flags.showscore
#endif
) flags.botl = 1;
) context.botl = 1;
if (u.urexp >= (Role_if(PM_WIZARD) ? 1000 : 2000))
flags.beginner = 0;
}
@@ -161,7 +161,7 @@ const char *drainer; /* cause of death, if drain should be fatal */
if (u.uexp > 0)
u.uexp = newuexp(u.ulevel) - 1;
flags.botl = 1;
context.botl = 1;
}
/*
@@ -214,7 +214,7 @@ boolean incr; /* true iff via incremental experience growth */
adjabil(u.ulevel - 1, u.ulevel); /* give new intrinsics */
reset_rndmonst(NON_PM); /* new monster selection */
}
flags.botl = 1;
context.botl = 1;
}
/* compute a random amount of experience points suitable for the hero's
+3 -3
View File
@@ -299,9 +299,9 @@ int expltype;
}
if (mtmp->mhp <= 0) {
/* KMH -- Don't blame the player for pets killing gas spores */
if (!flags.mon_moving) killed(mtmp);
if (!context.mon_moving) killed(mtmp);
else monkilled(mtmp, "", (int)adtyp);
} else if (!flags.mon_moving) setmangry(mtmp);
} else if (!context.mon_moving) setmangry(mtmp);
}
/* Do your injury last */
@@ -329,7 +329,7 @@ int expltype;
u.mh -= damu;
else
u.uhp -= damu;
flags.botl = 1;
context.botl = 1;
}
if (u.uhp <= 0 || (Upolyd && u.mh <= 0)) {
+1 -1
View File
@@ -211,7 +211,7 @@ drinkfountain()
for (ii = 0; ii < A_MAX; ii++)
if (ABASE(ii) < AMAX(ii)) {
ABASE(ii) = AMAX(ii);
flags.botl = 1;
context.botl = 1;
}
/* gain ability, blessed if "natural" luck is high */
i = rn2(A_MAX); /* start at a random attribute */
+46 -46
View File
@@ -313,24 +313,24 @@ still_chewing(x,y)
struct obj *boulder = sobj_at(BOULDER,x,y);
const char *digtxt = (char *)0, *dmgtxt = (char *)0;
if (digging.down) /* not continuing previous dig (w/ pick-axe) */
(void) memset((genericptr_t)&digging, 0, sizeof digging);
if (context.digging.down) /* not continuing previous dig (w/ pick-axe) */
(void) memset((genericptr_t)&context.digging, 0, sizeof(struct dig_info));
if (!boulder && IS_ROCK(lev->typ) && !may_dig(x,y)) {
You("hurt your teeth on the %s.",
IS_TREE(lev->typ) ? "tree" : "hard stone");
nomul(0);
return 1;
} else if (digging.pos.x != x || digging.pos.y != y ||
!on_level(&digging.level, &u.uz)) {
digging.down = FALSE;
digging.chew = TRUE;
digging.warned = FALSE;
digging.pos.x = x;
digging.pos.y = y;
assign_level(&digging.level, &u.uz);
} else if (context.digging.pos.x != x || context.digging.pos.y != y ||
!on_level(&context.digging.level, &u.uz)) {
context.digging.down = FALSE;
context.digging.chew = TRUE;
context.digging.warned = FALSE;
context.digging.pos.x = x;
context.digging.pos.y = y;
assign_level(&context.digging.level, &u.uz);
/* solid rock takes more work & time to dig through */
digging.effort =
context.digging.effort =
(IS_ROCK(lev->typ) && !IS_TREE(lev->typ) ? 30 : 60) + u.udaminc;
You("start chewing %s %s.",
(boulder || IS_TREE(lev->typ)) ? "on a" : "a hole in the",
@@ -338,14 +338,14 @@ still_chewing(x,y)
IS_TREE(lev->typ) ? "tree" : IS_ROCK(lev->typ) ? "rock" : "door");
watch_dig((struct monst *)0, x, y, FALSE);
return 1;
} else if ((digging.effort += (30 + u.udaminc)) <= 100) {
} else if ((context.digging.effort += (30 + u.udaminc)) <= 100) {
if (flags.verbose)
You("%s chewing on the %s.",
digging.chew ? "continue" : "begin",
context.digging.chew ? "continue" : "begin",
boulder ? "boulder" :
IS_TREE(lev->typ) ? "tree" :
IS_ROCK(lev->typ) ? "rock" : "door");
digging.chew = TRUE;
context.digging.chew = TRUE;
watch_dig((struct monst *)0, x, y, FALSE);
return 1;
}
@@ -368,7 +368,7 @@ still_chewing(x,y)
if (IS_ROCK(lev->typ) || closed_door(x,y) || sobj_at(BOULDER,x,y)) {
block_point(x,y); /* delobj will unblock the point */
/* reset dig state */
(void) memset((genericptr_t)&digging, 0, sizeof digging);
(void) memset((genericptr_t)&context.digging, 0, sizeof(struct dig_info));
return 1;
}
@@ -421,7 +421,7 @@ still_chewing(x,y)
newsym(x, y);
if (digtxt) You(digtxt); /* after newsym */
if (dmgtxt) pay_for_damage(dmgtxt, FALSE);
(void) memset((genericptr_t)&digging, 0, sizeof digging);
(void) memset((genericptr_t)&context.digging, 0, sizeof(struct dig_info));
return 0;
}
@@ -553,7 +553,7 @@ int mode;
} else if (tunnels(youmonst.data) && !needspick(youmonst.data)) {
/* Eat the rock. */
if (mode == DO_MOVE && still_chewing(x,y)) return FALSE;
} else if (flags.autodig && !flags.run && !flags.nopick &&
} else if (flags.autodig && !context.run && !context.nopick &&
uwep && is_pick(uwep)) {
/* MRKR: Automatic digging when wielding the appropriate tool */
if (mode == DO_MOVE)
@@ -634,7 +634,7 @@ int mode;
}
}
/* pick a path that does not require crossing a trap */
if (flags.run == 8 && mode != DO_MOVE) {
if (context.run == 8 && mode != DO_MOVE) {
struct trap* t = t_at(x, y);
if (t && t->tseen) return FALSE;
@@ -655,7 +655,7 @@ int mode;
}
if (sobj_at(BOULDER,x,y) && (In_sokoban(&u.uz) || !Passes_walls)) {
if (!(Blind || Hallucination) && (flags.run >= 2) && mode != TEST_TRAV)
if (!(Blind || Hallucination) && (context.run >= 2) && mode != TEST_TRAV)
return FALSE;
if (mode == DO_MOVE) {
/* tunneling monsters will chew before pushing */
@@ -756,7 +756,7 @@ boolean guess;
if (x == u.tx && y == u.ty) {
nomul(0);
/* reset run so domove run checks work */
flags.run = 8;
context.run = 8;
iflags.travelcc.x = iflags.travelcc.y = -1;
}
return TRUE;
@@ -834,7 +834,7 @@ domove()
u_wipe_engr(rnd(5));
if (flags.travel)
if (context.travel)
if (!findtravelpath(FALSE))
(void) findtravelpath(TRUE);
@@ -926,9 +926,9 @@ domove()
(Blind && !Levitation && !Flying &&
!is_clinger(youmonst.data) &&
(is_pool(x, y) || is_lava(x, y)) && levl[x][y].seenv)) {
if(flags.run >= 2) {
if(context.run >= 2) {
nomul(0);
flags.move = 0;
context.move = 0;
return;
} else
nomul(0);
@@ -982,14 +982,14 @@ domove()
if (mtmp) {
/* Don't attack if you're running, and can see it */
/* We should never get here if forcefight */
if (flags.run &&
if (context.run &&
((!Blind && mon_visible(mtmp) &&
((mtmp->m_ap_type != M_AP_FURNITURE &&
mtmp->m_ap_type != M_AP_OBJECT) ||
Protection_from_shape_changers)) ||
sensemon(mtmp))) {
nomul(0);
flags.move = 0;
context.move = 0;
return;
}
}
@@ -1018,7 +1018,7 @@ domove()
* invisible monster--then, we fall through to attack() and
* attack_check(), which still wastes a turn, but prints a
* different message and makes the player remember the monster. */
if(flags.nopick &&
if(context.nopick &&
(canspotmon(mtmp) || glyph_is_invisible(levl[x][y].glyph))){
if(mtmp->m_ap_type && !Protection_from_shape_changers
&& !sensemon(mtmp))
@@ -1029,7 +1029,7 @@ domove()
You("move right into %s.", mon_nam(mtmp));
return;
}
if(flags.forcefight || !mtmp->mundetected || sensemon(mtmp) ||
if(context.forcefight || !mtmp->mundetected || sensemon(mtmp) ||
((hides_under(mtmp->data) || mtmp->data->mlet == S_EEL) &&
!is_safepet(mtmp))){
gethungry();
@@ -1053,9 +1053,9 @@ domove()
}
/* specifying 'F' with no monster wastes a turn */
if (flags.forcefight ||
if (context.forcefight ||
/* remembered an 'I' && didn't use a move command */
(glyph_is_invisible(levl[x][y].glyph) && !flags.nopick)) {
(glyph_is_invisible(levl[x][y].glyph) && !context.nopick)) {
boolean expl = (Upolyd && attacktype(youmonst.data, AT_EXPL));
char buf[BUFSZ];
Sprintf(buf,"a vacant spot on the %s", surface(x,y));
@@ -1219,7 +1219,7 @@ domove()
}
if (!test_move(u.ux, u.uy, x-u.ux, y-u.uy, DO_MOVE)) {
flags.move = 0;
context.move = 0;
nomul(0);
return;
}
@@ -1332,8 +1332,8 @@ domove()
}
reset_occupations();
if (flags.run) {
if ( flags.run < 8 )
if (context.run) {
if ( context.run < 8 )
if (IS_DOOR(tmpr->typ) || IS_ROCK(tmpr->typ) ||
IS_FURNITURE(tmpr->typ))
nomul(0);
@@ -1378,10 +1378,10 @@ domove()
nomovemsg = "";
}
if (flags.run && flags.runmode != RUN_TPORT) {
if (context.run && flags.runmode != RUN_TPORT) {
/* display every step or every 7th step depending upon mode */
if (flags.runmode != RUN_LEAP || !(moves % 7L)) {
if (flags.time) flags.botl = 1;
if (flags.time) context.botl = 1;
curs_on_u();
delay_output();
if (flags.runmode == RUN_CRAWL) {
@@ -1885,7 +1885,7 @@ lookaround()
return;
}
if(Blind || flags.run == 0) return;
if(Blind || context.run == 0) return;
for(x = u.ux-1; x <= u.ux+1; x++) for(y = u.uy-1; y <= u.uy+1; y++) {
if(!isok(x,y)) continue;
@@ -1897,7 +1897,7 @@ lookaround()
mtmp->m_ap_type != M_AP_FURNITURE &&
mtmp->m_ap_type != M_AP_OBJECT &&
(!mtmp->minvis || See_invisible) && !mtmp->mundetected) {
if((flags.run != 1 && !mtmp->mtame)
if((context.run != 1 && !mtmp->mtame)
|| (x == u.ux+u.dx && y == u.uy+u.dy))
goto stop;
}
@@ -1913,12 +1913,12 @@ lookaround()
(mtmp->mappearance == S_hcdoor ||
mtmp->mappearance == S_vcdoor))) {
if(x != u.ux && y != u.uy) continue;
if(flags.run != 1) goto stop;
if(context.run != 1) goto stop;
goto bcorr;
} else if (levl[x][y].typ == CORR) {
bcorr:
if(levl[u.ux][u.uy].typ != ROOM) {
if(flags.run == 1 || flags.run == 3 || flags.run == 8) {
if(context.run == 1 || context.run == 3 || context.run == 8) {
i = dist2(x,y,u.ux+u.dx,u.uy+u.dy);
if(i > 2) continue;
if(corrct == 1 && dist2(x,y,x0,y0) != 1)
@@ -1934,7 +1934,7 @@ bcorr:
}
continue;
} else if ((trap = t_at(x,y)) && trap->tseen) {
if(flags.run == 1) goto bcorr; /* if you must */
if(context.run == 1) goto bcorr; /* if you must */
if(x == u.ux+u.dx && y == u.uy+u.dy) goto stop;
continue;
} else if (is_pool(x,y) || is_lava(x,y)) {
@@ -1950,8 +1950,8 @@ bcorr:
goto stop;
continue;
} else { /* e.g. objects or trap or stairs */
if(flags.run == 1) goto bcorr;
if(flags.run == 8) continue;
if(context.run == 1) goto bcorr;
if(context.run == 8) continue;
if(mtmp) continue; /* d */
if(((x == u.ux - u.dx) && (y != u.uy + u.dy)) ||
((y == u.uy - u.dy) && (x != u.ux + u.dx)))
@@ -1962,8 +1962,8 @@ stop:
return;
} /* end for loops */
if(corrct > 1 && flags.run == 2) goto stop;
if((flags.run == 1 || flags.run == 3 || flags.run == 8) &&
if(corrct > 1 && context.run == 2) goto stop;
if((context.run == 1 || context.run == 3 || context.run == 8) &&
!noturn && !m0 && i0 && (corrct == 1 || (corrct == 2 && i0 == 1)))
{
/* make sure that we do not turn too far */
@@ -2028,7 +2028,7 @@ nomul(nval)
u.uinvulnerable = FALSE; /* Kludge to avoid ctrl-C bug -dlc */
u.usleep = 0;
multi = nval;
flags.travel = flags.mv = flags.run = 0;
context.travel = context.mv = context.run = 0;
}
/* called when a non-movement, multi-turn action has completed */
@@ -2086,7 +2086,7 @@ boolean k_format;
if (Upolyd) {
u.mh -= n;
if (u.mhmax < u.mh) u.mhmax = u.mh;
flags.botl = 1;
context.botl = 1;
if (u.mh < 1)
rehumanize();
else if (n > 0 && u.mh*10 < u.mhmax && Unchanging)
@@ -2097,7 +2097,7 @@ boolean k_format;
u.uhp -= n;
if(u.uhp > u.uhpmax)
u.uhpmax = u.uhp; /* perhaps n was negative */
flags.botl = 1;
context.botl = 1;
if(u.uhp < 1) {
killer_format = k_format;
killer = knam; /* the thing that killed you */
+6 -6
View File
@@ -239,7 +239,7 @@ struct obj *obj;
#ifndef GOLDOBJ
u.ugold += obj->quan;
#else
flags.botl = 1;
context.botl = 1;
#endif
} else if (obj->otyp == AMULET_OF_YENDOR) {
if (u.uhave.amulet) impossible("already have amulet?");
@@ -479,7 +479,7 @@ struct obj *obj;
u.ugold -= obj->quan;
obj->in_use = FALSE;
#endif
flags.botl = 1;
context.botl = 1;
return;
} else if (obj->otyp == AMULET_OF_YENDOR) {
if (!u.uhave.amulet) impossible("don't have amulet?");
@@ -506,7 +506,7 @@ struct obj *obj;
curse(obj);
} else if (confers_luck(obj)) {
set_moreluck();
flags.botl = 1;
context.botl = 1;
} else if (obj->otyp == FIGURINE && obj->timed) {
(void) stop_timer(FIG_TRANSFORM, (genericptr_t) obj);
}
@@ -658,7 +658,7 @@ register long q;
u.ugold -= q;
otmp->quan = q;
otmp->owt = weight(otmp);
flags.botl = 1;
context.botl = 1;
return(otmp);
}
#endif
@@ -1011,7 +1011,7 @@ register const char *let,*word;
}
}
#ifdef GOLDOBJ
flags.botl = 1; /* May have changed the amount of money */
context.botl = 1; /* May have changed the amount of money */
#endif
#ifdef REDO
savech(ilet);
@@ -1262,7 +1262,7 @@ unsigned *resultflags;
You("have no gold.");
allowgold = 2;
#else
flags.botl = 1;
context.botl = 1;
#endif
} else if (sym == 'a') {
allflag = TRUE;
+1 -1
View File
@@ -417,7 +417,7 @@ pick_lock(pick) /* pick a lock with a given object */
xlock.box = 0;
}
}
flags.move = 0;
context.move = 0;
xlock.chance = ch;
xlock.picktyp = picktyp;
xlock.usedtime = 0;
+8 -8
View File
@@ -674,8 +674,8 @@ struct monst *mon;
*m2 = *mon; /* copy condition of old monster */
m2->nmon = fmon;
fmon = m2;
m2->m_id = flags.ident++;
if (!m2->m_id) m2->m_id = flags.ident++; /* ident overflowed */
m2->m_id = context.ident++;
if (!m2->m_id) m2->m_id = context.ident++; /* ident overflowed */
m2->mx = mm.x;
m2->my = mm.y;
@@ -869,8 +869,8 @@ register int mmflags;
(void)memset((genericptr_t)mtmp->mextra, 0, xlth);
mtmp->nmon = fmon;
fmon = mtmp;
mtmp->m_id = flags.ident++;
if (!mtmp->m_id) mtmp->m_id = flags.ident++; /* ident overflowed */
mtmp->m_id = context.ident++;
if (!mtmp->m_id) mtmp->m_id = context.ident++; /* ident overflowed */
set_mon_data(mtmp, ptr, 0);
if (mtmp->data->msound == MS_LEADER)
quest_status.leader_m_id = mtmp->m_id;
@@ -975,13 +975,13 @@ register int mmflags;
}
} else if (mndx == PM_WIZARD_OF_YENDOR) {
mtmp->iswiz = TRUE;
flags.no_of_wizards++;
if (flags.no_of_wizards == 1 && Is_earthlevel(&u.uz))
context.no_of_wizards++;
if (context.no_of_wizards == 1 && Is_earthlevel(&u.uz))
mitem = SPE_DIG;
} else if (mndx == PM_DJINNI) {
flags.djinni_count++;
context.djinni_count++;
} else if (mndx == PM_GHOST) {
flags.ghost_count++;
context.ghost_count++;
if (!(mmflags & MM_NONAME))
mtmp = christen_monst(mtmp, rndghostname());
} else if (mndx == PM_VLAD_THE_IMPALER) {
+2 -2
View File
@@ -343,7 +343,7 @@ int spellnum;
dmg = 0;
break;
case MGC_CLONE_WIZ:
if (mtmp->iswiz && flags.no_of_wizards == 1) {
if (mtmp->iswiz && context.no_of_wizards == 1) {
pline("Double Trouble...");
clonewiz();
dmg = 0;
@@ -725,7 +725,7 @@ int spellnum;
if (!mcouldseeu && (spellnum == MGC_SUMMON_MONS ||
(!mtmp->iswiz && spellnum == MGC_CLONE_WIZ)))
return TRUE;
if ((!mtmp->iswiz || flags.no_of_wizards > 1)
if ((!mtmp->iswiz || context.no_of_wizards > 1)
&& spellnum == MGC_CLONE_WIZ)
return TRUE;
} else if (adtyp == AD_CLRC) {
+14 -14
View File
@@ -642,7 +642,7 @@ mattacku(mtmp)
default: /* no attack */
break;
}
if(flags.botl) bot();
if(context.botl) bot();
/* give player a chance of waking up before dying -kaa */
if(sum[i] == 1) { /* successful attack */
if (u.usleep && u.usleep < monstermoves && !rn2(10)) {
@@ -917,7 +917,7 @@ hitmu(mtmp, mattk)
if (dmg < 1) dmg = 1;
if (dmg > 1) exercise(A_STR, FALSE);
u.mh -= dmg;
flags.botl = 1;
context.botl = 1;
dmg = 0;
if(cloneu())
You("divide as %s hits you!",mon_nam(mtmp));
@@ -1354,7 +1354,7 @@ dopois:
if (!rn2(3)) exercise(A_STR, TRUE);
if (!rn2(3)) exercise(A_CON, TRUE);
if (Sick) make_sick(0L, (char *) 0, FALSE, SICK_ALL);
flags.botl = 1;
context.botl = 1;
if (goaway) {
mongone(mtmp);
return 2;
@@ -1485,7 +1485,7 @@ dopois:
} else if (!Slimed) {
You("don't feel very well.");
Slimed = 10L;
flags.botl = 1;
context.botl = 1;
killer_format = KILLED_BY_AN;
delayed_killer = mtmp->data->mname;
} else
@@ -1553,7 +1553,7 @@ dopois:
*hpmax_p = lowerlimit;
else /* unlikely... */
; /* already at or below minimum threshold; do nothing */
flags.botl = 1;
context.botl = 1;
}
mdamageu(mtmp, dmg);
@@ -2003,7 +2003,7 @@ mdamageu(mtmp, n) /* mtmp hits you for n points damage */
register struct monst *mtmp;
register int n;
{
flags.botl = 1;
context.botl = 1;
if (Upolyd) {
u.mh -= n;
if (u.mh < 1) rehumanize();
@@ -2237,12 +2237,12 @@ register struct monst *mon;
case 1: You("are down in the dumps.");
(void) adjattrib(A_CON, -1, TRUE);
exercise(A_CON, FALSE);
flags.botl = 1;
context.botl = 1;
break;
case 2: Your("senses are dulled.");
(void) adjattrib(A_WIS, -1, TRUE);
exercise(A_WIS, FALSE);
flags.botl = 1;
context.botl = 1;
break;
case 3:
if (!resists_drli(&youmonst)) {
@@ -2274,12 +2274,12 @@ register struct monst *mon;
case 1: You_feel("good enough to do it again.");
(void) adjattrib(A_CON, 1, TRUE);
exercise(A_CON, TRUE);
flags.botl = 1;
context.botl = 1;
break;
case 2: You("will always remember %s...", noit_mon_nam(mon));
(void) adjattrib(A_WIS, 1, TRUE);
exercise(A_WIS, TRUE);
flags.botl = 1;
context.botl = 1;
break;
case 3: pline("That was a very educational experience.");
pluslvl(FALSE);
@@ -2289,7 +2289,7 @@ register struct monst *mon;
u.uhp = u.uhpmax;
if (Upolyd) u.mh = u.mhmax;
exercise(A_STR, TRUE);
flags.botl = 1;
context.botl = 1;
break;
}
}
@@ -2321,7 +2321,7 @@ register struct monst *mon;
noit_Monnam(mon), cost, currency(cost));
u.ugold -= cost;
mon->mgold += cost;
flags.botl = 1;
context.botl = 1;
}
#else
long cost;
@@ -2341,7 +2341,7 @@ register struct monst *mon;
pline("%s takes %ld %s for services rendered!",
noit_Monnam(mon), cost, currency(cost));
money2mon(mon, cost);
flags.botl = 1;
context.botl = 1;
}
#endif
}
@@ -2561,7 +2561,7 @@ cloneu()
mon->mhpmax = u.mhmax;
mon->mhp = u.mh / 2;
u.mh -= mon->mhp;
flags.botl = 1;
context.botl = 1;
return(mon);
}
+1 -1
View File
@@ -243,7 +243,7 @@ struct monst *mtmp;
}
(void) money2mon(mtmp, offer);
#endif
flags.botl = 1;
context.botl = 1;
return(offer);
}
+7 -7
View File
@@ -230,8 +230,8 @@ long num;
panic("splitobj"); /* can't split containers */
otmp = newobj(obj->oxlth + obj->onamelth);
*otmp = *obj; /* copies whole structure */
otmp->o_id = flags.ident++;
if (!otmp->o_id) otmp->o_id = flags.ident++; /* ident overflowed */
otmp->o_id = context.ident++;
if (!otmp->o_id) otmp->o_id = context.ident++; /* ident overflowed */
otmp->timed = 0; /* not timed, yet */
otmp->lamplit = 0; /* ditto */
otmp->owornmask = 0L; /* new object isn't worn */
@@ -332,8 +332,8 @@ register struct obj *otmp;
dummy = newobj(otmp->oxlth + otmp->onamelth);
*dummy = *otmp;
dummy->where = OBJ_FREE;
dummy->o_id = flags.ident++;
if (!dummy->o_id) dummy->o_id = flags.ident++; /* ident overflowed */
dummy->o_id = context.ident++;
if (!dummy->o_id) dummy->o_id = context.ident++; /* ident overflowed */
dummy->timed = 0;
if (otmp->oxlth)
(void)memcpy((genericptr_t)dummy->oextra,
@@ -365,8 +365,8 @@ boolean artif;
otmp = newobj(0);
*otmp = zeroobj;
otmp->age = monstermoves;
otmp->o_id = flags.ident++;
if (!otmp->o_id) otmp->o_id = flags.ident++; /* ident overflowed */
otmp->o_id = context.ident++;
if (!otmp->o_id) otmp->o_id = context.ident++; /* ident overflowed */
otmp->quan = 1L;
otmp->oclass = let;
otmp->otyp = otyp;
@@ -517,7 +517,7 @@ boolean artif;
}
break;
case AMULET_CLASS:
if (otmp->otyp == AMULET_OF_YENDOR) flags.made_amulet = TRUE;
if (otmp->otyp == AMULET_OF_YENDOR) context.made_amulet = TRUE;
if(rn2(10) && (otmp->otyp == AMULET_OF_STRANGULATION ||
otmp->otyp == AMULET_OF_CHANGE ||
otmp->otyp == AMULET_OF_RESTFUL_SLEEP)) {
+5 -5
View File
@@ -283,7 +283,7 @@ register struct monst *mtmp;
/* if polymorph or undead turning has killed this monster,
prevent the same attack beam from hitting its corpse */
if (flags.bypasses) bypass_obj(obj);
if (context.bypasses) bypass_obj(obj);
if (mtmp->mnamelth)
obj = oname(obj, NAME(mtmp));
@@ -484,7 +484,7 @@ struct monst *mon;
#ifdef STEED
if (mon == u.usteed) {
if (u.ugallop && flags.mv) {
if (u.ugallop && context.mv) {
/* average movement is 1.50 times normal */
mmove = ((rn2(2) ? 4 : 5) * mmove) / 3;
}
@@ -2075,7 +2075,7 @@ register struct monst *mtmp;
}
/* attacking your own quest leader will anger his or her guardians */
if (!flags.mon_moving && /* should always be the case here */
if (!context.mon_moving && /* should always be the case here */
mtmp->data == &mons[quest_info(MS_LEADER)]) {
struct monst *mon;
struct permonst *q_guardian = &mons[quest_info(MS_GUARDIAN)];
@@ -2103,7 +2103,7 @@ register struct monst *mtmp;
mtmp->meating = 0; /* assume there's no salvagable food left */
setmangry(mtmp);
if(mtmp->m_ap_type) seemimic(mtmp);
else if (flags.forcefight && !flags.mon_moving && mtmp->mundetected) {
else if (context.forcefight && !context.mon_moving && mtmp->mundetected) {
mtmp->mundetected = 0;
newsym(mtmp->mx, mtmp->my);
}
@@ -2498,7 +2498,7 @@ boolean msg; /* "The oldmon turns into a newmon!" */
mon_break_armor(mtmp, polyspot);
if (!(mtmp->misc_worn_check & W_ARMG))
mselftouch(mtmp, "No longer petrify-resistant, ",
!flags.mon_moving);
!context.mon_moving);
m_dowear(mtmp, FALSE);
/* This ought to re-test can_carry() on each item in the inventory
+1 -1
View File
@@ -63,7 +63,7 @@ register struct monst *mtmp;
}
} else if (is_digging()) {
/* chewing, wand/spell of digging are checked elsewhere */
watch_dig(mtmp, digging.pos.x, digging.pos.y, FALSE);
watch_dig(mtmp, context.digging.pos.x, context.digging.pos.y, FALSE);
}
}
}
+1 -1
View File
@@ -205,7 +205,7 @@ boolean verbose; /* give message(s) even when you can't see what happened */
(nonliving(mtmp->data) || !canspotmon(mtmp))
? "destroyed" : "killed");
/* don't blame hero for unknown rolling boulder trap */
if (!flags.mon_moving &&
if (!context.mon_moving &&
(otmp->otyp != BOULDER || range >= 0 || !otmp->otrapped))
xkilled(mtmp,0);
else mondied(mtmp);
+4 -4
View File
@@ -72,8 +72,8 @@ struct obj *obj;
potion_descr = OBJ_DESCR(objects[obj->otyp]);
if (potion_descr && !strcmp(potion_descr, "milky")) {
if ( flags.ghost_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(flags.ghost_count))) {
if ( context.ghost_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(context.ghost_count))) {
if (!enexto(&cc, mon->mx, mon->my, &mons[PM_GHOST])) return 0;
mquaffmsg(mon, obj);
m_useup(mon, obj);
@@ -95,8 +95,8 @@ struct obj *obj;
}
}
if (potion_descr && !strcmp(potion_descr, "smoky") &&
flags.djinni_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(flags.djinni_count))) {
context.djinni_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(context.djinni_count))) {
if (!enexto(&cc, mon->mx, mon->my, &mons[PM_DJINNI])) return 0;
mquaffmsg(mon, obj);
m_useup(mon, obj);
+2 -2
View File
@@ -2107,13 +2107,13 @@ boolean from_user;
if (from_user)
pline("%d gold piece%s.", cnt, plur(cnt));
u.ugold += cnt;
flags.botl=1;
context.botl=1;
return (&zeroobj);
#else
otmp = mksobj(GOLD_PIECE, FALSE, FALSE);
otmp->quan = cnt;
otmp->owt = weight(otmp);
flags.botl=1;
context.botl=1;
return (otmp);
#endif
}
+1 -3
View File
@@ -524,8 +524,6 @@ initoptions()
warnsyms[i] = def_warnsyms[i].sym;
iflags.bouldersym = 0;
iflags.travelcc.x = iflags.travelcc.y = -1;
flags.warnlevel = 1;
flags.warntype = 0L;
/* assert( sizeof flags.inv_order == sizeof def_inv_order ); */
(void)memcpy((genericptr_t)flags.inv_order,
@@ -2162,7 +2160,7 @@ goodfruit:
|| (boolopt[i].addr) == &flags.showscore
#endif
)
flags.botl = TRUE;
context.botl = TRUE;
else if ((boolopt[i].addr) == &flags.invlet_constant) {
if (flags.invlet_constant) reassign();
+11 -11
View File
@@ -268,7 +268,7 @@ boolean picked_some;
/* If there are objects here, take a look. */
if (ct) {
if (flags.run) nomul(0);
if (context.run) nomul(0);
flush_screen(1);
(void) look_here(ct, picked_some);
} else {
@@ -400,7 +400,7 @@ int what; /* should be a long */
if (!u.uswallow) {
struct trap *ttmp = t_at(u.ux, u.uy);
/* no auto-pick if no-pick move, nothing there, or in a pool */
if (autopickup && (flags.nopick || !OBJ_AT(u.ux, u.uy) ||
if (autopickup && (context.nopick || !OBJ_AT(u.ux, u.uy) ||
(is_pool(u.ux, u.uy) && !Underwater) || is_lava(u.ux, u.uy))) {
read_engr_at(u.ux, u.uy);
return (0);
@@ -408,7 +408,7 @@ int what; /* should be a long */
/* no pickup if levitating & not on air or water level */
if (!can_reach_floor()) {
if ((multi && !flags.run) || (autopickup && !flags.pickup))
if ((multi && !context.run) || (autopickup && !flags.pickup))
read_engr_at(u.ux, u.uy);
return (0);
}
@@ -424,11 +424,11 @@ int what; /* should be a long */
return(0);
}
}
/* multi && !flags.run means they are in the middle of some other
/* multi && !context.run means they are in the middle of some other
* action, or possibly paralyzed, sleeping, etc.... and they just
* teleported onto the object. They shouldn't pick it up.
*/
if ((multi && !flags.run) || (autopickup && !flags.pickup)) {
if ((multi && !context.run) || (autopickup && !flags.pickup)) {
check_here(FALSE);
return (0);
}
@@ -441,7 +441,7 @@ int what; /* should be a long */
}
/* if there's anything here, stop running */
if (OBJ_AT(u.ux,u.uy) && flags.run && flags.run != 8 && !flags.nopick) nomul(0);
if (OBJ_AT(u.ux,u.uy) && context.run && context.run != 8 && !context.nopick) nomul(0);
}
add_valid_menu_class(0); /* reset */
@@ -1266,8 +1266,8 @@ boolean telekinesis; /* not picking it up directly by hand */
else
obj->quan -= count;
}
flags.botl = 1;
if (flags.run) nomul(0);
context.botl = 1;
if (context.run) nomul(0);
return 1;
#endif
} else if (obj->otyp == CORPSE) {
@@ -1312,7 +1312,7 @@ boolean telekinesis; /* not picking it up directly by hand */
#ifdef GOLDOBJ
/* Whats left of the special case for gold :-) */
if (obj->oclass == COIN_CLASS) flags.botl = 1;
if (obj->oclass == COIN_CLASS) context.botl = 1;
#endif
if (obj->quan != count && obj->otyp != LOADSTONE)
obj = splitobj(obj, count);
@@ -1386,7 +1386,7 @@ encumber_msg()
newcap == 4 ? "can barely" : "can't even");
break;
}
flags.botl = 1;
context.botl = 1;
} else if(oldcap > newcap) {
switch(newcap) {
case 0: Your("movements are now unencumbered.");
@@ -1399,7 +1399,7 @@ encumber_msg()
stagger(youmonst.data, "stagger"));
break;
}
flags.botl = 1;
context.botl = 1;
}
oldcap = newcap;
+10 -10
View File
@@ -211,7 +211,7 @@ dead: /* we come directly here if their experience level went to 0 or less */
Your("body transforms, but there is still slime on you.");
Slimed = 10L;
}
flags.botl = 1;
context.botl = 1;
see_monsters();
(void) encumber_msg();
}
@@ -411,11 +411,11 @@ int mntmp;
mntmp == PM_SALAMANDER || mntmp == PM_FLAMING_SPHERE) {
pline_The("slime burns away!");
Slimed = 0L;
flags.botl = 1;
context.botl = 1;
} else if (mntmp == PM_GREEN_SLIME) {
/* do it silently */
Slimed = 0L;
flags.botl = 1;
context.botl = 1;
}
}
if (nohands(youmonst.data)) Glib = 0;
@@ -563,7 +563,7 @@ int mntmp;
You("orient yourself on the web.");
u.utrap = 0;
}
flags.botl = 1;
context.botl = 1;
vision_full_recalc = 1;
see_monsters();
exercise(A_CON, FALSE);
@@ -736,7 +736,7 @@ rehumanize()
if (!uarmg) selftouch("No longer petrify-resistant, you");
nomul(0);
flags.botl = 1;
context.botl = 1;
vision_full_recalc = 1;
(void) encumber_msg();
}
@@ -755,7 +755,7 @@ dobreathe()
return(0);
}
u.uen -= 15;
flags.botl = 1;
context.botl = 1;
if (!getdir((char *)0)) return(0);
@@ -921,7 +921,7 @@ dosummon()
return(0);
}
u.uen -= 10;
flags.botl = 1;
context.botl = 1;
You("call upon your brethren for help!");
exercise(A_WIS, TRUE);
@@ -960,7 +960,7 @@ dogaze()
return(0);
}
u.uen -= 15;
flags.botl = 1;
context.botl = 1;
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
if (DEADMONSTER(mtmp)) continue;
@@ -1086,7 +1086,7 @@ domindblast()
return(0);
}
u.uen -= 10;
flags.botl = 1;
context.botl = 1;
You("concentrate.");
pline("A wave of psychic energy pours out.");
@@ -1286,7 +1286,7 @@ int damtype, dam;
if (heal && (u.mh < u.mhmax)) {
u.mh += heal;
if (u.mh > u.mhmax) u.mh = u.mhmax;
flags.botl = 1;
context.botl = 1;
pline("Strangely, you feel better than before.");
exercise(A_STR, TRUE);
}
+22 -22
View File
@@ -64,7 +64,7 @@ boolean talk;
You_feel("less %s now.",
Hallucination ? "trippy" : "confused");
}
if ((xtime && !old) || (!xtime && old)) flags.botl = TRUE;
if ((xtime && !old) || (!xtime && old)) context.botl = TRUE;
set_itimeout(&HConfusion, xtime);
}
@@ -91,7 +91,7 @@ boolean talk;
You("%s...", stagger(youmonst.data, "stagger"));
}
}
if ((!xtime && old) || (xtime && !old)) flags.botl = TRUE;
if ((!xtime && old) || (xtime && !old)) context.botl = TRUE;
set_itimeout(&HStun, xtime);
}
@@ -117,7 +117,7 @@ int type;
}
set_itimeout(&Sick, xtime);
u.usick_type |= type;
flags.botl = TRUE;
context.botl = TRUE;
} else if (old && (type & u.usick_type)) {
/* was sick, now not */
u.usick_type &= ~type;
@@ -128,7 +128,7 @@ int type;
if (talk) pline("What a relief!");
Sick = 0L; /* set_itimeout(&Sick, 0L) */
}
flags.botl = TRUE;
context.botl = TRUE;
}
if (Sick) {
@@ -231,7 +231,7 @@ boolean talk;
set_itimeout(&Blinded, xtime);
if (u_could_see ^ can_see_now) { /* one or the other but not both */
flags.botl = 1;
context.botl = 1;
vision_full_recalc = 1; /* blindness just got toggled */
if (Blind_telepat || Infravision) see_monsters();
}
@@ -292,7 +292,7 @@ long mask; /* nonzero if resistance status should change by mask */
(eg. Qt windowport's equipped items display) */
update_inventory();
flags.botl = 1;
context.botl = 1;
if (talk) pline(message, verb);
}
}
@@ -364,14 +364,14 @@ dodrink()
potion_descr = OBJ_DESCR(objects[otmp->otyp]);
if (potion_descr) {
if (!strcmp(potion_descr, "milky") &&
flags.ghost_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(flags.ghost_count))) {
context.ghost_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(context.ghost_count))) {
ghost_from_bottle();
useup(otmp);
return(1);
} else if (!strcmp(potion_descr, "smoky") &&
flags.djinni_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(flags.djinni_count))) {
context.djinni_count < MAXMONNO &&
!rn2(POTION_OCCUPANT_CHANCE(context.djinni_count))) {
djinni_from_bottle(otmp);
useup(otmp);
return(1);
@@ -430,7 +430,7 @@ peffects(otmp)
if (i == A_STR && u.uhs >= 3) --lim; /* WEAK */
if (ABASE(i) < lim) {
ABASE(i) = lim;
flags.botl = 1;
context.botl = 1;
/* only first found if not blessed */
if (!otmp->blessed) break;
}
@@ -856,7 +856,7 @@ peffects(otmp)
u.uen += (otmp->cursed) ? -num : num;
if(u.uenmax <= 0) u.uenmax = 0;
if(u.uen <= 0) u.uen = 0;
flags.botl = 1;
context.botl = 1;
exercise(A_WIS, TRUE);
}
break;
@@ -921,7 +921,7 @@ healup(nhp, nxtra, curesick, cureblind)
}
if(cureblind) make_blinded(0L,TRUE);
if(curesick) make_sick(0L, (char *) 0, TRUE, SICK_ALL);
flags.botl = 1;
context.botl = 1;
return;
}
@@ -1206,23 +1206,23 @@ register struct obj *obj;
ABASE(i)++;
/* only first found if not blessed */
isdone = !(obj->blessed);
flags.botl = 1;
context.botl = 1;
}
if(++i >= A_MAX) i = 0;
}
}
break;
case POT_FULL_HEALING:
if (Upolyd && u.mh < u.mhmax) u.mh++, flags.botl = 1;
if (u.uhp < u.uhpmax) u.uhp++, flags.botl = 1;
if (Upolyd && u.mh < u.mhmax) u.mh++, context.botl = 1;
if (u.uhp < u.uhpmax) u.uhp++, context.botl = 1;
/*FALL THROUGH*/
case POT_EXTRA_HEALING:
if (Upolyd && u.mh < u.mhmax) u.mh++, flags.botl = 1;
if (u.uhp < u.uhpmax) u.uhp++, flags.botl = 1;
if (Upolyd && u.mh < u.mhmax) u.mh++, context.botl = 1;
if (u.uhp < u.uhpmax) u.uhp++, context.botl = 1;
/*FALL THROUGH*/
case POT_HEALING:
if (Upolyd && u.mh < u.mhmax) u.mh++, flags.botl = 1;
if (u.uhp < u.uhpmax) u.uhp++, flags.botl = 1;
if (Upolyd && u.mh < u.mhmax) u.mh++, context.botl = 1;
if (u.uhp < u.uhpmax) u.uhp++, context.botl = 1;
exercise(A_CON, TRUE);
break;
case POT_SICKNESS:
@@ -1232,7 +1232,7 @@ register struct obj *obj;
} else {
if (u.uhp <= 5) u.uhp = 1; else u.uhp -= 5;
}
flags.botl = 1;
context.botl = 1;
exercise(A_CON, FALSE);
}
break;
@@ -1983,7 +1983,7 @@ struct monst *mon, /* monster being split */
if (mtmp2) {
mtmp2->mhpmax = u.mhmax / 2;
u.mhmax -= mtmp2->mhpmax;
flags.botl = 1;
context.botl = 1;
You("multiply%s!", reason);
}
} else {
+9 -9
View File
@@ -278,13 +278,13 @@ register int trouble;
case TROUBLE_STONED:
You_feel("more limber.");
Stoned = 0;
flags.botl = 1;
context.botl = 1;
delayed_killer = 0;
break;
case TROUBLE_SLIMED:
pline_The("slime disappears.");
Slimed = 0;
flags.botl = 1;
context.botl = 1;
delayed_killer = 0;
break;
case TROUBLE_STRANGLED:
@@ -294,7 +294,7 @@ register int trouble;
}
You("can breathe again.");
Strangled = 0;
flags.botl = 1;
context.botl = 1;
break;
case TROUBLE_LAVA:
You("are back on solid ground.");
@@ -310,7 +310,7 @@ register int trouble;
case TROUBLE_HUNGRY:
Your("%s feels content.", body_part(STOMACH));
init_uhunger();
flags.botl = 1;
context.botl = 1;
break;
case TROUBLE_SICK:
You_feel("better.");
@@ -329,11 +329,11 @@ register int trouble;
if (u.uhpmax < u.ulevel * 5 + 11) u.uhpmax += rnd(5);
if (u.uhpmax <= 5) u.uhpmax = 5+1;
u.uhp = u.uhpmax;
flags.botl = 1;
context.botl = 1;
break;
case TROUBLE_COLLAPSING:
ABASE(A_STR) = AMAX(A_STR);
flags.botl = 1;
context.botl = 1;
break;
case TROUBLE_STUCK_IN_WALL:
Your("surroundings change.");
@@ -415,7 +415,7 @@ decurse:
for(i=0; i<A_MAX; i++) {
if(ABASE(i) < AMAX(i)) {
ABASE(i) = AMAX(i);
flags.botl = 1;
context.botl = 1;
}
}
(void) encumber_msg();
@@ -935,7 +935,7 @@ pleased(g_align)
if (u.uhunger < 900) init_uhunger();
if (u.uluck < 0) u.uluck = 0;
make_blinded(0L,TRUE);
flags.botl = 1;
context.botl = 1;
break;
case 4: {
register struct obj *otmp;
@@ -1361,7 +1361,7 @@ verbalize("In return for thy service, I grant thee the gift of Immortality!");
else
u.ualign.type = u.ualignbase[A_CURRENT] = altaralign;
u.ublessed = 0;
flags.botl = 1;
context.botl = 1;
You("have a sudden sense of a new direction.");
/* Beware, Conversion is costly */
+1 -1
View File
@@ -447,7 +447,7 @@ register struct monst *priest;
else
u.ugold = 1L;
priest->mgold -= u.ugold;
flags.botl = 1;
context.botl = 1;
#else
if(!money_cnt(invent)) {
if(coaligned && !strayed) {
+1 -1
View File
@@ -1065,7 +1065,7 @@ register struct obj *sobj;
else
u.uen = (u.uenmax += d(5,4));
}
flags.botl = 1;
context.botl = 1;
break;
}
known = TRUE;
+2 -2
View File
@@ -852,7 +852,7 @@ int radius, ttl;
tmprect.hy--;
}
ff->ttl = ttl;
if (!in_mklev && !flags.mon_moving)
if (!in_mklev && !context.mon_moving)
set_heros_fault(ff); /* assume player has created it */
/* ff->can_enter_f = enter_force_field; */
/* ff->can_leave_f = enter_force_field; */
@@ -971,7 +971,7 @@ int damage;
tmprect.hy--;
}
cloud->ttl = rn1(3,4);
if (!in_mklev && !flags.mon_moving)
if (!in_mklev && !context.mon_moving)
set_heros_fault(cloud); /* assume player has created it */
cloud->inside_f = INSIDE_GAS_CLOUD;
cloud->expire_f = EXPIRE_GAS_CLOUD;
+10 -5
View File
@@ -211,7 +211,7 @@ boolean ghostly, frozen;
mread(fd, (genericptr_t) otmp,
(unsigned) xl + sizeof(struct obj));
if (ghostly) {
unsigned nid = flags.ident++;
unsigned nid = context.ident++;
add_id_mapping(otmp->o_id, nid);
otmp->o_id = nid;
}
@@ -232,7 +232,13 @@ boolean ghostly, frozen;
otmp3->ocontainer = otmp;
}
if (otmp->bypass) otmp->bypass = 0;
if (!ghostly) {
/* fix the pointers */
if (context.victual.o_id == otmp->o_id)
context.victual.piece = otmp;
if (context.tin.o_id == otmp->o_id)
context.tin.tin = otmp;
}
otmp2 = otmp;
}
if(first && otmp2->nobj){
@@ -260,7 +266,7 @@ boolean ghostly;
else mtmp2->nmon = mtmp;
mread(fd, (genericptr_t) mtmp, (unsigned) xl + sizeof(struct monst));
if (ghostly) {
unsigned nid = flags.ident++;
unsigned nid = context.ident++;
add_id_mapping(mtmp->m_id, nid);
mtmp->m_id = nid;
}
@@ -371,9 +377,8 @@ unsigned int *stuckid, *steedid; /* STEED */
#endif
return FALSE;
}
mread(fd, (genericptr_t) &context, sizeof(struct context_info));
mread(fd, (genericptr_t) &flags, sizeof(struct flag));
flags.bypasses = 0; /* never use the saved value of bypasses */
if (remember_discover) discover = remember_discover;
role_init(); /* Reset the initial role, race, gender, and alignment */
+1 -1
View File
@@ -355,7 +355,7 @@ register struct monst *oracl;
#else
money2mon(oracl, (long)u_pay);
#endif
flags.botl = 1;
context.botl = 1;
add_xpts = 0; /* first oracle of each type gives experience points */
if (u_pay == minor_cost) {
outrumor(1, BY_ORACLE);
+12 -1
View File
@@ -284,6 +284,7 @@ register int fd, mode;
#endif
uid = getuid();
bwrite(fd, (genericptr_t) &uid, sizeof uid);
bwrite(fd, (genericptr_t) &context, sizeof(struct context_info));
bwrite(fd, (genericptr_t) &flags, sizeof(struct flag));
#ifndef GOLDOBJ
if (u.ugold) {
@@ -872,7 +873,17 @@ register struct obj *otmp;
if (Has_contents(otmp))
saveobjchn(fd,otmp->cobj,mode);
if (release_data(mode)) {
if (otmp->oclass == FOOD_CLASS) food_disappears(otmp);
/* if (otmp->oclass == FOOD_CLASS) food_disappears(otmp); */
if (otmp == context.victual.piece) {
/* Store the o_id of the victual if mismatched */
if (context.victual.o_id != otmp->o_id)
context.victual.o_id = otmp->o_id;
}
if (otmp == context.tin.tin) {
/* Store the o_id of your tin */
if (context.tin.o_id != otmp->o_id)
context.tin.o_id = otmp->o_id;
}
if (otmp->oclass == SPBOOK_CLASS) book_disappears(otmp);
otmp->where = OBJ_FREE; /* set to free so dealloc will work */
otmp->timed = 0; /* not timed any more */
+9 -9
View File
@@ -107,7 +107,7 @@ long amount;
remove_worn_item(ygold, FALSE); /* quiver */
freeinv(ygold);
add_to_minv(mon, ygold);
flags.botl = 1;
context.botl = 1;
return amount;
}
@@ -142,7 +142,7 @@ long amount;
dropy(mongold);
} else {
addinv(mongold);
flags.botl = 1;
context.botl = 1;
}
}
@@ -855,7 +855,7 @@ register struct monst *shkp;
if (balance > 0) money2mon(shkp, balance);
else if (balance < 0) money2u(shkp, -balance);
#endif
flags.botl = 1;
context.botl = 1;
if(robbed) {
robbed -= tmp;
if(robbed < 0) robbed = 0L;
@@ -1339,7 +1339,7 @@ proceed:
eshkp->debit = 0L;
eshkp->loan = 0L;
You("pay that debt.");
flags.botl = 1;
context.botl = 1;
} else {
dtmp -= eshkp->credit;
eshkp->credit = 0L;
@@ -1353,7 +1353,7 @@ proceed:
eshkp->loan = 0L;
pline("That debt is partially offset by your credit.");
You("pay the remainder.");
flags.botl = 1;
context.botl = 1;
}
paid = TRUE;
}
@@ -1671,7 +1671,7 @@ int croaked;
if (eshkp->robbed < 0L) eshkp->robbed = 0L;
if (umoney > 0) money2mon(shkp, umoney);
#endif
flags.botl = 1;
context.botl = 1;
pline("%s %s all your possessions.",
shkname(shkp), takes);
taken = TRUE;
@@ -1684,7 +1684,7 @@ int croaked;
#else
money2mon(shkp, loss);
#endif
flags.botl = 1;
context.botl = 1;
pline("%s %s the %ld %s %sowed %s.",
Monnam(shkp), takes,
loss, currency(loss),
@@ -2301,7 +2301,7 @@ register struct monst *shkp;
if(bp->bquan > obj->quan){
otmp = newobj(0);
*otmp = *obj;
bp->bo_id = otmp->o_id = flags.ident++;
bp->bo_id = otmp->o_id = context.ident++;
otmp->where = OBJ_FREE;
otmp->quan = (bp->bquan -= obj->quan);
otmp->owt = 0; /* superfluous */
@@ -3528,7 +3528,7 @@ getcad:
#else
money2mon(shkp, cost_of_damage);
#endif
flags.botl = 1;
context.botl = 1;
pline("Mollified, %s accepts your restitution.",
shkname(shkp));
/* move shk back to his home loc */
+3 -3
View File
@@ -14,7 +14,7 @@ take_gold()
} else {
You("notice you have no gold!");
u.ugold = 0;
flags.botl = 1;
context.botl = 1;
}
#else
struct obj *otmp, *nobj;
@@ -30,7 +30,7 @@ take_gold()
You_feel("a strange sensation.");
} else {
You("notice you have no money!");
flags.botl = 1;
context.botl = 1;
}
#endif
}
@@ -187,7 +187,7 @@ dosit()
make_blinded(0L,TRUE);
make_sick(0L, (char *) 0, FALSE, SICK_ALL);
heal_legs();
flags.botl = 1;
context.botl = 1;
break;
case 5:
take_gold();
+3 -3
View File
@@ -316,7 +316,7 @@ register struct monst *mtmp;
growl_verb = growl_sound(mtmp);
if (growl_verb) {
pline("%s %s!", Monnam(mtmp), vtense((char *)0, growl_verb));
if(flags.run) nomul(0);
if(context.run) nomul(0);
wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 18);
}
}
@@ -357,7 +357,7 @@ register struct monst *mtmp;
}
if (yelp_verb) {
pline("%s %s!", Monnam(mtmp), vtense((char *)0, yelp_verb));
if(flags.run) nomul(0);
if(context.run) nomul(0);
wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 12);
}
}
@@ -389,7 +389,7 @@ register struct monst *mtmp;
}
if (whimper_verb) {
pline("%s %s.", Monnam(mtmp), vtense((char *)0, whimper_verb));
if(flags.run) nomul(0);
if(context.run) nomul(0);
wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 6);
}
}
+3 -3
View File
@@ -799,12 +799,12 @@ boolean atme;
if (confused || (rnd(100) > chance)) {
You("fail to cast the spell correctly.");
u.uen -= energy / 2;
flags.botl = 1;
context.botl = 1;
return(1);
}
u.uen -= energy;
flags.botl = 1;
context.botl = 1;
exercise(A_WIS, TRUE);
/* pseudo is a temporary "false" object containing the spell stats */
pseudo = mksobj(spellid(spell), FALSE, FALSE);
@@ -928,7 +928,7 @@ boolean atme;
if (Slimed) {
pline_The("slime disappears!");
Slimed = 0;
/* flags.botl = 1; -- healup() handles this */
/* context.botl = 1; -- healup() handles this */
}
healup(0, 0, TRUE, FALSE);
break;
+2 -2
View File
@@ -60,7 +60,7 @@ register struct monst *mtmp;
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
mtmp->mavenge = 1;
monflee(mtmp, 0, FALSE, FALSE);
flags.botl = 1;
context.botl = 1;
}
}
@@ -131,7 +131,7 @@ register struct monst *mtmp;
Your("purse feels lighter.");
if (!tele_restrict(mtmp)) (void) rloc(mtmp, FALSE);
monflee(mtmp, 0, FALSE, FALSE);
flags.botl = 1;
context.botl = 1;
}
}
#endif /* GOLDOBJ */
+2 -2
View File
@@ -608,11 +608,11 @@ dismount_steed(reason)
in_steed_dismounting = TRUE;
(void) float_down(0L, W_SADDLE);
in_steed_dismounting = FALSE;
flags.botl = 1;
context.botl = 1;
(void)encumber_msg();
vision_full_recalc = 1;
} else
flags.botl = 1;
context.botl = 1;
/* polearms behave differently when not mounted */
if (uwep && is_pole(uwep)) unweapon = TRUE;
return;
+2 -2
View File
@@ -549,7 +549,7 @@ dotele()
return(0);
} else {
u.uen -= energy;
flags.botl = 1;
context.botl = 1;
}
}
@@ -777,7 +777,7 @@ level_tele()
schedule_goto(&newlevel, FALSE, FALSE, 0, (char *)0, (char *)0);
/* in case player just read a scroll and is about to be asked to
call it something, we can't defer until the end of the turn */
if (u.utotype && !flags.mon_moving) deferred_goto();
if (u.utotype && !context.mon_moving) deferred_goto();
}
void
+1 -1
View File
@@ -146,7 +146,7 @@ burn_away_slime()
if (Slimed) {
pline_The("slime that covers you is burned away!");
Slimed = 0L;
flags.botl = 1;
context.botl = 1;
}
return;
}
+8 -7
View File
@@ -271,7 +271,7 @@ register int x, y, typ;
IS_DOOR(lev->typ) || IS_WALL(lev->typ)))
add_damage(x, y, /* schedule repair */
((IS_DOOR(lev->typ) || IS_WALL(lev->typ))
&& !flags.mon_moving) ? 200L : 0L);
&& !context.mon_moving) ? 200L : 0L);
lev->doormask = 0; /* subsumes altarmask, icedpool... */
if (IS_ROOM(lev->typ)) /* && !IS_AIR(lev->typ) */
lev->typ = ROOM;
@@ -393,7 +393,7 @@ int *fail_reason;
struct monst *mon = 0;
struct obj *item;
coord cc;
boolean historic = (Role_if(PM_ARCHEOLOGIST) && !flags.mon_moving && (statue->spe & STATUE_HISTORIC));
boolean historic = (Role_if(PM_ARCHEOLOGIST) && !context.mon_moving && (statue->spe & STATUE_HISTORIC));
char statuename[BUFSZ];
Strcpy(statuename,the(xname(statue)));
@@ -1325,8 +1325,9 @@ int style;
launched (perhaps a monster triggered it), destroy context so that
next dig attempt never thinks you're resuming previous effort */
if ((otyp == BOULDER || otyp == STATUE) &&
singleobj->ox == digging.pos.x && singleobj->oy == digging.pos.y)
(void) memset((genericptr_t)&digging, 0, sizeof digging);
singleobj->ox == context.digging.pos.x &&
singleobj->oy == context.digging.pos.y)
(void) memset((genericptr_t)&context.digging, 0, sizeof(struct dig_info));
dist = distmin(x1,y1,x2,y2);
bhitpos.x = x1;
@@ -2415,11 +2416,11 @@ struct obj *box; /* null for floor trap */
}
if (alt > num) num = alt;
if (u.mhmax > mons[u.umonnum].mlevel)
u.mhmax -= rn2(min(u.mhmax,num + 1)), flags.botl = 1;
u.mhmax -= rn2(min(u.mhmax,num + 1)), context.botl = 1;
} else {
num = d(2,4);
if (u.uhpmax > u.ulevel)
u.uhpmax -= rn2(min(u.uhpmax,num + 1)), flags.botl = 1;
u.uhpmax -= rn2(min(u.uhpmax,num + 1)), context.botl = 1;
}
if (!num)
You("are uninjured.");
@@ -2924,7 +2925,7 @@ register int n;
if(u.uenmax < 0) u.uenmax = 0;
u.uen = 0;
}
flags.botl = 1;
context.botl = 1;
}
int
+8 -8
View File
@@ -106,7 +106,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
if (u.uswallow && mtmp == u.ustuck) return FALSE;
if (flags.forcefight) {
if (context.forcefight) {
/* Do this in the caller, after we checked that the monster
* didn't die from the blow. Reason: putting the 'I' there
* causes the hero to forget the square's contents since
@@ -202,7 +202,7 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
if (canspotmon(mtmp)) {
Sprintf(qbuf, "Really attack %s?", mon_nam(mtmp));
if (yn(qbuf) != 'y') {
flags.move = 0;
context.move = 0;
return(TRUE);
}
}
@@ -318,7 +318,7 @@ register struct monst *mtmp;
* you'll usually just swap places if this is a movement command
*/
/* Intelligent chaotic weapons (Stormbringer) want blood */
if (is_safepet(mtmp) && !flags.forcefight) {
if (is_safepet(mtmp) && !context.forcefight) {
if (!uwep || uwep->oartifact != ART_STORMBRINGER) {
/* there are some additional considerations: this won't work
* if in a shop or Punished or you miss a random roll or
@@ -411,7 +411,7 @@ atk_done:
* and it returned 0 (it's okay to attack), and the monster didn't
* evade.
*/
if (flags.forcefight && mtmp->mhp > 0 && !canspotmon(mtmp) &&
if (context.forcefight && mtmp->mhp > 0 && !canspotmon(mtmp) &&
!glyph_is_invisible(levl[u.ux+u.dx][u.uy+u.dy].glyph) &&
!(u.uswallow && mtmp == u.ustuck))
map_invisible(u.ux+u.dx, u.uy+u.dy);
@@ -1553,7 +1553,7 @@ register struct attack *mattk;
ABASE(A_INT) += rnd(4);
if (ABASE(A_INT) > AMAX(A_INT))
ABASE(A_INT) = AMAX(A_INT);
flags.botl = 1;
context.botl = 1;
}
exercise(A_WIS, TRUE);
break;
@@ -1821,7 +1821,7 @@ register struct attack *mattk;
The(mdef->data->mname));
if (!Unchanging) {
Slimed = 5L;
flags.botl = 1;
context.botl = 1;
}
} else
exercise(A_CON, TRUE);
@@ -2490,7 +2490,7 @@ struct obj *otmp; /* source of flash */
pline("%s %s!", Monnam(mtmp), amt > mtmp->mhp / 2 ?
"wails in agony" : "cries out in pain");
if ((mtmp->mhp -= amt) <= 0) {
if (flags.mon_moving)
if (context.mon_moving)
monkilled(mtmp, (char *)0, AD_BLND);
else
killed(mtmp);
@@ -2499,7 +2499,7 @@ struct obj *otmp; /* source of flash */
}
}
if (mtmp->mhp > 0) {
if (!flags.mon_moving) setmangry(mtmp);
if (!context.mon_moving) setmangry(mtmp);
if (tmp < 9 && !mtmp->isshk && rn2(4)) {
if (rn2(4))
monflee(mtmp, rnd(100), FALSE, TRUE);
+4 -4
View File
@@ -73,7 +73,7 @@ amulet()
}
}
if (!flags.no_of_wizards)
if (!context.no_of_wizards)
return;
/* find Wizard, and wake him if necessary */
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
@@ -260,7 +260,7 @@ strategy(mtmp)
break;
}
if(flags.made_amulet)
if(context.made_amulet)
if((strat = target_on(M3_WANTSAMUL, mtmp)) != STRAT_NONE)
return(strat);
@@ -468,7 +468,7 @@ resurrect()
long elapsed;
const char *verb;
if (!flags.no_of_wizards) {
if (!context.no_of_wizards) {
/* make a new Wizard */
verb = "kill";
mtmp = makemon(&mons[PM_WIZARD_OF_YENDOR], u.ux, u.uy, MM_NOWAIT);
@@ -537,7 +537,7 @@ intervene()
void
wizdead()
{
flags.no_of_wizards--;
context.no_of_wizards--;
if (!u.uevent.udemigod) {
u.uevent.udemigod = TRUE;
u.udg_cnt = rn1(250, 50);
+1 -1
View File
@@ -377,7 +377,7 @@ cutworm(worm, x, y, weap)
/* Create the second worm. */
new_worm = newmonst(0);
*new_worm = *worm; /* make a copy of the old worm */
new_worm->m_id = flags.ident++; /* make sure it has a unique id */
new_worm->m_id = context.ident++; /* make sure it has a unique id */
new_worm->wormno = new_wnum; /* affix new worm number */
if (worm->mtame)
+2 -2
View File
@@ -579,7 +579,7 @@ clear_bypasses()
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
otmp->bypass = 0;
}
flags.bypasses = FALSE;
context.bypasses = FALSE;
}
void
@@ -587,7 +587,7 @@ bypass_obj(obj)
struct obj *obj;
{
obj->bypass = 1;
flags.bypasses = TRUE;
context.bypasses = TRUE;
}
void
+20 -20
View File
@@ -155,7 +155,7 @@ struct obj *otmp;
if(dbldam) dmg *= 2;
if (otyp == SPE_TURN_UNDEAD)
dmg += spell_damage_bonus();
flags.bypasses = TRUE; /* for make_corpse() */
context.bypasses = TRUE; /* for make_corpse() */
if (!resist(mtmp, otmp->oclass, dmg, NOTELL)) {
if (mtmp->mhp > 0) monflee(mtmp, 0, FALSE, TRUE);
}
@@ -180,7 +180,7 @@ struct obj *otmp;
/* dropped inventory shouldn't be hit by this zap */
for (obj = mtmp->minvent; obj; obj = obj->nobj)
bypass_obj(obj);
/* flags.bypasses = TRUE; ## for make_corpse() */
/* context.bypasses = TRUE; ## for make_corpse() */
/* no corpse after system shock */
xkilled(mtmp, 3);
} else if (newcham(mtmp, (struct permonst *)0,
@@ -801,19 +801,19 @@ register struct obj *obj;
case RIN_GAIN_STRENGTH:
if ((obj->owornmask & W_RING) && u_ring) {
ABON(A_STR) -= obj->spe;
flags.botl = 1;
context.botl = 1;
}
break;
case RIN_GAIN_CONSTITUTION:
if ((obj->owornmask & W_RING) && u_ring) {
ABON(A_CON) -= obj->spe;
flags.botl = 1;
context.botl = 1;
}
break;
case RIN_ADORNMENT:
if ((obj->owornmask & W_RING) && u_ring) {
ABON(A_CHA) -= obj->spe;
flags.botl = 1;
context.botl = 1;
}
break;
case RIN_INCREASE_ACCURACY:
@@ -827,14 +827,14 @@ register struct obj *obj;
case GAUNTLETS_OF_DEXTERITY:
if ((obj->owornmask & W_ARMG) && (obj == uarmg)) {
ABON(A_DEX) -= obj->spe;
flags.botl = 1;
context.botl = 1;
}
break;
case HELM_OF_BRILLIANCE:
if ((obj->owornmask & W_ARMH) && (obj == uarmh)) {
ABON(A_INT) -= obj->spe;
ABON(A_WIS) -= obj->spe;
flags.botl = 1;
context.botl = 1;
}
break;
/* case RIN_PROTECTION: not needed */
@@ -917,19 +917,19 @@ register struct obj *obj;
case RIN_GAIN_STRENGTH:
if ((obj->owornmask & W_RING) && u_ring) {
ABON(A_STR)--;
flags.botl = 1;
context.botl = 1;
}
break;
case RIN_GAIN_CONSTITUTION:
if ((obj->owornmask & W_RING) && u_ring) {
ABON(A_CON)--;
flags.botl = 1;
context.botl = 1;
}
break;
case RIN_ADORNMENT:
if ((obj->owornmask & W_RING) && u_ring) {
ABON(A_CHA)--;
flags.botl = 1;
context.botl = 1;
}
break;
case RIN_INCREASE_ACCURACY:
@@ -944,17 +944,17 @@ register struct obj *obj;
if ((obj->owornmask & W_ARMH) && (obj == uarmh)) {
ABON(A_INT)--;
ABON(A_WIS)--;
flags.botl = 1;
context.botl = 1;
}
break;
case GAUNTLETS_OF_DEXTERITY:
if ((obj->owornmask & W_ARMG) && (obj == uarmg)) {
ABON(A_DEX)--;
flags.botl = 1;
context.botl = 1;
}
break;
case RIN_PROTECTION:
flags.botl = 1;
context.botl = 1;
break;
}
if (carried(obj)) update_inventory();
@@ -1444,13 +1444,13 @@ struct obj *obj, *otmp;
* immediately revived by the same effect.
*
* The bypass bit on all objects is reset each turn, whenever
* flags.bypasses is set.
* context.bypasses is set.
*
* We check the obj->bypass bit above AND flags.bypasses
* We check the obj->bypass bit above AND context.bypasses
* as a safeguard against any stray occurrence left in an obj
* struct someplace, although that should never happen.
*/
if (flags.bypasses)
if (context.bypasses)
return 0;
else {
#ifdef DEBUG
@@ -1526,7 +1526,7 @@ struct obj *obj, *otmp;
else if (obj->otyp == STATUE)
(void) break_statue(obj);
else {
if (!flags.mon_moving)
if (!context.mon_moving)
(void)hero_breaks(obj, obj->ox, obj->oy, FALSE);
else
(void)breaks(obj, obj->ox, obj->oy);
@@ -2206,7 +2206,7 @@ boolean youattack, allow_cancel_kill, self_cancel;
otmp; otmp = otmp->nobj)
cancel_item(otmp);
if (youdefend) {
flags.botl = 1; /* potential AC change */
context.botl = 1; /* potential AC change */
find_ac();
}
}
@@ -3711,7 +3711,7 @@ fracture_rock(obj) /* fractured by pick-axe or wand of striking */
register struct obj *obj; /* no texts here! */
{
/* A little Sokoban guilt... */
if (obj->otyp == BOULDER && In_sokoban(&u.uz) && !flags.mon_moving)
if (obj->otyp == BOULDER && In_sokoban(&u.uz) && !context.mon_moving)
change_luck(-1);
obj->otyp = ROCK;
@@ -3749,7 +3749,7 @@ register struct obj *obj;
obj_extract_self(item);
place_object(item, obj->ox, obj->oy);
}
if (Role_if(PM_ARCHEOLOGIST) && !flags.mon_moving && (obj->spe & STATUE_HISTORIC)) {
if (Role_if(PM_ARCHEOLOGIST) && !context.mon_moving && (obj->spe & STATUE_HISTORIC)) {
You_feel("guilty about damaging such a historic statue.");
adjalign(-1);
}