From f86f721a09fef1f93958a2abc37da555d87f8971 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 20 Mar 2009 21:50:54 +0000 Subject: * 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 --- crawl-ref/source/abl-show.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'crawl-ref/source/abl-show.cc') 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 = "\na: "; -- cgit v1.2.3-54-g00ecf