bullwhip and polearm attack feedback

When testing the urgent message for having weapon be snagged by a
bullwhip, in between the occasional weapon grabs (which mention
flicking the bullwhip) I saw lots of regular attacks that said
"<mon> swings his bullwhip."  That is accurate but seems odd, so
change it to "<mon> lashes his bullwhip."  Do same for the hero.

While working on that, I discovered that monsters using a polearm
for a ranged attack always showed "<mon> thrusts <a polearm>" even
for ones that aren't defined as piercing so should be swung rather
that thrust.  And they're allowed to do that when adjacent where
there isn't enough room to thrust or swing a long polearm.  Now it's
"<mon> bashes with <a polearm>" in that situation.
This commit is contained in:
PatR
2021-12-21 02:56:59 -08:00
parent 81a7157d7d
commit f08c7f2101
6 changed files with 74 additions and 15 deletions

View File

@@ -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));
}