summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-stuff.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2009-11-28 22:29:06 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2009-11-28 22:29:06 +1000
commita7280a4d1b2470ff6f78f82b5afb2d3b6dfccd09 (patch)
treeff9a95f5bfeb98c3ce192fe1901283306496ec4d /crawl-ref/source/mon-stuff.cc
parent97870b61701d19f36ae6da5b88595f207cb5c173 (diff)
downloadcrawl-ref-a7280a4d1b2470ff6f78f82b5afb2d3b6dfccd09.tar.gz
crawl-ref-a7280a4d1b2470ff6f78f82b5afb2d3b6dfccd09.zip
Make death effects unaffected by polymorph.
Polymorphing either Pikel, Kirke or Duvessa/Dowan rendered their death effects useless, as it checked monster->type and not the original monster (ie, monster->mname). Instead of checking monster->mname, though, store the name in monster->props, to stop sorear complaining.
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r--crawl-ref/source/mon-stuff.cc25
1 files changed, 19 insertions, 6 deletions
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 75dda5ad8b..dce2c5809e 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -1103,13 +1103,17 @@ static void _elven_twin_died(monsters* twin)
for (monster_iterator mi; mi; ++mi)
{
- if (mi->type == MONS_DUVESSA)
+ if (mi->type == MONS_DUVESSA
+ || (mi->props.exists("original_name")
+ && mi->props["original_name"].get_string() == "Duvessa"))
{
monster = *mi;
found_duvessa = true;
break;
}
- else if (mi->type == MONS_DOWAN)
+ else if (mi->type == MONS_DOWAN
+ || (mi->props.exists("original_name")
+ && mi->props["original_name"].get_string() == "Dowan"))
{
monster = *mi;
found_dowan = true;
@@ -2082,11 +2086,16 @@ int monster_die(monsters *monster, killer_type killer,
// And his vault can be placed again.
you.uniq_map_names.erase("uniq_boris");
}
- else if (monster->type == MONS_KIRKE && !in_transit)
+ else if (monster->type == MONS_KIRKE
+ || (monster->props.exists("original_name")
+ && monster->props["original_name"].get_string() == "Kirke")
+ && !in_transit)
{
_hogs_to_humans();
}
- else if (monster->type == MONS_PIKEL)
+ else if (monster->type == MONS_PIKEL
+ || (monster->props.exists("original_name")
+ && monster->props["original_name"].get_string() == "Pikel"))
{
// His slaves don't care if he's dead or not, just whether or not
// he goes away.
@@ -2100,8 +2109,11 @@ int monster_die(monsters *monster, killer_type killer,
"back into the water like the carrion they now are.");
}
}
- else if ((monster->type == MONS_DOWAN || monster->type == MONS_DUVESSA)
- && mons_near(monster))
+ else if (((monster->type == MONS_DOWAN || monster->type == MONS_DUVESSA)
+ || (monster->props.exists("original_name")
+ && (monster->props["original_name"].get_string() == "Dowan"
+ || monster->props["original_name"].get_string() == "Duvessa")))
+ && mons_near(monster))
{
_elven_twin_died(monster);
}
@@ -2484,6 +2496,7 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
define_monster(monster->mindex());
monster->mname = name;
+ monster->props["original_name"] = name;
monster->flags = flags;
monster->god = god;