From 0c908b45dcb7f2e50682b2f7fdf0b4ed573ddf47 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 26 Sep 2008 09:37:25 +0000 Subject: 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 --- crawl-ref/source/item_use.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/item_use.cc') 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 -- cgit v1.2.3-54-g00ecf