From d611da42ccc8fcbb07ebd09d4ed6dc2c0a467512 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 5 Feb 2025 00:01:07 -0800 Subject: [PATCH] enlightenment for armor's effect on spell casting Report the effect of suit and/or robe on spell casting during attribute enlightenment. Doesn't attempt to include other armor slots. That's complicated and would end up being too verbose. --- src/insight.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/insight.c b/src/insight.c index 0000db937..815f1113d 100644 --- a/src/insight.c +++ b/src/insight.c @@ -1782,6 +1782,23 @@ attributes_enlightenment( enlght_halfdmg(HALF_SPDAM, final); if (Half_gas_damage) enl_msg(You_, "take", "took", " reduced poison gas damage", ""); + if (spellid(0) > NO_SPELL) { /* skip if no spells are known yet */ + /* greatly simplified edition of percent_success(spell.c)--may need + to be suppressed if oversimplification leads to player confusion */ + char cast_adj[QBUFSZ]; + boolean suit = uarm && is_metallic(uarm), + robe = uarmc && uarmc->otyp == ROBE; + + *cast_adj = '\0'; + if (suit) /* omit "wearing" to shorten the text */ + Sprintf(cast_adj, " impaired by metallic armor%s", + robe ? ", mitigated by your robe" : ""); + else if (robe) + Strcpy(cast_adj, " enhanced by wearing a robe"); + + if (*cast_adj) + enl_msg("Your spell casting ", "is", "was", cast_adj, ""); + } /* polymorph and other shape change */ if (Protection_from_shape_changers) you_are("protected from shape changers",