From ac7f0d3615695b59dd6e571202887083845001b5 Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 11 Jan 2026 01:49:06 -0800 Subject: [PATCH] context sensitive item action for candles When picking candles from an inventory display, expand the 'a' choice if carrying the Candelabrum of Invocation. --- src/invent.c | 13 ++++++++++--- src/pager.c | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/invent.c b/src/invent.c index a7cc92bfc..523250197 100644 --- a/src/invent.c +++ b/src/invent.c @@ -3305,9 +3305,16 @@ itemactions(struct obj *otmp) Sprintf(buf, "%s the candelabrum", light); ia_addmenu(win, IA_APPLY_OBJ, 'a', buf); } else if (otmp->otyp == WAX_CANDLE || otmp->otyp == TALLOW_CANDLE) { - Sprintf(buf, "%s %s %s", light, - is_plural(otmp) ? "these" : "this", - simpleonames(otmp)); + boolean multiple = (otmp->quan == 1L) ? FALSE : TRUE; + const char *s = multiple ? "these" : "this"; + struct obj *o = carrying(CANDELABRUM_OF_INVOCATION); + + if (o && o->spe < 7) + Sprintf(buf, "Attach %s to your candelabrum, or %s %s", s, + !otmp->lamplit ? "light" : "extinguish", /* [lowercase] */ + multiple ? "them" : "it"); + else + Sprintf(buf, "%s %s %s", light, s, simpleonames(otmp)); ia_addmenu(win, IA_APPLY_OBJ, 'a', buf); } else if (otmp->otyp == OIL_LAMP || otmp->otyp == MAGIC_LAMP || otmp->otyp == BRASS_LANTERN) { diff --git a/src/pager.c b/src/pager.c index c5a122401..ca5ed2810 100644 --- a/src/pager.c +++ b/src/pager.c @@ -1721,7 +1721,7 @@ do_look(int mode, coord *click_cc) * introduced. * * When lootabc is set, abandon the 'y'|'n' compatibility in - * favor of newer '/' and '?' compatobility instead. + * favor of newer '/' and '?' compatibility instead. */ any.a_char = '/';