Fix the healer knife bonus

dmgval is also used for monster attacks; move the healer knife
bonus to actual hero-specific code, and make sure it only
applies to hand-to-hand combat.
This commit is contained in:
Pasi Kallinen
2026-02-11 08:17:34 +02:00
parent 1135f5ffe5
commit db36ee35de
2 changed files with 7 additions and 4 deletions

View File

@@ -929,6 +929,13 @@ hmon_hitmon_weapon_melee(
hmd->dmg = dmgval(obj, mon);
/* a minimal hit doesn't exercise proficiency */
hmd->train_weapon_skill = (hmd->dmg > 1);
/* Healer with anatomy knowledge */
if (Role_if(PM_HEALER) && hmd->hand_to_hand
&& obj->oclass == WEAPON_CLASS
&& objects[obj->otyp].oc_skill == P_KNIFE)
hmd->dmg += min(3, svm.mvitals[monsndx(mon->data)].died / 6);
/* special attack actions */
if (!hmd->train_weapon_skill || mon == u.ustuck || u.twoweap
/* Cleaver can hit up to three targets at once so don't

View File

@@ -319,10 +319,6 @@ dmgval(struct obj *otmp, struct monst *mon)
}
}
/* Healer with anatomy knowledge */
if (Role_if(PM_HEALER) && objects[otmp->otyp].oc_skill == P_KNIFE)
tmp += min(3, svm.mvitals[monsndx(ptr)].died / 6);
/* Put weapon vs. monster type damage bonuses in below: */
if (Is_weapon || otmp->oclass == GEM_CLASS || otmp->oclass == BALL_CLASS
|| otmp->oclass == CHAIN_CLASS) {