summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/item_use.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-26 09:37:25 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2008-09-26 09:37:25 +0000
commit0c908b45dcb7f2e50682b2f7fdf0b4ed573ddf47 (patch)
treef4b1116dfea6c7868ba42b79683539a9ab187e92 /crawl-ref/source/item_use.cc
parentaa4c5c19491455a299993091978e0db6a15dc66a (diff)
downloadcrawl-ref-0c908b45dcb7f2e50682b2f7fdf0b4ed573ddf47.tar.gz
crawl-ref-0c908b45dcb7f2e50682b2f7fdf0b4ed573ddf47.zip
2124815: decrease chance of projectile destruction as a
function of enchantment. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7009 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/item_use.cc')
-rw-r--r--crawl-ref/source/item_use.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index cc2c4e4d96..fc809cbb5c 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -2661,8 +2661,6 @@ bool thrown_object_destroyed( item_def *item, const coord_def& where,
ASSERT( item != NULL );
int chance = 0;
- bool destroyed = false;
- bool hostile_grid = false;
if (item->base_type == OBJ_MISSILES)
{
@@ -2688,8 +2686,11 @@ bool thrown_object_destroyed( item_def *item, const coord_def& where,
}
}
- destroyed = (chance == 0) ? false : one_chance_in(chance);
- hostile_grid = grid_destroys_items(grd(where));
+ // Enchanted projectiles get an extra shot at avoiding
+ // destruction: plus / (1 + plus) chance of survival.
+ bool destroyed = (chance == 0) ? false :
+ (one_chance_in(chance) && one_chance_in(item->plus));
+ bool hostile_grid = grid_destroys_items(grd(where));
// Non-returning items thrown into item-destroying grids are always
// destroyed. Returning items are only destroyed if they would have