From c32244f1ca9dfacd55040e1a61c3ff6c5c1ab4d5 Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 13 Jan 2009 15:46:45 +0000 Subject: Remove atk and def from melee_attack. Rewrite some code to use actor methods instead of calling things directly. In theory, attacker_as_monster() and defender_as_monster() are hacks; any calls to them that can be replaced by calls to actor methods should be. Fix some inconsistencies with monster bleeding and summoned creatures. (This should probably go into actor::can_bleed().) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8444 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/player.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 58a6393271..51eb1dc1d9 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -7143,6 +7143,24 @@ bool player::can_safely_mutate() const && you.hunger_state == HS_ENGORGED); } +bool player::can_bleed() const +{ + if (you.is_undead && (you.species != SP_VAMPIRE + || you.hunger_state <= HS_SATIATED)) + { + return (false); + } + + const int tran = you.attribute[ATTR_TRANSFORMATION]; + if (tran == TRAN_STATUE || tran == TRAN_ICE_BEAST + || tran == TRAN_AIR || tran == TRAN_LICH + || tran == TRAN_SPIDER) // Monster spiders don't bleed either. + { + return (false); + } + return (true); +} + bool player::mutate() { ASSERT(!crawl_state.arena); -- cgit v1.2.3-54-g00ecf