summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/religion.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-21 00:44:52 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-21 00:44:52 +0000
commit498c51d938cc76fc5f2a1b46a4618603da9f3f94 (patch)
treef0388b0ad11fcd486ba426e85006347e632a962a /crawl-ref/source/religion.cc
parent9310a8c76714dadd862b7e28dcf6c105be747388 (diff)
downloadcrawl-ref-498c51d938cc76fc5f2a1b46a4618603da9f3f94.tar.gz
crawl-ref-498c51d938cc76fc5f2a1b46a4618603da9f3f94.zip
Simplify follower blessing code again.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3776 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/religion.cc')
-rw-r--r--crawl-ref/source/religion.cc63
1 files changed, 24 insertions, 39 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index fb3d82860e..5c19fc258b 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -786,53 +786,38 @@ void bless_follower(god_type god,
monsters* mon = &menv[monster];
const char *blessed = mon->name(DESC_NOCAP_A).c_str();
- const char *result = NULL;
+ const char *result;
- switch (random2(100))
+ // 5% chance: Turn a monster into a priestly monster, if possible.
+ // This is currently only used for Beogh.
+ if (god == GOD_BEOGH && one_chance_in(20) && promote_to_priest(mon))
+ result = "priesthood";
+ // 95% chance: full healing.
+ else
{
- // 5% chance: Turn a monster into a priestly monster, if
- // possible. This is currently only used for Beogh.
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- if (god == GOD_BEOGH && promote_to_priest(mon))
- {
- result = "priesthood";
- break;
- }
- // Deliberate fall through.
+ bool healing = false;
+ bool vigour = true;
- // 95% chance: full healing.
- default:
- {
- bool healing = false;
- bool vigour = true;
+ healing = heal_monster(mon, mon->max_hit_points, false);
- healing = heal_monster(mon, mon->max_hit_points, false);
+ if (!healing || coinflip())
+ {
+ // Full healing, plus one added hit point.
+ heal_monster(mon, mon->max_hit_points, true);
- if (!healing || coinflip())
- {
- // Full healing, plus one added hit point.
+ if (coinflip())
+ // Full healing, plus another added hit point.
heal_monster(mon, mon->max_hit_points, true);
- if (coinflip())
- // Full healing, plus another added hit point.
- heal_monster(mon, mon->max_hit_points, true);
-
- vigour = true;
- }
-
- if (healing && vigour)
- result = "healing and extra vigour";
- else if (healing)
- result = "healing";
- else
- result = "extra vigour";
-
- break;
+ vigour = true;
}
+
+ if (healing && vigour)
+ result = "healing and extra vigour";
+ else if (healing)
+ result = "healing";
+ else
+ result = "extra vigour";
}
mprf(MSGCH_GOD, "%s blesses %s with %s.", god_name(god).c_str(),