summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-chimera.cc
diff options
context:
space:
mode:
authorPete Hurst <pete@streamuniverse.tv>2013-06-14 13:22:03 +0100
committerPete Hurst <pete@streamuniverse.tv>2013-06-21 18:26:18 +0100
commit92e16063525814529dc7614239ea6e335121c41c (patch)
treeef80b4390d27313b7020f75e1ef7f96e62c662e8 /crawl-ref/source/mon-chimera.cc
parent06883c5292065760817a4d6ce3c9d85269cbe6c6 (diff)
downloadcrawl-ref-92e16063525814529dc7614239ea6e335121c41c.tar.gz
crawl-ref-92e16063525814529dc7614239ea6e335121c41c.zip
Allow chimera to be batty
If they have a batty component they'll now have bat wings.
Diffstat (limited to 'crawl-ref/source/mon-chimera.cc')
-rw-r--r--crawl-ref/source/mon-chimera.cc28
1 files changed, 28 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-chimera.cc b/crawl-ref/source/mon-chimera.cc
index 032b18e7f8..53c104bcb4 100644
--- a/crawl-ref/source/mon-chimera.cc
+++ b/crawl-ref/source/mon-chimera.cc
@@ -34,6 +34,8 @@ void make_chimera(monster* mon, monster_type part1, monster_type part2, monster_
mon->base_monster = part1;
mon->props["chimera_part_2"] = part2;
mon->props["chimera_part_3"] = part3;
+
+ apply_chimera_part(mon,part1,1);
apply_chimera_part(mon,part2,2);
apply_chimera_part(mon,part3,3);
}
@@ -48,6 +50,32 @@ static void apply_chimera_part(monster* mon, monster_type part, int partnum)
monster dummy;
dummy.type = part;
define_monster(&dummy);
+
+ if (mons_is_batty(&dummy))
+ mon->props["chimera_batty"].get_int() = partnum;
+}
+
+monster_type get_chimera_part(monster* mon, int partnum)
+{
+ ASSERT_RANGE(partnum,1,4);
+ if (partnum == 1) return mon->base_monster;
+ if (partnum == 2) return static_cast<monster_type>(mon->props["chimera_part_2"].get_int());
+ if (partnum == 3) return static_cast<monster_type>(mon->props["chimera_part_3"].get_int());
+ return MONS_NO_MONSTER;
+}
+
+monster_type get_chimera_part(const monster_info* mi, int partnum)
+{
+ ASSERT_RANGE(partnum,1,4);
+ if (partnum == 1) return mi->base_type;
+ if (partnum == 2) return static_cast<monster_type>(mi->props["chimera_part_2"].get_int());
+ if (partnum == 3) return static_cast<monster_type>(mi->props["chimera_part_3"].get_int());
+ return MONS_NO_MONSTER;
+}
+
+bool chimera_is_batty(const monster* mon)
+{
+ return mon->props.exists("chimera_batty");
}
string monster_info::chimera_part_names() const