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

View File

@@ -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)

View 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;

View File

@@ -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)))

View File

@@ -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!");

View 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;

View 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.");

View 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;

View 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;

View File

@@ -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;

View 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);

View 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,

View 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);
}

View 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);
}

View File

@@ -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)) {

View 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 {

View 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 */

View 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:

View File

@@ -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++;