diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 23:26:27 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 23:26:27 +0000 |
commit | b20f4404a1ad6aad17756415905b6e5e9dfe54e4 (patch) | |
tree | f81b2ae51bb81c31bba76e54ca269d7766bd5381 /crawl-ref/source/spells3.cc | |
parent | c2d07b732f3c9749d24bda7c83a586c430757d1f (diff) | |
download | crawl-ref-b20f4404a1ad6aad17756415905b6e5e9dfe54e4.tar.gz crawl-ref-b20f4404a1ad6aad17756415905b6e5e9dfe54e4.zip |
Give falvour message when invoking sanctuary removes bloodstains.
Reveal hidden traps inside sanctuary when it's first invoked if the
traps are in LOS.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6358 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r-- | crawl-ref/source/spells3.cc | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 82743e0965..73d236e9dc 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -1677,6 +1677,8 @@ bool cast_sanctuary(const int power) // and would then have to be stored globally. const int radius = 5; const int pattern = random2(4); + int blood_count = 0; + int trap_count = 0; int scare_count = 0; int cloud_count = 0; monsters *seen_mon = NULL; @@ -1692,6 +1694,22 @@ bool cast_sanctuary(const int power) continue; coord_def pos(posx, posy); + if (env.map(pos).property == FPROP_BLOODY + && see_grid(pos)) + { + blood_count++; + } + + if (trap_type_at_xy(posx, posy) != NUM_TRAPS + && grd(pos) == DNGN_UNDISCOVERED_TRAP + && see_grid(pos)) + { + const dungeon_feature_type type = + trap_category( trap_type_at_xy(posx, posy) ); + grd(pos) = type; + set_envmap_obj(posx, posy, type); + trap_count++; + } // forming patterns if (pattern == 0 // outward rays @@ -1761,22 +1779,30 @@ bool cast_sanctuary(const int power) } } // radius loop - if (scare_count == 1 && seen_mon != NULL) - simple_monster_message(seen_mon, " turns to flee the light!"); - else if (scare_count > 0) - mpr("The monsters scatter in all directions!"); + if (trap_count > 0) + mpr("The flash of divine light reveals hidden traps!", + MSGCH_GOD); if (cloud_count == 1) { - mpr("By Zin's power, the foul cloud within the sanctuary is " + mpr("By Zin's power the foul cloud within the sanctuary is " "swept away.", MSGCH_GOD); } else if (cloud_count > 1) { - mpr("By Zin's power, all foul fumes within the sanctuary are " + mpr("By Zin's power all foul fumes within the sanctuary are " "swept away.", MSGCH_GOD); } + if (blood_count > 0) + mpr("By Zin's power all blood is cleared from the sanctuary.", + MSGCH_GOD); + + if (scare_count == 1 && seen_mon != NULL) + simple_monster_message(seen_mon, " turns to flee the light!"); + else if (scare_count > 0) + mpr("The monsters scatter in all directions!"); + // Pets stop attacking and converge on you. you.pet_target = MHITYOU; |