summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-14 21:37:09 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-14 21:37:09 +0000
commit5945e728fb8d65f4bf0bf90ab9979b7809db6350 (patch)
treee3f71a17289e664d1a4c34236e207dff6262fbb2 /crawl-ref/source/items.cc
parent50ebba493b26cbee7f13852a6dc68659e35115b2 (diff)
downloadcrawl-ref-5945e728fb8d65f4bf0bf90ab9979b7809db6350.tar.gz
crawl-ref-5945e728fb8d65f4bf0bf90ab9979b7809db6350.zip
God-gifted (i.e. Nemelex-gifted) decks now ID after one card if it's not
an oddity draw, since these decks are pure and there can be no confusion. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6931 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index d206da25d4..df5ad56637 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -1020,6 +1020,21 @@ static bool _origin_is_original_equip(const item_def &item)
return (item.orig_place == 0xFFFFU && item.orig_monnum == -1);
}
+bool origin_is_god_gift(const item_def& item)
+{
+ if (!origin_describable(item))
+ return false;
+
+ if (_origin_is_original_equip(item))
+ return false;
+
+ if (item.orig_monnum >= 0)
+ return false;
+
+ const int iorig = -item.orig_monnum - 2;
+ return (iorig > AQ_SCROLL && iorig < AQ_CARD_GENIE);
+}
+
std::string origin_desc(const item_def &item)
{
if (!origin_describable(item))