summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-15 06:36:07 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-15 06:36:07 +0000
commit62cba73fa0b680b992c6c11ba59268617abd35ae (patch)
tree2895b3f5acd644d2579c5798c913207d0cf8cf33 /crawl-ref/source/spells3.cc
parenta1b82e6be0343a691d342b48dd9f9076ad53453a (diff)
downloadcrawl-ref-62cba73fa0b680b992c6c11ba59268617abd35ae.tar.gz
crawl-ref-62cba73fa0b680b992c6c11ba59268617abd35ae.zip
Some fixes for mermaid beholding:
* A mermaid stops beholding if it polymorphs into something else. * If new walls are created, then Crawl stops the beholdment of any mermaid that gets hidden by the new walls. * Do paranoid sanity checking on beholders before each command with check_beholders() and try to restore sanity if any bugs are found (and give a diagnostics message if DEBUG is set). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2465 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index f35ae60e35..9bbb8789e5 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -766,7 +766,29 @@ bool entomb(int powc)
}
if (number_built > 0)
+ {
mpr("Walls emerge from the floor!");
+
+ for (int i = you.beheld_by.size() - 1; i >= 0; i--)
+ {
+ const monsters* mon = &menv[you.beheld_by[i]];
+ const coord_def pos = mon->pos();
+ int walls = num_feats_between(you.x_pos, you.y_pos,
+ pos.x, pos.y, DNGN_UNSEEN,
+ DNGN_MAXWALL);
+
+ if (walls > 0)
+ {
+ update_beholders(mon, true);
+ if (you.beheld_by.empty())
+ {
+ you.duration[DUR_BEHELD] = 0;
+ break;
+ }
+ continue;
+ }
+ }
+ }
else
canned_msg(MSG_NOTHING_HAPPENS);