From e3c41fc21fc88f1e1edb67992a7cb0bbe68abe83 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Fri, 15 Feb 2008 21:33:27 +0000 Subject: Add better feedback on piety gain command (^) in wizard mode. (Resulting from the mysterious FR 1892989.) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3440 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/acr.cc | 40 ++++++++++++++++++++++++++++++++++++---- crawl-ref/source/xom.cc | 6 +++--- 2 files changed, 39 insertions(+), 7 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 54138ed04b..bea7f1e501 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -995,11 +995,43 @@ static void handle_wizard_command( void ) case '^': { - int old_piety = you.piety; + if (you.religion == GOD_NO_GOD) + { + mpr("You are not religious!"); + break; + } + else if (you.religion == GOD_XOM) // increase amusement instead + { + xom_is_stimulated(50, XM_NORMAL, true); + break; + } + + const int old_piety = you.piety; + const int old_penance = you.penance[you.religion]; + if (old_piety >= MAX_PIETY && !old_penance) + { + mprf("Your piety (%d) is already %s maximum.", + old_piety, old_piety == MAX_PIETY ? "at" : "above"); + } - gain_piety(50); - mprf("Congratulations, your piety went from %d to %d!", - old_piety, you.piety); + // even at maximum, you can still gain gifts + // try at least once f. maximum, or repeat until something happens + // Rarely, this might result in several gifts during the same round! + do { + gain_piety(50); + } while (old_piety < MAX_PIETY && old_piety == you.piety + && old_penance == you.penance[you.religion]); + + if (old_penance) + { + mprf("Congratulations, your penance was decreased from %d to %d!", + old_penance, you.penance[you.religion]); + } + else if (you.piety > old_piety) + { + mprf("Congratulations, your piety went from %d to %d!", + old_piety, you.piety); + } } break; diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 789ecc7207..227798e990 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -182,9 +182,9 @@ static void _xom_is_stimulated(int maxinterestingness, god_speaks(GOD_XOM, ((interestingness > 200) ? message_array[5] : (interestingness > 100) ? message_array[4] : - (interestingness > 75) ? message_array[3] : - (interestingness > 50) ? message_array[2] : - (interestingness > 25) ? message_array[1] : + (interestingness > 75) ? message_array[3] : + (interestingness > 50) ? message_array[2] : + (interestingness > 25) ? message_array[1] : message_array[0])); } -- cgit v1.2.3-54-g00ecf