Half_physical_damage 07

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.
This commit is contained in:
nethack.allison
2003-10-22 23:05:24 +00:00
parent 8467ab1515
commit 9b9f13aa13
18 changed files with 44 additions and 30 deletions
+14
View File
@@ -290,6 +290,20 @@
#define EHalf_spell_damage u.uprops[HALF_SPDAM].extrinsic #define EHalf_spell_damage u.uprops[HALF_SPDAM].extrinsic
#define Half_spell_damage (HHalf_spell_damage || EHalf_spell_damage) #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 HHalf_physical_damage u.uprops[HALF_PHDAM].intrinsic
#define EHalf_physical_damage u.uprops[HALF_PHDAM].extrinsic #define EHalf_physical_damage u.uprops[HALF_PHDAM].extrinsic
#define Half_physical_damage (HHalf_physical_damage || EHalf_physical_damage) #define Half_physical_damage (HHalf_physical_damage || EHalf_physical_damage)
+1
View File
@@ -820,6 +820,7 @@ struct obj *obj;
case 5 : pline("%s!", Tobjnam(obj, "explode")); case 5 : pline("%s!", Tobjnam(obj, "explode"));
useup(obj); useup(obj);
obj = 0; /* it's gone */ obj = 0; /* it's gone */
/* physical damage cause by the shards and force */
losehp(Maybe_Half_Phys(rnd(30)), losehp(Maybe_Half_Phys(rnd(30)),
"exploding crystal ball", KILLED_BY_AN); "exploding crystal ball", KILLED_BY_AN);
break; break;
+1 -1
View File
@@ -102,7 +102,7 @@ boolean pushing;
Fire_resistance ? '.' : '!'); Fire_resistance ? '.' : '!');
burn_away_slime(); burn_away_slime();
dmg = d((Fire_resistance ? 1 : 3), 6); dmg = d((Fire_resistance ? 1 : 3), 6);
losehp(Maybe_Half_Phys(dmg), losehp(Maybe_Half_Phys(dmg), /* lava damage */
"molten lava", KILLED_BY); "molten lava", KILLED_BY);
} else if (!fills_up && flags.verbose && } else if (!fills_up && flags.verbose &&
(pushing ? !Blind : cansee(rx,ry))) (pushing ? !Blind : cansee(rx,ry)))
+1 -1
View File
@@ -1260,7 +1260,7 @@ eatcorpse(otmp) /* called when a corpse is selected as food */
} else if (acidic(&mons[mnum]) && !Acid_resistance) { } else if (acidic(&mons[mnum]) && !Acid_resistance) {
tp++; tp++;
You("have a very bad case of stomach acid."); /* not body_part() */ 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)) { } else if (poisonous(&mons[mnum]) && rn2(5)) {
tp++; tp++;
pline("Ecch - that must have been poisonous!"); pline("Ecch - that must have been poisonous!");
+1 -1
View File
@@ -71,8 +71,8 @@ int expltype;
case 1: str = olet == BURNING_OIL ? "burning oil" : case 1: str = olet == BURNING_OIL ? "burning oil" :
olet == SCROLL_CLASS ? "tower of flame" : olet == SCROLL_CLASS ? "tower of flame" :
"fireball"; "fireball";
/* fire damage, not physical damage */
adtyp = AD_FIRE; adtyp = AD_FIRE;
physical_dmg = TRUE;
break; break;
case 2: str = "ball of cold"; case 2: str = "ball of cold";
adtyp = AD_COLD; adtyp = AD_COLD;
+2 -2
View File
@@ -524,8 +524,8 @@ drinksink()
case 2: You("take a sip of scalding hot water."); case 2: You("take a sip of scalding hot water.");
if (Fire_resistance) if (Fire_resistance)
pline("It seems quite tasty."); pline("It seems quite tasty.");
else losehp(Maybe_Half_Phys(rnd(6)), else losehp(rnd(6), "sipping boiling water", KILLED_BY);
"sipping boiling water", KILLED_BY); /* boiling water burns considered fire damage */
break; break;
case 3: if (mvitals[PM_SEWER_RAT].mvflags & G_GONE) case 3: if (mvitals[PM_SEWER_RAT].mvflags & G_GONE)
pline_The("sink seems quite dirty."); pline_The("sink seems quite dirty.");
+3 -1
View File
@@ -484,7 +484,9 @@ int spellnum;
switch (spellnum) { switch (spellnum) {
case CLC_GEYSER: 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!"); pline("A sudden geyser slams into you from nowhere!");
dmg = d(8, 6); dmg = d(8, 6);
if (Half_physical_damage) dmg = (dmg + 1) / 2; if (Half_physical_damage) dmg = (dmg + 1) / 2;
+6 -1
View File
@@ -1783,6 +1783,8 @@ register struct monst *mtmp;
register struct attack *mattk; register struct attack *mattk;
boolean ufound; boolean ufound;
{ {
boolean physical_damage = TRUE;
if (mtmp->mcan) return(0); if (mtmp->mcan) return(0);
if (!ufound) if (!ufound)
@@ -1798,12 +1800,15 @@ boolean ufound;
switch (mattk->adtyp) { switch (mattk->adtyp) {
case AD_COLD: case AD_COLD:
physical_damage = FALSE;
not_affected |= Cold_resistance; not_affected |= Cold_resistance;
goto common; goto common;
case AD_FIRE: case AD_FIRE:
physical_damage = FALSE;
not_affected |= Fire_resistance; not_affected |= Fire_resistance;
goto common; goto common;
case AD_ELEC: case AD_ELEC:
physical_damage = FALSE;
not_affected |= Shock_resistance; not_affected |= Shock_resistance;
common: common:
@@ -1815,7 +1820,7 @@ common:
if (flags.verbose) You("get blasted!"); if (flags.verbose) You("get blasted!");
} }
if (mattk->adtyp == AD_FIRE) burn_away_slime(); 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); mdamageu(mtmp, tmp);
} }
break; break;
+1 -1
View File
@@ -2012,7 +2012,7 @@ int typ, fatal;
pline("You%s!", poiseff[typ]); pline("You%s!", poiseff[typ]);
} else { } else {
i = thrown_weapon ? rnd(6) : rn1(10,6); 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) { if(u.uhp < 1) {
killer.format = kprefix; killer.format = kprefix;
+1 -1
View File
@@ -73,7 +73,7 @@ const char *name; /* if null, then format `obj' */
pline("It doesn't seem to hurt you."); pline("It doesn't seem to hurt you.");
else { else {
if (is_acid) pline("It burns!"); if (is_acid) pline("It burns!");
losehp(Maybe_Half_Phys(dam), knm, kprefix); losehp(dam, knm, kprefix); /* acid damage */
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
} }
return(1); return(1);
+2 -5
View File
@@ -355,7 +355,6 @@ do_improvisation(instr)
struct obj *instr; struct obj *instr;
{ {
int damage, do_spec = !Confusion; int damage, do_spec = !Confusion;
boolean physical_damage = FALSE;
#if defined(MAC) || defined(AMIGA) || defined(VPIX_MUSIC) || defined (PCMUSIC) #if defined(MAC) || defined(AMIGA) || defined(VPIX_MUSIC) || defined (PCMUSIC)
struct obj itmp; struct obj itmp;
@@ -400,8 +399,6 @@ struct obj *instr;
exercise(A_DEX, TRUE); exercise(A_DEX, TRUE);
break; break;
case FIRE_HORN: /* Idem wand of fire */ case FIRE_HORN: /* Idem wand of fire */
physical_damage = TRUE;
/* fall through */
case FROST_HORN: /* Idem wand of cold */ case FROST_HORN: /* Idem wand of cold */
if (do_spec && instr->spe > 0) { if (do_spec && instr->spe > 0) {
consume_obj_charge(instr, TRUE); consume_obj_charge(instr, TRUE);
@@ -413,8 +410,8 @@ struct obj *instr;
if ((damage = zapyourself(instr, TRUE)) != 0) { if ((damage = zapyourself(instr, TRUE)) != 0) {
char buf[BUFSZ]; char buf[BUFSZ];
Sprintf(buf, "using a magical horn on %sself", uhim()); Sprintf(buf, "using a magical horn on %sself", uhim());
if (physical_damage) damage = Maybe_Half_Phys(damage); losehp(damage, buf, KILLED_BY); /* frost damage */
losehp(damage, buf, KILLED_BY); /* fire damage */
} }
} else { } else {
buzz((instr->otyp == FROST_HORN) ? AD_COLD-1 : AD_FIRE-1, buzz((instr->otyp == FROST_HORN) ? AD_COLD-1 : AD_FIRE-1,
+3 -2
View File
@@ -879,7 +879,8 @@ peffects(otmp)
good_for_you = TRUE; good_for_you = TRUE;
} else { } else {
You("burn your %s.", body_part(FACE)); 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); "burning potion of oil", KILLED_BY_AN);
} }
} else if(otmp->cursed) } else if(otmp->cursed)
@@ -1683,7 +1684,7 @@ dodip()
potionbreathe(obj); potionbreathe(obj);
useup(obj); useup(obj);
useup(potion); useup(potion);
losehp(Maybe_Half_Phys(rnd(10)), "alchemic blast", losehp(rnd(10), "alchemic blast", /* not physical damage */
KILLED_BY_AN); KILLED_BY_AN);
return(1); return(1);
} }
+1 -2
View File
@@ -1143,8 +1143,7 @@ register struct obj *sobj;
} else { } else {
pline_The("scroll catches fire and you burn your %s.", pline_The("scroll catches fire and you burn your %s.",
makeplural(body_part(HAND))); makeplural(body_part(HAND)));
losehp(Half_physical_damage ? rn2(2) : 1, losehp(1, "scroll of fire", KILLED_BY_AN);
"scroll of fire", KILLED_BY_AN);
} }
return(1); return(1);
} }
+2 -2
View File
@@ -92,7 +92,7 @@ dosit()
/* Must have fire resistance or they'd be dead already */ /* Must have fire resistance or they'd be dead already */
You("sit in the lava!"); You("sit in the lava!");
u.utrap += rnd(4); 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) { } else if(u.utraptype == TT_INFLOOR || u.utraptype == TT_BURIEDBALL) {
You_cant("maneuver to sit!"); You_cant("maneuver to sit!");
u.utrap++; u.utrap++;
@@ -146,7 +146,7 @@ dosit()
return 1; return 1;
} }
pline_The("lava burns you!"); 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); "sitting on lava", KILLED_BY);
} else if (is_ice(u.ux, u.uy)) { } else if (is_ice(u.ux, u.uy)) {
-4
View File
@@ -837,8 +837,6 @@ boolean atme;
* additional cost to the spellcaster. * additional cost to the spellcaster.
*/ */
case SPE_FIREBALL: case SPE_FIREBALL:
physical_damage = TRUE;
/* fall through */
case SPE_CONE_OF_COLD: case SPE_CONE_OF_COLD:
if (role_skill >= P_SKILLED) { if (role_skill >= P_SKILLED) {
if (throwspell()) { if (throwspell()) {
@@ -849,8 +847,6 @@ boolean atme;
if ((damage = zapyourself(pseudo, TRUE)) != 0) { if ((damage = zapyourself(pseudo, TRUE)) != 0) {
char buf[BUFSZ]; char buf[BUFSZ];
Sprintf(buf, "zapped %sself with a spell", uhim()); Sprintf(buf, "zapped %sself with a spell", uhim());
if (physical_damage)
damage = Maybe_Half_Phys(damage);
losehp(damage, buf, NO_KILLER_PREFIX); losehp(damage, buf, NO_KILLER_PREFIX);
} }
} else { } else {
+4 -4
View File
@@ -2413,7 +2413,7 @@ struct obj *box; /* null for floor trap */
pline("A cascade of steamy bubbles erupts from %s!", pline("A cascade of steamy bubbles erupts from %s!",
the(box ? xname(box) : surface(u.ux,u.uy))); the(box ? xname(box) : surface(u.ux,u.uy)));
if (Fire_resistance) You("are uninjured."); 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; return;
} }
pline("A %s %s from %s!", tower_of_flame, pline("A %s %s from %s!", tower_of_flame,
@@ -2442,7 +2442,7 @@ struct obj *box; /* null for floor trap */
if (!num) if (!num)
You("are uninjured."); You("are uninjured.");
else 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(); burn_away_slime();
if (burnarmor(&youmonst) || rn2(3)) { if (burnarmor(&youmonst) || rn2(3)) {
@@ -3898,7 +3898,7 @@ lava_effects()
dmg = d(6,6); dmg = d(6,6);
pline_The("lava here burns you!"); pline_The("lava here burns you!");
if(dmg < u.uhp) { if(dmg < u.uhp) {
losehp(Maybe_Half_Phys(dmg), lava_killer, KILLED_BY); losehp(dmg, lava_killer, KILLED_BY); /* lava damage */
goto burn_stuff; goto burn_stuff;
} }
} else } else
@@ -3955,7 +3955,7 @@ lava_effects()
u.utraptype = TT_LAVA; u.utraptype = TT_LAVA;
You("sink into the lava, but it only burns slightly!"); You("sink into the lava, but it only burns slightly!");
if (u.uhp > 1) 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 /* just want to burn boots, not all armor; destroy_item doesn't work on
armor anyway */ armor anyway */
+1 -1
View File
@@ -2324,7 +2324,7 @@ uchar aatyp;
break; break;
} }
You("are suddenly very hot!"); You("are suddenly very hot!");
mdamageu(mon, Maybe_Half_Phys(tmp)); mdamageu(mon, tmp); /* fire damage */
} }
break; break;
case AD_ELEC: case AD_ELEC:
-1
View File
@@ -3862,7 +3862,6 @@ register int osym, dmgtyp;
break; break;
case AD_FIRE: case AD_FIRE:
xresist = (Fire_resistance && obj->oclass != POTION_CLASS); xresist = (Fire_resistance && obj->oclass != POTION_CLASS);
physical_damage = TRUE;
if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL) if (obj->otyp == SCR_FIRE || obj->otyp == SPE_FIREBALL)
skip++; skip++;