From 182abe6b60d6488a93bd31e6102c6392dcfc41e2 Mon Sep 17 00:00:00 2001 From: PatR Date: Fri, 21 Jan 2022 11:38:21 -0800 Subject: [PATCH] wet towel tweaks When hitting with a wielded wet towel, use "you lash " like bullwhip. If you continue with the towel after it has dried out, message reverts to ordinary "you hit ". Enhance damage slightly and double the wetness bonus when target is an iron golem. Damage was (tmp=rnd(1..7), max(tmp,6)); now it's rnd(1 + 1..7) for other monsters, rnd(1 + 2*(1..7)) for iron golem, with no cap of 6 for either. Sequencing: defer "your towel dries" until after the lash message. --- doc/fixes37.0 | 6 +++++- src/uhitm.c | 49 +++++++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 23 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index b0725fac5..96c85cfba 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -720,7 +720,8 @@ 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 -attack feedback when using a bullwhip said "swing"; change to "lash" +attack feedback when using a bullwhip said "swing"; change to "lash"; + use "lash" for hero hitting with wet towel too attack feedback for monster using polearm when adjacent said "thrust"; change to "bash" apply runmode delay to multiturn actions, not just running @@ -753,6 +754,9 @@ change movement keys and some special keys into extended commands fix typo in message shown when hero sees a monster's wet towel become drier for hero with slippery fingers, enlightenment reports "slippery fingers" or "slippery gloves" but self-probing described it as "slippery hands" +when hitting with wet towel causes it to lose some wetness, defer "your towel + dries" until after the hit message +do some extra damage when hitting an iron golem with a wet towel Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/uhitm.c b/src/uhitm.c index e383a30c4..3d6c6567c 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -744,7 +744,7 @@ hmon_hitmon(struct monst *mon, boolean ispoisoned = FALSE, needpoismsg = FALSE, poiskilled = FALSE, unpoisonmsg = FALSE; boolean silvermsg = FALSE, silverobj = FALSE; - boolean lightobj = FALSE; + boolean lightobj = FALSE, dryit = FALSE; boolean use_weapon_skill = FALSE, train_weapon_skill = FALSE; boolean unarmed = !uwep && !uarm && !uarms; boolean hand_to_hand = (thrown == HMON_MELEE @@ -1146,30 +1146,32 @@ hmon_hitmon(struct monst *mon, default: /* non-weapons can damage because of their weight */ /* (but not too much) */ - tmp = obj->owt / 100; - if (is_wet_towel(obj)) { - /* wielded wet towel should probably use whip skill - (but not by setting objects[TOWEL].oc_skill==P_WHIP - because that would turn towel into a weptool) */ - tmp += obj->spe; - if (rn2(obj->spe + 1)) /* usually lose some wetness */ - dry_a_towel(obj, -1, TRUE); - } - if (tmp < 1) - tmp = 1; - else - tmp = rnd(tmp); + tmp = (obj->owt + 99) / 100; + tmp = (tmp <= 1) ? 1 : rnd(tmp); if (tmp > 6) tmp = 6; - /* - * Things like silver wands can arrive here so - * so we need another silver check. - */ + /* wet towel has modest damage bonus beyond its weight, + based on its wetness */ + if (is_wet_towel(obj)) { + boolean doubld = (mon->data == &mons[PM_IRON_GOLEM]); + + /* wielded wet towel should probably use whip skill + (but not by setting objects[TOWEL].oc_skill==P_WHIP + because that would turn towel into a weptool); + due to low weight, tmp always starts at 1 here, and + due to wet towel's definition, obj->spe is 1..7 */ + tmp += obj->spe * (doubld ? 2 : 1); + tmp = rnd(tmp); /* wet towel damage not capped at 6 */ + /* usually lose some wetness but defer doing so + until after hit message */ + dryit = (rn2(obj->spe + 1) > 0); + } + /* things like silver wands can arrive here so + so we need another silver check */ if (objects[obj->otyp].oc_material == SILVER && mon_hates_silver(mon)) { tmp += rnd(20); - silvermsg = TRUE; - silverobj = TRUE; + silvermsg = silverobj = TRUE; } } } @@ -1358,15 +1360,18 @@ hmon_hitmon(struct monst *mon, hit(mshot_xname(obj), mon, exclam(tmp)); else if (!flags.verbose) You("hit it."); - else + else /* hand_to_hand */ You("%s %s%s", (obj && (is_shield(obj) || obj->otyp == HEAVY_IRON_BALL)) ? "bash" - : (obj && obj->otyp == BULLWHIP) ? "lash" /* hand_to_hand */ + : (obj && (obj->otyp == BULLWHIP + || is_wet_towel(obj))) ? "lash" : Role_if(PM_BARBARIAN) ? "smite" : "hit", mon_nam(mon), canseemon(mon) ? exclam(tmp) : "."); } + if (dryit) /* dryit implies wet towel, so 'obj' is still intact */ + dry_a_towel(obj, -1, TRUE); if (silvermsg) { const char *fmt;