From ffc2688d711c6741e0ed21d09b9137ae7f173c2a Mon Sep 17 00:00:00 2001 From: zelgadis Date: Fri, 5 Dec 2008 06:09:49 +0000 Subject: 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 --- crawl-ref/source/spl-util.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'crawl-ref/source/spl-util.cc') 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); -- cgit v1.2.3-54-g00ecf