half poison gas damage from wearing a wet towel

Make wearing a wet towel confer new attribute Half_gas_damage in
addition to the usual blindness.  It reduces damage from being inside
a gas cloud region and from being hit by poison gas breath attack.
It also fully blocks breathing of potion vapors.

Might make the Plane of Fire easier although overcoming its blindness
with telepathy won't reveal elementals.  Definitely has the potential
to make blind-from-birth conduct easier which wasn't the intent and
probably isn't significant.
This commit is contained in:
PatR
2020-01-21 17:03:54 -08:00
parent a13d6c03c9
commit 3e18804371
7 changed files with 36 additions and 14 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 attrib.c $NHDT-Date: 1575245050 2019/12/02 00:04:10 $ $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.66 $ */
/* NetHack 3.6 attrib.c $NHDT-Date: 1579655026 2020/01/22 01:03:46 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.74 $ */
/* Copyright 1988, 1989, 1990, 1992, M. Stephenson */
/* NetHack may be freely redistributed. See license for details. */
@@ -277,11 +277,12 @@ int typ, fatal; /* if fatal is 0, limit damage to adjattrib */
boolean thrown_weapon; /* thrown weapons are less deadly */
{
int i, loss, kprefix = KILLED_BY_AN;
boolean blast = !strcmp(reason, "blast");
/* inform player about being poisoned unless that's already been done;
"blast" has given a "blast of poison gas" message; "poison arrow",
"poison dart", etc have implicitly given poison messages too... */
if (strcmp(reason, "blast") && !strstri(reason, "poison")) {
if (!blast && !strstri(reason, "poison")) {
boolean plural = (reason[strlen(reason) - 1] == 's') ? 1 : 0;
/* avoid "The" Orcus's sting was poisoned... */
@@ -290,7 +291,7 @@ boolean thrown_weapon; /* thrown weapons are less deadly */
plural ? "were" : "was");
}
if (Poison_resistance) {
if (!strcmp(reason, "blast"))
if (blast)
shieldeff(u.ux, u.uy);
pline_The("poison doesn't seem to affect you.");
return;
@@ -315,8 +316,12 @@ boolean thrown_weapon; /* thrown weapons are less deadly */
g.context.botl = TRUE;
pline_The("poison was deadly...");
} else if (i > 5) {
boolean cloud = !strcmp(reason, "gas cloud");
/* HP damage; more likely--but less severe--with missiles */
loss = thrown_weapon ? rnd(6) : rn1(10, 6);
if ((blast || cloud) && Half_gas_damage) /* worn towel */
loss = (loss + 1) / 2;
losehp(loss, pkiller, kprefix); /* poison damage */
} else {
/* attribute loss; if typ is A_STR, reduction in current and