Enable hero to wash hands in fountains and pools

Dipping hands (with '-') or currently-worn gloves in a fountain or pool
will cause the hero to wash her hands, washing away any oil and clearing
the Glib intrinsic timeout.  This does mean bare hands can be used to
fish for fountain effects, without having to pick up a stray arrow and
carry it around as a dipping item, but having your hands be the only
thing that does not activate those effects felt weird.  If that would be
too unbalancing this could be scrapped.
This commit is contained in:
Michael Meyer
2023-11-09 16:41:04 -08:00
committed by PatR
parent 33034ebaba
commit 5af1fad398
3 changed files with 58 additions and 13 deletions
+29 -5
View File
@@ -389,6 +389,7 @@ void
dipfountain(register struct obj *obj)
{
int er = ER_NOTHING;
boolean is_hands = (obj == &cg.zeroobj);
if (Levitation) {
floating_above("fountain");
@@ -437,17 +438,19 @@ dipfountain(register struct obj *obj)
if (in_town(u.ux, u.uy))
(void) angry_guards(FALSE);
return;
} else if (is_hands || obj == uarmg) {
er = wash_hands();
} else {
er = water_damage(obj, NULL, TRUE);
}
if (er == ER_DESTROYED || (er != ER_NOTHING && !rn2(2))) {
return; /* no further effect */
}
if (er == ER_DESTROYED || (er != ER_NOTHING && !rn2(2))) {
return; /* no further effect */
}
switch (rnd(30)) {
case 16: /* Curse the item */
if (obj->oclass != COIN_CLASS && !obj->cursed) {
if (!is_hands && obj->oclass != COIN_CLASS && !obj->cursed) {
curse(obj);
}
break;
@@ -455,7 +458,7 @@ dipfountain(register struct obj *obj)
case 18:
case 19:
case 20: /* Uncurse the item */
if (obj->cursed) {
if (!is_hands && obj->cursed) {
if (!Blind)
pline_The("%s glows for a moment.", hliquid("water"));
uncurse(obj);
@@ -539,6 +542,27 @@ dipfountain(register struct obj *obj)
dryup(u.ux, u.uy, TRUE);
}
int
wash_hands(void)
{
const char *hands = makeplural(body_part(HAND));
int res = ER_NOTHING;
You("wash your %s%s in the %s.", uarmg ? "gloved " : "", hands,
hliquid("water"));
if (Glib) {
make_glib(0);
Your("%s are no longer slippery.",
uarmg ? gloves_simple_name(uarmg) : hands);
/* not what ER_GREASED is for, but the checks in dipfountain just
compare the result to ER_DESTROYED and ER_NOTHING, so it works */
res = ER_GREASED;
} else if (uarmg) {
res = water_damage(uarmg, (const char *) 0, TRUE);
}
return res;
}
void
breaksink(coordxy x, coordxy y)
{