diff options
author | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2009-12-14 20:50:32 +0100 |
---|---|---|
committer | Johanna Ploog <j-p-e-g@users.sourceforge.net> | 2009-12-14 22:13:09 +0100 |
commit | 7da14e8092377fbda2ea8811b01f7a4afba16072 (patch) | |
tree | 74c0144ecb321a69f5b03fcf96f0f3ec8c6d6520 /crawl-ref/source | |
parent | 2033e2af0461bc98d09af36dcb601f1d308f2c04 (diff) | |
download | crawl-ref-7da14e8092377fbda2ea8811b01f7a4afba16072.tar.gz crawl-ref-7da14e8092377fbda2ea8811b01f7a4afba16072.zip |
Restrict Xom's banishment effect to xp > 8, or xp > 5 if bored.
Also, allow Xom to sometimes revert a banishment right after exacting it.
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/dat/database/godspeak.txt | 11 | ||||
-rw-r--r-- | crawl-ref/source/xom.cc | 56 | ||||
-rw-r--r-- | crawl-ref/source/xom.h | 3 |
3 files changed, 60 insertions, 10 deletions
diff --git a/crawl-ref/source/dat/database/godspeak.txt b/crawl-ref/source/dat/database/godspeak.txt index 29b8d734a3..595d0b210d 100644 --- a/crawl-ref/source/dat/database/godspeak.txt +++ b/crawl-ref/source/dat/database/godspeak.txt @@ -309,6 +309,17 @@ Xom casts you into the Abyss! The world seems to spin as Xom's maniacal laughter rings in your ears. %%%% +Xom revert banishment + +w:30 +"Kidding!" + +"On second thought, though..." + +"No, I've changed my mind." + +Xom pulls you back into the comparable quietude of the dungeon. +%%%% # Xom upgrades a nearby hostile monster's weapon to a chaos brand Xom chaos upgrade diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index d4df0e71d1..d0875d1a2d 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -3227,6 +3227,49 @@ static int _xom_summon_hostiles(int sever, bool debug = false) return (result); } +static int _xom_maybe_reverts_banishment(bool debug = false) +{ + if (_xom_feels_nasty()) + return XOM_BAD_BANISHMENT; + + // Sometimes Xom will immediately revert the banishment. + if (x_chance_in_y(you.piety, 1000)) + { + if (!debug) + { + more(); + god_speaks(GOD_XOM, _get_xom_speech("revert banishment").c_str()); + down_stairs(you.your_level, DNGN_EXIT_ABYSS); + take_note(Note(NOTE_XOM_EFFECT, you.piety, -1, + "revert banishment"), true); + } + return XOM_BAD_PSEUDO_BANISHMENT; + } + return XOM_BAD_BANISHMENT; +} + +static int _xom_do_banishment(bool debug = false) +{ + // Disallow early banishment and make it much rarer later-on. + // While Xom is bored, the chance is increased. + if (!_xom_feels_nasty() && x_chance_in_y(8, you.max_level) + || _xom_is_bored() && x_chance_in_y(5, you.max_level)) + { + return (XOM_DID_NOTHING); + } + + if (debug) + return _xom_maybe_reverts_banishment(debug); + + god_speaks(GOD_XOM, _get_xom_speech("banishment").c_str()); + + // Handles note taking. + banished(DNGN_ENTER_ABYSS, "Xom"); + const int result = _xom_maybe_reverts_banishment(debug); + + return (result); +} + static int _xom_is_bad(int sever, int tension, bool debug = false) { int done = XOM_DID_NOTHING; @@ -3354,14 +3397,8 @@ static int _xom_is_bad(int sever, int tension, bool debug = false) } else if (one_chance_in(sever) && you.level_type != LEVEL_ABYSS) { - if (!debug) - { - god_speaks(GOD_XOM, _get_xom_speech("banishment").c_str()); - // handles note taking - banished(DNGN_ENTER_ABYSS, "Xom"); - badness = 5; - } - done = XOM_BAD_BANISHMENT; + done = _xom_do_banishment(debug); + badness = (done == XOM_BAD_BANISHMENT ? 5 : 1); } } @@ -3583,7 +3620,8 @@ int xom_acts(bool niceness, int sever, int tension, bool debug) const bool was_bored = _xom_is_bored(); int result = XOM_DID_NOTHING; - if (niceness && !one_chance_in(20)) +// if (niceness && !one_chance_in(20)) + if (false) { // Good stuff. while (result == XOM_DID_NOTHING) diff --git a/crawl-ref/source/xom.h b/crawl-ref/source/xom.h index 7839987c9d..50f670e15a 100644 --- a/crawl-ref/source/xom.h +++ b/crawl-ref/source/xom.h @@ -61,8 +61,9 @@ enum xom_event_type XOM_BAD_TORMENT, XOM_BAD_ANIMATE_WPN, XOM_BAD_SUMMON_DEMONS, // 35 + XOM_BAD_PSEUDO_BANISHMENT, XOM_BAD_BANISHMENT, - XOM_LAST_BAD_ACT = XOM_BAD_BANISHMENT, // 36 + XOM_LAST_BAD_ACT = XOM_BAD_BANISHMENT, // 37 XOM_PLAYER_DEAD = 100, // player already dead (shouldn't happen) NUM_XOM_EVENTS |