Merge branch 'master' into win32-x64-working
Conflicts: src/files.c src/potion.c sys/winnt/Makefile.msc Changes to be committed: modified: .gitignore modified: DEVEL/hooksdir/nhsub modified: dat/.gitignore modified: dat/opthelp modified: doc/Guidebook.mn modified: doc/Guidebook.tex modified: doc/fixes35.0 modified: include/context.h modified: include/decl.h modified: include/extern.h modified: include/flag.h modified: include/hack.h modified: include/patchlevel.h modified: src/apply.c modified: src/attrib.c modified: src/decl.c modified: src/do.c modified: src/do_name.c modified: src/dothrow.c modified: src/eat.c modified: src/files.c modified: src/hack.c modified: src/invent.c modified: src/lock.c modified: src/mklev.c modified: src/mondata.c modified: src/monmove.c modified: src/music.c modified: src/options.c modified: src/potion.c modified: src/pray.c modified: src/sit.c modified: src/sp_lev.c modified: src/uhitm.c modified: sys/share/posixregex.c modified: sys/winnt/Makefile.msc modified: util/.gitignore modified: win/win32/vs2010/NetHackW.vcxproj
This commit is contained in:
35
src/hack.c
35
src/hack.c
@@ -347,7 +347,7 @@ still_chewing(x,y)
|
||||
|
||||
if (!boulder && IS_ROCK(lev->typ) && !may_dig(x,y)) {
|
||||
You("hurt your teeth on the %s.",
|
||||
IS_TREE(lev->typ) ? "tree" : "hard stone");
|
||||
lev->typ == IRONBARS ? "bars" : (IS_TREE(lev->typ) ? "tree" : "hard stone"));
|
||||
nomul(0);
|
||||
return 1;
|
||||
} else if (context.digging.pos.x != x || context.digging.pos.y != y ||
|
||||
@@ -362,9 +362,10 @@ still_chewing(x,y)
|
||||
context.digging.effort =
|
||||
(IS_ROCK(lev->typ) && !IS_TREE(lev->typ) ? 30 : 60) + u.udaminc;
|
||||
You("start chewing %s %s.",
|
||||
(boulder || IS_TREE(lev->typ)) ? "on a" : "a hole in the",
|
||||
(boulder || IS_TREE(lev->typ) || lev->typ == IRONBARS) ? "on a" : "a hole in the",
|
||||
boulder ? "boulder" :
|
||||
IS_TREE(lev->typ) ? "tree" : IS_ROCK(lev->typ) ? "rock" : "door");
|
||||
IS_TREE(lev->typ) ? "tree" : IS_ROCK(lev->typ) ? "rock" :
|
||||
lev->typ == IRONBARS ? "bar" : "door");
|
||||
watch_dig((struct monst *)0, x, y, FALSE);
|
||||
return 1;
|
||||
} else if ((context.digging.effort += (30 + u.udaminc)) <= 100) {
|
||||
@@ -373,7 +374,8 @@ still_chewing(x,y)
|
||||
context.digging.chew ? "continue" : "begin",
|
||||
boulder ? "boulder" :
|
||||
IS_TREE(lev->typ) ? "tree" :
|
||||
IS_ROCK(lev->typ) ? "rock" : "door");
|
||||
IS_ROCK(lev->typ) ? "rock" :
|
||||
lev->typ == IRONBARS ? "bars" : "door");
|
||||
context.digging.chew = TRUE;
|
||||
watch_dig((struct monst *)0, x, y, FALSE);
|
||||
return 1;
|
||||
@@ -418,6 +420,9 @@ still_chewing(x,y)
|
||||
} else if (IS_TREE(lev->typ)) {
|
||||
digtxt = "chew through the tree.";
|
||||
lev->typ = ROOM;
|
||||
} else if (lev->typ == IRONBARS) {
|
||||
digtxt = "eat through the bars.";
|
||||
dissolve_bars(x,y);
|
||||
} else if (lev->typ == SDOOR) {
|
||||
if (lev->doormask & D_TRAPPED) {
|
||||
lev->doormask = D_NODOOR;
|
||||
@@ -622,6 +627,7 @@ int mode;
|
||||
register struct rm *tmpr = &levl[x][y];
|
||||
register struct rm *ust;
|
||||
|
||||
context.door_opened = FALSE;
|
||||
/*
|
||||
* Check for physical obstacles. First, the place we are going.
|
||||
*/
|
||||
@@ -630,10 +636,15 @@ int mode;
|
||||
if (Passes_walls && may_passwall(x,y)) {
|
||||
; /* do nothing */
|
||||
} else if (tmpr->typ == IRONBARS) {
|
||||
if ((dmgtype(youmonst.data, AD_RUST) ||
|
||||
dmgtype(youmonst.data, AD_CORR)) &&
|
||||
mode == DO_MOVE && still_chewing(x,y)) {
|
||||
return FALSE;
|
||||
}
|
||||
if (!(Passes_walls || passes_bars(youmonst.data))) {
|
||||
if (iflags.mention_walls)
|
||||
You("cannot pass through the bars.");
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
} else if (tunnels(youmonst.data) && !needspick(youmonst.data)) {
|
||||
/* Eat the rock. */
|
||||
@@ -670,8 +681,10 @@ int mode;
|
||||
if (mode == DO_MOVE) {
|
||||
if (amorphous(youmonst.data))
|
||||
You("try to ooze under the door, but can't squeeze your possessions through.");
|
||||
else if (x == ux || y == uy) {
|
||||
if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) {
|
||||
if (flags.autoopen && !context.run && !Confusion && !Stunned && !Fumbling) {
|
||||
context.door_opened = context.move = doopen_indir(x, y);
|
||||
} else if (x == ux || y == uy) {
|
||||
if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) {
|
||||
if (u.usteed) {
|
||||
You_cant("lead %s through that closed door.",
|
||||
y_monnam(u.usteed));
|
||||
@@ -1395,9 +1408,11 @@ domove()
|
||||
}
|
||||
|
||||
if (!test_move(u.ux, u.uy, x-u.ux, y-u.uy, DO_MOVE)) {
|
||||
context.move = 0;
|
||||
nomul(0);
|
||||
return;
|
||||
if (!context.door_opened) {
|
||||
context.move = 0;
|
||||
nomul(0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Move ball and chain. */
|
||||
|
||||
Reference in New Issue
Block a user