summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-08 01:13:04 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-08 01:13:04 +0000
commit35883348f6901cfc65cf98f4c14e9bbc2800b531 (patch)
tree42d4a4a1c6e752d4888db3186564279f87acdeee
parentfd94c376a07880a14b26750032da5b0310a0b1c8 (diff)
downloadcrawl-ref-35883348f6901cfc65cf98f4c14e9bbc2800b531.tar.gz
crawl-ref-35883348f6901cfc65cf98f4c14e9bbc2800b531.zip
Make all spectral things levitate again, instead of flying if their base
monsters flew, since levitation provides immunity from falling into e.g. deep water due to being immobilized. Also, when enslaving a monster's soul, free the monster first if it's trapped in a net. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8313 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/mon-util.cc18
-rw-r--r--crawl-ref/source/religion.cc3
2 files changed, 7 insertions, 14 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 45b8cee9b3..174d2f565a 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -1456,23 +1456,13 @@ flight_type mons_class_flies(int mc)
flight_type mons_flies(const monsters *mon)
{
- if (mon->type == MONS_PANDEMONIUM_DEMON
- && mon->ghost->fly)
- {
+ if (mon->type == MONS_PANDEMONIUM_DEMON && mon->ghost->fly)
return (mon->ghost->fly);
- }
-
- flight_type ret = FL_NONE;
- if (mons_is_zombified(mon))
- ret = mons_class_flies(mon->base_monster);
+ const int montype = mons_is_zombified(mon) ? mons_zombie_base(mon)
+ : mon->type;
- // Set flight status this way so that monsters will always have the
- // best flight status possible. This is necessary so that monsters
- // with FL_NONE status when alive get FL_LEVITATE status as spectral
- // things, and monsters with FL_FLY status when alive retain it as
- // spectral things.
- ret = std::max(mons_class_flies(mon->type), ret);
+ flight_type ret = mons_class_flies(montype);
if (ret == FL_NONE && _scan_mon_inv_randarts(mon, RAP_LEVITATE) > 0)
ret = FL_LEVITATE;
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 3888571ccf..a2d3b02012 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -5557,6 +5557,9 @@ void yred_make_enslaved_soul(monsters *mon, bool force_hostile,
int corps = -1;
bool twisted = allow_fail && coinflip();
+ // If the monster's held in a net, get it out.
+ mons_clear_trapping_net(mon);
+
if (!quiet)
{
mprf("%s soul %s.", whose.c_str(),