summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-24 14:05:13 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-24 14:05:13 +0000
commitac738ba838f899d98ff0570e1070cdd62d6b77c5 (patch)
tree9e7e7c9602afc754150e76f8b80e1c96eda60be8 /crawl-ref/source/player.cc
parent35129e9e324fd6464cb8799edfca960881a0dd09 (diff)
downloadcrawl-ref-ac738ba838f899d98ff0570e1070cdd62d6b77c5.tar.gz
crawl-ref-ac738ba838f899d98ff0570e1070cdd62d6b77c5.zip
Add a "forget level map" command, Ctrl-F, to level map. This command used
to be for waypoints along with Ctrl-W but as that never made it into the level map help I don't think it matters. (FR 1745112) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2537 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index af1a809c48..e36a13035e 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -2574,19 +2574,24 @@ bool you_resist_magic(int power)
return 1; */
}
-void forget_map(unsigned char chance_forgotten)
+// force is true for forget_map command on level map
+void forget_map(unsigned char chance_forgotten, bool force)
{
- unsigned char xcount, ycount = 0;
+ if ( force && !yesno("Really forget level map?", true, 'n') )
+ return;
- for (xcount = 0; xcount < GXM; xcount++)
+ for (unsigned char xcount = 0; xcount < GXM; xcount++)
{
- for (ycount = 0; ycount < GYM; ycount++)
+ for (unsigned char ycount = 0; ycount < GYM; ycount++)
{
- if (random2(100) < chance_forgotten)
- env.map[xcount][ycount].clear();
+ if (!see_grid(xcount, ycount) &&
+ (force || random2(100) < chance_forgotten))
+ {
+ env.map[xcount][ycount].clear();
+ }
}
}
-} // end forget_map()
+} // end forget_map()
void gain_exp( unsigned int exp_gained, unsigned int* actual_gain,
unsigned int* actual_avail_gain)