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/traps.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/traps.cc')
-rw-r--r-- | crawl-ref/source/traps.cc | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crawl-ref/source/traps.cc b/crawl-ref/source/traps.cc index b69a514fd4..a66b9fb40f 100644 --- a/crawl-ref/source/traps.cc +++ b/crawl-ref/source/traps.cc @@ -471,9 +471,9 @@ void trap_def::trigger(actor& triggerer, bool flat_footed) if (!mons_is_summoned(m)) bleed_onto_floor(m->pos(), m->type, damage_taken, true); - hurt_monster(m, damage_taken); - if (m->hit_points < 1) - monster_die(m, KILL_MISC, NON_MONSTER); + m->hurt(NULL, damage_taken); + if (in_sight && m->alive()) + print_wounds(m); } } break; @@ -1203,9 +1203,7 @@ void trap_def::shoot_ammo(actor& act, bool was_known) poison_monster(monster, KC_OTHER); // Apply damage. - hurt_monster(monster, damage_taken); - if (monster->hit_points < 1) - monster_die(monster, KILL_MISC, NON_MONSTER); + monster->hurt(NULL, damage_taken); } // Drop the item (sometimes.) |