From: Pasi Kallinen Date: Tue, 18 May 2021 14:00:16 +0000 (+0300) Subject: Knights get no metal armor penalty for clerical spells X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f057ef573c2ac0fbe26bb5bd62ada3cc16fc9d04;p=nethack Knights get no metal armor penalty for clerical spells Originally from SporkHack by Derek Ray. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index e692295e8..7956836bc 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -520,6 +520,7 @@ prediscovered weapons adjustmens: only knights and samurai know polearms; rangers know launchers (bows), ammo (arrows), and spears regardless of their race/species; likewise, rogues know all daggers if the move counter ever reaches 1000000000, end the game +knights get no metal armor penalty for clerical spells Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/spell.c b/src/spell.c index 7cd1b4541..870f7f552 100644 --- a/src/spell.c +++ b/src/spell.c @@ -1729,6 +1729,9 @@ percent_success(int spell) int chance, splcaster, special, statused; int difficulty; int skill; + /* Knights don't get metal armor penalty for clerical spells */ + boolean paladin_bonus = Role_if(PM_KNIGHT) + && spell_skilltype(spellid(spell)) == P_CLERIC_SPELL; /* Calculate intrinsic ability (splcaster) */ @@ -1736,7 +1739,7 @@ percent_success(int spell) special = g.urole.spelheal; statused = ACURR(g.urole.spelstat); - if (uarm && is_metallic(uarm)) + if (uarm && is_metallic(uarm) && !paladin_bonus) splcaster += (uarmc && uarmc->otyp == ROBE) ? g.urole.spelarmr / 2 : g.urole.spelarmr; else if (uarmc && uarmc->otyp == ROBE) @@ -1744,12 +1747,14 @@ percent_success(int spell) if (uarms) splcaster += g.urole.spelshld; - if (uarmh && is_metallic(uarmh) && uarmh->otyp != HELM_OF_BRILLIANCE) - splcaster += uarmhbon; - if (uarmg && is_metallic(uarmg)) - splcaster += uarmgbon; - if (uarmf && is_metallic(uarmf)) - splcaster += uarmfbon; + if (!paladin_bonus) { + if (uarmh && is_metallic(uarmh) && uarmh->otyp != HELM_OF_BRILLIANCE) + splcaster += uarmhbon; + if (uarmg && is_metallic(uarmg)) + splcaster += uarmgbon; + if (uarmf && is_metallic(uarmf)) + splcaster += uarmfbon; + } if (spellid(spell) == g.urole.spelspec) splcaster += g.urole.spelsbon;