summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilepick.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 16:23:13 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-10 16:23:13 +0000
commitabec3e39f39b3f598c90b645a45bb43097b8e5cb (patch)
tree6050a955d8385bd0c2d46d12776702c62d585b4e /crawl-ref/source/tilepick.cc
parent87616cef0d3617cd349edb6641d32d71cdd96b22 (diff)
downloadcrawl-ref-abec3e39f39b3f598c90b645a45bb43097b8e5cb.tar.gz
crawl-ref-abec3e39f39b3f598c90b645a45bb43097b8e5cb.zip
[2495836] Show names for friendly uniques during arena mode. Also, add a tile_tag_pref option.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8383 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilepick.cc')
-rw-r--r--crawl-ref/source/tilepick.cc72
1 files changed, 59 insertions, 13 deletions
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index ddaac223fd..1575a4a355 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -17,6 +17,7 @@ REVISION("$Rev$");
#include "itemname.h"
#include "items.h"
#include "itemprop.h"
+#include "Kills.h"
#include "macro.h"
#include "monstuff.h"
#include "mon-util.h"
@@ -4394,20 +4395,46 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground, bool detected)
if (foreground)
{
env.tile_fg[ep.x-1][ep.y-1] = t;
- if (menv[idx].is_named() && !mons_friendly_real(&menv[idx])
- && menv[idx].type != MONS_PANDEMONIUM_DEMON)
+ const monsters *mon = &menv[idx];
+
+ if (!player_monster_visible(mon)
+ || mons_is_lurking(mon)
+ || (mons_is_mimic(mon->type) && !mons_is_known_mimic(mon))
+ || mons_class_flag(mon->type, M_NO_EXP_GAIN))
{
- if (menv[idx].type == MONS_PLAYER_GHOST)
- {
- // Beautification hack. "Foo's ghost" is a little bit
- // verbose as a tag. "Foo" on its own should be sufficient.
- tiles.add_text_tag(TAG_NAMED_MONSTER, menv[idx].mname, gc);
- }
- else
- {
- tiles.add_text_tag(TAG_NAMED_MONSTER,
- menv[idx].name(DESC_CAP_A), gc);
- }
+ return;
+ }
+
+ const tag_pref pref = Options.tile_tag_pref;
+ if (pref == TAGPREF_NONE)
+ return;
+ else if (pref == TAGPREF_TUTORIAL)
+ {
+ const long kills = you.kills->num_kills(mon);
+ const int limit = 3;
+
+ if (!mon->is_named() && kills > limit)
+ return;
+ }
+ else if (!mon->is_named())
+ return;
+
+ if (pref != TAGPREF_NAMED && mons_friendly_real(mon))
+ return;
+
+ // HACK. Names cover up pan demons in a weird way.
+ if (mon->type == MONS_PANDEMONIUM_DEMON)
+ return;
+
+ if (mon->type == MONS_PLAYER_GHOST)
+ {
+ // Beautification hack. "Foo's ghost" is a little bit
+ // verbose as a tag. "Foo" on its own should be sufficient.
+ tiles.add_text_tag(TAG_NAMED_MONSTER, mon->mname, gc);
+ }
+ else
+ {
+ tiles.add_text_tag(TAG_NAMED_MONSTER, mon->name(DESC_PLAIN), gc);
}
}
else
@@ -4517,4 +4544,23 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy)
}
}
+static FixedVector<const char*, TAGPREF_MAX>
+ tag_prefs("none", "tutorial", "named", "enemy");
+
+tag_pref string2tag_pref(const char *opt)
+{
+ for (int i = 0; i < TAGPREF_MAX; i++)
+ {
+ if (!stricmp(opt, tag_prefs[i]))
+ return ((tag_pref)i);
+ }
+
+ return TAGPREF_ENEMY;
+}
+
+const char *tag_pref2string(tag_pref pref)
+{
+ return tag_prefs[pref];
+}
+
#endif