This adds in <Someone>'s autodig patch.

This commit is contained in:
arromdee
2002-01-15 02:50:36 +00:00
parent 59b7cb4be4
commit 4b6b5d7b8c
9 changed files with 37 additions and 2 deletions

View File

@@ -2,6 +2,7 @@ Boolean options not under specific compile flags (with default values in []):
(You can learn which options exist in your version by checking your current
option setting, which is reached via the 'O' cmd.)
autodig dig if moving and wielding digging tool [FALSE]
autopickup automatically pick up objects you move over [TRUE]
autoquiver when firing with an empty quiver, select some
suitable inventory weapon to fill the quiver [FALSE]

View File

@@ -1596,6 +1596,9 @@ Your starting alignment (align:lawful, align:neutral,
or align:chaotic). You may specify just the first letter.
The default is to randomly pick an appropriate alignment.
Cannot be set with the `O' command.
.lp autodig
Automatically dig if you are wielding a digging tool and moving into a place
that can be dug (default false).
.lp "autopickup "
Automatically pick up things onto which you move (default on).
.lp "autoquiver "

View File

@@ -2006,6 +2006,10 @@ or {\tt align:chaotic}). You may specify just the first letter.
The default is to randomly pick an appropriate alignment.
Cannot be set with the `{\tt O}' command.
%.lp
\item[\ib{autodig}]
Automatically dig if you are wielding a digging tool and moving into a place
that can be dug (default false).
%.lp
\item[\ib{autopickup}]
Automatically pick up things onto which you move (default on).
%.Ip

View File

@@ -469,6 +469,7 @@ blessed gold detection now detects anything made of gold, not just
coins, including candelabrum and gold rings
new T-shirt messages from Scott Bigham
option to get rid of resistance 'sparkle' (shieldeffect) (Scott Bigham)
option for autodig (Malcolm Ryan)
glowing Sunsword (inspired by Slashem)
msg_window option for ^P in TTY mode (Jay Tilton)
ninjas should get multishot bonus with yumi and ya (Dylan O'Donnell)

View File

@@ -228,6 +228,7 @@ E boolean FDECL(dig_check, (struct monst *, BOOLEAN_P, int, int));
E void FDECL(digactualhole, (int,int,struct monst *,int));
E boolean FDECL(dighole, (BOOLEAN_P));
E int FDECL(use_pick_axe, (struct obj *));
E int FDECL(use_pick_axe2, (struct obj *));
E boolean FDECL(mdig_tunnel, (struct monst *));
E void FDECL(watch_dig, (struct monst *,XCHAR_P,XCHAR_P,BOOLEAN_P));
E void NDECL(zap_dig);

View File

@@ -22,6 +22,7 @@ struct flag {
#ifdef MFLOPPY
boolean asksavedisk;
#endif
boolean autodig; /* MRKR: Automatically dig */
boolean autoquiver; /* Automatically fill quiver */
boolean beginner;
#ifdef MAIL

View File

@@ -773,9 +773,8 @@ struct obj *obj;
char dirsyms[12];
char qbuf[QBUFSZ];
register char *dsp = dirsyms;
register struct rm *lev;
register int rx, ry;
int dig_target, res = 0;
int res = 0;
register const char *sdp;
if(iflags.num_pad) sdp = ndir; else sdp = sdir; /* DICE workaround */
@@ -804,6 +803,22 @@ struct obj *obj;
Sprintf(qbuf, "In what direction do you want to dig? [%s]", dirsyms);
if(!getdir(qbuf))
return(res);
return(use_pick_axe2(obj));
}
/* MRKR: use_pick_axe() is split in two to allow autodig to bypass */
/* the "In what direction do you want to dig?" query. */
/* use_pick_axe2() uses the existing u.dx, u.dy and u.dz */
int
use_pick_axe2(obj)
struct obj *obj;
{
register int rx, ry;
register struct rm *lev;
int dig_target;
if (u.uswallow && attack(u.ustuck)) {
; /* return(1) */
} else if (Underwater) {

View File

@@ -545,6 +545,14 @@ boolean test_only;
} else if (tunnels(youmonst.data) && !needspick(youmonst.data)) {
/* Eat the rock. */
if (!test_only && still_chewing(x,y)) return FALSE;
} else if (flags.autodig && !flags.run && !flags.nopick && (uwep->otyp == PICK_AXE || uwep->otyp == DWARVISH_MATTOCK)) {
/* MRKR: Automatic digging when wielding the appropriate tool */
if (!test_only) {
use_pick_axe2(uwep);
flags.move = 0;
nomul(0);
return FALSE;
}
} else {
if ( !test_only ) {
if (Is_stronghold(&u.uz) && is_db_wall(x,y))

View File

@@ -39,6 +39,7 @@ static struct Bool_Opt
#else
{"asksavedisk", (boolean *)0, FALSE},
#endif
{"autodig", &flags.autodig, FALSE},
{"autopickup", &flags.pickup, TRUE},
{"autoquiver", &flags.autoquiver, FALSE},
#if defined(MICRO) && !defined(AMIGA)