diff --git a/include/youprop.h b/include/youprop.h index fa85420cf..905012516 100644 --- a/include/youprop.h +++ b/include/youprop.h @@ -290,6 +290,20 @@ #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) diff --git a/src/detect.c b/src/detect.c index 1a6cc4890..7ed39726a 100644 --- a/src/detect.c +++ b/src/detect.c @@ -820,6 +820,7 @@ struct obj *obj; 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; diff --git a/src/do.c b/src/do.c index 46e4e9027..0031e62a5 100644 --- a/src/do.c +++ b/src/do.c @@ -102,7 +102,7 @@ boolean pushing; 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))) diff --git a/src/eat.c b/src/eat.c index 347e8b13c..453ac7f74 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1260,7 +1260,7 @@ eatcorpse(otmp) /* called when a corpse is selected as food */ } 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!"); diff --git a/src/explode.c b/src/explode.c index e7d687954..c0d707bec 100644 --- a/src/explode.c +++ b/src/explode.c @@ -71,8 +71,8 @@ int expltype; 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; diff --git a/src/fountain.c b/src/fountain.c index 366aa25c6..6cc8c1a5d 100644 --- a/src/fountain.c +++ b/src/fountain.c @@ -524,8 +524,8 @@ drinksink() 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."); diff --git a/src/mcastu.c b/src/mcastu.c index 2b2c91a50..24ea19ad6 100644 --- a/src/mcastu.c +++ b/src/mcastu.c @@ -484,7 +484,9 @@ int spellnum; 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; diff --git a/src/mhitu.c b/src/mhitu.c index 4dba6b387..fd74ff565 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1783,6 +1783,8 @@ register struct monst *mtmp; register struct attack *mattk; boolean ufound; { + boolean physical_damage = TRUE; + if (mtmp->mcan) return(0); if (!ufound) @@ -1798,12 +1800,15 @@ boolean 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: @@ -1815,7 +1820,7 @@ 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; diff --git a/src/mon.c b/src/mon.c index 21894887e..f5d73d97a 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2012,7 +2012,7 @@ int typ, fatal; 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; diff --git a/src/mthrowu.c b/src/mthrowu.c index a6501d5aa..0c0af1dfe 100644 --- a/src/mthrowu.c +++ b/src/mthrowu.c @@ -73,7 +73,7 @@ const char *name; /* if null, then format `obj' */ 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); diff --git a/src/music.c b/src/music.c index b661816ec..d3ba97e49 100644 --- a/src/music.c +++ b/src/music.c @@ -355,7 +355,6 @@ do_improvisation(instr) 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; @@ -400,8 +399,6 @@ struct obj *instr; 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); @@ -413,8 +410,8 @@ struct obj *instr; 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, diff --git a/src/potion.c b/src/potion.c index ae4adec62..5c1dff265 100644 --- a/src/potion.c +++ b/src/potion.c @@ -879,7 +879,8 @@ peffects(otmp) 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) @@ -1683,7 +1684,7 @@ dodip() 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); } diff --git a/src/read.c b/src/read.c index a93e0bc50..f324b2d71 100644 --- a/src/read.c +++ b/src/read.c @@ -1143,8 +1143,7 @@ register struct obj *sobj; } 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); } diff --git a/src/sit.c b/src/sit.c index 69c4f90f1..4104fb6c7 100644 --- a/src/sit.c +++ b/src/sit.c @@ -92,7 +92,7 @@ dosit() /* 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++; @@ -146,7 +146,7 @@ dosit() 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)) { diff --git a/src/spell.c b/src/spell.c index 59cbd5de8..5828b8532 100644 --- a/src/spell.c +++ b/src/spell.c @@ -837,8 +837,6 @@ boolean atme; * 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()) { @@ -849,8 +847,6 @@ boolean atme; 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 { diff --git a/src/trap.c b/src/trap.c index 0abeccd27..2084e93a0 100644 --- a/src/trap.c +++ b/src/trap.c @@ -2413,7 +2413,7 @@ struct obj *box; /* null for floor trap */ 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, @@ -2442,7 +2442,7 @@ struct obj *box; /* null for floor trap */ 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)) { @@ -3898,7 +3898,7 @@ lava_effects() 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 @@ -3955,7 +3955,7 @@ lava_effects() 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 */ diff --git a/src/uhitm.c b/src/uhitm.c index a9d431f3f..6f115ba85 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -2324,7 +2324,7 @@ uchar aatyp; break; } You("are suddenly very hot!"); - mdamageu(mon, Maybe_Half_Phys(tmp)); + mdamageu(mon, tmp); /* fire damage */ } break; case AD_ELEC: diff --git a/src/zap.c b/src/zap.c index db8e8385e..63589ae24 100644 --- a/src/zap.c +++ b/src/zap.c @@ -3862,7 +3862,6 @@ register int osym, dmgtyp; break; case AD_FIRE: xresist = (Fire_resistance && obj->oclass != POTION_CLASS); - physical_damage = TRUE; if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) skip++;