Instance variable work check-point.

This commit is contained in:
Bart House
2018-11-23 04:49:51 -08:00
parent 244a473a19
commit 8e316df117
17 changed files with 171 additions and 139 deletions

View File

@@ -39,9 +39,6 @@ STATIC_DCL boolean FDECL(thitm, (int, struct monst *, struct obj *, int,
BOOLEAN_P));
STATIC_DCL void NDECL(maybe_finish_sokoban);
/* mintrap() should take a flags argument, but for time being we use this */
STATIC_VAR int force_mintrap = 0;
STATIC_VAR const char *const a_your[2] = { "a", "your" };
STATIC_VAR const char *const A_Your[2] = { "A", "Your" };
STATIC_VAR const char tower_of_flame[] = "tower of flame";
@@ -2163,7 +2160,7 @@ register struct monst *mtmp;
} else {
register int tt = trap->ttyp;
boolean in_sight, tear_web, see_it,
inescapable = force_mintrap || ((tt == HOLE || tt == PIT)
inescapable = iv.force_mintrap || ((tt == HOLE || tt == PIT)
&& Sokoban && !trap->madeby_u);
const char *fallverb;
@@ -2279,7 +2276,7 @@ register struct monst *mtmp;
|| mptr == &mons[PM_BUGBEAR])
You_hear("the roaring of an angry bear!");
}
} else if (force_mintrap) {
} else if (iv.force_mintrap) {
if (in_sight) {
pline("%s evades %s bear trap!", Monnam(mtmp),
a_your[trap->madeby_u]);
@@ -2428,7 +2425,7 @@ register struct monst *mtmp;
if (is_flyer(mptr) || is_floater(mptr)
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|| is_clinger(mptr)) {
if (force_mintrap && !Sokoban) {
if (iv.force_mintrap && !Sokoban) {
/* openfallingtrap; not inescapable here */
if (in_sight) {
seetrap(trap);
@@ -2465,7 +2462,7 @@ register struct monst *mtmp;
if (is_flyer(mptr) || is_floater(mptr) || mptr == &mons[PM_WUMPUS]
|| (mtmp->wormno && count_wsegs(mtmp) > 5)
|| mptr->msize >= MZ_HUGE) {
if (force_mintrap && !Sokoban) {
if (iv.force_mintrap && !Sokoban) {
/* openfallingtrap; not inescapable here */
if (in_sight) {
seetrap(trap);
@@ -2554,7 +2551,7 @@ register struct monst *mtmp;
a_your[trap->madeby_u]);
deltrap(trap);
newsym(mtmp->mx, mtmp->my);
} else if (force_mintrap && !mtmp->mtrapped) {
} else if (iv.force_mintrap && !mtmp->mtrapped) {
if (in_sight) {
pline("%s avoids %s spider web!", Monnam(mtmp),
a_your[trap->madeby_u]);
@@ -4689,9 +4686,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */
/* dotrap calls mintrap when mounted hero encounters a web */
if (u.usteed)
dotrapflags |= NOWEBMSG;
++force_mintrap;
++iv.force_mintrap;
dotrap(t, dotrapflags);
--force_mintrap;
--iv.force_mintrap;
result = (u.utrap != 0);
} else {
if (mon->mtrapped)
@@ -4699,9 +4696,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */
/* you notice it if you see the trap close/tremble/whatever
or if you sense the monster who becomes trapped */
*noticed = cansee(t->tx, t->ty) || canspotmon(mon);
++force_mintrap;
++iv.force_mintrap;
result = (mintrap(mon) != 0);
--force_mintrap;
--iv.force_mintrap;
}
return result;
}
@@ -4742,9 +4739,9 @@ boolean *noticed; /* set to true iff hero notices the effect; */
*noticed = cansee(t->tx, t->ty) || canspotmon(mon);
/* monster will be angered; mintrap doesn't handle that */
wakeup(mon, TRUE);
++force_mintrap;
++iv.force_mintrap;
result = (mintrap(mon) != 0);
--force_mintrap;
--iv.force_mintrap;
/* mon might now be on the migrating monsters list */
}
return result;