summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevktalo <evktalo@users.sourceforge.net>2009-09-30 21:49:06 +0300
committerevktalo <evktalo@users.sourceforge.net>2009-09-30 21:49:06 +0300
commit088bde53337992e16d041865ed3f29a251c5c55b (patch)
treeae485dbf708804869a1cd811134cd9455310fc3c
parent3d29622183c8faefd8135c3f91b847e427283dc0 (diff)
downloadcrawl-ref-088bde53337992e16d041865ed3f29a251c5c55b.tar.gz
crawl-ref-088bde53337992e16d041865ed3f29a251c5c55b.zip
Generalize the check for Vehumet supported spells. Add Shatter and Lee's Rapid Deconstruction (SPELL_FRAGMENTATION) to the list.
Signed-off-by: evktalo <evktalo@users.sourceforge.net>
-rw-r--r--crawl-ref/source/religion.cc10
-rw-r--r--crawl-ref/source/religion.h2
-rw-r--r--crawl-ref/source/spl-cast.cc5
-rw-r--r--crawl-ref/source/spl-util.cc4
-rw-r--r--crawl-ref/source/spl-util.h2
5 files changed, 18 insertions, 5 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 1e9b273aa4..a12cc8d63d 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -4283,6 +4283,16 @@ static bool _destroyed_valuable_weapon(int value, int type)
return (false);
}
+bool vehumet_supports_spell(spell_type spell)
+{
+ if (spell_typematch(spell, SPTYP_CONJURATION | SPTYP_SUMMONING))
+ return (true);
+ if (spell == SPELL_SHATTER || spell == SPELL_FRAGMENTATION)
+ return (true);
+
+ return (false);
+}
+
bool ely_destroy_weapons()
{
if (you.religion != GOD_ELYVILON)
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index f2e12e21ae..a59234a681 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -150,6 +150,8 @@ bool god_hates_spell_type(spell_type spell, god_type god = you.religion);
bool god_dislikes_spell_type(spell_type spell, god_type god = you.religion);
bool god_dislikes_spell_discipline(int discipline, god_type god = you.religion);
+bool vehumet_supports_spell(spell_type spell);
+
bool trog_burn_spellbooks();
bool ely_destroy_weapons();
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 5106e310f6..8c5f71d7b9 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -338,9 +338,8 @@ static int _apply_spellcasting_success_boosts(spell_type spell, int chance)
int wiz_factor = 87;
if (you.religion == GOD_VEHUMET
- && !player_under_penance() && you.piety >= 50
- && (spell_typematch(spell, SPTYP_CONJURATION)
- || spell_typematch(spell, SPTYP_SUMMONING)))
+ && !player_under_penance() && you.piety >= piety_breakpoint(1)
+ && vehumet_supports_spell(spell))
{
// [dshaligram] Fail rate multiplier used to be .5, scaled
// back to 67%.
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index 15e355f103..9c4860de9b 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -388,7 +388,7 @@ bool spell_sanctuary_castable(spell_type spell)
// for Xom acting (more power = more likely to grab his attention) {dlb}
int spell_mana(spell_type which_spell)
{
- if(spell_typematch(which_spell, SPTYP_CONJURATION | SPTYP_SUMMONING)
+ if(vehumet_supports_spell(which_spell)
&& you.religion == GOD_VEHUMET
&& !player_under_penance()
&& you.piety >= piety_breakpoint(3)
@@ -1003,7 +1003,7 @@ int spell_range(spell_type spell, int pow, bool real_cast, bool player_spell)
ASSERT(maxrange >= minrange);
if(player_spell
- && spell_typematch(spell, SPTYP_CONJURATION)
+ && vehumet_supports_spell(spell)
&& you.religion == GOD_VEHUMET
&& !player_under_penance()
&& you.piety >= piety_breakpoint(2))
diff --git a/crawl-ref/source/spl-util.h b/crawl-ref/source/spl-util.h
index 38d022f946..2208be3bf9 100644
--- a/crawl-ref/source/spl-util.h
+++ b/crawl-ref/source/spl-util.h
@@ -123,4 +123,6 @@ const char *spelltype_name(unsigned int which_spelltype);
int spell_type2skill (unsigned int which_spelltype);
int spell_skill2type (unsigned int which_skill);
+bool vehumet_supports_spell(spell_type spell);
+
#endif