From 5945e728fb8d65f4bf0bf90ab9979b7809db6350 Mon Sep 17 00:00:00 2001 From: haranp Date: Sun, 14 Sep 2008 21:37:09 +0000 Subject: 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 --- crawl-ref/source/items.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crawl-ref/source/items.cc') 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)) -- cgit v1.2.3-54-g00ecf