summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-01 16:07:23 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-01 16:07:23 +0000
commitce03c65515786c7f3c019314fe44019258236a94 (patch)
tree4f2215b3c665329834e2d654af4c2d43e009b3b9 /crawl-ref/source/monstuff.cc
parent8f8b5b59f645ca88bf6b821b04a899b8d779ea45 (diff)
downloadcrawl-ref-ce03c65515786c7f3c019314fe44019258236a94.tar.gz
crawl-ref-ce03c65515786c7f3c019314fe44019258236a94.zip
Slime:6 teleport control is enabled even if you kill the royal jelly off-level (sorear). TC is also enabled when banishing the royal jelly, which is a bit cheesy...
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4026 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 28b340f0fb..39651da8f0 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -38,6 +38,7 @@
#include "describe.h"
#include "dgnevent.h"
#include "fight.h"
+#include "files.h"
#include "ghost.h"
#include "hiscores.h"
#include "it_use2.h"
@@ -639,6 +640,25 @@ static bool _is_mons_mutator_or_rotter(monsters *mons)
return (attk_flavour == AF_MUTATE || attk_flavour == AF_ROT);
}
+static bool _slime_pit_enable_teleport_control()
+{
+ return unset_level_flags(LFLAG_NO_TELE_CONTROL);
+}
+
+static void _fire_monster_death_event(monsters *monster,
+ killer_type killer,
+ int i)
+{
+ dungeon_events.fire_event(
+ dgn_event(DET_MONSTER_DIED, monster->pos(), 0,
+ monster_index(monster), killer));
+
+ if (monster->type == MONS_ROYAL_JELLY)
+ apply_to_level( level_id(BRANCH_SLIME_PITS, 6),
+ true,
+ _slime_pit_enable_teleport_control );
+}
+
void monster_die(monsters *monster, killer_type killer, int i, bool silent)
{
if (monster->type == -1)
@@ -1202,9 +1222,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
}
}
- dungeon_events.fire_event(
- dgn_event(DET_MONSTER_DIED, monster->pos(), 0,
- monster_index(monster), killer));
+ _fire_monster_death_event(monster, killer, i);
const coord_def mwhere = monster->pos();
if (drop_items)
@@ -1217,7 +1235,7 @@ void monster_die(monsters *monster, killer_type killer, int i, bool silent)
view_update_at(mwhere);
update_screen();
}
-} // end monster_die
+}
void monster_cleanup(monsters *monster)
{