diff options
author | Chris Campbell <chriscampbell89@gmail.com> | 2014-03-30 04:07:40 +0100 |
---|---|---|
committer | Chris Campbell <chriscampbell89@gmail.com> | 2014-04-03 14:12:54 +0100 |
commit | b999a6f53cd2a0990672b31796d9ae3a1d9bfa46 (patch) | |
tree | a0909a984a2095fe33679a7f10281041b44dc2d1 /crawl-ref/source/xom.cc | |
parent | bb6752c796fbcc8c7bb9e82ff2bc772eeac75cc2 (diff) | |
download | crawl-ref-b999a6f53cd2a0990672b31796d9ae3a1d9bfa46.tar.gz crawl-ref-b999a6f53cd2a0990672b31796d9ae3a1d9bfa46.zip |
Let Xom occasionally give stealth or make noise upon entering a new level
Only rarely, and only upon entering a level for the first time. Randomly
pick between providing a fairly long-duration stealth boost or making a
loud noise.
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r-- | crawl-ref/source/xom.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index c30d8dec2f..aabe7f42c1 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -4036,6 +4036,30 @@ bool xom_saves_your_life(const kill_method_type death_type, const char *aux) return true; } +// Xom might have something to say when you enter a new level. +void xom_new_level_noise_or_stealth() +{ + if (!you_worship(GOD_XOM) && !player_under_penance(GOD_XOM)) + return; + + // But only occasionally. + if (one_chance_in(30)) + { + if (!player_under_penance(GOD_XOM) && coinflip()) + { + god_speaks(GOD_XOM, _get_xom_speech("stealth player").c_str()); + mpr(you.duration[DUR_STEALTH] ? "You feel more catlike." + : "You feel stealthy."); + you.increase_duration(DUR_STEALTH, 10 + random2(80)); + take_note(Note(NOTE_XOM_EFFECT, you.piety, -1, + "stealth player"), true); + } + else + _xom_noise(); + } + return; +} + #ifdef WIZARD struct xom_effect_count { |