From: cohrs Date: Sat, 9 Mar 2002 19:28:16 +0000 (+0000) Subject: dipping into burning potions X-Git-Tag: MOVE2GIT~3017 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=570a6e8bbd1166e3ba97659bc4a9c1585034310b;p=nethack 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 --- diff --git a/doc/fixes34.0 b/doc/fixes34.0 index 32bc97009..3130f49d8 100644 --- a/doc/fixes34.0 +++ b/doc/fixes34.0 @@ -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 diff --git a/src/mkobj.c b/src/mkobj.c index 658165cea..aa80a7743 100644 --- a/src/mkobj.c +++ b/src/mkobj.c @@ -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 diff --git a/src/potion.c b/src/potion.c index f82c390c5..c18b80f9c 100644 --- a/src/potion.c +++ b/src/potion.c @@ -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) &&