From 78217c3ebd36f6a797158dc121bbdabf796fbe79 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Fri, 13 Feb 2026 12:50:27 +0200 Subject: [PATCH] Allow rogues to backstab sleeping or paralyzed monsters --- doc/fixes3-7-0.txt | 2 ++ src/uhitm.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 3bcb9e172..6f801ae22 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1579,6 +1579,8 @@ light-spell is clerical, if playing a priest boomerang can hit multiple monsters the "bustling town" minetown has more peacefuls healers may get tiny damage increase when attacking with knives +allow rogues to also backstab sleeping or paralyzed monsters +rogues cannot backstab monsters that have no backside Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/uhitm.c b/src/uhitm.c index 22a6456b3..af4e8ca8a 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -26,6 +26,7 @@ staticfn void hmon_hitmon_barehands(struct _hitmon_data *, struct monst *) NONNULLARG12; staticfn void hmon_hitmon_weapon_ranged(struct _hitmon_data *, struct monst *, struct obj *) NONNULLARG123; +staticfn boolean backstabbable(struct monst *) NONNULLARG1; staticfn void hmon_hitmon_weapon_melee(struct _hitmon_data *, struct monst *, struct obj *) NONNULLARG123; staticfn void hmon_hitmon_weapon(struct _hitmon_data *, struct monst *, @@ -915,6 +916,20 @@ hmon_hitmon_weapon_ranged( } } +/* can monster be stabbed in the back? */ +staticfn boolean +backstabbable(struct monst *mon) +{ + return !amorphous(mon->data) + && !is_whirly(mon->data) + && !noncorporeal(mon->data) + && mon->data->mlet != S_BLOB + && mon->data->mlet != S_EYE + && mon->data->mlet != S_FUNGUS + && canseemon(mon) + && (mon->mflee || helpless(mon)); +} + staticfn void hmon_hitmon_weapon_melee( struct _hitmon_data *hmd, @@ -942,7 +957,7 @@ hmon_hitmon_weapon_melee( let it also hit from behind or shatter foes' weapons */ || (hmd->hand_to_hand && is_art(obj, ART_CLEAVER))) { ; /* no special bonuses */ - } else if (mon->mflee && Role_if(PM_ROGUE) && !Upolyd + } else if (Role_if(PM_ROGUE) && backstabbable(mon) && !Upolyd /* multi-shot throwing is too powerful here */ && hmd->hand_to_hand) { You("strike %s from behind!", mon_nam(mon));