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.
This commit is contained in:
PatR
2021-12-14 02:38:17 -08:00
parent 1fd379a980
commit 78c84a1e5d

View File

@@ -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) {