summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-11-25 14:02:38 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-11-25 14:03:09 +0100
commit9e4ff27375df190391c1a7bbfe8851dd1bf26293 (patch)
treee1a88f6b5bdba42de22f54dfa5b4bddf350fb719 /crawl-ref/source/item_use.cc
parent9a1056ab7e0feb88bb8bcf84411441de3dc32ba6 (diff)
downloadcrawl-ref-9e4ff27375df190391c1a7bbfe8851dd1bf26293.tar.gz
crawl-ref-9e4ff27375df190391c1a7bbfe8851dd1bf26293.zip
Implement reaping as a melee brand.
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc40
1 files changed, 2 insertions, 38 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index cde532b561..698a066220 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -1767,48 +1767,12 @@ static bool _silver_damages_victim(bolt &beam, actor* victim, int &dmg,
static bool _reaping_hit_victim(bolt& beam, actor* victim, int dmg, int corpse)
{
if (beam.is_tracer || victim->alive() || corpse == -1
- || corpse == NON_ITEM)
+ || corpse == NON_ITEM || victim->atype() == ACT_PLAYER)
{
return (false);
}
- actor* agent = beam.agent();
- beh_type beh;
- unsigned short hitting;
-
- if (agent->atype() == ACT_PLAYER)
- {
- hitting = MHITYOU;
- beh = BEH_FRIENDLY;
- }
- else
- {
- monsters *mon = dynamic_cast<monsters*>(agent);
-
- beh = SAME_ATTITUDE(mon);
-
- // Get a new foe for the zombie to target.
- behaviour_event(mon, ME_EVAL);
- hitting = mon->foe;
- }
-
- int midx = NON_MONSTER;
- if (animate_remains(victim->pos(), CORPSE_BODY, beh, hitting, agent, "",
- GOD_NO_GOD, true, true, true, &midx) <= 0)
- {
- return (false);
- }
-
- monsters *zombie = &menv[midx];
-
- if (you.can_see(victim))
- mprf("%s turns into a zombie!", victim->name(DESC_CAP_THE).c_str());
- else if (you.can_see(zombie))
- mprf("%s appears out of thin air!", zombie->name(DESC_CAP_THE).c_str());
-
- player_angers_monster(zombie);
-
- return (true);
+ return (mons_reaped(beam.agent(), dynamic_cast<monsters*>(victim)));
}
static bool _dispersal_hit_victim(bolt& beam, actor* victim, int dmg,