summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-util.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-05 06:09:49 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-05 06:09:49 +0000
commitffc2688d711c6741e0ed21d09b9137ae7f173c2a (patch)
tree2bcb3c0af9dd86d969dd44ed78e3748118997572 /crawl-ref/source/spl-util.cc
parent0c5066560faff5d49fe240c76c650d00bea2129d (diff)
downloadcrawl-ref-ffc2688d711c6741e0ed21d09b9137ae7f173c2a.tar.gz
crawl-ref-ffc2688d711c6741e0ed21d09b9137ae7f173c2a.zip
Non-weighted themed randart spellbooks, and prices for randart spellbooks.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7746 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-util.cc')
-rw-r--r--crawl-ref/source/spl-util.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/crawl-ref/source/spl-util.cc b/crawl-ref/source/spl-util.cc
index f31b56a552..00473e9ac7 100644
--- a/crawl-ref/source/spl-util.cc
+++ b/crawl-ref/source/spl-util.cc
@@ -390,6 +390,17 @@ int count_bits(unsigned int bits)
return (c);
}
+// NOTE: Assumes that any single spell won't belong to conflicting
+// disciplines.
+bool disciplines_conflict(unsigned int disc1, unsigned int disc2)
+{
+ const unsigned int combined = disc1 | disc2;
+
+ return ( (combined & SPTYP_EARTH) && (combined & SPTYP_AIR)
+ || (combined & SPTYP_FIRE) && (combined & SPTYP_ICE)
+ || (combined & SPTYP_HOLY) && (combined & SPTYP_NECROMANCY));
+}
+
const char *spell_title(spell_type spell)
{
return (_seekspell(spell)->title);