*** oldsrc\include\config.h Wed Mar 20 16:42:44 2002 --- include\config.h Sat Oct 12 18:29:52 2002 *************** *** 338,343 **** --- 338,359 ---- #define EXP_ON_BOTL /* Show experience on bottom line */ /* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ + /* allows you to autoopen doors by walking into them. + * No documentation; use "autoopen" option. + * Compatible with old save/bones files. + * by Teppic + */ + #define AUTO_OPEN + + /* Clean up trash messages and other user interface flaws. + * Use the AUTO_OPEN patch, too. + * Compatible with old save/bones files. + * By Rob Ellwood + */ + #define DE_IRK + + + /* * Section 5: EXPERIMENTAL STUFF * *** oldsrc\include\extern.h Wed Mar 20 16:42:46 2002 --- include\extern.h Fri Jun 21 12:15:24 2002 *************** *** 837,842 **** --- 837,845 ---- E boolean FDECL(boxlock, (struct obj *,struct obj *)); E boolean FDECL(doorlock, (struct obj *,int,int)); E int NDECL(doopen); + #ifdef AUTO_OPEN + E int FDECL(doopen_indir, (boolean)); + #endif /* AUTO_OPEN */ E int NDECL(doclose); #ifdef MAC *** oldsrc\include\flag.h Wed Mar 20 16:42:46 2002 --- include\flag.h Fri Jun 21 12:15:50 2002 *************** *** 155,160 **** --- 155,163 ---- */ struct instance_flags { + #ifdef AUTO_OPEN + boolean autoopen; /* automatic door opening */ + #endif /* AUTO_OPEN */ boolean cbreak; /* in cbreak mode, rogue format */ boolean DECgraphics; /* use DEC VT-xxx extended character set */ boolean echo; /* 1 to echo characters */ *** oldsrc\util\makedefs.c Wed Mar 20 16:44:06 2002 --- util\makedefs.c Sun Jun 23 13:46:44 2002 *************** *** 725,730 **** --- 725,734 ---- #ifdef ZEROCOMP "zero-compressed save files", #endif + #ifdef AUTO_OPEN + "patch: auto open doors", + #endif /* AUTO_OPEN */ + "basic NetHack features" }; *** oldsrc\src\hack.c Wed Mar 20 16:43:06 2002 --- src\hack.c Sat Oct 12 18:29:58 2002 *************** *** 228,234 **** --- 228,239 ---- #ifdef STEED if (!u.usteed) { #endif + + #ifdef DE_IRK + if (moves > lastmovetime+200 || moves < lastmovetime) + #else if (moves > lastmovetime+2 || moves < lastmovetime) + #endif pline("With %s effort you move %s.", throws_rocks(youmonst.data) ? "little" : "great", the(xname(otmp))); *************** *** 575,580 **** --- 580,586 ---- if ( !test_only ) { if (amorphous(youmonst.data)) You("try to ooze under the door, but can't squeeze your possessions through."); + #ifndef AUTO_OPEN else if (x == ux || y == uy) { if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) { #ifdef STEED *************** *** 584,599 **** u.usteed->mnamelth ? ARTICLE_NONE : ARTICLE_THE, (char *)0, SUPPRESS_SADDLE, FALSE)); else { ! #else pline("Ouch! You bump into a door."); exercise(A_DEX, FALSE); ! #endif #ifdef STEED } ! #endif } else pline("That door is closed."); } } return FALSE; } } else if (dx && dy && !Passes_walls --- 590,641 ---- u.usteed->mnamelth ? ARTICLE_NONE : ARTICLE_THE, (char *)0, SUPPRESS_SADDLE, FALSE)); else { ! #else /* STEED */ pline("Ouch! You bump into a door."); exercise(A_DEX, FALSE); ! #endif /* STEED */ #ifdef STEED } ! #endif /* STEED */ ! } else pline("That door is closed."); ! } ! #else /* AUTO_OPEN */ ! ! /* teppic - begin(autoopen) */ ! /* ! * prevent doors from being autoopened ! * at the end of a diagonal run ! */ ! else if (flags.run || !iflags.autoopen) { ! if (x == u.ux || y == u.uy) { ! if (Blind || Stunned || ACURR(A_DEX) < 10 || Fumbling) { ! #ifdef STEED ! if (u.usteed) ! You_cant("lead %s through that closed door.", ! x_monnam(u.usteed, ! u.usteed->mnamelth ? ARTICLE_NONE : ARTICLE_THE, ! (char *)0, SUPPRESS_SADDLE, FALSE)); ! else { ! #else /* STEED */ ! ! pline("Ouch! You bump into a door."); ! exercise(A_DEX, FALSE); ! #endif /* STEED */ ! #ifdef STEED ! } ! #endif /* STEED */ ! } else pline("That door is closed."); } } + else { + flags.move = doopen_indir(FALSE); + } + /* teppic - end(autoopen) */ + + #endif /* AUTO_OPEN */ + + } return FALSE; } } else if (dx && dy && !Passes_walls *** oldsrc\src\lock.c Wed Mar 20 16:43:08 2002 --- src\lock.c Fri Jun 21 12:07:06 2002 *************** *** 490,495 **** --- 490,504 ---- int doopen() /* try to open a door */ { + #ifdef AUTO_OPEN + return doopen_indir(TRUE); + } + + int + doopen_indir(doprompt) /* try to open a door in direction u.dx/u.dy */ + boolean doprompt; /* if true, prompt for direction */ + { + #endif /* AUTO_OPEN */ register int x, y; register struct rm *door; struct monst *mtmp; *************** *** 504,510 **** --- 513,524 ---- return 0; } + #ifndef AUTO_OPEN + if(!getdir((char *)0)) return(0); + #else + if (doprompt) if(!getdir((char *)0)) return(0); + #endif /* AUTO_OPEN */ x = u.ux + u.dx; y = u.uy + u.dy; *** oldsrc\src\options.c Wed Mar 20 16:43:12 2002 --- src\options.c Fri Jun 21 12:12:48 2002 *************** *** 45,50 **** --- 45,53 ---- {"asksavedisk", (boolean *)0, FALSE, SET_IN_FILE}, #endif {"autodig", &flags.autodig, FALSE, SET_IN_GAME}, + #ifdef AUTO_OPEN + {"autoopen", &iflags.autoopen, TRUE, SET_IN_GAME}, + #endif /* AUTO_OPEN */ {"autopickup", &flags.pickup, TRUE, SET_IN_GAME}, {"autoquiver", &flags.autoquiver, FALSE, SET_IN_GAME}, #if defined(MICRO) && !defined(AMIGA) *** oldsrc\src\dig.c Wed Mar 20 16:43:02 2002 --- src\dig.c Fri Jun 21 15:27:00 2002 *************** *** 892,898 **** --- 892,902 ---- if (flags.autodig && !dig_target && !digging.down && digging.pos.x == u.ux && digging.pos.y == u.uy && + #ifdef DE_IRK + (moves <= digging.lastdigtime+200 && + #else (moves <= digging.lastdigtime+2 && + #endif moves >= digging.lastdigtime)) { /* avoid messages if repeated autodigging */ did_dig_msg = TRUE;