summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-24 06:12:43 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-24 06:12:43 +0000
commitee53c253f44622190c9981c17e7efe66d15ddfc8 (patch)
treec128607e7088e007bd838e95f1ad8ca2d422cc2c /crawl-ref/source/misc.cc
parent87b16bb06d3f693ec3f6d727a50bdadf4df5c138 (diff)
downloadcrawl-ref-ee53c253f44622190c9981c17e7efe66d15ddfc8.tar.gz
crawl-ref-ee53c253f44622190c9981c17e7efe66d15ddfc8.zip
Put skeletal dragons back in the dragon genus, and treat all
dragon-types consistently when dealing with weapons of dragon slaying (dragons, draconians, dragon-transformed players, zombified dragons, and zombified draconians). New function is_dragonkind() handles this. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7578 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index a5f5cc577b..ffc862cd29 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -2861,3 +2861,26 @@ bool stop_attack_prompt(const monsters *mon, bool beam_attack,
return (retval);
}
+
+bool is_dragonkind(const actor *act, const monsters *mon)
+{
+ if (mons_genus(act->mons_species()) == MONS_DRAGON
+ || mons_genus(act->mons_species()) == MONS_DRACONIAN)
+ {
+ return (true);
+ }
+ else if (act->atype() == ACT_PLAYER
+ && you.attribute[ATTR_TRANSFORMATION] == TRAN_DRAGON)
+ {
+ return (true);
+ }
+ else if (act->atype() == ACT_MONSTER
+ && mons_is_zombified(mon)
+ && (mons_genus(mon->base_monster) == MONS_DRAGON
+ || mons_genus(mon->base_monster) == MONS_DRACONIAN))
+ {
+ return (true);
+ }
+
+ return (false);
+}