Merge branch 'NetHack-3.6.2'

This commit is contained in:
nhmall
2019-01-27 12:39:52 -05:00
7 changed files with 65 additions and 17 deletions

View File

@@ -16,6 +16,8 @@ STATIC_DCL boolean FDECL(trapmove, (int, int, struct trap *));
STATIC_DCL struct monst *FDECL(monstinroom, (struct permonst *, int));
STATIC_DCL boolean FDECL(doorless_door, (int, int));
STATIC_DCL void FDECL(move_update, (BOOLEAN_P));
STATIC_DCL void FDECL(maybe_smudge_engr, (int, int, int, int));
STATIC_DCL void NDECL(domove_core);
#define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE)
@@ -1327,6 +1329,19 @@ u_rooted()
void
domove()
{
int ux1 = u.ux, uy1 = u.uy;
g.context.domove_succeeded = 0L;
domove_core();
/* g.context.domove_succeeded is available to make assessments now */
if ((g.context.domove_succeeded & (DOMOVE_RUSH | DOMOVE_WALK)) != 0)
maybe_smudge_engr(ux1, uy1, u.ux, u.uy);
g.context.domove_attempting = 0L;
}
void
domove_core()
{
register struct monst *mtmp;
register struct rm *tmpr;
@@ -1339,8 +1354,6 @@ domove()
int bc_control = 0; /* control for ball&chain */
boolean cause_delay = FALSE; /* dragging ball will skip a move */
u_wipe_engr(rnd(5));
if (g.context.travel) {
if (!findtravelpath(FALSE))
(void) findtravelpath(TRUE);
@@ -1858,6 +1871,9 @@ domove()
check_leash(u.ux0, u.uy0);
if (u.ux0 != u.ux || u.uy0 != u.uy) {
/* let caller know so that an evaluation may take place */
g.context.domove_succeeded |=
(g.context.domove_attempting & (DOMOVE_RUSH | DOMOVE_WALK));
u.umoved = TRUE;
/* Clean old position -- vision_recalc() will print our new one. */
newsym(u.ux0, u.uy0);
@@ -1897,6 +1913,21 @@ domove()
}
}
void
maybe_smudge_engr(x1,y1,x2,y2)
int x1, y1, x2, y2;
{
struct engr *ep;
if (can_reach_floor(TRUE)) {
if ((ep = engr_at(x1, y1)) && ep->engr_type != HEADSTONE)
wipe_engr_at(x1, y1, rnd(5), FALSE);
if ((x2 != x1 || y2 != y1)
&& (ep = engr_at(x2, y2)) && ep->engr_type != HEADSTONE)
wipe_engr_at(x2, y2, rnd(5), FALSE);
}
}
/* combat increases metabolism */
boolean
overexertion()