if (dam <= 0) dam = 1;
You("hit your %s with your bullwhip.", body_part(FOOT));
Sprintf(buf, "killed %sself with %s bullwhip", uhim(), uhis());
- losehp(dam, buf, NO_KILLER_PREFIX);
+ losehp(Maybe_Half_Phys(dam), buf, NO_KILLER_PREFIX);
context.botl = 1;
return 1;
default: /* Yourself (oops!) */
if (P_SKILL(typ) <= P_BASIC) {
You("hook yourself!");
- losehp(rn1(10,10), "a grappling hook", KILLED_BY);
+ losehp(Maybe_Half_Phys(rn1(10,10)), "a grappling hook", KILLED_BY);
return (1);
}
break;
} else if (flags.verbose)
pline("%s does not protect you.", Yname2(uarmh));
}
- losehp(dmg, "crunched in the head by an iron ball",
+ losehp(Maybe_Half_Phys(dmg),
+ "crunched in the head by an iron ball",
NO_KILLER_PREFIX);
}
}
Your("%s %s is severely damaged.",
(side == LEFT_SIDE) ? "left" : "right",
body_part(LEG));
- losehp(2, "leg damage from being pulled out of a bear trap",
- KILLED_BY);
+ losehp(Maybe_Half_Phys(2),
+ "leg damage from being pulled out of a bear trap",
+ KILLED_BY);
}
break;
}
if (forward) {
if(rn2(6)) {
pline_The("iron ball drags you downstairs!");
- losehp(rnd(6), "dragged downstairs by an iron ball",
+ losehp(Maybe_Half_Phys(rnd(6)),
+ "dragged downstairs by an iron ball",
NO_KILLER_PREFIX);
litter();
}
} else {
if(rn2(2)) {
pline_The("iron ball smacks into you!");
- losehp(rnd(20), "iron ball collision", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rnd(20)),
+ "iron ball collision", KILLED_BY_AN);
exercise(A_STR, FALSE);
dragchance -= 2;
}
if( (int) dragchance >= rnd(6)) {
pline_The("iron ball drags you downstairs!");
- losehp(rnd(3), "dragged downstairs by an iron ball",
+ losehp(Maybe_Half_Phys(rnd(3)),
+ "dragged downstairs by an iron ball",
NO_KILLER_PREFIX);
exercise(A_STR, FALSE);
litter();
case 5 : pline("%s!", Tobjnam(obj, "explode"));
useup(obj);
obj = 0; /* it's gone */
- losehp(rnd(30), "exploding crystal ball", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rnd(30)),
+ "exploding crystal ball", KILLED_BY_AN);
break;
}
if (obj) consume_obj_charge(obj, TRUE);
You("hit yourself with %s.", yname(uwep));
Sprintf(buf, "%s own %s", uhis(),
OBJ_NAME(objects[obj->otyp]));
- losehp(dam, buf, KILLED_BY);
+ losehp(Maybe_Half_Phys(dam), buf, KILLED_BY);
context.botl=1;
return(1);
} else if(u.dz == 0) {
if (u.dz) {
if (!Is_airlevel(&u.uz) && !Is_waterlevel(&u.uz) && !Underwater) {
if (u.dz < 0 || On_stairs(u.ux, u.uy)) {
+ int dmg;
if (On_stairs(u.ux, u.uy))
pline_The("beam bounces off the %s and hits the %s.",
(u.ux == xdnladder || u.ux == xupladder) ?
"ladder" : "stairs", ceiling(u.ux, u.uy));
You("loosen a rock from the %s.", ceiling(u.ux, u.uy));
pline("It falls on your %s!", 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);
otmp = mksobj_at(ROCK, u.ux, u.uy, FALSE, FALSE);
if (otmp) {
mtmp->mtrapped = 0;
} else {
if (!Passes_walls && !throws_rocks(youmonst.data)) {
- losehp(rnd(15), "squished under a boulder",
+ losehp(Maybe_Half_Phys(rnd(15)),
+ "squished under a boulder",
NO_KILLER_PREFIX);
return FALSE; /* player remains trapped */
} else u.utrap = 0;
{
int x, y;
int avrg_attrib;
+ int dmg = 0;
register struct monst *mtmp;
boolean no_kick = FALSE;
char buf[BUFSZ];
maploc = &levl[x][y];
}
if(!rn2(3)) set_wounded_legs(RIGHT_SIDE, 5 + rnd(5));
- losehp(rnd(ACURR(A_CON) > 15 ? 3 : 5), kickstr(buf),
+ dmg = rnd(ACURR(A_CON) > 15 ? 3 : 5);
+ losehp(Maybe_Half_Phys(dmg), kickstr(buf),
KILLED_BY);
if(Is_airlevel(&u.uz) || Levitation)
hurtle(-u.dx, -u.dy, rn1(2,4), TRUE); /* assume it's heavy */
/* Must have fire resistance or they'd be dead already */
You("sit in the lava!");
u.utrap += rnd(4);
- losehp(d(2,10), "sitting in lava", KILLED_BY);
+ losehp(Maybe_Half_Phys(d(2,10)), "sitting in lava", KILLED_BY);
} else if(u.utraptype == TT_INFLOOR || u.utraptype == TT_BURIEDBALL) {
You_cant("maneuver to sit!");
u.utrap++;
return 1;
}
pline_The("lava burns you!");
- losehp(d((Fire_resistance ? 2 : 10), 10),
+ losehp(Maybe_Half_Phys(d((Fire_resistance ? 2 : 10), 10)),
"sitting on lava", KILLED_BY);
} else if (is_ice(u.ux, u.uy)) {
stackobj(otmp);
newsym(u.ux,u.uy); /* map the rock */
- losehp(dmg, "falling rock", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(dmg), "falling rock", KILLED_BY_AN);
exercise(A_STR, FALSE);
}
break;
if (!steedintrap(trap, (struct obj *)0)) {
#endif
if (ttype == SPIKED_PIT) {
- losehp(rnd(10),"fell into a pit of iron spikes",
+ losehp(Maybe_Half_Phys(rnd(10)),
+ "fell into a pit of iron spikes",
NO_KILLER_PREFIX);
if (!rn2(6))
poisoned("spikes", A_STR, "fall onto poison spikes", 8);
} else
- losehp(rnd(6),"fell into a pit", NO_KILLER_PREFIX);
+ losehp(Maybe_Half_Phys(rnd(6)),"fell into a pit",
+ NO_KILLER_PREFIX);
if (Punished && !carried(uball)) {
unplacebc();
ballfall();
(void)keep_saddle_with_steedcorpse(steed_mid, fobj, saddle);
#endif
newsym(u.ux,u.uy); /* update trap symbol */
- losehp(rnd(16), "land mine", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(rnd(16)), "land mine", KILLED_BY_AN);
/* fall recursively into the pit... */
if ((trap = t_at(u.ux, u.uy)) != 0) dotrap(trap, RECURSIVETRAP);
fill_pit(u.ux, u.uy);
pline("A cascade of steamy bubbles erupts from %s!",
the(box ? xname(box) : surface(u.ux,u.uy)));
if (Fire_resistance) You("are uninjured.");
- else losehp(rnd(3), "boiling water", KILLED_BY);
+ else losehp(Maybe_Half_Phys(rnd(3)), "boiling water", KILLED_BY);
return;
}
pline("A %s %s from %s!", tower_of_flame,
pline("KABOOM!! %s was booby-trapped!", The(item));
wake_nearby();
- losehp(dmg, "explosion", KILLED_BY_AN);
+ losehp(Maybe_Half_Phys(dmg), "explosion", KILLED_BY_AN);
exercise(A_STR, FALSE);
if (bodypart) exercise(A_CON, FALSE);
make_stunned(HStun + dmg, TRUE);
dmg = d(6,6);
pline_The("lava here burns you!");
if(dmg < u.uhp) {
- losehp(dmg, lava_killer, KILLED_BY);
+ losehp(Maybe_Half_Phys(dmg), lava_killer, KILLED_BY);
goto burn_stuff;
}
} else
u.utraptype = TT_LAVA;
You("sink into the lava, but it only burns slightly!");
if (u.uhp > 1)
- losehp(1, lava_killer, KILLED_BY);
+ losehp(Half_physical_damage ? rn2(2) : 1, lava_killer, KILLED_BY);
}
/* just want to burn boots, not all armor; destroy_item doesn't work on
armor anyway */