From ce03c65515786c7f3c019314fe44019258236a94 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 1 Apr 2008 16:07:23 +0000 Subject: 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 --- crawl-ref/source/monstuff.cc | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') 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) { -- cgit v1.2.3-54-g00ecf