Merge branch 'NetHack-3.6.2'
This commit is contained in:
@@ -405,6 +405,15 @@ when engulfed while in a shop, dropping an item into the engulfer and then
|
|||||||
using ':' to look at current location could cause a crash
|
using ':' to look at current location could cause a crash
|
||||||
when items were on the floor just inside a shop's door where the shopkeeper
|
when items were on the floor just inside a shop's door where the shopkeeper
|
||||||
doesn't buy and sell stuff, those items showed a 'for sale' price
|
doesn't buy and sell stuff, those items showed a 'for sale' price
|
||||||
|
separate most of domove() into domove_core() and introduce a pair of global
|
||||||
|
variables that allow for assessment of domove_core() results in
|
||||||
|
domove() after one of the many return paths
|
||||||
|
new domove()-related global variables mentioned above also replace a couple
|
||||||
|
of booleans in rhack() that were used for similar upcoming action
|
||||||
|
identification
|
||||||
|
smudging of an engraving has been relocated and follows domove_core() and is
|
||||||
|
carried out only after a successful move attempt; your former
|
||||||
|
location and resulting location are both potentially impacted now
|
||||||
tty: turn off an optimization that is the suspected cause of Windows reported
|
tty: turn off an optimization that is the suspected cause of Windows reported
|
||||||
partial status lines following level changes
|
partial status lines following level changes
|
||||||
tty: ensure that current status fields are always copied to prior status
|
tty: ensure that current status fields are always copied to prior status
|
||||||
|
|||||||
@@ -117,6 +117,10 @@ struct context_info {
|
|||||||
int rndencode; /* randomized escape sequence introducer */
|
int rndencode; /* randomized escape sequence introducer */
|
||||||
long next_attrib_check; /* next attribute check */
|
long next_attrib_check; /* next attribute check */
|
||||||
long stethoscope_move;
|
long stethoscope_move;
|
||||||
|
long domove_attempting;
|
||||||
|
long domove_succeeded;
|
||||||
|
#define DOMOVE_WALK 0x00000001
|
||||||
|
#define DOMOVE_RUSH 0x00000002
|
||||||
short stethoscope_movement;
|
short stethoscope_movement;
|
||||||
boolean travel; /* find way automatically to u.tx,u.ty */
|
boolean travel; /* find way automatically to u.tx,u.ty */
|
||||||
boolean travel1; /* first travel step */
|
boolean travel1; /* first travel step */
|
||||||
|
|||||||
@@ -1182,3 +1182,5 @@ E const struct const_globals cg;
|
|||||||
#undef E
|
#undef E
|
||||||
|
|
||||||
#endif /* DECL_H */
|
#endif /* DECL_H */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -579,6 +579,7 @@ newgame()
|
|||||||
g.context.botlx = 1;
|
g.context.botlx = 1;
|
||||||
g.context.ident = 1;
|
g.context.ident = 1;
|
||||||
g.context.stethoscope_move = -1L;
|
g.context.stethoscope_move = -1L;
|
||||||
|
g.context.domove_attempting = 0L;
|
||||||
g.context.warnlevel = 1;
|
g.context.warnlevel = 1;
|
||||||
g.context.next_attrib_check = 600L; /* arbitrary first setting */
|
g.context.next_attrib_check = 600L; /* arbitrary first setting */
|
||||||
g.context.tribute.enabled = TRUE; /* turn on 3.6 tributes */
|
g.context.tribute.enabled = TRUE; /* turn on 3.6 tributes */
|
||||||
|
|||||||
29
src/cmd.c
29
src/cmd.c
@@ -4523,7 +4523,7 @@ rhack(cmd)
|
|||||||
register char *cmd;
|
register char *cmd;
|
||||||
{
|
{
|
||||||
int spkey;
|
int spkey;
|
||||||
boolean do_walk, do_rush, prefix_seen, bad_command,
|
boolean prefix_seen, bad_command,
|
||||||
firsttime = (cmd == 0);
|
firsttime = (cmd == 0);
|
||||||
|
|
||||||
iflags.menu_requested = FALSE;
|
iflags.menu_requested = FALSE;
|
||||||
@@ -4554,7 +4554,7 @@ register char *cmd;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* handle most movement commands */
|
/* handle most movement commands */
|
||||||
do_walk = do_rush = prefix_seen = FALSE;
|
prefix_seen = FALSE;
|
||||||
g.context.travel = g.context.travel1 = 0;
|
g.context.travel = g.context.travel1 = 0;
|
||||||
spkey = ch2spkeys(*cmd, NHKF_RUN, NHKF_CLICKLOOK);
|
spkey = ch2spkeys(*cmd, NHKF_RUN, NHKF_CLICKLOOK);
|
||||||
|
|
||||||
@@ -4562,7 +4562,7 @@ register char *cmd;
|
|||||||
case NHKF_RUSH:
|
case NHKF_RUSH:
|
||||||
if (movecmd(cmd[1])) {
|
if (movecmd(cmd[1])) {
|
||||||
g.context.run = 2;
|
g.context.run = 2;
|
||||||
do_rush = TRUE;
|
g.context.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4573,7 +4573,7 @@ register char *cmd;
|
|||||||
case NHKF_RUN:
|
case NHKF_RUN:
|
||||||
if (movecmd(lowc(cmd[1]))) {
|
if (movecmd(lowc(cmd[1]))) {
|
||||||
g.context.run = 3;
|
g.context.run = 3;
|
||||||
do_rush = TRUE;
|
g.context.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4589,7 +4589,7 @@ register char *cmd;
|
|||||||
case NHKF_FIGHT:
|
case NHKF_FIGHT:
|
||||||
if (movecmd(cmd[1])) {
|
if (movecmd(cmd[1])) {
|
||||||
g.context.forcefight = 1;
|
g.context.forcefight = 1;
|
||||||
do_walk = TRUE;
|
g.context.domove_attempting |= DOMOVE_WALK;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4598,7 +4598,7 @@ register char *cmd;
|
|||||||
g.context.run = 0;
|
g.context.run = 0;
|
||||||
g.context.nopick = 1;
|
g.context.nopick = 1;
|
||||||
if (!u.dz)
|
if (!u.dz)
|
||||||
do_walk = TRUE;
|
g.context.domove_attempting |= DOMOVE_WALK;
|
||||||
else
|
else
|
||||||
cmd[0] = cmd[1]; /* "m<" or "m>" */
|
cmd[0] = cmd[1]; /* "m<" or "m>" */
|
||||||
} else
|
} else
|
||||||
@@ -4608,7 +4608,7 @@ register char *cmd;
|
|||||||
if (movecmd(lowc(cmd[1]))) {
|
if (movecmd(lowc(cmd[1]))) {
|
||||||
g.context.run = 1;
|
g.context.run = 1;
|
||||||
g.context.nopick = 1;
|
g.context.nopick = 1;
|
||||||
do_rush = TRUE;
|
g.context.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else
|
} else
|
||||||
prefix_seen = TRUE;
|
prefix_seen = TRUE;
|
||||||
break;
|
break;
|
||||||
@@ -4631,20 +4631,20 @@ register char *cmd;
|
|||||||
g.context.travel1 = 1;
|
g.context.travel1 = 1;
|
||||||
g.context.run = 8;
|
g.context.run = 8;
|
||||||
g.context.nopick = 1;
|
g.context.nopick = 1;
|
||||||
do_rush = TRUE;
|
g.context.domove_attempting |= DOMOVE_RUSH;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/*FALLTHRU*/
|
/*FALLTHRU*/
|
||||||
default:
|
default:
|
||||||
if (movecmd(*cmd)) { /* ordinary movement */
|
if (movecmd(*cmd)) { /* ordinary movement */
|
||||||
g.context.run = 0; /* only matters here if it was 8 */
|
g.context.run = 0; /* only matters here if it was 8 */
|
||||||
do_walk = TRUE;
|
g.context.domove_attempting |= DOMOVE_WALK;
|
||||||
} else if (movecmd(g.Cmd.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
|
} else if (movecmd(g.Cmd.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
|
||||||
g.context.run = 1;
|
g.context.run = 1;
|
||||||
do_rush = TRUE;
|
g.context.domove_attempting |= DOMOVE_RUSH;
|
||||||
} else if (movecmd(unctrl(*cmd))) {
|
} else if (movecmd(unctrl(*cmd))) {
|
||||||
g.context.run = 3;
|
g.context.run = 3;
|
||||||
do_rush = TRUE;
|
g.context.domove_attempting |= DOMOVE_RUSH;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -4662,7 +4662,8 @@ register char *cmd;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((do_walk || do_rush) && !g.context.travel && !dxdy_moveok()) {
|
if (((g.context.domove_attempting & (DOMOVE_RUSH | DOMOVE_WALK)) != 0L)
|
||||||
|
&& !g.context.travel && !dxdy_moveok()) {
|
||||||
/* trying to move diagonally as a grid bug;
|
/* trying to move diagonally as a grid bug;
|
||||||
this used to be treated by movecmd() as not being
|
this used to be treated by movecmd() as not being
|
||||||
a movement attempt, but that didn't provide for any
|
a movement attempt, but that didn't provide for any
|
||||||
@@ -4676,13 +4677,13 @@ register char *cmd;
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (do_walk) {
|
if ((g.context.domove_attempting & DOMOVE_WALK) != 0L) {
|
||||||
if (g.multi)
|
if (g.multi)
|
||||||
g.context.mv = TRUE;
|
g.context.mv = TRUE;
|
||||||
domove();
|
domove();
|
||||||
g.context.forcefight = 0;
|
g.context.forcefight = 0;
|
||||||
return;
|
return;
|
||||||
} else if (do_rush) {
|
} else if ((g.context.domove_attempting & DOMOVE_RUSH) != 0L) {
|
||||||
if (firsttime) {
|
if (firsttime) {
|
||||||
if (!g.multi)
|
if (!g.multi)
|
||||||
g.multi = max(COLNO, ROWNO);
|
g.multi = max(COLNO, ROWNO);
|
||||||
|
|||||||
35
src/hack.c
35
src/hack.c
@@ -16,6 +16,8 @@ STATIC_DCL boolean FDECL(trapmove, (int, int, struct trap *));
|
|||||||
STATIC_DCL struct monst *FDECL(monstinroom, (struct permonst *, int));
|
STATIC_DCL struct monst *FDECL(monstinroom, (struct permonst *, int));
|
||||||
STATIC_DCL boolean FDECL(doorless_door, (int, int));
|
STATIC_DCL boolean FDECL(doorless_door, (int, int));
|
||||||
STATIC_DCL void FDECL(move_update, (BOOLEAN_P));
|
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)
|
#define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE)
|
||||||
|
|
||||||
@@ -1327,6 +1329,19 @@ u_rooted()
|
|||||||
|
|
||||||
void
|
void
|
||||||
domove()
|
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 monst *mtmp;
|
||||||
register struct rm *tmpr;
|
register struct rm *tmpr;
|
||||||
@@ -1339,8 +1354,6 @@ domove()
|
|||||||
int bc_control = 0; /* control for ball&chain */
|
int bc_control = 0; /* control for ball&chain */
|
||||||
boolean cause_delay = FALSE; /* dragging ball will skip a move */
|
boolean cause_delay = FALSE; /* dragging ball will skip a move */
|
||||||
|
|
||||||
u_wipe_engr(rnd(5));
|
|
||||||
|
|
||||||
if (g.context.travel) {
|
if (g.context.travel) {
|
||||||
if (!findtravelpath(FALSE))
|
if (!findtravelpath(FALSE))
|
||||||
(void) findtravelpath(TRUE);
|
(void) findtravelpath(TRUE);
|
||||||
@@ -1858,6 +1871,9 @@ domove()
|
|||||||
check_leash(u.ux0, u.uy0);
|
check_leash(u.ux0, u.uy0);
|
||||||
|
|
||||||
if (u.ux0 != u.ux || u.uy0 != u.uy) {
|
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;
|
u.umoved = TRUE;
|
||||||
/* Clean old position -- vision_recalc() will print our new one. */
|
/* Clean old position -- vision_recalc() will print our new one. */
|
||||||
newsym(u.ux0, u.uy0);
|
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 */
|
/* combat increases metabolism */
|
||||||
boolean
|
boolean
|
||||||
overexertion()
|
overexertion()
|
||||||
|
|||||||
Reference in New Issue
Block a user