summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/xom.cc
diff options
context:
space:
mode:
authorJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-18 23:30:57 +0100
committerJohanna Ploog <j-p-e-g@users.sourceforge.net>2009-12-18 23:52:19 +0100
commitb2f09ceeac848937906311367ed2072255f93464 (patch)
treef7779713e22f428a2dfb56823e73bf9535d6bbc6 /crawl-ref/source/xom.cc
parentad2ab460048119f15ece7a885098426c2b5e7b33 (diff)
downloadcrawl-ref-b2f09ceeac848937906311367ed2072255f93464.tar.gz
crawl-ref-b2f09ceeac848937906311367ed2072255f93464.zip
Sometimes suppress good Xom events at 0 tension, bad acts at tension > 0.
Note that a good act is not changed to a bad one, or vice versa. Rather, Xom simply doesn't act after all, so that overall, bad acts become more likely when the player is just walking around, without actually making the game nastier. This should make the tension effect actually noticeable in-game. Hopefully, this will also reduce the number of item gifts while simply walking around.
Diffstat (limited to 'crawl-ref/source/xom.cc')
-rw-r--r--crawl-ref/source/xom.cc40
1 files changed, 33 insertions, 7 deletions
diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc
index 5b0ee4b460..a37362e01d 100644
--- a/crawl-ref/source/xom.cc
+++ b/crawl-ref/source/xom.cc
@@ -3669,9 +3669,21 @@ int xom_acts(bool niceness, int sever, int tension, bool debug)
#endif
const bool was_bored = _xom_is_bored();
+ const bool good_act = niceness && !one_chance_in(20);
int result = XOM_DID_NOTHING;
- if (niceness && !one_chance_in(20))
+ if (good_act)
{
+ // Make good acts at zero tension less likely, especially if Xom
+ // is in a bad mood.
+ if (tension == 0 && !x_chance_in_y(you.piety, MAX_PIETY))
+ {
+#ifdef NOTE_DEBUG_XOM
+ take_note(Note(NOTE_MESSAGE, 0, 0, "suppress good act because of "
+ "zero tension"), true);
+#endif
+ return (XOM_GOOD_NOTHING);
+ }
+
// Good stuff.
while (result == XOM_DID_NOTHING)
result = _xom_is_good(sever, tension, debug);
@@ -3691,6 +3703,19 @@ int xom_acts(bool niceness, int sever, int tension, bool debug)
}
#endif
+ // Make bad acts at non-zero tension less likely, especially if Xom
+ // is in a good mood.
+ if (!_xom_feels_nasty() && tension > random2(10)
+ && x_chance_in_y(you.piety, MAX_PIETY))
+ {
+#ifdef NOTE_DEBUG_XOM
+ snprintf(info, INFO_SIZE, "suppress bad act because of %d tension",
+ tension);
+ take_note(Note(NOTE_MESSAGE, 0, 0, info), true);
+#endif
+ return (XOM_BAD_NOTHING);
+ }
+
// Bad mojo.
while (result == XOM_DID_NOTHING)
result = _xom_is_bad(sever, tension, debug);
@@ -4018,15 +4043,15 @@ static const char* _xom_effect_to_name(int effect)
// See xom.h
static const char* _xom_effect_names[] =
{
- "nothing",
+ "bugginess",
// good acts
- "potion", "spell (tension)", "spell (no tension)", "mapping",
- "confuse monsters", "single ally", "animate monster weapon",
+ "nothing", "potion", "spell (tension)", "spell (no tension)",
+ "mapping", "confuse monsters", "single ally", "animate monster weapon",
"annoyance gift", "random item gift", "acquirement", "summon allies",
"polymorph", "swap monsters", "teleportation", "vitrification",
"mutation", "permanent ally", "lightning", "change scenery",
// bad acts
- "miscast (pseudo)", "miscast (minor)", "miscast (major)",
+ "nothing", "miscast (pseudo)", "miscast (minor)", "miscast (major)",
"miscast (nasty)", "stat loss", "teleportation", "swap weapons",
"chaos upgrade", "mutation", "polymorph", "repel stairs", "confusion",
"draining", "torment", "animate weapon", "summon demons",
@@ -4121,8 +4146,9 @@ void debug_xom_effects()
// Repeat N times.
for (int i = 0; i < N; ++i)
{
- bool niceness = xom_is_nice(tension);
- int result = xom_acts(niceness, sever, tension, true);
+ const bool niceness = xom_is_nice(tension);
+ const int result = xom_acts(niceness, sever, tension, true);
+
mood_effects.push_back(result);
all_effects[0].push_back(result);