summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-transit.cc
diff options
context:
space:
mode:
authorDracoOmega <draco_omega@live.com>2013-02-13 12:58:09 -0330
committerDracoOmega <draco_omega@live.com>2013-03-03 18:36:47 -0330
commit1bd74f58a62e72d0ffebc7184334b0d6b5a7fdac (patch)
tree69ef1e05b7317e393306061659d81b411095ad43 /crawl-ref/source/mon-transit.cc
parent82ac2224c72061ef69f27ba69f7f69326b850989 (diff)
downloadcrawl-ref-1bd74f58a62e72d0ffebc7184334b0d6b5a7fdac.tar.gz
crawl-ref-1bd74f58a62e72d0ffebc7184334b0d6b5a7fdac.zip
Interlevel recall for Yred and Beogh
Allow the god-given recall abilities for Yred and Beogh to recall all god-associated permenant allies, regardless of where in the dungeon they reside. (Note that this only includes Yred gifts and not zombies; ie: things that could already follow you between levels) This is done by actively tracking all of these allies in a seperate list which is updated whenever a tracked ally is gained, dies, changes level, or the player changes level. The fact that permanent allies from these gods make interlevel travel unusable is one of the largest sources of tedium associated with those gods, and a major reason for their lack of popularity. Being able to recall from previous levels means you no longer have to manually herd and count allies at the top and bottom of every stair, sometimes having to make multiple trips if the terrain surrounding the stair is too confined. This should make these gods much more playable (and if their power level is now more obvious and considered too high, it can be adjusted in other ways than via tedium)
Diffstat (limited to 'crawl-ref/source/mon-transit.cc')
-rw-r--r--crawl-ref/source/mon-transit.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-transit.cc b/crawl-ref/source/mon-transit.cc
index f4ee5f07d4..43f99585fd 100644
--- a/crawl-ref/source/mon-transit.cc
+++ b/crawl-ref/source/mon-transit.cc
@@ -14,6 +14,7 @@
#include "coordit.h"
#include "dungeon.h"
#include "env.h"
+#include "godcompanions.h"
#include "items.h"
#include "mon-place.h"
#include "mon-util.h"
@@ -118,11 +119,28 @@ void add_monster_to_transit(const level_id &lid, const monster& m)
dprf("Monster in transit to %s: %s", lid.describe().c_str(),
m.name(DESC_PLAIN, true).c_str());
+ if (m.is_divine_companion())
+ move_companion_to(&m, lid);
+
const int how_many = mlist.size();
if (how_many > MAX_LOST)
cull_lost_mons(mlist, how_many);
}
+void remove_monster_from_transit(const level_id &lid, mid_t mid)
+{
+ m_transit_list &mlist = the_lost_ones[lid];
+
+ for (m_transit_list::iterator i = mlist.begin(); i != mlist.end(); ++i)
+ {
+ if (i->mons.mid == mid)
+ {
+ mlist.erase(i);
+ return;
+ }
+ }
+}
+
static void _place_lost_ones(void (*placefn)(m_transit_list &ml))
{
level_id c = level_id::current();