summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/xom.cc33
1 files changed, 16 insertions, 17 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 8a7c5c0b8a..0e966f8642 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -435,28 +435,27 @@ static bool _xom_is_good(int sever)
if (random2(sever) <= 1)
{
- potion_type pot;
+ potion_type pot =
+ static_cast<potion_type>(
+ random_choose(POT_HEALING, POT_HEAL_WOUNDS, POT_SPEED,
+ POT_MIGHT, POT_INVISIBILITY, POT_BERSERK_RAGE,
+ POT_EXPERIENCE, -1));
- do
- {
- pot = (potion_type)random_choose(
- POT_HEALING, POT_HEAL_WOUNDS, POT_SPEED, POT_MIGHT,
- POT_INVISIBILITY, POT_BERSERK_RAGE, POT_EXPERIENCE, -1);
-
- // Downplay this one a bit.
- if (pot == POT_EXPERIENCE && !one_chance_in(6))
- pot = POT_BERSERK_RAGE;
- }
- while (pot == POT_BERSERK_RAGE && !you.can_go_berserk(false));
+ // Downplay this one a bit.
+ if (pot == POT_EXPERIENCE && !one_chance_in(6))
+ pot = POT_BERSERK_RAGE;
- if (pot == POT_BERSERK_RAGE)
- you.berserk_penalty = NO_BERSERK_PENALTY;
+ if (pot != POT_BERSERK_RAGE || you.can_go_berserk(false))
+ {
+ god_speaks(GOD_XOM, _get_xom_speech("potion effect"));
- god_speaks(GOD_XOM, _get_xom_speech("potion effect"));
+ if (pot == POT_BERSERK_RAGE)
+ you.berserk_penalty = NO_BERSERK_PENALTY;
- potion_effect(pot, 150);
+ potion_effect(pot, 150);
- done = true;
+ done = true;
+ }
}
else if (random2(sever) <= 2)
{