summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 21:13:55 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 21:13:55 +0000
commitbfbe4152f64f699687acaf77e7dc570306aa73bf (patch)
tree445025a408299cd5056db5d26bf1196a0a7d9b0a /crawl-ref/source/effects.cc
parenteba8d5fc45bccf678b43e75f6f8657c74da3ba49 (diff)
downloadcrawl-ref-bfbe4152f64f699687acaf77e7dc570306aa73bf.tar.gz
crawl-ref-bfbe4152f64f699687acaf77e7dc570306aa73bf.zip
Let Zin's sanctuary protect the player from random hell effects.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6153 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc40
1 files changed, 24 insertions, 16 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 10ad2a1cb9..5224db7dba 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2137,23 +2137,29 @@ bool vitrify_area(int radius)
static void _hell_effects()
{
+ if (is_sanctuary(you.x_pos, you.y_pos))
+ {
+ mpr("Your sanctuary protects you from Hell's scourges!");
+ return;
+ }
+
int temp_rand = random2(17);
spschool_flag_type which_miscast = SPTYP_RANDOM;
bool summon_instead = false;
monster_type which_beastie = MONS_PROGRAM_BUG;
- mpr((temp_rand == 0) ? "\"You will not leave this place.\"" :
- (temp_rand == 1) ? "\"Die, mortal!\"" :
- (temp_rand == 2) ? "\"We do not forgive those who trespass against us!\"" :
- (temp_rand == 3) ? "\"Trespassers are not welcome here!\"" :
- (temp_rand == 4) ? "\"You do not belong in this place!\"" :
- (temp_rand == 5) ? "\"Leave now, before it is too late!\"" :
- (temp_rand == 6) ? "\"We have you now!\"" :
+ mpr((temp_rand == 0) ? "\"You will not leave this place.\"" :
+ (temp_rand == 1) ? "\"Die, mortal!\"" :
+ (temp_rand == 2) ? "\"We do not forgive those who trespass against us!\"" :
+ (temp_rand == 3) ? "\"Trespassers are not welcome here!\"" :
+ (temp_rand == 4) ? "\"You do not belong in this place!\"" :
+ (temp_rand == 5) ? "\"Leave now, before it is too late!\"" :
+ (temp_rand == 6) ? "\"We have you now!\"" :
// plain messages
- (temp_rand == 7) ? (player_can_smell()) ? "You smell brimstone." :
- "Brimstone rains from above." :
- (temp_rand == 8) ? "You feel lost and a long, long way from home..." :
- (temp_rand == 9) ? "You shiver with fear." :
+ (temp_rand == 7) ? (player_can_smell()) ? "You smell brimstone."
+ : "Brimstone rains from above." :
+ (temp_rand == 8) ? "You feel lost and a long, long way from home..." :
+ (temp_rand == 9) ? "You shiver with fear." :
// warning
(temp_rand == 10) ? "You feel a terrible foreboding..." :
(temp_rand == 11) ? "Something frightening happens." :
@@ -2163,11 +2169,11 @@ static void _hell_effects()
// sounds
(temp_rand == 15) ? "A gut-wrenching scream fills the air!" :
(temp_rand == 16) ? "You hear words spoken in a strange and terrible language..."
- : "You hear diabolical laughter!",
- (temp_rand < 7 ? MSGCH_TALK :
+ : "You hear diabolical laughter!",
+ (temp_rand < 7 ? MSGCH_TALK :
temp_rand < 10 ? MSGCH_PLAIN :
temp_rand < 15 ? MSGCH_WARN
- : MSGCH_SOUND) );
+ : MSGCH_SOUND));
temp_rand = random2(27);
@@ -2184,8 +2190,8 @@ static void _hell_effects()
else // 1 in 8 odds {dlb}
which_miscast = SPTYP_ENCHANTMENT;
- miscast_effect( which_miscast, 4 + random2(6), random2avg(97, 3),
- 100, "the effects of Hell" );
+ miscast_effect(which_miscast, 4 + random2(6), random2avg(97, 3),
+ 100, "the effects of Hell");
}
else if (temp_rand > 7) // 10 in 27 odds {dlb}
{
@@ -2253,8 +2259,10 @@ static void _hell_effects()
create_monster(mg);
for (int i = 0; i < 4; ++i)
+ {
if (one_chance_in(3))
create_monster(mg);
+ }
}
}