diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 06:53:52 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-29 06:53:52 +0000 |
commit | 8cffb32e8c61a88ce23b389c5d1e4255e21e59d9 (patch) | |
tree | fee921f947ec465a58a91b65fa53dc21ad8fbecd /crawl-ref/source/mstuff2.cc | |
parent | dcf9fc82a633b9541eae069e209088bcaa557cc8 (diff) | |
download | crawl-ref-8cffb32e8c61a88ce23b389c5d1e4255e21e59d9.tar.gz crawl-ref-8cffb32e8c61a88ce23b389c5d1e4255e21e59d9.zip |
Only place a newly created monster (summons) on a sanctuary square if it
is friendly.
Only allow friendly and neutral-good monsters to blink or teleport onto
a sanctuary square.
Don't allow corpses on sanctuary squares to be rotted or animated.
Restrict monster cantrip messages to self-buff types if the player is
in sanctuary.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6211 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mstuff2.cc')
-rw-r--r-- | crawl-ref/source/mstuff2.cc | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index 841a3ca89c..7e57b643e3 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -786,6 +786,8 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast) case SPELL_CANTRIP: { const bool friendly = mons_friendly(monster); + const bool buff_only = !friendly && is_sanctuary(you.x_pos, + you.y_pos); bool need_friendly_stub = false; const msg_channel_type channel = (friendly) ? MSGCH_FRIEND_ENCHANT : MSGCH_MONSTER_ENCHANT; @@ -795,35 +797,35 @@ void mons_cast(monsters *monster, bolt &pbolt, spell_type spell_cast) // spells (ie orc priest) can be toned down a bit. -- bwr // // XXX: Needs expansion, and perhaps different priest/mage flavours. - switch (random2(7)) + switch (random2(buff_only ? 4 : 7)) { case 0: simple_monster_message(monster, " glows brightly for a moment.", channel); break; case 1: - if (friendly) - need_friendly_stub = true; - else - mpr("You feel troubled."); + simple_monster_message(monster, " looks stronger.", + channel); break; case 2: - if (friendly) - need_friendly_stub = true; - else - mpr("You feel a wave of unholy energy pass over you."); + simple_monster_message(monster, " becomes somewhat translucent.", + channel); break; case 3: - simple_monster_message(monster, " looks stronger.", + simple_monster_message(monster, "'s eyes start to glow.", channel); break; case 4: - simple_monster_message(monster, " becomes somewhat translucent.", - channel); + if (friendly) + need_friendly_stub = true; + else + mpr("You feel troubled."); break; case 5: - simple_monster_message(monster, "'s eyes start to glow.", - channel); + if (friendly) + need_friendly_stub = true; + else + mpr("You feel a wave of unholy energy pass over you."); break; case 6: default: @@ -1012,6 +1014,12 @@ void monster_teleport(monsters *monster, bool instan, bool silent) continue; } + if (is_sanctuary(newx, newy) && !mons_friendly(monster) + && !mons_good_neutral(monster)) + { + continue; + } + if (monster_habitable_grid(monster, grd[newx][newy])) break; } |