dipping into burning potions

- candles, et al, light via catch_lit
- non-weapons can be damaged
- only flammable items can be damaged, previously SILVER objects, for example,
  would get a message, but add_erosion_words wouldn't display a damage word
- can't track burnt food, put this in the "seems" case too
- PLASTIC items are is_flammable, which is appropriate for all current uses
- paper gets destroyed (special artifacts excepted by earlier check)
- a cursed potion now spills even if not dipping weapons
- charge for damaging unpaid objects this way
- still very hard to destroy PYEC this way
This commit is contained in:
cohrs
2002-03-09 19:28:16 +00:00
parent 6971feed31
commit 570a6e8bbd
3 changed files with 23 additions and 10 deletions

View File

@@ -455,6 +455,8 @@ don't slap against the floor while riding and eating bad food
got rid of "nori" (since it doesn't really translate "kelp frond" accurately)
engraving in fog-covered location on in the Wizard quest said you
engraved in air, not dust
dipping non-weapons into burning potions of oil had no effect
dipping arrows into burning potions resulted in rust damage
Platform- and/or Interface-Specific Fixes
@@ -576,6 +578,7 @@ USER_SOUNDS compilation option to enable use of SOUND and SOUNDDIR variables
resistance does not protect inventory from artifacts (cold vs Frost Brand,&c)
phrase the prompts for P and R commands using "put on" and "remove" as the
actions rather than repeating W and T commands' "wear" and "take off"
dipping candles, et al, into burning potions lights them
Platform- and/or Interface-Specific New Features

View File

@@ -1045,12 +1045,12 @@ is_flammable(otmp)
register struct obj *otmp;
{
int otyp = otmp->otyp;
int omat = objects[otyp].oc_material;
if (objects[otyp].oc_oprop == FIRE_RES || otyp == WAN_FIRE)
return FALSE;
return((boolean)(objects[otyp].oc_material <= WOOD &&
objects[otyp].oc_material != LIQUID));
return((boolean)((omat <= WOOD && omat != LIQUID) || omat == PLASTIC));
}
boolean

View File

@@ -1733,18 +1733,20 @@ dodip()
}
}
if (potion->otyp == POT_OIL &&
(obj->oclass == WEAPON_CLASS || is_weptool(obj))) {
if (potion->otyp == POT_OIL) {
boolean wisx = FALSE;
if (potion->lamplit) { /* burning */
int omat = objects[obj->otyp].oc_material;
if (obj->oerodeproof || obj_resists(obj, 5, 95) ||
/* `METAL' should not be confused with is_metallic() */
omat == METAL || omat == MITHRIL || omat == BONE) {
/* the code here should be merged with fire_damage */
if (catch_lit(obj)) {
/* catch_lit does all the work if true */
} else if (obj->oerodeproof || obj_resists(obj, 5, 95) ||
!is_flammable(obj) || obj->oclass == FOOD_CLASS) {
pline("%s %s to burn for a moment.",
Yname2(obj), otense(obj, "seem"));
} else {
if (omat == PLASTIC) obj->oeroded = MAX_ERODE;
if ((omat == PLASTIC || omat == PAPER) && !obj->oartifact)
obj->oeroded = MAX_ERODE;
pline_The("burning oil %s %s.",
obj->oeroded == MAX_ERODE ? "destroys" : "damages",
yname(obj));
@@ -1753,8 +1755,12 @@ dodip()
obfree(obj, (struct obj *)0);
obj = (struct obj *) 0;
} else {
/* should check for and do something about
damaging unpaid shop goods here */
/* we know it's carried */
if (obj->unpaid) {
/* create a dummy duplicate to put on bill */
verbalize("You burnt it, you bought it!");
bill_dummy_object(obj);
}
obj->oeroded++;
}
}
@@ -1762,6 +1768,9 @@ dodip()
pline_The("potion spills and covers your %s with oil.",
makeplural(body_part(FINGER)));
incr_itimeout(&Glib, d(2,10));
} else if (obj->oclass != WEAPON_CLASS && !is_weptool(obj)) {
/* the following cases apply only to weapons */
goto more_dips;
/* Oil removes rust and corrosion, but doesn't unburn.
* Arrows, etc are classed as metallic due to arrowhead
* material, but dipping in oil shouldn't repair them.
@@ -1785,6 +1794,7 @@ dodip()
useup(potion);
return 1;
}
more_dips:
/* Allow filling of MAGIC_LAMPs to prevent identification by player */
if ((obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP) &&