From d0e996604d4494fa90392be1d80129c95e2f4e46 Mon Sep 17 00:00:00 2001 From: Erik Lunna Date: Sat, 28 Oct 2023 21:21:36 +0200 Subject: [PATCH] Flame mages and ice mages get a small boost for casting their spells of their element. --- src/spell.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/spell.c b/src/spell.c index 18f63f316..4333920b6 100644 --- a/src/spell.c +++ b/src/spell.c @@ -2057,12 +2057,9 @@ percent_success(spell) int spell; { /* Intrinsic and learned ability are combined to calculate - * the probability of player's success at cast a given spell. + * the probability of player's success at casting a given spell. */ - int chance, splcaster, special, statused; - int difficulty; - int skill; - int dex_adjust; + int chance, splcaster, special, statused, difficulty, skill, dex_adjust; boolean paladin_bonus, is_spellcaster, non_casters; /* Calculate intrinsic ability (splcaster) */ @@ -2168,6 +2165,18 @@ int spell; if (wielding_artifact(ART_ORIGIN)) splcaster -= 3; + /* Elemental bonus */ + if (Role_if(PM_FLAME_MAGE)) { + if (spellid(spell) == SPE_FLAME_SPHERE + || spellid(spell) == SPE_FIREBALL + || spellid(spell) == SPE_FIRE_BOLT) + splcaster -= 1; + } else if (Role_if(PM_ICE_MAGE)) { + if (spellid(spell) == SPE_FREEZE_SPHERE + || spellid(spell) == SPE_CONE_OF_COLD) + splcaster -= 1; + } + if (splcaster > 20) splcaster = 20;