]> granicus.if.org Git - nethack/commitdiff
Knights get no metal armor penalty for clerical spells
authorPasi Kallinen <paxed@alt.org>
Tue, 18 May 2021 14:00:16 +0000 (17:00 +0300)
committerPasi Kallinen <paxed@alt.org>
Tue, 18 May 2021 14:02:28 +0000 (17:02 +0300)
Originally from SporkHack by Derek Ray.

doc/fixes37.0
src/spell.c

index e692295e88ab0fb1c4d05d6e56c01d3a8cfec19f..7956836bc8f21100ec7b319b1b315424fde24c28 100644 (file)
@@ -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
index 7cd1b4541beb64fca4aef2eff329187631cd5c00..870f7f552eb15db7023d9c85e93ded90abeae9aa 100644 (file)
@@ -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;