static boolean get_valid_polearm_position(coordxy, coordxy);
static boolean find_poleable_mon(coord *, int, int);
+static const char Nothing_seems_to_happen[] = "Nothing seems to happen.";
static const char no_elbow_room[] =
"don't have enough elbow-room to maneuver.";
if (!Blind)
pline_The("%s fogs up and doesn't reflect!", mirror);
else
- pline("Nothing seems to happen.");
+ pline("%s", Nothing_seems_to_happen);
return ECMD_TIME;
}
if (!u.dx && !u.dy && !u.dz) {
return FALSE;
}
+/* light a lamp or candle */
static void
use_lamp(struct obj *obj)
{
char buf[BUFSZ];
+ const char *lamp = (obj->otyp == OIL_LAMP
+ || obj->otyp == MAGIC_LAMP) ? "lamp"
+ : (obj->otyp == BRASS_LANTERN) ? "lantern"
+ : NULL;
+
+ /*
+ * When blind, lamps' and candles' on/off state can be distinguished
+ * by heat. For brass lantern assume that there is an on/off switch
+ * that can be felt.
+ */
if (obj->lamplit) {
- if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
- || obj->otyp == BRASS_LANTERN)
- pline("%slamp is now off.", Shk_Your(buf, obj));
+ if (lamp) /* lamp or lantern */
+ pline("%s%s is now off.", Shk_Your(buf, obj), lamp);
else
You("snuff out %s.", yname(obj));
end_burn(obj, TRUE);
/* magic lamps with an spe == 0 (wished for) cannot be lit */
if ((!Is_candle(obj) && obj->age == 0)
|| (obj->otyp == MAGIC_LAMP && obj->spe == 0)) {
- if (obj->otyp == BRASS_LANTERN)
- Your("lantern is out of power.");
- else
+ if (obj->otyp == BRASS_LANTERN) {
+ if (!Blind)
+ Your("lantern is out of power.");
+ else
+ pline("%s", Nothing_seems_to_happen);
+ } else {
pline("This %s has no oil.", xname(obj));
+ }
return;
}
if (obj->cursed && !rn2(2)) {
pline_The("lamp spills and covers your %s with oil.",
fingers_or_gloves(TRUE));
make_glib((int) (Glib & TIMEOUT) + d(2, 10));
- } else if (!Blind)
+ } else if (!Blind) {
pline("%s for a moment, then %s.", Tobjnam(obj, "flicker"),
otense(obj, "die"));
+ } else {
+ pline("%s", Nothing_seems_to_happen);
+ }
} else {
- if (obj->otyp == OIL_LAMP || obj->otyp == MAGIC_LAMP
- || obj->otyp == BRASS_LANTERN) {
+ if (lamp) { /* lamp or lantern */
check_unpaid(obj);
- pline("%slamp is now on.", Shk_Your(buf, obj));
+ pline("%s%s is now on.", Shk_Your(buf, obj), lamp);
} else { /* candle(s) */
pline("%s flame%s %s%s", s_suffix(Yname2(obj)), plur(obj->quan),
otense(obj, "burn"), Blind ? "." : " brightly!");
break;
case 6:
if (Deaf) /* make_deaf() won't give feedback when already deaf */
- pline("Nothing seems to happen.");
+ pline("%s", Nothing_seems_to_happen);
make_deaf((HDeaf & TIMEOUT) + lcount, TRUE);
break;
}
if (did_prop)
g.context.botl = TRUE;
else
- pline("Nothing seems to happen.");
+ pline("%s", Nothing_seems_to_happen);
#undef PROP_COUNT
#undef prop_trouble
if (eobj->timed || eobj->corpsenm != oldcorpsenm)
pline("The %s %s feebly.", xname(eobj), otense(eobj, "quiver"));
else
- pline("Nothing seems to happen.");
+ pline("%s", Nothing_seems_to_happen);
kill_egg(eobj);
goto useup_jelly;
}
|| eobj->corpsenm != oldcorpsenm)
pline("The %s %s briefly.", xname(eobj), otense(eobj, "quiver"));
else
- pline("Nothing seems to happen.");
+ pline("%s", Nothing_seems_to_happen);
useup_jelly:
/* not useup() because we've already done freeinv() */
}
}
-/* Print a lamp flicker message with tailer. */
+/* Print a lamp flicker message with tailer. Only called if seen. */
static void
see_lamp_flicker(struct obj *obj, const char *tailer)
{
}
}
-/* Print a dimming message for brass lanterns. */
+/* Print a dimming message for brass lanterns. Only called if seen. */
static void
lantern_message(struct obj *obj)
{
burn_object(anything *arg, long timeout)
{
struct obj *obj = arg->a_obj;
- boolean canseeit, many, menorah, need_newsym, need_invupdate;
+ boolean canseeit, many, menorah, need_newsym, need_invupdate, bytouch;
coordxy x, y;
char whose[BUFSZ];
} else {
canseeit = FALSE;
}
+ /* when carrying the light source, you can feel the heat from lit lamp
+ or candle so you'll be notified when it burns out even if blind at
+ the time; brass lantern doesn't radiate sufficient heat for that
+ (however, inventory formatting drops "(lit)" so player can tell) */
+ bytouch = (obj->where == OBJ_INVENT && obj->otyp != BRASS_LANTERN);
need_newsym = need_invupdate = FALSE;
/* obj->age is the age remaining at this point. */
case 25:
if (canseeit) {
- if (obj->otyp == BRASS_LANTERN)
+ if (obj->otyp == BRASS_LANTERN) {
lantern_message(obj);
- else {
+ } else {
switch (obj->where) {
case OBJ_INVENT:
case OBJ_MINVENT:
case 0:
/* even if blind you'll know if holding it */
- if (canseeit || obj->where == OBJ_INVENT) {
+ if (canseeit || bytouch) {
switch (obj->where) {
case OBJ_INVENT:
need_invupdate = TRUE;
case 0:
/* we know even if blind and in our inventory */
- if (canseeit || obj->where == OBJ_INVENT) {
+ if (canseeit || bytouch) {
if (menorah) {
switch (obj->where) {
case OBJ_INVENT:
end_burn(obj, FALSE);
if (menorah) {
- obj->spe = 0;
+ obj->spe = 0; /* no candles */
obj->owt = weight(obj);
+ if (carried(obj))
+ need_invupdate = TRUE;
} else {
if (carried(obj)) {
useupall(obj);