From 83bb85c8af603bc1f7afc386ce1fd06a11639228 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Tue, 17 Jul 2007 13:52:27 +0000 Subject: [PATCH] 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. --- doc/fixes35.0 | 1 + src/hack.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 690e5fddf..721097c2e 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -369,6 +369,7 @@ C and #name commands are now same and use menu to choose monster vs object hallucination provides partial protection against gaze attacks attempting to read "dull" spellbook might cause hero to fall asleep dipping prompt is more precise +using F to attack boulder or statue while wielding pick digs/breaks target Platform- and/or Interface-Specific New Features diff --git a/src/hack.c b/src/hack.c index 252d26372..82211bf4e 100644 --- a/src/hack.c +++ b/src/hack.c @@ -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) -- 2.40.0