MCPcopy Create free account
hub / github.com/NetHack/NetHack / dry_a_towel

Function dry_a_towel

src/weapon.c:1066–1088  ·  view source on GitHub ↗

decrease a towel's wetness; unlike when wetting, 0 is not a no-op */

Source from the content-addressed store, hash-verified

1064
1065/* decrease a towel's wetness; unlike when wetting, 0 is not a no-op */
1066void
1067dry_a_towel(
1068 struct obj *obj,
1069 int amt, /* positive or zero: new value; negative: decrement by abs(amt) */
1070 boolean verbose)
1071{
1072 int newspe = (amt < 0) ? obj->spe + amt : amt;
1073
1074 /* new state is only reported if it's a decrease */
1075 if (newspe < obj->spe) {
1076 if (verbose) {
1077 if (carried(obj))
1078 pline("%s dries%s.", Yobjnam2(obj, (const char *) 0),
1079 !newspe ? " out" : "");
1080 else if (mcarried(obj) && canseemon(obj->ocarry))
1081 pline("%s %s dries%s.", s_suffix(Monnam(obj->ocarry)),
1082 xname(obj), !newspe ? " out" : "");
1083 }
1084 }
1085
1086 if (newspe != obj->spe)
1087 finish_towel_change(obj, newspe);
1088}
1089
1090/* copy the skill level name into the given buffer */
1091char *

Callers 5

hmon_hitmonFunction · 0.85
doengrave_sfx_itemFunction · 0.85
throw_objFunction · 0.85
burnarmorFunction · 0.85
use_towelFunction · 0.85

Calls 7

Yobjnam2Function · 0.85
canseemonFunction · 0.85
s_suffixFunction · 0.85
MonnamFunction · 0.85
xnameFunction · 0.85
finish_towel_changeFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected