summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 07:47:50 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-17 07:47:50 +0000
commit0a69a524938f8c559947685b901abdb22043925b (patch)
treeb54afdee8f5b7d1669fdd2453cd5f6fe733bb687 /crawl-ref/source/ouch.cc
parentae735f39601423c88be471340dfe88dc3d3d103d (diff)
downloadcrawl-ref-0a69a524938f8c559947685b901abdb22043925b.tar.gz
crawl-ref-0a69a524938f8c559947685b901abdb22043925b.zip
Apply r6579 to 0.4.1, and revert my local makefile change (oops!)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6581 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index f53fa8d9bb..f309e7fc3a 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -541,7 +541,7 @@ static void _expose_invent_to_element(beam_type flavour, int strength)
}
}
-void expose_items_to_element(beam_type flavour, int x, int y)
+void expose_items_to_element(beam_type flavour, int x, int y, int strength)
{
int num_dest = 0;
@@ -554,16 +554,18 @@ void expose_items_to_element(beam_type flavour, int x, int y)
if (!is_valid_item(*si))
continue;
- if ( si->base_type == target_class
- || (target_class == OBJ_FOOD && si->base_type == OBJ_CORPSES))
+ if (si->base_type == target_class
+ || target_class == OBJ_FOOD && si->base_type == OBJ_CORPSES)
{
- num_dest += si->quantity;
- item_was_destroyed(*si);
- destroy_item(si->index());
+ if (x_chance_in_y(strength, 100))
+ {
+ num_dest++;
+ dec_mitm_item_quantity(si->index(), 1);
+ }
}
}
- if (num_dest > 0)
+ if (num_dest)
{
if (see_grid(x, y))
{
@@ -605,7 +607,7 @@ void expose_items_to_element(beam_type flavour, int x, int y)
//
// This function now calls _expose_invent_to_element() if strength > 0.
//
-// XXX: this function is far from perfect and a work in progress.
+// XXX: This function is far from perfect and a work in progress.
void expose_player_to_element(beam_type flavour, int strength)
{
// Note that BEAM_TELEPORT is sent here when the player