diff options
author | Shmuale Mark <shm.mark@gmail.com> | 2014-06-10 13:10:43 -0400 |
---|---|---|
committer | Shmuale Mark <shm.mark@gmail.com> | 2014-06-10 16:56:46 -0400 |
commit | 92cf7ad39a9b562528c658f8457966d2616c8a1d (patch) | |
tree | d3ef724dba3a5a6786f800b647441b4585a27e04 /crawl-ref/source/mon-gear.cc | |
parent | dd24ea8036ebe4356d444bd7787329e57651151f (diff) | |
download | crawl-ref-92cf7ad39a9b562528c658f8457966d2616c8a1d.tar.gz crawl-ref-92cf7ad39a9b562528c658f8457966d2616c8a1d.zip |
Give mercs better items.
They automatically get their items set as MAKE_GOOD_ITEM, which
might not be enough to make up for the mediocre weapon types they
tend to start with, but it's the simplest solution for now. They're
also marked as MF_HARD_RESET so that you can't not pay and then take
their stuff.
Also, fix compilation: I'll fix this (so that git bisect works) while
merging into master.
Diffstat (limited to 'crawl-ref/source/mon-gear.cc')
-rw-r--r-- | crawl-ref/source/mon-gear.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/crawl-ref/source/mon-gear.cc b/crawl-ref/source/mon-gear.cc index bbd4309161..d39efb3598 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} @@ -1986,7 +1987,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; @@ -2462,6 +2463,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; @@ -2510,7 +2514,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 @@ -2520,8 +2524,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); } |