From 3d81bd7a6b61c60f49995ad85787afa7452a7965 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 1 Jul 2008 14:59:59 +0000 Subject: Outsource the description of Xom's powers (so to speak) instead of hardcoding it. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6296 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/dat/descript/gods.txt | 8 ++++++++ crawl-ref/source/describe.cc | 29 +++++++++-------------------- crawl-ref/source/religion.cc | 2 +- 3 files changed, 18 insertions(+), 21 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/dat/descript/gods.txt b/crawl-ref/source/dat/descript/gods.txt index 891a49fb6e..16368ab777 100644 --- a/crawl-ref/source/dat/descript/gods.txt +++ b/crawl-ref/source/dat/descript/gods.txt @@ -157,6 +157,14 @@ Yredelemnul will also sporadically gift you with stronger undead servants. Sometimes, Yredelemnul may directly intervene to save a follower's life. %%%% +Xom powers + +To worship Xom is to live riskily. In a good mood Xom may shower you +with gifts, while at other times this capricious god could decide to +"spice things up a little" and send you to your doom. If you prove +yourself the stronger, so much the better; if not, well, there'll be +other playthings... +%%%% # no active powers of Vehumet %%%% Okawaru powers diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 56bf70c4cd..c64306b9fe 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -2742,28 +2742,17 @@ static void _detailed_god_description(god_type which_god) textcolor(LIGHTGREY); cprintf(EOL); - if (which_god == GOD_XOM) - { - cprintf("To worship Xom is to live riskily. In a good mood Xom may " - "shower you " EOL - "with gifts, while at other times this capricious god could " - "decide to " EOL - "\"spice things up a little\" and send you to your doom. If " - "you prove " EOL - "yourself the stronger, so much the better; if not, well, " - "there'll be " EOL - "other playthings..." EOL); + std::string broken = get_god_powers(which_god); + if (!broken.empty()) + { + linebreak_string2(broken, width); + formatted_string::parse_block(broken, false).display(); + cprintf(EOL); + cprintf(EOL); } - else + + if (which_god != GOD_XOM) { - std::string broken = get_god_powers(which_god); - if (!broken.empty()) - { - linebreak_string2(broken, width); - formatted_string::parse_block(broken, false).display(); - cprintf(EOL); - cprintf(EOL); - } broken = get_god_likes(which_god, true); linebreak_string2(broken, width); formatted_string::parse_block(broken, false).display(); diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index c531c96366..eba5c836c5 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -464,7 +464,7 @@ bool god_gives_permanent_followers(god_type god) std::string get_god_powers(god_type which_god) { // Return early for the special cases. - if (which_god == GOD_NO_GOD || which_god == GOD_XOM) + if (which_god == GOD_NO_GOD) return ""; std::string result = getLongDescription(god_name(which_god) + " powers"); -- cgit v1.2.3-54-g00ecf