wet towel enhancements
Flesh out wet towels a bit: 1) wielding a wet towel--or a dry one which becomes wet--won't give a "you begin bashing with your wet towel" message when attacking; 2) if a formerly wet towel dries out completely while wielded, *do* give "you begin bashing with your towel" on the next attack; 3) successfully hitting with a wet towel no longer always loses wetness; 4) water damage to dry towel always confers at least 1 point of wetness; 5) taking fire damage (via burnarmor() which is used for most types of fire damage) has a chance to partially or fully dry a wet towel (regardless of whether it's wielded at the time; applies to monsters as well as hero; each towel being carried is checked until one is affected, then any others escape drying. Not done: -) attacking with a wielded wet towel perhaps ought to be treated as a weapon attack using whip skill rather than an augmented arbitrary- junk-by-weight attack; -) throwing a wet towel should probably ignore wetness--it's just a wet piece of cloth when not finishing with a whip snap; right now, it loses a point of wetness when thrown and usually--#3 above--another point if it hits...; -) hitting burning creatures is no different than hitting anything else; -) likewise for hitting wet creatures.
This commit is contained in:
90
src/weapon.c
90
src/weapon.c
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.6 weapon.c $NHDT-Date: 1436753527 2015/07/13 02:12:07 $ $NHDT-Branch: master $:$NHDT-Revision: 1.51 $ */
|
||||
/* NetHack 3.6 weapon.c $NHDT-Date: 1445126431 2015/10/18 00:00:31 $ $NHDT-Branch: master $:$NHDT-Revision: 1.54 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -79,8 +79,9 @@ STATIC_DCL void FDECL(skill_advance, (int));
|
||||
static NEARDATA const char kebabable[] = { S_XORN, S_DRAGON, S_JABBERWOCK,
|
||||
S_NAGA, S_GIANT, '\0' };
|
||||
|
||||
/* weapon's skill category name for use as generalized description of weapon
|
||||
*/
|
||||
/* weapon's skill category name for use as generalized description of weapon;
|
||||
mostly used to shorten "you drop your <weapon>" messages when slippery
|
||||
fingers or polymorph causes hero to involuntarily drop wielded weapon(s) */
|
||||
const char *
|
||||
weapon_descr(obj)
|
||||
struct obj *obj;
|
||||
@@ -91,10 +92,12 @@ struct obj *obj;
|
||||
/* assorted special cases */
|
||||
switch (skill) {
|
||||
case P_NONE:
|
||||
/* not a weapon: use item class name; override "food" for corpses,
|
||||
tins, and eggs and "large rock" for statues and boulders */
|
||||
/* not a weapon or weptool: use item class name;
|
||||
override class name "food" for corpses, tins, and eggs,
|
||||
"large rock" for statues and boulders, and "tool" for towels */
|
||||
descr = (obj->otyp == CORPSE || obj->otyp == TIN || obj->otyp == EGG
|
||||
|| obj->otyp == STATUE || obj->otyp == BOULDER)
|
||||
|| obj->otyp == STATUE || obj->otyp == BOULDER
|
||||
|| obj->otyp == TOWEL)
|
||||
? OBJ_NAME(objects[obj->otyp])
|
||||
: def_oc_syms[(int) obj->oclass].name;
|
||||
break;
|
||||
@@ -102,13 +105,11 @@ struct obj *obj;
|
||||
if (is_ammo(obj))
|
||||
descr = (obj->otyp == ROCK || is_graystone(obj))
|
||||
? "stone"
|
||||
:
|
||||
/* avoid "rock"; what about known glass? */
|
||||
(obj->oclass == GEM_CLASS)
|
||||
: (obj->oclass == GEM_CLASS)
|
||||
? "gem"
|
||||
:
|
||||
/* in case somebody adds odd sling ammo */
|
||||
def_oc_syms[(int) obj->oclass].name;
|
||||
: def_oc_syms[(int) obj->oclass].name;
|
||||
break;
|
||||
case P_BOW:
|
||||
if (is_ammo(obj))
|
||||
@@ -738,7 +739,9 @@ struct monst *mon;
|
||||
}
|
||||
}
|
||||
|
||||
int abon() /* attack bonus for strength & dexterity */
|
||||
/* attack bonus for strength & dexterity */
|
||||
int
|
||||
abon()
|
||||
{
|
||||
int sbon;
|
||||
int str = ACURR(A_STR), dex = ACURR(A_DEX);
|
||||
@@ -774,7 +777,9 @@ int abon() /* attack bonus for strength & dexterity */
|
||||
return (sbon + dex - 14);
|
||||
}
|
||||
|
||||
int dbon() /* damage bonus for strength */
|
||||
/* damage bonus for strength */
|
||||
int
|
||||
dbon()
|
||||
{
|
||||
int str = ACURR(A_STR);
|
||||
|
||||
@@ -799,6 +804,67 @@ int dbon() /* damage bonus for strength */
|
||||
return (6);
|
||||
}
|
||||
|
||||
/* increase a towel's wetness */
|
||||
void
|
||||
wet_a_towel(obj, amt, verbose)
|
||||
struct obj *obj;
|
||||
int amt; /* positive: new value; negative: increment by -amt; zero: no-op */
|
||||
boolean verbose;
|
||||
{
|
||||
int newspe = (amt <= 0) ? obj->spe - amt : amt;
|
||||
|
||||
/* new state is only reported if it's an increase */
|
||||
if (newspe > obj->spe) {
|
||||
if (verbose) {
|
||||
const char *wetness = (newspe < 3)
|
||||
? (!obj->spe ? "damp" : "damper")
|
||||
: (!obj->spe ? "wet" : "wetter");
|
||||
|
||||
if (carried(obj))
|
||||
pline("%s gets %s.", Yobjnam2(obj, (const char *) 0),
|
||||
wetness);
|
||||
else if (mcarried(obj) && canseemon(obj->ocarry))
|
||||
pline("%s %s gets %s.", s_suffix(Monnam(obj->ocarry)),
|
||||
xname(obj), wetness);
|
||||
}
|
||||
}
|
||||
obj->spe = min(newspe, 7);
|
||||
|
||||
/* if hero is wielding this towel, don't give "you begin bashing
|
||||
with your wet towel" message on next attack with it */
|
||||
if (obj == uwep)
|
||||
unweapon = !is_wet_towel(obj);
|
||||
}
|
||||
|
||||
/* decrease a towel's wetness */
|
||||
void
|
||||
dry_a_towel(obj, amt, verbose)
|
||||
struct obj *obj;
|
||||
int amt; /* positive: new value; negative: decrement by -amt; zero: no-op */
|
||||
boolean verbose;
|
||||
{
|
||||
int newspe = (amt <= 0) ? obj->spe + amt : amt;
|
||||
|
||||
/* new state is only reported if it's a decrease */
|
||||
if (newspe < obj->spe) {
|
||||
if (verbose) {
|
||||
if (carried(obj))
|
||||
pline("%s dries%s.", Yobjnam2(obj, (const char *) 0),
|
||||
!newspe ? " out" : "");
|
||||
else if (mcarried(obj) && canseemon(obj->ocarry))
|
||||
pline("%s %s drie%s.", s_suffix(Monnam(obj->ocarry)),
|
||||
xname(obj), !newspe ? " out" : "");
|
||||
}
|
||||
}
|
||||
newspe = min(newspe, 7);
|
||||
obj->spe = max(newspe, 0);
|
||||
|
||||
/* if hero is wielding this towel and it is now dry, give "you begin
|
||||
bashing with your towel" message on next attack with it */
|
||||
if (obj == uwep)
|
||||
unweapon = !is_wet_towel(obj);
|
||||
}
|
||||
|
||||
/* copy the skill level name into the given buffer */
|
||||
STATIC_OVL char *
|
||||
skill_level_name(skill, buf)
|
||||
|
||||
Reference in New Issue
Block a user