summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-07 19:55:50 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-07 19:55:50 +0000
commite426b1b518bd6fded95d320aa188ed564861877f (patch)
tree0d5f81bea93705d7d7420e81e4210d43b8800b7d /crawl-ref
parent172890e12641f850a171ff0e4206f6bca5e50e34 (diff)
downloadcrawl-ref-e426b1b518bd6fded95d320aa188ed564861877f.tar.gz
crawl-ref-e426b1b518bd6fded95d320aa188ed564861877f.zip
Consolidate prayer-ending routines.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7177 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/acr.cc5
-rw-r--r--crawl-ref/source/religion.cc12
-rw-r--r--crawl-ref/source/religion.h1
3 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 2b4355621a..01dfd41993 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2577,10 +2577,7 @@ static void _decrement_durations()
if (you.duration[DUR_PRAYER] > 1)
you.duration[DUR_PRAYER]--;
else if (you.duration[DUR_PRAYER] == 1)
- {
- mpr("Your prayer is over.", MSGCH_PRAY, you.religion);
- you.duration[DUR_PRAYER] = 0;
- }
+ end_prayer();
if (you.duration[DUR_DIVINE_SHIELD])
{
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index d097267b68..6c6cc5978c 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -2129,8 +2129,13 @@ void pray()
#if DEBUG_DIAGNOSTICS
mprf(MSGCH_DIAGNOSTICS, "piety: %d (-%d)", you.piety, you.piety_hysteresis );
#endif
+}
-} // end pray()
+void end_prayer(void)
+{
+ mpr("Your prayer is over.", MSGCH_PRAY, you.religion);
+ you.duration[DUR_PRAYER] = 0;
+}
std::string god_name( god_type which_god, bool long_name )
{
@@ -3481,10 +3486,7 @@ void lose_piety(int pgn)
}
if (!_god_accepts_prayer(you.religion))
- {
- mpr("Your prayer is over.", MSGCH_PRAY, you.religion);
- you.duration[DUR_PRAYER] = 0;
- }
+ end_prayer();
if (you.piety > 0 && you.piety <= 5)
learned_something_new(TUT_GOD_DISPLEASED);
diff --git a/crawl-ref/source/religion.h b/crawl-ref/source/religion.h
index 1276501f85..011a85d752 100644
--- a/crawl-ref/source/religion.h
+++ b/crawl-ref/source/religion.h
@@ -77,6 +77,7 @@ void lose_piety(int pgn);
void offer_corpse(int corpse);
std::string god_prayer_reaction();
void pray();
+void end_prayer();
void handle_god_time(void);
int god_colour(god_type god);
void god_pitch(god_type which_god);