summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/overmap.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-11 11:12:18 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-11 11:12:18 +0000
commita9ac64d3b972306982b27c81632182864022f939 (patch)
tree137e07e43b0d975949d817e257645a0aa9053c23 /crawl-ref/source/overmap.cc
parentdec341f5c123fcaab27d036d70dbef1456ad10fb (diff)
downloadcrawl-ref-a9ac64d3b972306982b27c81632182864022f939.tar.gz
crawl-ref-a9ac64d3b972306982b27c81632182864022f939.zip
Generalize swapping two pieces of terrain in function swap_terrain().
Encapsulate filling out a corpse object for a particular monster in fill_out_corpse(). Started work on "swap chaos weapon with weapon of victim" chaos effect, but am putting that off until there's some actor class virtual methods for changing inventory and equipment. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7807 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/overmap.cc')
-rw-r--r--crawl-ref/source/overmap.cc24
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/overmap.cc b/crawl-ref/source/overmap.cc
index cc371f4165..5308280b93 100644
--- a/crawl-ref/source/overmap.cc
+++ b/crawl-ref/source/overmap.cc
@@ -81,6 +81,30 @@ void seen_notable_thing( dungeon_feature_type which_thing,
_seen_other_thing( which_thing, pos );
}
+bool move_notable_thing(const coord_def& orig, const coord_def& dest)
+{
+ ASSERT(in_bounds(orig) && in_bounds(dest));
+ ASSERT(orig != dest);
+ ASSERT(!is_notable_terrain(grd(dest)));
+
+ if (!is_notable_terrain(grd(orig)))
+ return (false);
+
+ level_pos pos1(level_id::current(), orig);
+ level_pos pos2(level_id::current(), dest);
+
+ shops_present[pos2] = shops_present[pos1];
+ altars_present[pos2] = altars_present[pos1];
+ portals_present[pos2] = portals_present[pos1];
+ portal_vaults_present[pos2] = portal_vaults_present[pos1];
+ portal_vault_notes[pos2] = portal_vault_notes[pos1];
+ portal_vault_colours[pos2] = portal_vault_colours[pos1];
+
+ unnotice_feature(pos1);
+
+ return (true);
+}
+
static dungeon_feature_type portal_to_feature(portal_type p)
{
switch ( p )