You("are blasted by %s power!", s_suffix(the(xname(obj))));
dmg = d((Antimagic ? 2 : 4), (self_willed ? 10 : 4));
Sprintf(buf, "touching %s", oart->name);
- losehp(dmg, buf, KILLED_BY);
+ losehp(dmg, buf, KILLED_BY); /* magic damage, not physical */
exercise(A_WIS, FALSE);
}
pline("Sparks fly as you whack the %s.%s",
sobj_at(STATUE, rx, ry) ? "statue" : "boulder",
vibrate ? " The axe-handle vibrates violently!" : "");
- if (vibrate) losehp(2, "axing a hard object", KILLED_BY);
+ if (vibrate) losehp(Maybe_Half_Phys(2),
+ "axing a hard object", KILLED_BY);
}
else
You("swing %s through thin air.",
}
}
hitfloor(obj);
- losehp(dmg, "falling object", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(dmg), "falling object", KILLED_BY_AN);
}
return TRUE;
}
} else if (acidic(&mons[mnum]) && !Acid_resistance) {
tp++;
You("have a very bad case of stomach acid."); /* not body_part() */
- losehp(rnd(15), "acidic corpse", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rnd(15)), "acidic corpse", KILLED_BY_AN);
} else if (poisonous(&mons[mnum]) && rn2(5)) {
tp++;
pline("Ecch - that must have been poisonous!");
case 2: You("take a sip of scalding hot water.");
if (Fire_resistance)
pline("It seems quite tasty.");
- else losehp(rnd(6), "sipping boiling water", KILLED_BY);
+ else losehp(Maybe_Half_Phys(rnd(6)),
+ "sipping boiling water", KILLED_BY);
break;
case 3: if (mvitals[PM_SEWER_RAT].mvflags & G_GONE)
pline_The("sink seems quite dirty.");
You_feel("exhausted.");
exercise(A_STR, FALSE);
tmp = rn1(10, 6);
- if(Half_physical_damage) tmp = (tmp+1) / 2;
- losehp(tmp, "exhaustion", KILLED_BY);
+ losehp(Maybe_Half_Phys(tmp), "exhaustion", KILLED_BY);
break;
}
}
body_part(STOMACH));
Sprintf(killer.name, "%s explosion",
s_suffix(mdat->mname));
- if (Half_physical_damage) tmp = (tmp+1) / 2;
- losehp(tmp, killer.name, KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(tmp), killer.name, KILLED_BY_AN);
} else {
if (!Deaf) You_hear("an explosion.");
magr->mhp -= tmp;
pline("You%s!", poiseff[typ]);
} else {
i = thrown_weapon ? rnd(6) : rn1(10,6);
- if(Half_physical_damage) i = (i+1) / 2;
- losehp(i, pname, kprefix);
+ losehp(Maybe_Half_Phys(i), pname, kprefix);
}
if(u.uhp < 1) {
killer.format = kprefix;
pline("It doesn't seem to hurt you.");
else {
if (is_acid) pline("It burns!");
- if (Half_physical_damage) dam = (dam+1) / 2;
- losehp(dam, knm, kprefix);
+ losehp(Maybe_Half_Phys(dam), knm, kprefix);
exercise(A_STR, FALSE);
}
return(1);
stackobj(otmp2);
newsym(u.ux, u.uy);
}
- if (dmg) losehp(dmg, "scroll of earth", KILLED_BY_AN);
+ if (dmg) losehp(Maybe_Half_Phys(dmg), "scroll of earth",
+ KILLED_BY_AN);
}
xxx_noobj:
You("carefully open the bag...");
pline("It develops a huge set of teeth and bites you!");
tmp = rnd(10);
- if (Half_physical_damage) tmp = (tmp+1) / 2;
- losehp(tmp, "carnivorous bag", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(tmp), "carnivorous bag", KILLED_BY_AN);
makeknown(BAG_OF_TRICKS);
timepassed = 1;
continue;
/* Not necessarily a creature who _likes_ acid */
pline("This tastes %s.", Hallucination ? "tangy" : "sour");
else {
+ int dmg;
pline("This burns%s!", otmp->blessed ? " a little" :
otmp->cursed ? " a lot" : " like acid");
- losehp(d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8),
+ dmg = d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8);
+ losehp(Maybe_Half_Phys(dmg),
"potion of acid", KILLED_BY_AN);
exercise(A_CON, FALSE);
}
break;
case POT_ACID:
if (!Acid_resistance) {
+ int dmg;
pline("This burns%s!", obj->blessed ? " a little" :
obj->cursed ? " a lot" : "");
- losehp(d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8),
+ dmg = d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
+ losehp(Maybe_Half_Phys(dmg),
"potion of acid", KILLED_BY_AN);
}
break;
if (obj->otyp == POT_ACID) {
pline("It boils vigorously!");
You("are caught in the explosion!");
- losehp(rnd(10), "elementary chemistry", KILLED_BY);
+ losehp(Maybe_Half_Phys(rnd(10)), "elementary chemistry",
+ KILLED_BY);
makeknown(obj->otyp);
update_inventory();
return (TRUE);
potionbreathe(obj);
useup(obj);
useup(potion);
- losehp(rnd(10), "alchemic blast", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rnd(10)), "alchemic blast",
+ KILLED_BY_AN);
return(1);
}
You_feel("like you are falling apart.");
/* KMH -- Gods have mastery over unchanging */
rehumanize();
+ /* no Half_physical_damage adjustment here */
losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN);
exercise(A_CON, FALSE);
return(1);
if (is_on) Ring_gone(obj);
s = rnd(3 * abs(obj->spe)); /* amount of damage */
useup(obj);
- losehp(s, "exploding ring", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(s), "exploding ring", KILLED_BY_AN);
} else {
long mask = is_on ? (obj == uleft ? LEFT_RING :
RIGHT_RING) : 0L;
} else {
pline_The("scroll catches fire and you burn your %s.",
makeplural(body_part(HAND)));
- losehp(1, "scroll of fire", KILLED_BY_AN);
+ losehp(Half_physical_damage ? rn2(2) : 1,
+ "scroll of fire", KILLED_BY_AN);
}
return(1);
}
stackobj(otmp2);
newsym(u.ux, u.uy);
}
- if (dmg) losehp(dmg, "scroll of earth", KILLED_BY_AN);
+ if (dmg) losehp(Maybe_Half_Phys(dmg), "scroll of earth",
+ KILLED_BY_AN);
}
}
break;
wand_explode(obj)
register struct obj *obj;
{
+ int vibration_dmg;
obj->in_use = TRUE; /* in case losehp() is fatal */
pline("%s vibrates violently, and explodes!", Yname2(obj));
nhbell();
- losehp(rnd(2*(u.uhpmax+1)/3), "exploding wand", KILLED_BY_AN);
+ vibration_dmg = rnd(2*(u.uhpmax+1)/3);
+ losehp(Maybe_Half_Phys(vibration_dmg), "exploding wand", KILLED_BY_AN);
useup(obj);
exercise(A_STR, FALSE);
}
pline("%s you!", A_gush_of_water_hits);
You("are covered with rust!");
- if (Half_physical_damage) dam = (dam+1) / 2;
- losehp(dam, "rusting away", KILLED_BY);
+ losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY);
break;
} else if (u.umonnum == PM_GREMLIN && rn2(3)) {
pline("%s you!", A_gush_of_water_hits);
(void)split_mon(&youmonst, (struct monst *)0);
else if (u.umonnum == PM_IRON_GOLEM) {
You("rust!");
- i = d(2,6);
+ i = Maybe_Half_Phys(d(2,6));
if (u.mhmax > i) u.mhmax -= i;
losehp(i, "rusting away", KILLED_BY);
}
delobj(otmp);
}
wake_nearby();
- losehp(d(6,6), buf, KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(d(6,6)), buf, KILLED_BY_AN);
exercise(A_STR, FALSE);
if(costly && loss) {
if(insider)