summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stash.h
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-05 08:43:08 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-05 08:43:08 +0000
commit3bc86f82a03f66f402afe45bdfc46312310cc565 (patch)
treecef2dd68f626f8caa63ab3ac87b07393923760ee /crawl-ref/source/stash.h
parentee9ef53947fd17b16194459da580c197bf2a7474 (diff)
downloadcrawl-ref-3bc86f82a03f66f402afe45bdfc46312310cc565.tar.gz
crawl-ref-3bc86f82a03f66f402afe45bdfc46312310cc565.zip
Added two new stash options, stash_track_decay and stash_remove_decay. If
stash_track_decay is true then the stash tracker will remember how long it's been since you've seen a rottable object (corpses, skeletons and meat chunks) and tell you its condition by appending "rotten by now", "skeletalised by now" or "gone by now" to its name in the stash menu. If stash_remove_decay is also true then any item that would have been marked "gone by now" is instead removed from the stash tracker. Doesn't yet track decay of potions of blood. Breaks stash save data compatibility. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5485 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/stash.h')
-rw-r--r--crawl-ref/source/stash.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/crawl-ref/source/stash.h b/crawl-ref/source/stash.h
index 8ca50d0ca3..570a611257 100644
--- a/crawl-ref/source/stash.h
+++ b/crawl-ref/source/stash.h
@@ -90,6 +90,10 @@ public:
// also never removed from the level's map of
// stashes.
private:
+ void _update_corpses(long rot_time);
+ void add_item(const item_def &item, bool add_to_front = false);
+
+private:
bool verified; // Is this correct to the best of our knowledge?
unsigned char x, y;
int abspos;
@@ -109,6 +113,8 @@ private:
static bool are_items_same(const item_def &, const item_def &);
static bool is_filtered(const item_def &item);
+
+ friend class LevelStashes;
};
class ShopInfo
@@ -247,6 +253,7 @@ public:
private:
int _num_enabled_stashes() const;
+ void _update_corpses(long rot_time);
private:
typedef std::map<int, Stash> stashes_t;
@@ -256,6 +263,8 @@ public:
level_id m_place;
stashes_t m_stashes;
shops_t m_shops;
+
+ friend class StashTracker;
};
extern std::ostream &operator << (std::ostream &, const LevelStashes &);
@@ -269,7 +278,7 @@ public:
|| you.level_type == LEVEL_ABYSS;
}
- StashTracker() : levels()
+ StashTracker() : levels(), last_corpse_update(0.0)
{
}
@@ -294,6 +303,8 @@ public:
// previously marked as stashes.
};
+ void update_corpses();
+
void update_visible_stashes(StashTracker::stash_update_mode = ST_PASSIVE);
// Update stash at (x,y) on current level, defaulting to player's current
@@ -326,6 +337,8 @@ private:
private:
typedef std::map<level_id, LevelStashes> stash_levels_t;
stash_levels_t levels;
+
+ double last_corpse_update;
};
extern StashTracker StashTrack;