Skip to content

Commit 25e9eb0

Browse files
committed
Fix: bracers should not be a suitable target when applying a dwarvish bearded axe towards the player or a monster.
Surprised this wasn't noticed sooner.
1 parent 98cdc06 commit 25e9eb0

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

doc/evilhack-changelog.md

+2
Original file line numberDiff line numberDiff line change
@@ -3505,4 +3505,6 @@ The following changes to date are:
35053505
- Minor formatting tweaks to last PR
35063506
- Fix: peaceful underline glyph not clearing for shopkeepers
35073507
when rile_shk() routine was called
3508+
- Fix: bracers should not be a suitable target when applying
3509+
a dwarvish bearded axe towards the player or a monster
35083510

src/apply.c

+7
Original file line numberDiff line numberDiff line change
@@ -3486,6 +3486,13 @@ struct obj *obj;
34863486
const char *mon_hand;
34873487
boolean gotit = proficient && (!Fumbling || !rn2(10));
34883488

3489+
if (is_bracer(otmp)) {
3490+
You("swing your axe towards %s.", mon_nam(mtmp));
3491+
pline("%s %s deflects your attack!",
3492+
s_suffix(Monnam(mtmp)), xname(otmp));
3493+
return res; /* bracers are not a valid target */
3494+
}
3495+
34893496
Strcpy(onambuf, cxname(otmp));
34903497
if (gotit) {
34913498
mon_hand = mbodypart(mtmp, HAND);

src/muse.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -2675,7 +2675,8 @@ struct monst *mtmp;
26752675
/* the random test prevents axe-wielding
26762676
monster from attempting shield removal every
26772677
turn - shields are harder to disarm than weapons */
2678-
&& uarms && !rn2(7) && obj == MON_WEP(mtmp)
2678+
&& (uarms && !is_bracer(uarms))
2679+
&& !rn2(7) && obj == MON_WEP(mtmp)
26792680
/* hero's location must be known and adjacent */
26802681
&& mtmp->mux == u.ux && mtmp->muy == u.uy
26812682
&& distu(mtmp->mx, mtmp->my) <= 2
@@ -2849,7 +2850,8 @@ struct obj *start;
28492850
/* the random test prevents axe-wielding
28502851
monster from attempting shield removal every
28512852
turn - shields are harder to disarm than weapons */
2852-
&& uarms && !rn2(7) && obj == MON_WEP(mtmp)
2853+
&& (uarms && !is_bracer(uarms))
2854+
&& !rn2(7) && obj == MON_WEP(mtmp)
28532855
/* hero's location must be known and adjacent */
28542856
&& mtmp->mux == u.ux && mtmp->muy == u.uy
28552857
&& distu(mtmp->mx, mtmp->my) <= 2
@@ -3333,7 +3335,7 @@ struct monst *mtmp;
33333335
const char *hand;
33343336
char the_shield[BUFSZ];
33353337

3336-
if (!obj)
3338+
if (!obj || is_bracer(obj))
33373339
break; /* shouldn't happen after find_misc() */
33383340

33393341
Strcpy(the_shield, the(xname(obj)));

0 commit comments

Comments
 (0)