summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-gear.cc
diff options
context:
space:
mode:
authorShmuale Mark <shm.mark@gmail.com>2014-06-11 09:54:49 -0400
committerShmuale Mark <shm.mark@gmail.com>2014-06-11 09:54:49 -0400
commit2cf48292452445b275df5d685341c721aadafa5e (patch)
tree1c4fce0323717e30e26e89d2eeeb17e9f5c35eb7 /crawl-ref/source/mon-gear.cc
parent3208b8c6f14b47ebc069ae040432dc5f15435bfb (diff)
parente9415a749937a864f07066d4fd07b66b538b3f5c (diff)
downloadcrawl-ref-2cf48292452445b275df5d685341c721aadafa5e.tar.gz
crawl-ref-2cf48292452445b275df5d685341c721aadafa5e.zip
Merge branch 'mon-pickup'
The problem with monster pickup of the type that this branch removes is that it encourages tedious behaviour to achieve the optimum result. While in general people don't bother to pick up every weapon and armour and stuff it upstairs, that would be a way to prevent monsters from ever picking up items you've seen. With Apportation, you don't even have to reach the item, and on a mummy, say, you don't even have to worry about the infintesimal food cost. People do already do this for chaos and distortion weapons, and it is not a very good thing. Not allowing allies to pick up items is related, in that it means that the code can be simpler, but it also has problems of micromanagement, weirdnesses with the ctrl-T command, and allies already have their share of problems. I hope that the compensations for Beogh and mercenaries make up for what is lost in terms of fun. Conflicts: crawl-ref/source/tag-version.h
Diffstat (limited to 'crawl-ref/source/mon-gear.cc')
-rw-r--r--crawl-ref/source/mon-gear.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc
index 6529a4b3fe..c80a25211e 100644
--- a/crawl-ref/source/mon-gear.cc
+++ b/crawl-ref/source/mon-gear.cc
@@ -228,7 +228,8 @@ static item_def* make_item_for_monster(
iflags_t flags);
static void _give_weapon(monster* mon, int level, bool melee_only = false,
- bool give_aux_melee = true, bool spectral_orcs = false)
+ bool give_aux_melee = true, bool spectral_orcs = false,
+ bool merc = false)
{
bool force_item = false;
bool force_uncursed = false;
@@ -238,7 +239,7 @@ static void _give_weapon(monster* mon, int level, bool melee_only = false,
item.base_type = OBJ_UNASSIGNED;
- if (mon->type == MONS_DANCING_WEAPON)
+ if (mon->type == MONS_DANCING_WEAPON || merc)
level = MAKE_GOOD_ITEM;
// moved setting of quantity here to keep it in mind {dlb}
@@ -1997,7 +1998,7 @@ static void _give_shield(monster* mon, int level)
}
}
-static void _give_armour(monster* mon, int level, bool spectral_orcs)
+static void _give_armour(monster* mon, int level, bool spectral_orcs, bool merc)
{
item_def item;
@@ -2473,6 +2474,9 @@ static void _give_armour(monster* mon, int level, bool spectral_orcs)
return;
}
+ if (merc)
+ level = MAKE_GOOD_ITEM;
+
// Only happens if something in above switch doesn't set it. {dlb}
if (item.base_type == OBJ_UNASSIGNED)
return;
@@ -2521,7 +2525,7 @@ void give_weapon(monster *mons, int level_number, bool mons_summoned, bool spect
_give_weapon(mons, level_number, false, true, spectral_orcs);
}
-void give_item(monster *mons, int level_number, bool mons_summoned, bool spectral_orcs)
+void give_item(monster *mons, int level_number, bool mons_summoned, bool spectral_orcs, bool merc)
{
ASSERT(level_number > -1); // debugging absdepth0 changes
@@ -2531,8 +2535,8 @@ void give_item(monster *mons, int level_number, bool mons_summoned, bool spectra
_give_scroll(mons, level_number);
_give_wand(mons, level_number);
_give_potion(mons, level_number);
- _give_weapon(mons, level_number, false, true, spectral_orcs);
+ _give_weapon(mons, level_number, false, true, spectral_orcs, merc);
_give_ammo(mons, level_number, mons_summoned);
- _give_armour(mons, 1 + level_number / 2, spectral_orcs);
+ _give_armour(mons, 1 + level_number / 2, spectral_orcs, merc);
_give_shield(mons, 1 + level_number / 2);
}