From 27a42940bf6942306c74fa5a52abcf1e69e56b1d Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 24 Nov 2008 06:32:59 +0000 Subject: Make zombified orcs vulnerable to weapons of orc slaying, too. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7581 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 2 +- crawl-ref/source/misc.cc | 15 +++++++++++++++ crawl-ref/source/misc.h | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index ab988bcf71..40ac2c348d 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2154,7 +2154,7 @@ bool melee_attack::apply_damage_brand() break; case SPWPN_ORC_SLAYING: - if (defender->mons_species() == MONS_ORC) + if (is_orckind(defender, def)) { special_damage = 1 + random2(3*damage_done/2); if (defender_visible) diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc index ace70f6b3d..3ea8557f0f 100644 --- a/crawl-ref/source/misc.cc +++ b/crawl-ref/source/misc.cc @@ -2862,6 +2862,21 @@ bool stop_attack_prompt(const monsters *mon, bool beam_attack, return (retval); } +bool is_orckind(const actor *act, const monsters *mon) +{ + if (mons_genus(act->mons_species()) == MONS_ORC) + return (true); + + if (act->atype() == ACT_MONSTER + && mons_is_zombified(mon) + && mons_genus(mon->base_monster) == MONS_ORC) + { + return (true); + } + + return (false); +} + bool is_dragonkind(const actor *act, const monsters *mon) { if (mons_genus(act->mons_species()) == MONS_DRAGON diff --git a/crawl-ref/source/misc.h b/crawl-ref/source/misc.h index 4c46506d0e..0eb05999b0 100644 --- a/crawl-ref/source/misc.h +++ b/crawl-ref/source/misc.h @@ -110,6 +110,8 @@ std::string your_hand(bool plural); bool stop_attack_prompt(const monsters *mon, bool beam_attack, bool beam_target); +bool is_orckind(const actor *act, const monsters *mon); + bool is_dragonkind(const actor *act, const monsters *mon); #endif -- cgit v1.2.3-54-g00ecf