more Riders (trunk only)

If a Rider's corpse revival timer ends with failure (presumeably
because the level has become entirely filled with monsters), give it a big
chance to try again in a few turns instead of always rotting the corpse
away.  Also, if there is another monster standing on the corpse when it's
due to revive, try to bump that monster out of the way to let the Rider
revive in place instead of having it be diverted to some other location.
This commit is contained in:
nethack.rankin
2006-11-23 04:17:48 +00:00
parent dd4f4efb59
commit f834fdbdd0
2 changed files with 36 additions and 5 deletions

View File

@@ -171,6 +171,7 @@ for inventory display, include cost info on hero-owned containers holding
shops now claim ownership of items created by using an unpaid horn of plenty
shopkeepers shouldn't refer to non-male character as "cad"
tweak levitation timeout if trap is being triggered on same turn it is to end
if Rider corpse revival fails, usually try again later instead of rotting away
Platform- and/or Interface-Specific Fixes

View File

@@ -1589,13 +1589,43 @@ anything *arg;
long timeout;
{
struct obj *body = arg->a_obj;
struct permonst *mptr = &mons[body->corpsenm];
struct monst *mtmp;
xchar x, y;
/* if we succeed, the corpse is gone, otherwise, rot it away */
/* corpse will revive somewhere else if there is a monster in the way;
Riders get a chance to try to bump the obstacle out of their way */
if ((mptr->mflags3 & M3_DISPLACES) != 0 && body->where == OBJ_FLOOR &&
get_obj_location(body, &x, &y, 0) && (mtmp = m_at(x, y)) != 0) {
boolean notice_it = canseemon(mtmp); /* before rloc() */
char *monname = Monnam(mtmp);
if (rloc(mtmp, TRUE)) {
if (notice_it && !canseemon(mtmp))
pline("%s vanishes.", monname);
else if (!notice_it && canseemon(mtmp))
pline("%s appears.", Monnam(mtmp)); /* not pre-rloc monname */
else if (notice_it && dist2(mtmp->mx, mtmp->my, x, y) > 2)
pline("%s teleports.", monname); /* saw it and still see it */
}
}
/* if we succeed, the corpse is gone */
if (!revive_corpse(body)) {
if (is_rider(&mons[body->corpsenm]))
You_feel("less hassled.");
(void) start_timer(250L - (monstermoves-body->age),
TIMER_OBJECT, ROT_CORPSE, arg);
long when;
int action;
if (is_rider(mptr) && rn2(99)) { /* Rider usually tries again */
action = REVIVE_MON;
for (when = 3L; when < 67L; when++)
if (!rn2(3)) break;
} else { /* rot this corpse away */
You_feel("%sless hassled.", is_rider(mptr) ? "much " : "");
action = ROT_CORPSE;
when = 250L - (monstermoves - body->age);
if (when < 1L) when = 1L;
}
(void) start_timer(when, TIMER_OBJECT, action, arg);
}
}