summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/items.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-30 05:56:13 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-30 05:56:13 +0000
commitfc944616f69e347423c408a9d3e3efee9140a46d (patch)
tree342a77d3a517969c7ac57c6d6bc0408dc07422c3 /crawl-ref/source/items.cc
parentcc20c6d673722c6dd4ca32290d9cc66e55597f3c (diff)
downloadcrawl-ref-fc944616f69e347423c408a9d3e3efee9140a46d.tar.gz
crawl-ref-fc944616f69e347423c408a9d3e3efee9140a46d.zip
This commit breaks save file compatability.
Lots of new things that amuse/stimulate Xom, and a few things which don't amuse him as much anymore. Among the new things is a corpse turning into a skeleton while butchering it; if this is too harsh to do just for Xom's amusement (previously turning into a skeleton while butchering was an ignored case and still produced chunks of flesh) it can be changed back. Also, if a Xom worshiper draws the Blank card, Xom makes it act like a Xom card, since a plain old Blank card is boring. Keep track of which branch the Orb is in, if the player isn't carrying it. Keep track of how/why the player ended up in a particular level type (Abyss, Pan, etc). Changed most "a distortion effect" cause strings for distortion caused tranlsocation miscast effects to something more specific. Added new wizard commands 'C' to curse or uncruse an item, and 'Ctrl-A' to re-generate the Abyss. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2256 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/items.cc')
-rw-r--r--crawl-ref/source/items.cc47
1 files changed, 45 insertions, 2 deletions
diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc
index 60bacbd15b..7d7daea1b6 100644
--- a/crawl-ref/source/items.cc
+++ b/crawl-ref/source/items.cc
@@ -34,6 +34,7 @@
#include "externs.h"
#include "beam.h"
+#include "branch.h"
#include "cloud.h"
#include "debug.h"
#include "delay.h"
@@ -73,6 +74,7 @@
#include "transfor.h"
#include "tutorial.h"
#include "view.h"
+#include "xom.h"
static bool invisible_to_player( const item_def& item );
static void item_list_on_square( std::vector<const item_def*>& items,
@@ -530,6 +532,8 @@ void destroy_item_stack( int x, int y )
UNIQ_LOST_IN_ABYSS );
}
+ xom_check_lost_item( mitm[o] );
+
mitm[o].base_type = OBJ_UNASSIGNED;
mitm[o].quantity = 0;
}
@@ -944,8 +948,16 @@ static std::string origin_place_desc(const item_def &item)
bool is_rune(const item_def &item)
{
- return (item.base_type == OBJ_MISCELLANY &&
- item.sub_type == MISC_RUNE_OF_ZOT);
+ return (item.base_type == OBJ_MISCELLANY
+ && item.sub_type == MISC_RUNE_OF_ZOT);
+}
+
+bool is_unique_rune(const item_def &item)
+{
+ return (item.base_type == OBJ_MISCELLANY
+ && item.sub_type == MISC_RUNE_OF_ZOT
+ && item.plus != RUNE_DEMONIC
+ && item.plus != RUNE_ABYSSAL);
}
bool origin_describable(const item_def &item)
@@ -1473,8 +1485,12 @@ int move_item_to_player( int obj, int quant_got, bool quiet )
if (!quiet)
mpr("Now all you have to do is get back out of the dungeon!");
you.char_direction = GDT_ASCENDING;
+ xom_is_stimulated(255, XM_INTRIGUED);
}
+ if (item.base_type == OBJ_ORBS && you.level_type == LEVEL_DUNGEON)
+ unset_branch_flags(BFLAG_HAS_ORB);
+
you.turn_is_over = true;
return (retval);
@@ -1542,6 +1558,9 @@ void move_item_to_grid( int *const obj, int x, int y )
mitm[*obj].link = igrd[x][y];
igrd[x][y] = *obj;
+ if (mitm[*obj].base_type == OBJ_ORBS && you.level_type == LEVEL_DUNGEON)
+ set_branch_flags(BFLAG_HAS_ORB);
+
return;
}
@@ -3026,6 +3045,30 @@ item_def find_item_type(object_class_type base_type, std::string name)
return (item);
}
+bool item_is_equipped(const item_def &item)
+{
+ if (item.x != -1 || item.y != -1)
+ return (false);
+
+ for (int i = 0; i < NUM_EQUIP; i++)
+ {
+ if (you.equip[i] == EQ_NONE)
+ continue;
+
+ item_def& eq(you.inv[you.equip[i]]);
+
+ if (!is_valid_item(eq))
+ continue;
+
+ if (eq.slot == item.slot)
+ return (true);
+ else if (&eq == &item)
+ return (true);
+ }
+
+ return (false);
+}
+
////////////////////////////////////////////////////////////////////////
// item_def functions.