diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-04 14:44:13 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-10-04 14:44:13 +0000 |
commit | 4d0b7c461fd459e01cab475eb6b01ab5ea9d4689 (patch) | |
tree | 3750b8574e0cba9afe96292cf622c385a30ce62e /crawl-ref/source/monstuff.cc | |
parent | da0c3f0c317cfb21e88aecbbb90388cc6d087cfe (diff) | |
download | crawl-ref-4d0b7c461fd459e01cab475eb6b01ab5ea9d4689.tar.gz crawl-ref-4d0b7c461fd459e01cab475eb6b01ab5ea9d4689.zip |
Redid monster death idiom so that monsters::hurt can implicitly
call monster_die(). (This behaviour can be overriden.)
Minor code cleanups elsewhere, removal of dead code from bolt.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7123 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r-- | crawl-ref/source/monstuff.cc | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index f2549cd11d..caa77f743d 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -1968,15 +1968,9 @@ void mons_get_damage_level( const monsters* monster, std::string& desc, void print_wounds(const monsters *monster) { - if (monster->type == -1) + if (!monster->alive() || monster->hit_points == monster->max_hit_points) return; - if (monster->hit_points == monster->max_hit_points - || monster->hit_points < 1) - { - return; - } - if (monster_descriptor(monster->type, MDSC_NOMSG_WOUNDS)) return; @@ -7398,15 +7392,13 @@ static void _mons_in_cloud(monsters *monster) behaviour_event(monster, ME_DISTURB, MHITNOT, monster->pos()); } - hurted = std::max(0, hurted); - if (hurted > 0) { #ifdef DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "%s takes %d damage from cloud.", monster->name(DESC_CAP_THE).c_str(), hurted); #endif - hurt_monster(monster, hurted); + monster->hurt(NULL, hurted, BEAM_MISSILE, false); if (monster->hit_points < 1) { |