diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 21:32:07 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-07 21:32:07 +0000 |
commit | 5a806811128416a0c67409e137c929873c28cd7a (patch) | |
tree | fbde21511115a46723c43fcc07f7701e89cbefa4 /crawl-ref/source/itemname.cc | |
parent | f5a70a7cbd7c9a7dd6c41fdfade1dc53dbb77f0f (diff) | |
download | crawl-ref-5a806811128416a0c67409e137c929873c28cd7a.tar.gz crawl-ref-5a806811128416a0c67409e137c929873c28cd7a.zip |
Nerf damage of the bat transformation. Reduced from
2 + skill(unarmed_combat)/3 to
2 + rnd(skill(unarmed_combat)/5 + 1)
Also replace the menu_colour_prefix colouring for prompts and the like
to use message_colour instead, so those "msg" abbreviations in
food_colouring.txt actually have an effect now, and players can disable
colouring of prompts etc. (respects channels) while leaving it on in the
inventory.
I'm leaving the menu_colour_prefix function in for now, in case it can
be used somewhere else.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5558 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r-- | crawl-ref/source/itemname.cc | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index f44bbfcd7f..47a39c3f9a 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2283,6 +2283,43 @@ const std::string get_menu_colour_prefix_tags(item_def &item, return (item_name); } +const std::string get_message_colour_tags(item_def &item, + description_level_type desc, + msg_channel_type channel) +{ + std::string cprf = menu_colour_item_prefix(item); + std::string colour = ""; + std::string colour_off = ""; + std::string item_name = item.name(desc); + cprf += " " + item_name; + + int col = -1; + const std::vector<message_colour_mapping>& mcm + = Options.message_colour_mappings; + typedef std::vector<message_colour_mapping>::const_iterator mcmci; + + for (mcmci ci = mcm.begin(); ci != mcm.end(); ++ci) + { + if (ci->message.is_filtered(channel, cprf)) + { + col = ci->colour; + break; + } + } + + if (col != -1) + colour = colour_to_str( col ); + + if (!colour.empty()) + { + // Order is important here. + colour_off = "</" + colour + ">"; + colour = "<" + colour + ">"; + item_name = colour + item_name + colour_off; + } + + return (item_name); +} typedef std::map<std::string, item_types_pair> item_names_map; static item_names_map item_names_cache; |