Half_physical_damage 06

- [fixed in trunk] Alchemical explosion
- [fixed in trunk] Artifacts' blasting
- [fixed in trunk] Boiling/freezing potions
- [fixed in trunk] Chest/door/tin traps
- [fixed in trunk] Falling rocks/boulders (trap, digging, scroll of earth)
- [fixed in trunk] Mixing water and acid
- [fixed in trunk] Thrown potion (acid)

This is my last patch on this today.
This commit is contained in:
nethack.allison
2003-10-22 03:02:11 +00:00
parent cdf982e478
commit 8467ab1515
14 changed files with 36 additions and 28 deletions
+1 -1
View File
@@ -529,7 +529,7 @@ touch_artifact(obj,mon)
You("are blasted by %s power!", s_suffix(the(xname(obj)))); You("are blasted by %s power!", s_suffix(the(xname(obj))));
dmg = d((Antimagic ? 2 : 4), (self_willed ? 10 : 4)); dmg = d((Antimagic ? 2 : 4), (self_willed ? 10 : 4));
Sprintf(buf, "touching %s", oart->name); Sprintf(buf, "touching %s", oart->name);
losehp(dmg, buf, KILLED_BY); losehp(dmg, buf, KILLED_BY); /* magic damage, not physical */
exercise(A_WIS, FALSE); exercise(A_WIS, FALSE);
} }
+2 -1
View File
@@ -945,7 +945,8 @@ struct obj *obj;
pline("Sparks fly as you whack the %s.%s", pline("Sparks fly as you whack the %s.%s",
sobj_at(STATUE, rx, ry) ? "statue" : "boulder", sobj_at(STATUE, rx, ry) ? "statue" : "boulder",
vibrate ? " The axe-handle vibrates violently!" : ""); vibrate ? " The axe-handle vibrates violently!" : "");
if (vibrate) losehp(2, "axing a hard object", KILLED_BY); if (vibrate) losehp(Maybe_Half_Phys(2),
"axing a hard object", KILLED_BY);
} }
else else
You("swing %s through thin air.", You("swing %s through thin air.",
+1 -1
View File
@@ -828,7 +828,7 @@ boolean hitsroof;
} }
} }
hitfloor(obj); hitfloor(obj);
losehp(dmg, "falling object", KILLED_BY_AN); losehp(Maybe_Half_Phys(dmg), "falling object", KILLED_BY_AN);
} }
return TRUE; return TRUE;
} }
+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(rnd(15), "acidic corpse", KILLED_BY_AN); losehp(Maybe_Half_Phys(rnd(15)), "acidic corpse", KILLED_BY_AN);
} 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!");
+2 -1
View File
@@ -524,7 +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(rnd(6), "sipping boiling water", KILLED_BY); else losehp(Maybe_Half_Phys(rnd(6)),
"sipping boiling water", KILLED_BY);
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.");
+1 -2
View File
@@ -2263,8 +2263,7 @@ register struct monst *mon;
You_feel("exhausted."); You_feel("exhausted.");
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
tmp = rn1(10, 6); tmp = rn1(10, 6);
if(Half_physical_damage) tmp = (tmp+1) / 2; losehp(Maybe_Half_Phys(tmp), "exhaustion", KILLED_BY);
losehp(tmp, "exhaustion", KILLED_BY);
break; break;
} }
} }
+2 -4
View File
@@ -1485,8 +1485,7 @@ boolean was_swallowed; /* digestion */
body_part(STOMACH)); body_part(STOMACH));
Sprintf(killer.name, "%s explosion", Sprintf(killer.name, "%s explosion",
s_suffix(mdat->mname)); s_suffix(mdat->mname));
if (Half_physical_damage) tmp = (tmp+1) / 2; losehp(Maybe_Half_Phys(tmp), killer.name, KILLED_BY_AN);
losehp(tmp, killer.name, KILLED_BY_AN);
} else { } else {
if (!Deaf) You_hear("an explosion."); if (!Deaf) You_hear("an explosion.");
magr->mhp -= tmp; magr->mhp -= tmp;
@@ -2013,8 +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);
if(Half_physical_damage) i = (i+1) / 2; losehp(Maybe_Half_Phys(i), pname, kprefix);
losehp(i, pname, kprefix);
} }
if(u.uhp < 1) { if(u.uhp < 1) {
killer.format = kprefix; killer.format = kprefix;
+1 -2
View File
@@ -73,8 +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!");
if (Half_physical_damage) dam = (dam+1) / 2; losehp(Maybe_Half_Phys(dam), knm, kprefix);
losehp(dam, knm, kprefix);
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
} }
return(1); return(1);
+2 -1
View File
@@ -1437,7 +1437,8 @@ struct monst *mtmp;
stackobj(otmp2); stackobj(otmp2);
newsym(u.ux, u.uy); newsym(u.ux, u.uy);
} }
if (dmg) losehp(dmg, "scroll of earth", KILLED_BY_AN); if (dmg) losehp(Maybe_Half_Phys(dmg), "scroll of earth",
KILLED_BY_AN);
} }
xxx_noobj: xxx_noobj:
+1 -2
View File
@@ -1525,8 +1525,7 @@ lootcont:
You("carefully open the bag..."); You("carefully open the bag...");
pline("It develops a huge set of teeth and bites you!"); pline("It develops a huge set of teeth and bites you!");
tmp = rnd(10); tmp = rnd(10);
if (Half_physical_damage) tmp = (tmp+1) / 2; losehp(Maybe_Half_Phys(tmp), "carnivorous bag", KILLED_BY_AN);
losehp(tmp, "carnivorous bag", KILLED_BY_AN);
makeknown(BAG_OF_TRICKS); makeknown(BAG_OF_TRICKS);
timepassed = 1; timepassed = 1;
continue; continue;
+10 -4
View File
@@ -894,9 +894,11 @@ peffects(otmp)
/* Not necessarily a creature who _likes_ acid */ /* Not necessarily a creature who _likes_ acid */
pline("This tastes %s.", Hallucination ? "tangy" : "sour"); pline("This tastes %s.", Hallucination ? "tangy" : "sour");
else { else {
int dmg;
pline("This burns%s!", otmp->blessed ? " a little" : pline("This burns%s!", otmp->blessed ? " a little" :
otmp->cursed ? " a lot" : " like acid"); otmp->cursed ? " a lot" : " like acid");
losehp(d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8), dmg = d(otmp->cursed ? 2 : 1, otmp->blessed ? 4 : 8);
losehp(Maybe_Half_Phys(dmg),
"potion of acid", KILLED_BY_AN); "potion of acid", KILLED_BY_AN);
exercise(A_CON, FALSE); exercise(A_CON, FALSE);
} }
@@ -1017,9 +1019,11 @@ boolean your_fault;
break; break;
case POT_ACID: case POT_ACID:
if (!Acid_resistance) { if (!Acid_resistance) {
int dmg;
pline("This burns%s!", obj->blessed ? " a little" : pline("This burns%s!", obj->blessed ? " a little" :
obj->cursed ? " a lot" : ""); obj->cursed ? " a lot" : "");
losehp(d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8), dmg = d(obj->cursed ? 2 : 1, obj->blessed ? 4 : 8);
losehp(Maybe_Half_Phys(dmg),
"potion of acid", KILLED_BY_AN); "potion of acid", KILLED_BY_AN);
} }
break; break;
@@ -1447,7 +1451,8 @@ register struct obj *obj;
if (obj->otyp == POT_ACID) { if (obj->otyp == POT_ACID) {
pline("It boils vigorously!"); pline("It boils vigorously!");
You("are caught in the explosion!"); You("are caught in the explosion!");
losehp(rnd(10), "elementary chemistry", KILLED_BY); losehp(Maybe_Half_Phys(rnd(10)), "elementary chemistry",
KILLED_BY);
makeknown(obj->otyp); makeknown(obj->otyp);
update_inventory(); update_inventory();
return (TRUE); return (TRUE);
@@ -1678,7 +1683,8 @@ dodip()
potionbreathe(obj); potionbreathe(obj);
useup(obj); useup(obj);
useup(potion); useup(potion);
losehp(rnd(10), "alchemic blast", KILLED_BY_AN); losehp(Maybe_Half_Phys(rnd(10)), "alchemic blast",
KILLED_BY_AN);
return(1); return(1);
} }
+1
View File
@@ -1601,6 +1601,7 @@ prayer_done() /* M. Stephenson (1.0.3b) */
You_feel("like you are falling apart."); You_feel("like you are falling apart.");
/* KMH -- Gods have mastery over unchanging */ /* KMH -- Gods have mastery over unchanging */
rehumanize(); rehumanize();
/* no Half_physical_damage adjustment here */
losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN); losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN);
exercise(A_CON, FALSE); exercise(A_CON, FALSE);
return(1); return(1);
+8 -4
View File
@@ -276,7 +276,7 @@ int curse_bless;
if (is_on) Ring_gone(obj); if (is_on) Ring_gone(obj);
s = rnd(3 * abs(obj->spe)); /* amount of damage */ s = rnd(3 * abs(obj->spe)); /* amount of damage */
useup(obj); useup(obj);
losehp(s, "exploding ring", KILLED_BY_AN); losehp(Maybe_Half_Phys(s), "exploding ring", KILLED_BY_AN);
} else { } else {
long mask = is_on ? (obj == uleft ? LEFT_RING : long mask = is_on ? (obj == uleft ? LEFT_RING :
RIGHT_RING) : 0L; RIGHT_RING) : 0L;
@@ -1143,7 +1143,8 @@ 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(1, "scroll of fire", KILLED_BY_AN); losehp(Half_physical_damage ? rn2(2) : 1,
"scroll of fire", KILLED_BY_AN);
} }
return(1); return(1);
} }
@@ -1268,7 +1269,8 @@ register struct obj *sobj;
stackobj(otmp2); stackobj(otmp2);
newsym(u.ux, u.uy); newsym(u.ux, u.uy);
} }
if (dmg) losehp(dmg, "scroll of earth", KILLED_BY_AN); if (dmg) losehp(Maybe_Half_Phys(dmg), "scroll of earth",
KILLED_BY_AN);
} }
} }
break; break;
@@ -1310,10 +1312,12 @@ STATIC_OVL void
wand_explode(obj) wand_explode(obj)
register struct obj *obj; register struct obj *obj;
{ {
int vibration_dmg;
obj->in_use = TRUE; /* in case losehp() is fatal */ obj->in_use = TRUE; /* in case losehp() is fatal */
pline("%s vibrates violently, and explodes!", Yname2(obj)); pline("%s vibrates violently, and explodes!", Yname2(obj));
nhbell(); nhbell();
losehp(rnd(2*(u.uhpmax+1)/3), "exploding wand", KILLED_BY_AN); vibration_dmg = rnd(2*(u.uhpmax+1)/3);
losehp(Maybe_Half_Phys(vibration_dmg), "exploding wand", KILLED_BY_AN);
useup(obj); useup(obj);
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
} }
+3 -4
View File
@@ -783,8 +783,7 @@ unsigned trflags;
pline("%s you!", A_gush_of_water_hits); pline("%s you!", A_gush_of_water_hits);
You("are covered with rust!"); You("are covered with rust!");
if (Half_physical_damage) dam = (dam+1) / 2; losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY);
losehp(dam, "rusting away", KILLED_BY);
break; break;
} else if (u.umonnum == PM_GREMLIN && rn2(3)) { } else if (u.umonnum == PM_GREMLIN && rn2(3)) {
pline("%s you!", A_gush_of_water_hits); pline("%s you!", A_gush_of_water_hits);
@@ -2824,7 +2823,7 @@ drown()
(void)split_mon(&youmonst, (struct monst *)0); (void)split_mon(&youmonst, (struct monst *)0);
else if (u.umonnum == PM_IRON_GOLEM) { else if (u.umonnum == PM_IRON_GOLEM) {
You("rust!"); You("rust!");
i = d(2,6); i = Maybe_Half_Phys(d(2,6));
if (u.mhmax > i) u.mhmax -= i; if (u.mhmax > i) u.mhmax -= i;
losehp(i, "rusting away", KILLED_BY); losehp(i, "rusting away", KILLED_BY);
} }
@@ -3652,7 +3651,7 @@ boolean disarm;
delobj(otmp); delobj(otmp);
} }
wake_nearby(); wake_nearby();
losehp(d(6,6), buf, KILLED_BY_AN); losehp(Maybe_Half_Phys(d(6,6)), buf, KILLED_BY_AN);
exercise(A_STR, FALSE); exercise(A_STR, FALSE);
if(costly && loss) { if(costly && loss) {
if(insider) if(insider)