summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-27 10:01:26 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-27 10:01:26 +0000
commit4d5a197bc8c4d782e374364286ce91fd2e118758 (patch)
tree12901f8b4121ecebc13c2c75cc18aeeaa8627ba4 /crawl-ref/source/monstuff.cc
parent05d3781c9f84d761b4f0aa7c3241aea9523710f8 (diff)
downloadcrawl-ref-4d5a197bc8c4d782e374364286ce91fd2e118758.tar.gz
crawl-ref-4d5a197bc8c4d782e374364286ce91fd2e118758.zip
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
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc30
1 files changed, 16 insertions, 14 deletions
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));
}