confirmation for polearm attacks (trunk only)

From a bug report, 2005:  applying a
polearm towards a monster ignores the `confirm' option.  It's a wielded
weapon attack but is handled internally as a throw since it's also a
ranged attack.  The report included a small patch for use_pole() but I'm
calling the regular attack confirmation routine instead.

     Also, move the penalty for samurai attacking peaceful monsters into
the same routine that handles knight attacking defenseless monsters so
that they're more consistent.
This commit is contained in:
nethack.rankin
2007-05-28 00:20:43 +00:00
parent 2b29d99315
commit bb5ade4293
4 changed files with 27 additions and 20 deletions

View File

@@ -140,7 +140,9 @@ struct obj *wep; /* uwep for attack(), null for kick_monster() */
/* if it was an invisible mimic, treat it as if we stumbled
* onto a visible mimic
*/
if(mtmp->m_ap_type && !Protection_from_shape_changers) {
if (mtmp->m_ap_type && !Protection_from_shape_changers &&
/* applied pole-arm attack is too far to get stuck */
distu(mtmp->mx, mtmp->my) <= 2) {
if(!u.ustuck && !mtmp->mflee && dmgtype(mtmp->data,AD_STCK))
u.ustuck = mtmp;
}
@@ -220,12 +222,17 @@ void
check_caitiff(mtmp)
struct monst *mtmp;
{
if (u.ualign.record <= -10) return;
if (Role_if(PM_KNIGHT) && u.ualign.type == A_LAWFUL &&
(!mtmp->mcanmove || mtmp->msleeping ||
(mtmp->mflee && !mtmp->mavenge)) &&
u.ualign.record > -10) {
(mtmp->mflee && !mtmp->mavenge))) {
You("caitiff!");
adjalign(-1);
} else if (Role_if(PM_SAMURAI) && mtmp->mpeaceful) {
/* attacking peaceful creatures is bad for the samurai's giri */
You("dishonorably attack the innocent!");
adjalign(-1);
}
}
@@ -245,15 +252,8 @@ int *attk_count, *role_roll_penalty;
/* some actions should occur only once during multiple attacks */
if (!(*attk_count)++) {
/* knight's chivalry */
/* knight's chivalry or samurai's giri */
check_caitiff(mtmp);
/* attacking peaceful creatures is bad for the samurai's giri */
if (Role_if(PM_SAMURAI) && mtmp->mpeaceful &&
u.ualign.record > -10) {
You("dishonorably attack the innocent!");
adjalign(-1);
}
}
/* adjust vs. (and possibly modify) monster state */