From fada7cc9c6c230526a737d34e8f04cf22969b7f7 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 19 Jun 2008 12:59:48 +0000 Subject: Fix 1996837: Allow equipping spellcasters with ammunition on generation. Fix 1997179: Merge zombies correctly in the monster list. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5977 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/makeitem.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/makeitem.cc') diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index df03895983..b885d764f8 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2905,6 +2905,11 @@ static void _give_monster_item(monsters *mon, int thing, { item_def &mthing = mitm[thing]; +#ifdef DEBUG_DIAGNOSTICS + mprf("Giving %s to %s...", mthing.name(DESC_PLAIN).c_str(), + mon->name(DESC_PLAIN).c_str()); +#endif + mthing.x = 0; mthing.y = 0; mthing.link = NON_ITEM; @@ -3674,11 +3679,12 @@ static item_make_species_type _give_weapon(monsters *mon, int level, return (item_race); } +// Hands out ammunition fitting the monster's launcher (if any), or else any +// throwable weapon depending on the monster type. static void _give_ammo(monsters *mon, int level, item_make_species_type item_race) { - // mv: gives ammunition - // note that item_race is not reset for this section + // Note that item_race is not reset for this section. if (const item_def *launcher = mon->launcher()) { const object_class_type xitc = OBJ_MISSILES; @@ -3691,8 +3697,6 @@ static void _give_ammo(monsters *mon, int level, if (thing_created == NON_ITEM) return; - // monsters will always have poisoned needles -- otherwise - // they are just going to behave badly --GDL if (xitt == MI_NEEDLE) { set_item_ego_type(mitm[thing_created], OBJ_MISSILES, @@ -3705,7 +3709,7 @@ static void _give_ammo(monsters *mon, int level, mitm[thing_created].quantity *= 2; _give_monster_item(mon, thing_created); - } // end if needs ammo + } else { // Give some monsters throwing weapons. @@ -4146,7 +4150,7 @@ void give_item(int mid, int level_number) //mv: cleanup+minor changes jewellery_type get_random_amulet_type() { return (jewellery_type) - (AMU_FIRST_AMULET + random2(NUM_JEWELLERY - AMU_FIRST_AMULET)); + (AMU_FIRST_AMULET + random2(NUM_JEWELLERY - AMU_FIRST_AMULET)); } static jewellery_type _get_raw_random_ring_type() -- cgit v1.2.3-54-g00ecf