summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-19 13:25:44 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-03-19 13:25:44 +0000
commitd12bf8d524b832a148ffb9e9184eab8cfa34df17 (patch)
treed9188fff864db592f966cb65029ee201ff2c58be /crawl-ref/source/monstuff.cc
parente65b75cf40976e2643e0ca1cc2ae5b165f2e5d58 (diff)
downloadcrawl-ref-d12bf8d524b832a148ffb9e9184eab8cfa34df17.tar.gz
crawl-ref-d12bf8d524b832a148ffb9e9184eab8cfa34df17.zip
Fixed shadow creature abuse in Hall of Blades.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1058 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc60
1 files changed, 37 insertions, 23 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index eb8c5915a4..92066944ea 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -328,17 +328,31 @@ static void place_monster_corpse(const monsters *monster)
learned_something_new(TUT_MAKE_CHUNKS);
} // end place_monster_corpse()
+static void tutorial_inspect_kill()
+{
+ if (Options.tutorial_events[TUT_KILLED_MONSTER])
+ learned_something_new(TUT_KILLED_MONSTER);
+ else if (Options.tutorial_left
+ && (you.religion == GOD_TROG
+ || you.religion == GOD_OKAWARU
+ || you.religion == GOD_MAKHLEB)
+ && !you.duration[DUR_PRAYER])
+ {
+ tutorial_prayer_reminder();
+ }
+}
+
void monster_die(monsters *monster, char killer, int i, bool silent)
{
if (monster->type == -1)
return;
- int dmi; // dead monster's inventory
int xom_will_act = 0;
int monster_killed = monster_index(monster);
bool death_message =
!silent && mons_near(monster) && player_monster_visible(monster);
bool in_transit = false;
+ const bool hard_reset = testbits(monster->flags, MF_HARD_RESET);
// From time to time Trog gives you a little bonus
if (killer == KILL_YOU && you.berserker)
@@ -418,8 +432,19 @@ void monster_die(monsters *monster, char killer, int i, bool silent)
else if (monster->type == MONS_DANCING_WEAPON)
{
if (!silent)
- simple_monster_message(monster, " falls from the air.",
- MSGCH_MONSTER_DAMAGE, MDAM_DEAD);
+ {
+ if (hard_reset)
+ simple_monster_message( monster,
+ " disappears in a puff of smoke!" );
+ else
+ simple_monster_message(monster, " falls from the air.",
+ MSGCH_MONSTER_DAMAGE, MDAM_DEAD);
+ }
+
+ if (hard_reset)
+ place_cloud( CLOUD_GREY_SMOKE_MON + random2(3), monster->x,
+ monster->y, 1 + random2(3) );
+
if (!testbits(monster->flags, MF_CREATED_FRIENDLY))
{
@@ -441,12 +466,10 @@ void monster_die(monsters *monster, char killer, int i, bool silent)
if (!silent)
{
- strcpy(info, "You ");
- strcat(info,
- (wounded_damaged(monster->type)) ? "destroy" : "kill");
- strcat(info, " ");
- strcat(info, ptr_monam(monster, DESC_NOCAP_THE));
- strcat(info, "!");
+ snprintf(info, INFO_SIZE,
+ "You %s %s!",
+ wounded_damaged(monster->type) ? "destroy" : "kill",
+ ptr_monam(monster, DESC_NOCAP_THE));
}
if (death_message)
@@ -463,11 +486,7 @@ void monster_die(monsters *monster, char killer, int i, bool silent)
}
// killing triggers tutorial lesson
- if (Options.tutorial_events[TUT_KILLED_MONSTER])
- learned_something_new(TUT_KILLED_MONSTER);
- else if (Options.tutorial_left && (you.religion == GOD_TROG || you.religion == GOD_OKAWARU || you.religion == GOD_MAKHLEB)
- && !you.duration[DUR_PRAYER])
- tutorial_prayer_reminder();
+ tutorial_inspect_kill();
// Xom doesn't care who you killed:
if (you.religion == GOD_XOM
@@ -671,13 +690,7 @@ void monster_die(monsters *monster, char killer, int i, bool silent)
// fall-through
case KILL_DISMISSED:
- for (dmi = MSLOT_GOLD; dmi >= MSLOT_WEAPON; dmi--)
- { /* takes whatever it's carrying back home */
- if (monster->inv[dmi] != NON_ITEM)
- destroy_item(monster->inv[dmi]);
-
- monster->inv[dmi] = NON_ITEM;
- }
+ monster->destroy_inventory();
break;
}
}
@@ -773,8 +786,9 @@ void monster_die(monsters *monster, char killer, int i, bool silent)
}
}
- monster_drop_ething(monster,
- killer == KILL_YOU_MISSILE
+ if (!hard_reset)
+ monster_drop_ething(monster,
+ killer == KILL_YOU_MISSILE
|| killer == KILL_YOU
|| pet_kill);
monster_cleanup(monster);