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