more fighting boulders (trunk only)

Followup to yesterday's "you attack thin air" fix for when there's a
boulder at the target location:  if wielding a pick-axe or mattock and you
use F to explicitly try to attack a boulder, dig the boulder to break it.
Also, treat statues like boulders:  F at them gets "you harmlessly attack
a statue" for non-pick weapon, or digs/breaks statue when wielding a pick.
Classified as a new feature in the fixes file.
This commit is contained in:
nethack.rankin
2007-07-17 13:52:27 +00:00
parent 65905e6ce9
commit 83bb85c8af
2 changed files with 16 additions and 0 deletions

View File

@@ -1205,8 +1205,23 @@ domove()
(glyph_is_invisible(levl[x][y].glyph) && !context.nopick)) {
struct obj *boulder = sobj_at(BOULDER, x, y);
boolean explo = (Upolyd && attacktype(youmonst.data, AT_EXPL));
int glyph = glyph_at(x, y); /* might be monster */
char buf[BUFSZ];
/* if a statue is displayed at the target location,
player is attempting to attack it [and boulder
handlng below is suitable for handling that] */
if (glyph_is_statue(glyph) ||
(Hallucination && glyph_is_monster(glyph)))
boulder = sobj_at(STATUE, x, y);
/* force fight at boulder (or statue) while wielding pick:
start digging to break the boulder (or statue) */
if (boulder && context.forcefight && uwep && is_pick(uwep)) {
(void)use_pick_axe2(uwep);
return;
}
if (boulder)
Strcpy(buf, ansimpleoname(boulder));
else if (!Underwater)