diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 987be58e0..6eaba8930 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -717,7 +717,9 @@ mark some messages as urgent ("You die*.", having equipment stolen, being if a leashed pet changed name (#name m) or an unnamed pet changed type (polymorph or grow-up) and perm_invent was On, persistent inventory display didn't get updated to show the leash's changed information -give some dragon armor extra effects when worn +attack feedback when using a bullwhip said "swing"; change to "lash" +attack feedback for monster using polearm when adjacent said "thrust"; change + to "bash" Fixes to 3.7.0-x Problems that Were Exposed Via git Repository @@ -1291,6 +1293,7 @@ decaying globs of {ooze,pudding,slime} shrink over time based on their total time, and while doing so they no longer give the tainted corpse food poisoning effect when eaten track peak maximum HP and peak maximum energy/power; no noticeable effect +give some dragon armor extra effects when worn Platform- and/or Interface-Specific New Features diff --git a/include/extern.h b/include/extern.h index e302abaac..dacabbb84 100644 --- a/include/extern.h +++ b/include/extern.h @@ -1227,6 +1227,7 @@ extern void rustm(struct monst *, struct obj *); /* ### mhitu.c ### */ extern void hitmsg(struct monst *, struct attack *); +extern const char *mswings_verb(struct obj *, boolean); extern const char *mpoisons_subj(struct monst *, struct attack *); extern void u_slow_down(void); extern struct monst *cloneu(void); diff --git a/src/mhitm.c b/src/mhitm.c index 30ab74f37..234515594 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -1116,11 +1116,16 @@ rustm(struct monst *mdef, struct obj *obj) } static void -mswingsm(struct monst *magr, struct monst *mdef, struct obj *otemp) +mswingsm( + struct monst *magr, /* attacker */ + struct monst *mdef, /* defender */ + struct obj *otemp) /* attacker's weapon */ { if (flags.verbose && !Blind && mon_visible(magr)) { - pline("%s %s %s%s %s at %s.", Monnam(magr), - (objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings", + boolean bash = (is_pole(otemp) + && dist2(magr->mx, magr->my, mdef->mx, mdef->my) <= 2); + + pline("%s %s %s%s %s at %s.", Monnam(magr), mswings_verb(otemp, bash), (otemp->quan > 1L) ? "one of " : "", mhis(magr), xname(otemp), mon_nam(mdef)); } diff --git a/src/mhitu.c b/src/mhitu.c index 5e04b2a00..c4446ba9d 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -9,7 +9,7 @@ static NEARDATA struct obj *mon_currwep = (struct obj *) 0; static void missmu(struct monst *, boolean, struct attack *); -static void mswings(struct monst *, struct obj *); +static void mswings(struct monst *, struct obj *, boolean); static void wildmiss(struct monst *, struct attack *); static void summonmu(struct monst *, boolean); static int hitmu(struct monst *, struct attack *); @@ -85,13 +85,40 @@ missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk) stop_occupation(); } +/* strike types P|S|B: Pierce (pointed: stab) => "thrusts", + Slash (edged: slice) or whack (blunt: Bash) => "swings" */ +const char * +mswings_verb( + struct obj *mwep, /* attacker's weapon */ + boolean bash) /* True: using polearm while too close */ +{ + const char *verb; + int otyp = mwep->otyp, + lash = (otyp == BULLWHIP), + /* some weapons can have more than one strike type; for those, + give a mix of thrust and swing (caller doesn't care either way) */ + thrust = ((objects[otyp].oc_dir & PIERCE) != 0 + && ((objects[otyp].oc_dir & ~PIERCE) == 0 || !rn2(2))); + + verb = bash ? "bashes with" /*sigh*/ + : lash ? "lashes" + : thrust ? "thrusts" + : "swings"; + /* (might have caller also pass attacker's formatted name so that + if hallucination makes that be plural, we could use vtense() to + adjust the result to match) */ + return verb; +} + /* monster swings obj */ static void -mswings(struct monst *mtmp, struct obj *otemp) +mswings( + struct monst *mtmp, /* attacker */ + struct obj *otemp, /* attacker's weapon */ + boolean bash) /* True: polearm used at too close range */ { if (flags.verbose && !Blind && mon_visible(mtmp)) { - pline("%s %s %s%s %s.", Monnam(mtmp), - (objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings", + pline("%s %s %s%s %s.", Monnam(mtmp), mswings_verb(otemp, bash), (otemp->quan > 1L) ? "one of " : "", mhis(mtmp), xname(otemp)); } } @@ -727,9 +754,12 @@ mattacku(register struct monst *mtmp) if (foundyou) { mon_currwep = MON_WEP(mtmp); if (mon_currwep) { + boolean bash = (is_pole(mon_currwep) + && distu(mtmp->mx, mtmp->my) <= 2); + hittmp = hitval(mon_currwep, &g.youmonst); tmp += hittmp; - mswings(mtmp, mon_currwep); + mswings(mtmp, mon_currwep, bash); } if (tmp > (j = g.mhitu_dieroll = rnd(20 + i))) sum[i] = hitmu(mtmp, mattk); diff --git a/src/mthrowu.c b/src/mthrowu.c index 3442fb674..82838183f 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -909,17 +909,34 @@ thrwmu(struct monst* mtmp) return; if (is_pole(otmp)) { - int dam, hitv; + int dam, hitv, rang; if (otmp != MON_WEP(mtmp)) return; /* polearm must be wielded */ - if (dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy) > MON_POLE_DIST - || !couldsee(mtmp->mx, mtmp->my)) + + /* + * MON_POLE_DIST encompasses knight's move range (5): two spots + * away provided it's not on a straight diagonal, same as skilled + * hero. Using polearm while adjacent is allowed but the verb + * is adjusted from "thrusts" to "bashes", where the hero would + * have to switch from applying a polearm to ordinary melee attack + * to accomplish that. + * + * .545. + * 52125 + * 41014 + * 52125 + * .545. + */ + rang = dist2(mtmp->mx, mtmp->my, mtmp->mux, mtmp->muy); + if (rang > MON_POLE_DIST || !couldsee(mtmp->mx, mtmp->my)) return; /* Out of range, or intervening wall */ if (canseemon(mtmp)) { onm = xname(otmp); - pline("%s thrusts %s.", Monnam(mtmp), + pline("%s %s %s.", Monnam(mtmp), + /* "thrusts" or "swings", or "bashes with" if adjacent */ + mswings_verb(otmp, (rang <= 2) ? TRUE : FALSE), obj_is_pname(otmp) ? the(onm) : an(onm)); } diff --git a/src/uhitm.c b/src/uhitm.c index aff4172e8..24d2573e2 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1351,8 +1351,11 @@ hmon_hitmon(struct monst *mon, You("hit it."); else You("%s %s%s", - (obj && (is_shield(obj) || obj->otyp == HEAVY_IRON_BALL)) - ? "bash" : Role_if(PM_BARBARIAN) ? "smite" : "hit", + (obj && (is_shield(obj) + || obj->otyp == HEAVY_IRON_BALL)) ? "bash" + : (obj && obj->otyp == BULLWHIP) ? "lash" /* hand_to_hand */ + : Role_if(PM_BARBARIAN) ? "smite" + : "hit", mon_nam(mon), canseemon(mon) ? exclam(tmp) : "."); }