case TT_BEARTRAP: {
register long side = rn2(3) ? LEFT_SIDE : RIGHT_SIDE;
You("rip yourself free of the bear trap! Ouch!");
- losehp(rnd(10), "jumping out of a bear trap", KILLED_BY);
+ losehp(Maybe_Half_Phys(rnd(10)),
+ "jumping out of a bear trap", KILLED_BY);
set_wounded_legs(side, rn1(1000,500));
break;
}
vision_full_recalc = 1;
You("find yourself on dry land again!");
} else if (lava && distu(rx,ry) <= 2) {
+ int dmg;
You("are hit by molten lava%c",
Fire_resistance ? '.' : '!');
burn_away_slime();
- losehp(d((Fire_resistance ? 1 : 3), 6),
+ dmg = d((Fire_resistance ? 1 : 3), 6);
+ losehp(Maybe_Half_Phys(dmg),
"molten lava", KILLED_BY);
} else if (!fills_up && flags.verbose &&
(pushing ? !Blind : cansee(rx,ry)))
dismount_steed(DISMOUNT_FELL);
else
#endif
- losehp(rnd(3), "falling downstairs", KILLED_BY);
+ losehp(Maybe_Half_Phys(rnd(3)),
+ "falling downstairs", KILLED_BY);
selftouch("Falling, you");
} else if (u.dz && at_ladder)
You("climb down the ladder.");
struct monst *mon;
boolean may_pass = TRUE;
struct trap *ttmp;
+ int dmg = 0;
if (!isok(x,y)) {
You_feel("the spirits holding you back.");
s = "bumping into a wall";
else
s = "bumping into a door";
- losehp(rnd(2+*range), s, KILLED_BY);
+ dmg = rnd(2+*range);
+ losehp(Maybe_Half_Phys(dmg), s, KILLED_BY);
return FALSE;
}
if (levl[x][y].typ == IRONBARS) {
You("crash into some iron bars. Ouch!");
- losehp(rnd(2+*range), "crashing into iron bars", KILLED_BY);
+ dmg = rnd(2+*range);
+ losehp(Maybe_Half_Phys(dmg), "crashing into iron bars", KILLED_BY);
return FALSE;
}
if ((obj = sobj_at(BOULDER,x,y)) != 0) {
You("bump into a %s. Ouch!", xname(obj));
- losehp(rnd(2+*range), "bumping into a boulder", KILLED_BY);
+ dmg = rnd(2+*range);
+ losehp(Maybe_Half_Phys(dmg), "bumping into a boulder", KILLED_BY);
return FALSE;
}
if (!may_pass) {
/* did we hit a no-dig non-wall position? */
You("smack into something!");
- losehp(rnd(2+*range), "touching the edge of the universe", KILLED_BY);
+ dmg = rnd(2+*range);
+ losehp(Maybe_Half_Phys(dmg), "touching the edge of the universe",
+ KILLED_BY);
return FALSE;
}
if ((u.ux - x) && (u.uy - y) &&
if (bigmonst(youmonst.data) || too_much) {
You("%sget forcefully wedged into a crevice.",
too_much ? "and all your belongings " : "");
- losehp(rnd(2+*range), "wedging into a narrow crevice", KILLED_BY);
+ dmg = rnd(2+*range);
+ losehp(Maybe_Half_Phys(dmg), "wedging into a narrow crevice",
+ KILLED_BY);
return FALSE;
}
}
body_part(ARM));
(void) artifact_hit((struct monst *)0,
&youmonst, obj, &dmg, 0);
- losehp(dmg, xname(obj),
+ losehp(Maybe_Half_Phys(dmg), xname(obj),
obj_is_pname(obj) ? KILLED_BY : KILLED_BY_AN);
}
if (ship_object(obj, u.ux, u.uy, FALSE)) {
dosinkfall()
{
register struct obj *obj;
+ int dmg;
if (is_floater(youmonst.data) || (HLevitation & FROMOUTSIDE)) {
You("wobble unsteadily for a moment.");
are really still worn has no effect on bones data */
ELevitation = HLevitation = 0L;
You("crash to the floor!");
- losehp(rn1(8, 25 - (int)ACURR(A_CON)),
+ dmg = rn1(8, 25 - (int)ACURR(A_CON));
+ losehp(Maybe_Half_Phys(dmg),
fell_on_sink, NO_KILLER_PREFIX);
exercise(A_DEX, FALSE);
selftouch("Falling, you");
for (obj = level.objects[u.ux][u.uy]; obj; obj = obj->nexthere)
if (obj->oclass == WEAPON_CLASS || is_weptool(obj)) {
You("fell on %s.", doname(obj));
- losehp(rnd(3), fell_on_sink, NO_KILLER_PREFIX);
+ losehp(Maybe_Half_Phys(rnd(3)), fell_on_sink, NO_KILLER_PREFIX);
exercise(A_CON, FALSE);
}
ELevitation = save_ELev;
You("fall into a chasm!");
u.utrap = rn1(6,2);
u.utraptype = TT_PIT;
- losehp(rnd(6),"fell into a chasm",
+ losehp(Maybe_Half_Phys(rnd(6)),
+ "fell into a chasm",
NO_KILLER_PREFIX);
selftouch("Falling, you");
}
struct obj *instr;
{
int damage, do_spec = !Confusion;
+ boolean physical_damage = FALSE;
#if defined(MAC) || defined(AMIGA) || defined(VPIX_MUSIC) || defined (PCMUSIC)
struct obj itmp;
if (do_spec) charm_snakes(u.ulevel * 3);
exercise(A_DEX, TRUE);
break;
- case FROST_HORN: /* Idem wand of cold */
case FIRE_HORN: /* Idem wand of fire */
+ physical_damage = TRUE;
+ /* fall through */
+ case FROST_HORN: /* Idem wand of cold */
if (do_spec && instr->spe > 0) {
consume_obj_charge(instr, TRUE);
if ((damage = zapyourself(instr, TRUE)) != 0) {
char buf[BUFSZ];
Sprintf(buf, "using a magical horn on %sself", uhim());
+ if (physical_damage) damage = Maybe_Half_Phys(damage);
losehp(damage, buf, KILLED_BY);
}
} else {
you_unwere(FALSE);
u.ulycn = NON_PM; /* cure lycanthropy */
}
- losehp(d(2,6), "potion of holy water", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(d(2,6)),
+ "potion of holy water", KILLED_BY_AN);
} else if(otmp->cursed) {
You_feel("quite proud of yourself.");
healup(d(2,6),0,0,0);
} else {
if(u.ualign.type == A_LAWFUL) {
pline("This burns like acid!");
- losehp(d(2,6), "potion of unholy water",
+ losehp(Maybe_Half_Phys(d(2,6)),
+ "potion of unholy water",
KILLED_BY_AN);
} else
You_feel("full of dread.");
&& (u.ux != sstairs.sx || u.uy != sstairs.sy || !sstairs.up)
&& (!xupladder || u.ux != xupladder || u.uy != yupladder)
) {
+ int dmg = uarmh ? 1 : rnd(10);
You("hit your %s on the %s.",
body_part(HEAD),
ceiling(u.ux,u.uy));
- losehp(uarmh ? 1 : rnd(10),
+ losehp(Maybe_Half_Phys(dmg),
"colliding with the ceiling",
KILLED_BY);
} else (void) doup();
distance = 0;
pline_The("%s crashes on your %s and breaks into shards.",
botlnam, body_part(HEAD));
- losehp(rnd(2), "thrown potion", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rnd(2)), "thrown potion", KILLED_BY_AN);
} else {
distance = distu(mon->mx,mon->my);
if (!cansee(mon->mx,mon->my)) pline("Crash!");
if (!Poison_resistance) {
pline("%s is burning your %s!", Something, makeplural(body_part(LUNG)));
You("cough and spit blood!");
- losehp(rnd(dam) + 5, "gas cloud", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rnd(dam) + 5), "gas cloud", KILLED_BY_AN);
return FALSE;
} else {
You("cough!");
} else if(u.utraptype == TT_PIT) {
if(trap->ttyp == SPIKED_PIT) {
You("sit down on a spike. Ouch!");
- losehp(1, "sitting on an iron spike", KILLED_BY);
+ losehp(Half_physical_damage ? rn2(2) : 1,
+ "sitting on an iron spike", KILLED_BY);
exercise(A_STR, FALSE);
} else
You("sit down in the pit.");
struct obj *bp;
{
int lev = objects[bp->otyp].oc_level;
+ int dmg = 0;
switch(rn2(lev)) {
case 0:
} else {
pline("As you read the book, it %s in your %s!",
explodes, body_part(FACE));
- losehp(2*rnd(10)+5, "exploding rune", KILLED_BY_AN);
+ dmg = 2*rnd(10)+5;
+ losehp(Maybe_Half_Phys(dmg), "exploding rune", KILLED_BY_AN);
}
return TRUE;
default:
int energy, damage, chance, n, intell;
int skill, role_skill;
boolean confused = (Confusion != 0);
+ boolean physical_damage = FALSE;
struct obj *pseudo;
coord cc;
* effects, e.g. more damage, further distance, and so on, without
* additional cost to the spellcaster.
*/
- case SPE_CONE_OF_COLD:
case SPE_FIREBALL:
+ physical_damage = TRUE;
+ /* fall through */
+ case SPE_CONE_OF_COLD:
if (role_skill >= P_SKILLED) {
if (throwspell()) {
cc.x=u.dx;cc.y=u.dy;
if ((damage = zapyourself(pseudo, TRUE)) != 0) {
char buf[BUFSZ];
Sprintf(buf, "zapped %sself with a spell", uhim());
+ if (physical_damage)
+ damage = Maybe_Half_Phys(damage);
losehp(damage, buf, NO_KILLER_PREFIX);
}
} else {
/* these spells are all duplicates of wand effects */
case SPE_FORCE_BOLT:
+ physical_damage = TRUE;
+ /* fall through */
case SPE_SLEEP:
case SPE_MAGIC_MISSILE:
case SPE_KNOCK:
if ((damage = zapyourself(pseudo, TRUE)) != 0) {
char buf[BUFSZ];
Sprintf(buf, "zapped %sself with a spell", uhim());
+ if (physical_damage) damage = Maybe_Half_Phys(damage);
losehp(damage, buf, NO_KILLER_PREFIX);
}
} else weffects(pseudo);
x_monnam(mtmp, ARTICLE_A, (char *)0,
SUPPRESS_IT|SUPPRESS_INVISIBLE|SUPPRESS_HALLUCINATION,
TRUE));
- losehp(rn1(5,10), buf, NO_KILLER_PREFIX);
+ losehp(Maybe_Half_Phys(rn1(5,10)), buf, NO_KILLER_PREFIX);
return (FALSE);
}
case DISMOUNT_FELL:
You("%s off of %s!", verb, mon_nam(mtmp));
if (!have_spot) have_spot = landing_spot(&cc,reason,1);
- losehp(rn1(10,10), "riding accident", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rn1(10,10)), "riding accident", KILLED_BY_AN);
set_wounded_legs(BOTH_SIDES, (int)HWounded_legs + rn1(5,5));
repair_leg_damage = FALSE;
break;
if (!num)
You("are uninjured.");
else
- losehp(num, tower_of_flame, KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(num), tower_of_flame, KILLED_BY_AN);
burn_away_slime();
if (burnarmor(&youmonst) || rn2(3)) {
break;
}
You("are suddenly very hot!");
- mdamageu(mon, tmp);
+ mdamageu(mon, Maybe_Half_Phys(tmp));
}
break;
case AD_ELEC:
backfire(otmp)
struct obj *otmp;
{
+ int dmg;
otmp->in_use = TRUE; /* in case losehp() is fatal */
pline("%s suddenly explodes!", The(xname(otmp)));
- losehp(d(otmp->spe+2,6), "exploding wand", KILLED_BY_AN);
+ dmg = d(otmp->spe+2,6);
+ losehp(Maybe_Half_Phys(dmg), "exploding wand", KILLED_BY_AN);
useup(otmp);
}
if ((damage = zapyourself(obj, TRUE)) != 0) {
char buf[BUFSZ];
Sprintf(buf, "zapped %sself with a wand", uhim());
- losehp(damage, buf, NO_KILLER_PREFIX);
+ losehp(Maybe_Half_Phys(damage), buf, NO_KILLER_PREFIX);
}
} else {
} else if (striking && u.dz < 0 && rn2(3) &&
!Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz) &&
!Underwater && !Is_qstart(&u.uz)) {
+ int dmg;
/* similar to zap_dig() */
pline("A rock is dislodged from the %s and falls on your %s.",
ceiling(x, y), body_part(HEAD));
- losehp(rnd((uarmh && is_metallic(uarmh)) ? 2 : 6),
+ dmg = rnd((uarmh && is_metallic(uarmh)) ? 2 : 6);
+ losehp(Maybe_Half_Phys(dmg),
"falling rock", KILLED_BY_AN);
if ((otmp = mksobj_at(ROCK, x, y, FALSE, FALSE)) != 0) {
(void)xname(otmp); /* set dknown, maybe bknown */
register long i, cnt, quan;
register int dindx;
const char *mult;
+ boolean physical_damage;
for(obj = invent; obj; obj = obj2) {
obj2 = obj->nobj;
+ physical_damage = FALSE;
if(obj->oclass != osym) continue; /* test only objs of type osym */
if(obj->oartifact) continue; /* don't destroy artifacts */
if(obj->in_use && obj->quan == 1) continue; /* not available */
break;
case AD_FIRE:
xresist = (Fire_resistance && obj->oclass != POTION_CLASS);
+ physical_damage = TRUE;
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL)
skip++;
const char *how = destroy_strings[dindx * 3 + 2];
boolean one = (cnt == 1L);
+ if (physical_damage) dmg = Maybe_Half_Phys(dmg);
losehp(dmg, one ? how : (const char *)makeplural(how),
one ? KILLED_BY_AN : KILLED_BY);
exercise(A_STR, FALSE);