summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/describe.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-08 17:00:33 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-08 17:00:33 +0000
commit6760ab3170033b2ecceb6ced51e2de7a5d78d6fe (patch)
tree9d5ed416ad5402c17ae593404ca6589d8c07a3ba /crawl-ref/source/describe.cc
parent1854b1209c376c3e3359b4d8a54f9bbf38e1a5ba (diff)
downloadcrawl-ref-6760ab3170033b2ecceb6ced51e2de7a5d78d6fe.tar.gz
crawl-ref-6760ab3170033b2ecceb6ced51e2de7a5d78d6fe.zip
* Rarely, allow randart books to use entirely random names.
* Use monsters' 'x' descriptions as inf.title when hovering your mouse over monster tiles. * A bit of code cleanup. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9385 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/describe.cc')
-rw-r--r--crawl-ref/source/describe.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc
index 80ba34ff21..cb8b69786a 100644
--- a/crawl-ref/source/describe.cc
+++ b/crawl-ref/source/describe.cc
@@ -331,7 +331,7 @@ static void _trim_randart_inscrip( item_def& item )
std::string randart_auto_inscription( const item_def& item )
{
if (item.base_type == OBJ_BOOKS)
- return("");
+ return ("");
const std::vector<std::string> propnames = _randart_propnames(item);
@@ -2683,7 +2683,7 @@ static std::string _monster_stat_description(const monsters& mon)
result << pronoun << " can sense the presence of invisible creatures.$";
// Unusual monster speed.
- const int speed = mons_speed(&mon);
+ const int speed = mons_class_speed(mon.type);
if (speed != 10)
{
result << pronoun << " is ";
@@ -2711,7 +2711,9 @@ static std::string _monster_stat_description(const monsters& mon)
return (result.str());
}
-void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
+// Fetches the monster's database description and reads it into inf.
+void get_monster_db_desc(const monsters& mons, describe_info &inf,
+ bool force_seen)
{
// For undetected mimics describe mimicked item instead.
if (!force_seen && mons_is_unknown_mimic(&mons))
@@ -2722,13 +2724,15 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
return;
}
- inf.title = mons.full_name(DESC_CAP_A, true);
+ if (inf.title.empty())
+ inf.title = mons.full_name(DESC_CAP_A, true);
std::string db_name = mons.base_name(DESC_DBNAME, force_seen);
if (mons_is_mimic(mons.type) && mons.type != MONS_GOLD_MIMIC)
{
- db_name = "mimic";
- inf.title = "A mimic";
+ db_name = "mimic";
+ if (inf.title.empty())
+ inf.title = "A mimic";
}
// Don't get description for player ghosts.
@@ -2855,7 +2859,7 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
{
inf.body << "$" << mons_pronoun(static_cast<monster_type>(mons.type),
PRONOUN_CAP, true)
- << " is incapable of using stairs.$";
+ << " is incapable of using stairs.$";
}
if (mons_is_summoned(&mons))
@@ -2911,7 +2915,7 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
has_item = true;
}
inf.body << " " << i << ") "
- << mitm[mons.inv[i]].name(DESC_NOCAP_A, false, true);
+ << mitm[mons.inv[i]].name(DESC_NOCAP_A, false, true);
}
}
#endif
@@ -2920,12 +2924,12 @@ void get_monster_desc(const monsters& mons, describe_info &inf, bool force_seen)
void describe_monsters(const monsters& mons, bool force_seen)
{
describe_info inf;
- get_monster_desc(mons, inf, force_seen);
+ get_monster_db_desc(mons, inf, force_seen);
print_description(inf);
mouse_control mc(MOUSE_MODE_MORE);
- // TODO enne - this should really move into get_monster_desc
+ // TODO enne - this should really move into get_monster_db_desc
// and an additional tutorial string added to describe_info.
if (Options.tutorial_left)
tutorial_describe_monster(&mons);