summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/abl-show.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-20 21:50:54 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-20 21:50:54 +0000
commitf86f721a09fef1f93958a2abc37da555d87f8971 (patch)
tree1851c4f80e2848734dc5c2202b3478f890818253 /crawl-ref/source/abl-show.cc
parent3219115e22de903dd8795fc40e101d6c05ab3291 (diff)
downloadcrawl-ref-f86f721a09fef1f93958a2abc37da555d87f8971.tar.gz
crawl-ref-f86f721a09fef1f93958a2abc37da555d87f8971.zip
* Add ability descriptions to the database search.
* Xom no longer gifts stuff that unquestionably makes for a more boring adventure (scrolls of Detect/Remove Curse, Magic Mapping, Identify; potion of cure mutation, amulet of resist mutation, ring of control teleport). * Xom's "niceness" is no longer automatically defined by his mood, but it's now randomly picked according to piety > random2(200), which translates to nice, else the opposite. A "beloved toy" is extremely likely to get nice effects, and vice versa for the "beloved plaything". * In xom_acts, instead of 50% chance for piety flip, there's now a 20% chance of piety being randomly rerolled. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9523 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/abl-show.cc')
-rw-r--r--crawl-ref/source/abl-show.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index bbc6f7c5aa..dd74d1c66e 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -313,6 +313,21 @@ const struct ability_def & get_ability_def( ability_type abil )
return (Ability_List[0]);
}
+bool string_matches_ability_name(const std::string key)
+{
+ for (int i = ABIL_SPIT_POISON; i <= ABIL_RENOUNCE_RELIGION; ++i)
+ {
+ const ability_def abil = get_ability_def((ability_type) i);
+ if (abil.ability == ABIL_NON_ABILITY)
+ continue;
+
+ std::string name = lowercase_string(ability_name(abil.ability));
+ if (name.find(key) != std::string::npos)
+ return (true);
+ }
+ return (false);
+}
+
std::string print_abilities()
{
std::string text = "\n<w>a:</w> ";