#define EHalf_spell_damage u.uprops[HALF_SPDAM].extrinsic
#define Half_spell_damage (HHalf_spell_damage || EHalf_spell_damage)
+/*
+ * Physical damage
+ *
+ * Damage is NOT physical damage if (in order of priority):
+ * 1. it already qualifies for some other special category
+ * for which a special resistance already exists in the game
+ * including: cold, fire, shock, acid, and magic.
+ * Note that fire is extended to include all non-acid forms of
+ * burning, even boiling water since that is already dealt with
+ * by fire resistance, and in most or all cases is caused by fire.
+ * 2. it doesn't leave a mark. Marks include destruction of, or
+ * damage to, an internal organ (including the brain),
+ * lacerations, bruises, crushed body parts, bleeding.
+ */
#define HHalf_physical_damage u.uprops[HALF_PHDAM].intrinsic
#define EHalf_physical_damage u.uprops[HALF_PHDAM].extrinsic
#define Half_physical_damage (HHalf_physical_damage || EHalf_physical_damage)
case 5 : pline("%s!", Tobjnam(obj, "explode"));
useup(obj);
obj = 0; /* it's gone */
+ /* physical damage cause by the shards and force */
losehp(Maybe_Half_Phys(rnd(30)),
"exploding crystal ball", KILLED_BY_AN);
break;
Fire_resistance ? '.' : '!');
burn_away_slime();
dmg = d((Fire_resistance ? 1 : 3), 6);
- losehp(Maybe_Half_Phys(dmg),
+ losehp(Maybe_Half_Phys(dmg), /* lava damage */
"molten lava", KILLED_BY);
} else if (!fills_up && flags.verbose &&
(pushing ? !Blind : cansee(rx,ry)))
} else if (acidic(&mons[mnum]) && !Acid_resistance) {
tp++;
You("have a very bad case of stomach acid."); /* not body_part() */
- losehp(Maybe_Half_Phys(rnd(15)), "acidic corpse", KILLED_BY_AN);
+ losehp(rnd(15), "acidic corpse", KILLED_BY_AN); /* acid damage */
} else if (poisonous(&mons[mnum]) && rn2(5)) {
tp++;
pline("Ecch - that must have been poisonous!");
case 1: str = olet == BURNING_OIL ? "burning oil" :
olet == SCROLL_CLASS ? "tower of flame" :
"fireball";
+ /* fire damage, not physical damage */
adtyp = AD_FIRE;
- physical_dmg = TRUE;
break;
case 2: str = "ball of cold";
adtyp = AD_COLD;
case 2: You("take a sip of scalding hot water.");
if (Fire_resistance)
pline("It seems quite tasty.");
- else losehp(Maybe_Half_Phys(rnd(6)),
- "sipping boiling water", KILLED_BY);
+ else losehp(rnd(6), "sipping boiling water", KILLED_BY);
+ /* boiling water burns considered fire damage */
break;
case 3: if (mvitals[PM_SEWER_RAT].mvflags & G_GONE)
pline_The("sink seems quite dirty.");
switch (spellnum) {
case CLC_GEYSER:
- /* this is physical damage, not magical damage */
+ /* this is physical damage (force not heat),
+ * not magical damage or fire damage
+ */
pline("A sudden geyser slams into you from nowhere!");
dmg = d(8, 6);
if (Half_physical_damage) dmg = (dmg + 1) / 2;
register struct attack *mattk;
boolean ufound;
{
+ boolean physical_damage = TRUE;
+
if (mtmp->mcan) return(0);
if (!ufound)
switch (mattk->adtyp) {
case AD_COLD:
+ physical_damage = FALSE;
not_affected |= Cold_resistance;
goto common;
case AD_FIRE:
+ physical_damage = FALSE;
not_affected |= Fire_resistance;
goto common;
case AD_ELEC:
+ physical_damage = FALSE;
not_affected |= Shock_resistance;
common:
if (flags.verbose) You("get blasted!");
}
if (mattk->adtyp == AD_FIRE) burn_away_slime();
- if (Half_physical_damage) tmp = (tmp+1) / 2;
+ if (physical_damage) tmp = Maybe_Half_Phys(tmp);
mdamageu(mtmp, tmp);
}
break;
pline("You%s!", poiseff[typ]);
} else {
i = thrown_weapon ? rnd(6) : rn1(10,6);
- losehp(Maybe_Half_Phys(i), pname, kprefix);
+ losehp(i, pname, kprefix); /* poison damage */
}
if(u.uhp < 1) {
killer.format = kprefix;
pline("It doesn't seem to hurt you.");
else {
if (is_acid) pline("It burns!");
- losehp(Maybe_Half_Phys(dam), knm, kprefix);
+ losehp(dam, knm, kprefix); /* acid damage */
exercise(A_STR, FALSE);
}
return(1);
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;
exercise(A_DEX, TRUE);
break;
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);
+ losehp(damage, buf, KILLED_BY); /* frost damage */
+ /* fire damage */
}
} else {
buzz((instr->otyp == FROST_HORN) ? AD_COLD-1 : AD_FIRE-1,
good_for_you = TRUE;
} else {
You("burn your %s.", body_part(FACE));
- losehp(Maybe_Half_Phys(d(Fire_resistance ? 1 : 3, 4)),
+ /* fire damage */
+ losehp(d(Fire_resistance ? 1 : 3, 4),
"burning potion of oil", KILLED_BY_AN);
}
} else if(otmp->cursed)
potionbreathe(obj);
useup(obj);
useup(potion);
- losehp(Maybe_Half_Phys(rnd(10)), "alchemic blast",
+ losehp(rnd(10), "alchemic blast", /* not physical damage */
KILLED_BY_AN);
return(1);
}
} else {
pline_The("scroll catches fire and you burn your %s.",
makeplural(body_part(HAND)));
- losehp(Half_physical_damage ? rn2(2) : 1,
- "scroll of fire", KILLED_BY_AN);
+ losehp(1, "scroll of fire", KILLED_BY_AN);
}
return(1);
}
/* Must have fire resistance or they'd be dead already */
You("sit in the lava!");
u.utrap += rnd(4);
- losehp(Maybe_Half_Phys(d(2,10)), "sitting in lava", KILLED_BY);
+ losehp(d(2,10), "sitting in lava", KILLED_BY); /* lava damage */
} 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(Maybe_Half_Phys(d((Fire_resistance ? 2 : 10), 10)),
+ losehp(d((Fire_resistance ? 2 : 10), 10), /* lava damage */
"sitting on lava", KILLED_BY);
} else if (is_ice(u.ux, u.uy)) {
* additional cost to the spellcaster.
*/
case SPE_FIREBALL:
- physical_damage = TRUE;
- /* fall through */
case SPE_CONE_OF_COLD:
if (role_skill >= P_SKILLED) {
if (throwspell()) {
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 {
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(Maybe_Half_Phys(rnd(3)), "boiling water", KILLED_BY);
+ else losehp(rnd(3), "boiling water", KILLED_BY);
return;
}
pline("A %s %s from %s!", tower_of_flame,
if (!num)
You("are uninjured.");
else
- losehp(Maybe_Half_Phys(num), tower_of_flame, KILLED_BY_AN);
+ losehp(num, tower_of_flame, KILLED_BY_AN); /* fire damage */
burn_away_slime();
if (burnarmor(&youmonst) || rn2(3)) {
dmg = d(6,6);
pline_The("lava here burns you!");
if(dmg < u.uhp) {
- losehp(Maybe_Half_Phys(dmg), lava_killer, KILLED_BY);
+ losehp(dmg, lava_killer, KILLED_BY); /* lava damage */
goto burn_stuff;
}
} else
u.utraptype = TT_LAVA;
You("sink into the lava, but it only burns slightly!");
if (u.uhp > 1)
- losehp(Half_physical_damage ? rn2(2) : 1, lava_killer, KILLED_BY);
+ losehp(1, lava_killer, KILLED_BY); /* lava damage */
}
/* just want to burn boots, not all armor; destroy_item doesn't work on
armor anyway */
break;
}
You("are suddenly very hot!");
- mdamageu(mon, Maybe_Half_Phys(tmp));
+ mdamageu(mon, tmp); /* fire damage */
}
break;
case AD_ELEC:
break;
case AD_FIRE:
xresist = (Fire_resistance && obj->oclass != POTION_CLASS);
- physical_damage = TRUE;
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL)
skip++;