static boolean
m_use_healing(struct monst* mtmp)
{
- struct obj *obj = 0;
+ struct obj *obj;
+
if ((obj = m_carrying(mtmp, POT_FULL_HEALING)) != 0) {
g.m.defensive = obj;
g.m.has_defense = MUSE_POT_FULL_HEALING;
by_you ? -EXPL_FIERY : EXPL_FIERY);
dmg = 0; /* damage has been applied by explode() */
}
+ } else if (otyp == POT_OIL) {
+ char Pronoun[40];
+ boolean was_lit = obj->lamplit ? TRUE : FALSE, saw_lit = FALSE;
+ /*
+ * If not already lit, requires two actions. We cheat and let
+ * monster do both rather than render the potion unuseable.
+ *
+ * Monsters don't start with oil and don't actively pick up oil
+ * so this may never occur in a real game. (Possible though;
+ * nymph can steal potions of oil; shapechanger could take on
+ * nymph form or vacuum up stuff as a g.cube and then eventually
+ * engage with a green slime.)
+ */
+
+ if (obj->quan > 1L)
+ obj = splitobj(obj, 1L);
+ if (vis && !was_lit) {
+ pline("%s ignites %s.", Monnam(mon), ansimpleoname(obj));
+ saw_lit = TRUE;
+ }
+ begin_burn(obj, was_lit);
+ vis |= canseemon(mon); /* burning potion may improve visibility */
+ if (vis) {
+ if (!Unaware)
+ obj->dknown = 1; /* hero is watching mon drink obj */
+ pline("%s quaffs a burning %s",
+ saw_lit ? upstart(strcpy(Pronoun, mhe(mon))) : Monnam(mon),
+ simpleonames(obj));
+ makeknown(POT_OIL);
+ }
+ dmg = d(3, 4); /* [**TEMP** (different from hero)] */
+ m_useup(mon, obj);
} else { /* wand/horn of fire w/ positive charge count */
mplayhorn(mon, obj, TRUE);
/* -1 => monster's wand of fire; 2 => # of damage dice */
/* decide whether obj can be used to cure green slime */
static int
-cures_sliming(struct monst* mon, struct obj* obj)
+cures_sliming(struct monst *mon, struct obj *obj)
{
- /* scroll of fire, non-empty wand or horn of fire */
+ /* scroll of fire */
if (obj->otyp == SCR_FIRE)
- return (haseyes(mon->data) && mon->mcansee);
- /* hero doesn't need hands or even limbs to zap, so mon doesn't either */
+ return (haseyes(mon->data) && mon->mcansee && !nohands(mon->data));
+
+ /* potion of oil; will be set burning if not already */
+ if (obj->otyp == POT_OIL)
+ return !nohands(mon->data);
+
+ /* non-empty wand or horn of fire;
+ hero doesn't need hands or even limbs to zap, so mon doesn't either */
return ((obj->otyp == WAN_FIRE
|| (obj->otyp == FIRE_HORN && can_blow(mon)))
&& obj->spe > 0);
break;
}
case POT_OIL: { /* P. Winner */
- boolean good_for_you = FALSE;
+ boolean good_for_you = FALSE, vulnerable;
if (otmp->lamplit) {
if (likes_fire(g.youmonst.data)) {
pline("Ahh, a refreshing drink.");
good_for_you = TRUE;
} else {
+ /*
+ * Note: if poly'd into green slime, hero ought to take
+ * extra damage, but drinking potions in that form isn't
+ * possible so there's no need to try to handle that.
+ */
You("burn your %s.", body_part(FACE));
/* fire damage */
- losehp(d(Fire_resistance ? 1 : 3, 4), "burning potion of oil",
- KILLED_BY_AN);
+ vulnerable = !Fire_resistance || Cold_resistance;
+ losehp(d(vulnerable ? 4 : 2, 4),
+ "quaffing a burning potion of oil",
+ KILLED_BY);
}
- } else if (otmp->cursed)
+ /*
+ * This is slightly iffy because the burning isn't being
+ * spread across the body. But the message is "the slime
+ * that covers you burns away" and having that follow
+ * "you burn your face" seems consistent enough.
+ */
+ burn_away_slime();
+ } else if (otmp->cursed) {
pline("This tastes like castor oil.");
- else
+ } else {
pline("That was smooth!");
+ }
exercise(A_WIS, good_for_you);
break;
}