From 4d5a197bc8c4d782e374364286ce91fd2e118758 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Tue, 27 May 2008 10:01:26 +0000 Subject: Yet another session of comment/whitespace cleanups. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5291 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 887ffe8987..fc3cd93f58 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -101,16 +101,16 @@ void get_mimic_item( const monsters *mimic, item_def &item ) ASSERT( mimic != NULL && mons_is_mimic( mimic->type ) ); item.base_type = OBJ_UNASSIGNED; - item.sub_type = 0; - item.special = 0; - item.colour = 0; - item.flags = 0; - item.quantity = 1; - item.plus = 0; - item.plus2 = 0; - item.x = mimic->x; - item.y = mimic->y; - item.link = NON_ITEM; + item.sub_type = 0; + item.special = 0; + item.colour = 0; + item.flags = 0; + item.quantity = 1; + item.plus = 0; + item.plus2 = 0; + item.x = mimic->x; + item.y = mimic->y; + item.link = NON_ITEM; int prop = 127 * mimic->x + 269 * mimic->y; @@ -268,14 +268,15 @@ bool curse_an_item( bool decay_potions, bool quiet ) } static void _monster_drop_ething(monsters *monster, - bool mark_item_origins = false) + bool mark_item_origins = false, + int owner_id = NON_ITEM) { const bool hostile_grid = grid_destroys_items(grd(monster->pos())); const int midx = (int) monster_index(monster); bool destroyed = false; - // drop weapons & missiles last (ie on top) so others pick up + // Drop weapons & missiles last (ie on top) so others pick up. for (int i = NUM_MONSTER_SLOTS - 1; i >= 0; i--) { int item = monster->inv[i]; @@ -3946,8 +3947,8 @@ static bool _handle_wand(monsters *monster, bolt &beem) else set_ident_type(OBJ_WANDS, wand_type, ID_MON_TRIED_TYPE); - // increment zap count - if ( wand.plus2 >= 0 ) + // Increment zap count. + if (wand.plus2 >= 0) wand.plus2++; } @@ -4522,6 +4523,7 @@ int mons_thrown_weapon_damage(const item_def *weap) { if (!weap || get_weapon_brand(*weap) != SPWPN_RETURNING) return (0); + return std::max(0, (property(*weap, PWPN_DAMAGE) + weap->plus2 / 2)); } -- cgit v1.2.3-54-g00ecf