summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.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/files.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/files.cc')
-rw-r--r--crawl-ref/source/files.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 2e69a145c1..190d75cb9c 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -90,6 +90,7 @@
#include "travel.h"
#include "tutorial.h"
#include "view.h"
+#include "xom.h"
void save_level(int level_saved, level_area_type lt,
branch_type where_were_you);
@@ -823,6 +824,29 @@ static void grab_followers()
}
}
+// Should be called afetr grab_followers(), so that items carried by
+// followers won't be considered lost.
+static void _xom_check_lost_items(level_area_type old_level_type)
+{
+ if (old_level_type == LEVEL_DUNGEON)
+ return;
+
+ int amusement = 0;
+
+ for (int i = 0; i < MAX_ITEMS; i++)
+ {
+ item_def& item(mitm[i]);
+
+ if (!is_valid_item(item))
+ continue;
+
+ // Item is in player intentory, so it's not lost.
+ if (item.x == -1 && item.y == -1)
+ continue;
+
+ xom_check_lost_item(item);
+ }
+}
bool load( dungeon_feature_type stair_taken, int load_mode,
level_area_type old_level_type, char old_level,
@@ -872,6 +896,8 @@ bool load( dungeon_feature_type stair_taken, int load_mode,
save_level( old_level, LEVEL_DUNGEON, where_were_you2 );
}
+ _xom_check_lost_items(old_level_type);
+
// Try to open level savefile.
FILE *levelFile = fopen(cha_fil.c_str(), "rb");
@@ -1027,6 +1053,9 @@ bool load( dungeon_feature_type stair_taken, int load_mode,
curr_PlaceInfo.assert_validity();
}
+ if (just_created_level)
+ you.attribute[ATTR_ABYSS_ENTOURAGE] = 0;
+
return just_created_level;
} // end load()