summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/it_use3.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 04:49:59 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 04:49:59 +0000
commitca71ef2d7cb0af2b978e34694ee17264ead6f5c9 (patch)
tree869bf13150876f9118992819544638dee912df2c /crawl-ref/source/it_use3.cc
parentc65f183d6dd6f26b461fe24b2b46260548859c07 (diff)
downloadcrawl-ref-ca71ef2d7cb0af2b978e34694ee17264ead6f5c9.tar.gz
crawl-ref-ca71ef2d7cb0af2b978e34694ee17264ead6f5c9.zip
Don't allow the box of beasts to give you a hell hound if you worship a
good god, since, like "Summon Small Mammals", only one of its summons is bad. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5581 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/it_use3.cc')
-rw-r--r--crawl-ref/source/it_use3.cc36
1 files changed, 21 insertions, 15 deletions
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc
index c9a7a57e54..792c4a3d2e 100644
--- a/crawl-ref/source/it_use3.cc
+++ b/crawl-ref/source/it_use3.cc
@@ -970,19 +970,25 @@ static bool box_of_beasts()
if (random2(100) < 60 + you.skills[SK_EVOCATIONS])
{
- temp_rand = random2(11);
-
- beasty = ((temp_rand == 0) ? MONS_GIANT_BAT :
- (temp_rand == 1) ? MONS_HOUND :
- (temp_rand == 2) ? MONS_JACKAL :
- (temp_rand == 3) ? MONS_RAT :
- (temp_rand == 4) ? MONS_ICE_BEAST :
- (temp_rand == 5) ? MONS_SNAKE :
- (temp_rand == 6) ? MONS_YAK :
- (temp_rand == 7) ? MONS_BUTTERFLY :
- (temp_rand == 8) ? MONS_HELL_HOUND :
- (temp_rand == 9) ? MONS_BROWN_SNAKE
- : MONS_GIANT_LIZARD);
+ // If you worship a good god, don't summon an evil beast (in
+ // this case, the hell hound).
+ do
+ {
+ temp_rand = random2(11);
+
+ beasty = ((temp_rand == 0) ? MONS_GIANT_BAT :
+ (temp_rand == 1) ? MONS_HOUND :
+ (temp_rand == 2) ? MONS_JACKAL :
+ (temp_rand == 3) ? MONS_RAT :
+ (temp_rand == 4) ? MONS_ICE_BEAST :
+ (temp_rand == 5) ? MONS_SNAKE :
+ (temp_rand == 6) ? MONS_YAK :
+ (temp_rand == 7) ? MONS_BUTTERFLY :
+ (temp_rand == 8) ? MONS_BROWN_SNAKE :
+ (temp_rand == 9) ? MONS_GIANT_LIZARD
+ : MONS_HELL_HOUND);
+ }
+ while (player_will_anger_monster(beasty));
beh_type beha = BEH_FRIENDLY;
unsigned short hitting = you.pet_target;
@@ -994,8 +1000,8 @@ static bool box_of_beasts()
}
if (create_monster(
- mgen_data( beasty, beha, 2 + random2(4),
- you.pos(), hitting ) ) != -1)
+ mgen_data(beasty, beha, 2 + random2(4),
+ you.pos(), hitting)) != -1)
{
mpr("...and something leaps out!");
xom_is_stimulated(14);