summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-06 12:00:07 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-06 12:00:07 +0000
commitadd136cf7b50672fe74ad7040d7a2dc02e8b70b7 (patch)
treea24989bc93921194f8f5d69f195f76be5304cc89 /crawl-ref/source/spells3.cc
parentc367e4974ffca4793040a909f862c0dd0b080ee0 (diff)
downloadcrawl-ref-add136cf7b50672fe74ad7040d7a2dc02e8b70b7.tar.gz
crawl-ref-add136cf7b50672fe74ad7040d7a2dc02e8b70b7.zip
[2094619] Animate dead cast when player is butchering could produce spurious messages about the butchered corpse being animated.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6880 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc37
1 files changed, 14 insertions, 23 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 18bf5742e4..361296a177 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -943,10 +943,7 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting,
env_show_grid &los(caster == &you? env.no_trans_show : losgrid);
- bool was_butchering = false;
-
coord_def a;
-
for (a.x = minx; a.x != maxx; a.x += xinc)
{
for (a.y = miny; a.y != maxy; a.y += yinc)
@@ -958,9 +955,7 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting,
// one of a stack will be raised.
for (stack_iterator si(a); si; ++si)
{
- if (is_being_butchered(*si, false))
- was_butchering = true;
-
+ const bool was_butchering = is_being_butchered(*si, false);
if (animate_a_corpse(a, CORPSE_BODY, beha, hitting, god,
actual, true))
{
@@ -969,20 +964,16 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting,
if (see_grid(env.show, you.pos(), a))
number_seen++;
+ if (was_butchering)
+ mpr("The corpse you are butchering rises to attack!");
+
break;
}
}
}
}
-
- if (actual)
- {
- if (was_butchering)
- mpr("The corpse you are butchering rises to attack!");
-
- if (number_seen > 0)
- mpr("The dead are walking!");
- }
+ if (actual && number_seen > 0)
+ mpr("The dead are walking!");
return (number_raised);
}
@@ -1438,11 +1429,11 @@ bool entomb(int powc)
// checkpoint two - is the orb resting in the tile? {dlb}:
if (!proceed)
continue;
-
+
// Destroy all items on the square.
for ( stack_iterator si(*ai); si; ++si )
destroy_item(si->index());
-
+
// deal with clouds {dlb}:
if (env.cgrid(*ai) != EMPTY_CLOUD)
delete_cloud( env.cgrid(*ai) );
@@ -1634,7 +1625,7 @@ bool cast_sanctuary(const int power)
for ( radius_iterator ri(you.pos(), radius, false, false); ri; ++ri )
{
int dist = _inside_circle(*ri, radius);
-
+
if (dist == -1)
continue;
@@ -1651,7 +1642,7 @@ bool cast_sanctuary(const int power)
set_envmap_obj(pos, type);
trap_count++;
}
-
+
// forming patterns
const int x = pos.x - you.pos().x, y = pos.y - you.pos().y;
if (pattern == 0 // outward rays
@@ -1669,7 +1660,7 @@ bool cast_sanctuary(const int power)
}
else
env.map(pos).property = FPROP_SANCTUARY_2; // white
-
+
// scare all attacking monsters inside sanctuary, and make
// all friendly monsters inside sanctuary stop attacking and
// move towards the player.
@@ -1677,7 +1668,7 @@ bool cast_sanctuary(const int power)
if (monster != NON_MONSTER)
{
monsters* mon = &menv[monster];
-
+
if (mons_friendly(mon))
{
mon->foe = MHITYOU;
@@ -1699,7 +1690,7 @@ bool cast_sanctuary(const int power)
else if (mon->add_ench(mon_enchant(ENCH_FEAR, 0, KC_YOU)))
{
behaviour_event(mon, ME_SCARE, MHITYOU);
-
+
// Check to see that monster is actually fleeing,
// since plants can't flee.
if (mons_is_fleeing(mon) && you.can_see(mon))
@@ -1710,7 +1701,7 @@ bool cast_sanctuary(const int power)
}
}
} // if (monster != NON_MONSTER)
-
+
if (!is_harmless_cloud(cloud_type_at(pos)))
{
delete_cloud(env.cgrid(pos));