summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-11 11:59:07 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-11 11:59:07 +0000
commit907b837e7c0860984593413279c686d27a81a77e (patch)
tree17467a249c96a2ec459b54ab7034837abef320b7 /crawl-ref/source
parentcc9ba6c05755e235c14daa555bbd037813f91a6e (diff)
downloadcrawl-ref-907b837e7c0860984593413279c686d27a81a77e.tar.gz
crawl-ref-907b837e7c0860984593413279c686d27a81a77e.zip
Take a note when a labyrinth entrance is first found (via either magic mapping
or seeing it) and when a portal vault is first found (via seeing it only, since magic mapping doesn't provide the description of the portal). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7809 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/notes.cc5
-rw-r--r--crawl-ref/source/notes.h1
-rw-r--r--crawl-ref/source/view.cc28
3 files changed, 33 insertions, 1 deletions
diff --git a/crawl-ref/source/notes.cc b/crawl-ref/source/notes.cc
index 63a40de98d..5a7f6bf743 100644
--- a/crawl-ref/source/notes.cc
+++ b/crawl-ref/source/notes.cc
@@ -124,7 +124,8 @@ static bool _is_noteworthy( const Note& note )
|| note.type == NOTE_LOSE_GOD
|| note.type == NOTE_PENANCE
|| note.type == NOTE_MOLLIFY_GOD
- || note.type == NOTE_DEATH)
+ || note.type == NOTE_DEATH
+ || note.type == NOTE_SEEN_FEAT)
{
return (true);
}
@@ -367,6 +368,8 @@ std::string Note::describe( bool when, bool where, bool what ) const
break;
case NOTE_MESSAGE:
result << name;
+ case NOTE_SEEN_FEAT:
+ result << "Found " << name;
break;
default:
result << "Buggy note description: unknown note type";
diff --git a/crawl-ref/source/notes.h b/crawl-ref/source/notes.h
index 86879d0081..3232bd5b08 100644
--- a/crawl-ref/source/notes.h
+++ b/crawl-ref/source/notes.h
@@ -46,6 +46,7 @@ enum NOTE_TYPES
NOTE_DEATH, /* needs: death cause */
NOTE_BUY_ITEM, /* needs: item name (string), price (int) */
NOTE_DONATE_MONEY, /* needs: amount of gold */
+ NOTE_SEEN_FEAT, /* needs: feature seen (string) */
NOTE_NUM_TYPES
};
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 99b9f8cdbb..e414eb9c80 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -43,6 +43,7 @@
#include "monstuff.h"
#include "mon-util.h"
#include "newgame.h"
+#include "notes.h"
#include "output.h"
#include "overmap.h"
#include "place.h"
@@ -255,6 +256,14 @@ void set_terrain_changed( int x, int y )
void set_terrain_mapped( int x, int y )
{
+ if (!(env.map[x][y].flags & (MAP_MAGIC_MAPPED_FLAG | MAP_SEEN_FLAG))
+ && grd[x][y] == DNGN_ENTER_LABYRINTH)
+ {
+ coord_def pos(x, y);
+ take_note(Note(NOTE_SEEN_FEAT, 0, 0,
+ feature_description(pos, false, DESC_NOCAP_A).c_str()));
+ }
+
env.map[x][y].flags &= (~MAP_CHANGED_FLAG);
env.map[x][y].flags |= MAP_MAGIC_MAPPED_FLAG;
#ifdef USE_TILE
@@ -264,6 +273,25 @@ void set_terrain_mapped( int x, int y )
void set_terrain_seen( int x, int y )
{
+ if (!(env.map[x][y].flags & (MAP_MAGIC_MAPPED_FLAG | MAP_SEEN_FLAG))
+ && grd[x][y] == DNGN_ENTER_LABYRINTH)
+ {
+ coord_def pos(x, y);
+ take_note(Note(NOTE_SEEN_FEAT, 0, 0,
+ feature_description(pos, false, DESC_NOCAP_A).c_str()));
+ }
+
+ // Magic mapping doesn't reveal the description of the portal vault
+ // entrance.
+ if (!(env.map[x][y].flags & MAP_SEEN_FLAG)
+ && grd[x][y] == DNGN_ENTER_PORTAL_VAULT
+ && you.level_type != LEVEL_PORTAL_VAULT)
+ {
+ coord_def pos(x, y);
+ take_note(Note(NOTE_SEEN_FEAT, 0, 0,
+ feature_description(pos, false, DESC_NOCAP_A).c_str()));
+ }
+
#ifdef USE_TILE
env.map[x][y].flags &= ~(MAP_DETECTED_ITEM);
env.map[x][y].flags &= ~(MAP_DETECTED_MONSTER);