From 78c84a1e5dcb2464ab085fa422bc03d16536976e Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 14 Dec 2021 02:38:17 -0800 Subject: [PATCH] insufficient spell power feedback If attempting to cast a spell without having enough power, you get |You don't have enough energy to cast that spell. Recently that was augmented to |You don't have enough energy to cast that spell yet. if your current power is at maximum and not enough. Augment again to |You don't have enough energy to cast that spell anymore. if current power is at maximum and that maximum is less than the peak value it once had and that peak value would have been enough. --- src/spell.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/spell.c b/src/spell.c index 339494baa..038873609 100644 --- a/src/spell.c +++ b/src/spell.c @@ -977,13 +977,14 @@ spelleffects(int spell, boolean atme) * Augment the message when current energy is at maximum. * "yet": mainly for level 1 characters who already know a spell * but don't start with enough energy to cast it. - * - * TODO: track peak energy (which can be reduced by traps or - * monster attacks or loss of levels) and say "any more" instead - * of "yet" if it was ever high enough to make this cast. + * "anymore": maximum energy was high enough at some point but + * isn't now (lost energy when losing levels or polymorphing into + * new person or had some stripped away by traps or monsters). */ You("don't have enough energy to cast that spell%s.", - (u.uen >= u.uenmax) ? " yet" : ""); + (u.uen < u.uenmax) ? "" /* not at full energy => normal message */ + : (energy > u.uenpeak) ? " yet" /* haven't ever had enough */ + : " anymore"); /* once had enough but have lost some since */ return res; } else { if (spellid(spell) != SPE_DETECT_FOOD) {