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

View File

@@ -529,7 +529,7 @@ touch_artifact(obj,mon)
You("are blasted by %s power!", s_suffix(the(xname(obj))));
dmg = d((Antimagic ? 2 : 4), (self_willed ? 10 : 4));
Sprintf(buf, "touching %s", oart->name);
losehp(dmg, buf, KILLED_BY);
losehp(dmg, buf, KILLED_BY); /* magic damage, not physical */
exercise(A_WIS, FALSE);
}

View File

@@ -945,7 +945,8 @@ struct obj *obj;
pline("Sparks fly as you whack the %s.%s",
sobj_at(STATUE, rx, ry) ? "statue" : "boulder",
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
You("swing %s through thin air.",

View File

@@ -828,7 +828,7 @@ boolean hitsroof;
}
}
hitfloor(obj);
losehp(dmg, "falling object", KILLED_BY_AN);
losehp(Maybe_Half_Phys(dmg), "falling object", KILLED_BY_AN);
}
return TRUE;
}

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(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)) {
tp++;
pline("Ecch - that must have been poisonous!");

View File

@@ -524,7 +524,8 @@ drinksink()
case 2: You("take a sip of scalding hot water.");
if (Fire_resistance)
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;
case 3: if (mvitals[PM_SEWER_RAT].mvflags & G_GONE)
pline_The("sink seems quite dirty.");

View File

@@ -2263,8 +2263,7 @@ register struct monst *mon;
You_feel("exhausted.");
exercise(A_STR, FALSE);
tmp = rn1(10, 6);
if(Half_physical_damage) tmp = (tmp+1) / 2;
losehp(tmp, "exhaustion", KILLED_BY);
losehp(Maybe_Half_Phys(tmp), "exhaustion", KILLED_BY);
break;
}
}

View File

@@ -1485,8 +1485,7 @@ boolean was_swallowed; /* digestion */
body_part(STOMACH));
Sprintf(killer.name, "%s explosion",
s_suffix(mdat->mname));
if (Half_physical_damage) tmp = (tmp+1) / 2;
losehp(tmp, killer.name, KILLED_BY_AN);
losehp(Maybe_Half_Phys(tmp), killer.name, KILLED_BY_AN);
} else {
if (!Deaf) You_hear("an explosion.");
magr->mhp -= tmp;
@@ -2013,8 +2012,7 @@ int typ, fatal;
pline("You%s!", poiseff[typ]);
} else {
i = thrown_weapon ? rnd(6) : rn1(10,6);
if(Half_physical_damage) i = (i+1) / 2;
losehp(i, pname, kprefix);
losehp(Maybe_Half_Phys(i), pname, kprefix);
}
if(u.uhp < 1) {
killer.format = kprefix;

View File

@@ -73,8 +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!");
if (Half_physical_damage) dam = (dam+1) / 2;
losehp(dam, knm, kprefix);
losehp(Maybe_Half_Phys(dam), knm, kprefix);
exercise(A_STR, FALSE);
}
return(1);

View File

@@ -1437,7 +1437,8 @@ struct monst *mtmp;
stackobj(otmp2);
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:

View File

@@ -1525,8 +1525,7 @@ lootcont:
You("carefully open the bag...");
pline("It develops a huge set of teeth and bites you!");
tmp = rnd(10);
if (Half_physical_damage) tmp = (tmp+1) / 2;
losehp(tmp, "carnivorous bag", KILLED_BY_AN);
losehp(Maybe_Half_Phys(tmp), "carnivorous bag", KILLED_BY_AN);
makeknown(BAG_OF_TRICKS);
timepassed = 1;
continue;

View File

@@ -894,9 +894,11 @@ peffects(otmp)
/* Not necessarily a creature who _likes_ acid */
pline("This tastes %s.", Hallucination ? "tangy" : "sour");
else {
int dmg;
pline("This burns%s!", otmp->blessed ? " a little" :
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);
exercise(A_CON, FALSE);
}
@@ -1017,9 +1019,11 @@ boolean your_fault;
break;
case POT_ACID:
if (!Acid_resistance) {
int dmg;
pline("This burns%s!", obj->blessed ? " a little" :
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);
}
break;
@@ -1447,7 +1451,8 @@ register struct obj *obj;
if (obj->otyp == POT_ACID) {
pline("It boils vigorously!");
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);
update_inventory();
return (TRUE);
@@ -1678,7 +1683,8 @@ dodip()
potionbreathe(obj);
useup(obj);
useup(potion);
losehp(rnd(10), "alchemic blast", KILLED_BY_AN);
losehp(Maybe_Half_Phys(rnd(10)), "alchemic blast",
KILLED_BY_AN);
return(1);
}

View File

@@ -1601,6 +1601,7 @@ prayer_done() /* M. Stephenson (1.0.3b) */
You_feel("like you are falling apart.");
/* KMH -- Gods have mastery over unchanging */
rehumanize();
/* no Half_physical_damage adjustment here */
losehp(rnd(20), "residual undead turning effect", KILLED_BY_AN);
exercise(A_CON, FALSE);
return(1);

View File

@@ -276,7 +276,7 @@ int curse_bless;
if (is_on) Ring_gone(obj);
s = rnd(3 * abs(obj->spe)); /* amount of damage */
useup(obj);
losehp(s, "exploding ring", KILLED_BY_AN);
losehp(Maybe_Half_Phys(s), "exploding ring", KILLED_BY_AN);
} else {
long mask = is_on ? (obj == uleft ? LEFT_RING :
RIGHT_RING) : 0L;
@@ -1143,7 +1143,8 @@ register struct obj *sobj;
} else {
pline_The("scroll catches fire and you burn your %s.",
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);
}
@@ -1268,7 +1269,8 @@ register struct obj *sobj;
stackobj(otmp2);
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;
@@ -1310,10 +1312,12 @@ STATIC_OVL void
wand_explode(obj)
register struct obj *obj;
{
int vibration_dmg;
obj->in_use = TRUE; /* in case losehp() is fatal */
pline("%s vibrates violently, and explodes!", Yname2(obj));
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);
exercise(A_STR, FALSE);
}

View File

@@ -783,8 +783,7 @@ unsigned trflags;
pline("%s you!", A_gush_of_water_hits);
You("are covered with rust!");
if (Half_physical_damage) dam = (dam+1) / 2;
losehp(dam, "rusting away", KILLED_BY);
losehp(Maybe_Half_Phys(dam), "rusting away", KILLED_BY);
break;
} else if (u.umonnum == PM_GREMLIN && rn2(3)) {
pline("%s you!", A_gush_of_water_hits);
@@ -2824,7 +2823,7 @@ drown()
(void)split_mon(&youmonst, (struct monst *)0);
else if (u.umonnum == PM_IRON_GOLEM) {
You("rust!");
i = d(2,6);
i = Maybe_Half_Phys(d(2,6));
if (u.mhmax > i) u.mhmax -= i;
losehp(i, "rusting away", KILLED_BY);
}
@@ -3652,7 +3651,7 @@ boolean disarm;
delobj(otmp);
}
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);
if(costly && loss) {
if(insider)