diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-03 21:57:12 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-03 21:57:12 +0000 |
commit | bf2a59fd761571998062b21409ee678e2852254b (patch) | |
tree | be3130faa7dd7c8a41c0c5b1c0a7a7a104ce0860 /crawl-ref/source | |
parent | d0e164c2124ff90bca9eef4b06f9d2f0a9006964 (diff) | |
download | crawl-ref-bf2a59fd761571998062b21409ee678e2852254b.tar.gz crawl-ref-bf2a59fd761571998062b21409ee678e2852254b.zip |
Add missing tension check for one of Xom's friendly summoning routines.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8183 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/religion.cc | 13 | ||||
-rw-r--r-- | crawl-ref/source/xom.cc | 4 |
2 files changed, 10 insertions, 7 deletions
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 77bbf17a63..edc80afd2e 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -6886,7 +6886,7 @@ int get_tension(god_type god) continue; if (see_grid(mons->pos())) - ; // Monster is nearby + ; // Monster is nearby. else { // Is the monster trying to get somewhere nearby? @@ -6929,11 +6929,12 @@ int get_tension(god_type god) } else if (att == ATT_FRIENDLY) { - // Friendly monsters being around to help you reduce tension. + // Friendly monsters being around to help you reduce + // tension. exper = -exper; - // If it's a god gift it reduces tension even more, since the - // god is already helping you out. + // If it's a god gift, it reduces tension even more, since + // the god is already helping you out. if (gift) exper *= 2; } @@ -6970,8 +6971,8 @@ int get_tension(god_type god) int tension = total; - // Tension goes up inversly proportional to the % of max hp you - // have. + // Tension goes up inversely proportional to the percentage of max + // hp you have. tension *= (scale + 1) * you.hp_max; tension /= you.hp_max + scale * you.hp; diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index 7904b6f1a0..360bf995a8 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -878,7 +878,8 @@ static bool _xom_is_good(int sever, int tension) done = true; } - else if (x_chance_in_y(7, sever)) + // It's pointless to send in help if there's no danger. + else if (tension > 0 && x_chance_in_y(7, sever)) { monster_type mon = _xom_random_demon(sever); const bool is_demonic = (mons_class_holiness(mon) == MH_DEMONIC); @@ -1634,6 +1635,7 @@ static bool _xom_is_bad(int sever, int tension) mon_inv_type slots[] = {MSLOT_WEAPON, MSLOT_ALT_WEAPON, MSLOT_MISSILE}; + for (int i = 0; i < 3; ++i) { int idx = mon->inv[slots[i]]; |