]> granicus.if.org Git - nethack/commitdiff
Half_physical_damage 07
authornethack.allison <nethack.allison>
Wed, 22 Oct 2003 23:05:24 +0000 (23:05 +0000)
committernethack.allison <nethack.allison>
Wed, 22 Oct 2003 23:05:24 +0000 (23:05 +0000)
It is not physical damage if:
1. it already qualifies for some other special type of damage
   for which a special resistance already exists in the game
   including: cold, fire, shock, and acid. Note that fire is
   extended to include all 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.

Current exceptions to the rule (already existing):
- holy water burning chaotic ("it burns like acid") is physical damage.
- unholy water burning lawful is physical damage.

18 files changed:
include/youprop.h
src/detect.c
src/do.c
src/eat.c
src/explode.c
src/fountain.c
src/mcastu.c
src/mhitu.c
src/mon.c
src/mthrowu.c
src/music.c
src/potion.c
src/read.c
src/sit.c
src/spell.c
src/trap.c
src/uhitm.c
src/zap.c

index fa85420cf4942806021af8574576743950d7043f..9050125161636ed0c4e38e11a6c7434223351dd2 100644 (file)
 #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)
index 1a6cc489013a038e5c45390f65fa71cbda50d7b3..7ed39726a0d54a7cb36bdb837d70b6ba95b606e3 100644 (file)
@@ -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;
index 46e4e9027eb99d1e6e971d3ddebc029e4a9fcf19..0031e62a5a45a40547a0c1486ee19d18079dfd93 100644 (file)
--- 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)))
index 347e8b13c18e1002c6bd7985d600d7df31f94fd1..453ac7f74eb1b358e642650d7ea8cd1a4ed26e80 100644 (file)
--- 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!");
index e7d68795473eb779585c7411e0c762d05e322f26..c0d707bec0c358925e623f19d1124829d6e9a7a2 100644 (file)
@@ -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;
index 366aa25c6c3721439f91d9a41084dd226fbeebd4..6cc8c1a5dd2ffd62b2ab104672d32e38f0ee1bc4 100644 (file)
@@ -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.");
index 2b2c91a501ae4337ce3168cadb8a63c9b1cc26fe..24ea19ad6d936ad954d079c74386aeb277bc25a1 100644 (file)
@@ -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;
index 4dba6b387ad61eab77302df18ac33e0e0ce6aff7..fd74ff56503495e5f316aca794957cb7c439e618 100644 (file)
@@ -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;
index 21894887ef50c229829cb5ee6e44282741febe71..f5d73d97a80a65fe2e3b11094322694ce0223c69 100644 (file)
--- 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;
index a6501d5aab1feb13cc531de172cc875944cfced1..0c0af1dfe1ae16530c72de6f1ada808d89738fab 100644 (file)
@@ -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);
index b661816eca5c58abff8e2ff8e8b3aa3d22bfe421..d3ba97e49a175798a249669a9794b0205409b336 100644 (file)
@@ -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,
index ae4adec62b1607ec821f8c91c08e15c6e570c3ed..5c1dff265e9f530e377684c023e05465f9363464 100644 (file)
@@ -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);
                }
index a93e0bc50a6b2b77da01c72eaa9218731b421945..f324b2d719429b245d7c6f114c826b80237c4e33 100644 (file)
@@ -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);
                }
index 69c4f90f172e36e9b3d5d92449ed472551f19bb7..4104fb6c7665e9dbb4e192df8b8a34f5a53b6029 100644 (file)
--- 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)) {
index 59cbd5de8b6fb8753530fbef0bb825f6edb8d805..5828b8532a4fb1e230c12836aa8bb9c2869e80ad 100644 (file)
@@ -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 {
index 0abeccd274a595af1a5068f60e76e2b2978854a8..2084e93a063d4bdd018519d75d4cc1b715accab1 100644 (file)
@@ -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 */
index a9d431f3f1306b816bf9407f2a8e7c8174ee5897..6f115ba856550691280983a28cd12e9446fb79be 100644 (file)
@@ -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:
index db8e8385ed162affc8a6e6f90d98a974b5c659ef..63589ae24976da7c3c8ba986088a19bc191d39f6 100644 (file)
--- 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++;