diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-24 15:45:20 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-24 15:45:20 +0000 |
commit | a4cf0d15ce8bae7dbefe95b5709a403ab2f1ccaa (patch) | |
tree | 9d20ab89329eb4ef9c86d8292a9b39ea9dba1256 /crawl-ref/source/xom.cc | |
parent | 1c46649f35b7423825ea143b614661bc502c9cc5 (diff) | |
download | crawl-ref-a4cf0d15ce8bae7dbefe95b5709a403ab2f1ccaa.tar.gz crawl-ref-a4cf0d15ce8bae7dbefe95b5709a403ab2f1ccaa.zip |
Change Options.autopickup_on from boolean to 3-state: 1 (autopick up), 0
(autopickup off), -1 (autopickup turned off automatically). Only in the
latter case does killing an invisible monster turn autopickup (back) on.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9691 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r-- | crawl-ref/source/xom.cc | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index ed8c9f2371..46798f35e5 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -1010,7 +1010,6 @@ static bool _player_is_dead() static bool _xom_do_potion() { - bool rc = false; potion_type pot = POT_HEALING; while (true) { @@ -1019,6 +1018,9 @@ static bool _xom_do_potion() POT_SPEED, POT_MIGHT, POT_INVISIBILITY, POT_BERSERK_RAGE, POT_EXPERIENCE, -1)); + if (pot == POT_EXPERIENCE && !one_chance_in(6)) + pot = POT_BERSERK_RAGE; + bool has_effect = true; // Don't pick something that won't have an effect. // Extending an existing effect is okay, though. @@ -1054,38 +1056,30 @@ static bool _xom_do_potion() break; } - if (pot == POT_EXPERIENCE && !one_chance_in(6)) - pot = POT_BERSERK_RAGE; - - if (pot != POT_BERSERK_RAGE || you.can_go_berserk(false)) - { - god_speaks(GOD_XOM, _get_xom_speech("potion effect").c_str()); - - if (pot == POT_BERSERK_RAGE) - you.berserk_penalty = NO_BERSERK_PENALTY; - - // Take a note. - std::string potion_msg = "potion effect "; - switch (pot) - { - case POT_HEALING: potion_msg += "(healing)"; break; - case POT_HEAL_WOUNDS: potion_msg += "(heal wounds)"; break; - case POT_SPEED: potion_msg += "(speed)"; break; - case POT_MIGHT: potion_msg += "(might)"; break; - case POT_INVISIBILITY: potion_msg += "(invisibility)"; break; - case POT_BERSERK_RAGE: potion_msg += "(berserk)"; break; - case POT_EXPERIENCE: potion_msg += "(experience)"; break; - default: potion_msg += "(other)"; break; - } - take_note(Note(NOTE_XOM_EFFECT, you.piety, -1, - potion_msg.c_str()), true); + god_speaks(GOD_XOM, _get_xom_speech("potion effect").c_str()); - potion_effect(pot, 150); + if (pot == POT_BERSERK_RAGE) + you.berserk_penalty = NO_BERSERK_PENALTY; - rc = true; + // Take a note. + std::string potion_msg = "potion effect "; + switch (pot) + { + case POT_HEALING: potion_msg += "(healing)"; break; + case POT_HEAL_WOUNDS: potion_msg += "(heal wounds)"; break; + case POT_MAGIC: potion_msg += "(magic)"; break; + case POT_SPEED: potion_msg += "(speed)"; break; + case POT_MIGHT: potion_msg += "(might)"; break; + case POT_INVISIBILITY: potion_msg += "(invisibility)"; break; + case POT_BERSERK_RAGE: potion_msg += "(berserk)"; break; + case POT_EXPERIENCE: potion_msg += "(experience)"; break; + default: potion_msg += "(other)"; break; } + take_note(Note(NOTE_XOM_EFFECT, you.piety, -1, potion_msg.c_str()), true); - return (rc); + potion_effect(pot, 150); + + return (true); } static bool _xom_confuse_monsters(int sever) @@ -1638,7 +1632,7 @@ static bool _xom_is_good(int sever, int tension) // This series of random calls produces a poisson-looking // distribution: initial hump, plus a long-ish tail. - // Don't make the player go berserk if there's no danger. + // Don't make the player go berserk etc. if there's no danger. if (tension > random2(3) && x_chance_in_y(2, sever)) done = _xom_do_potion(); else if (x_chance_in_y(3, sever)) @@ -2167,6 +2161,7 @@ static void _xom_miscast(const int max_level, const bool nasty) god_speaks(GOD_XOM, _get_xom_speech(speech_str).c_str()); + bool flavour_only = false; MiscastEffect(&you, -GOD_XOM, SPTYP_RANDOM, level, cause_str, NH_DEFAULT, lethality_margin, hand_str, can_plural); } |