From ad552ae6735e657e9e0a885d6d333d33f2b9d129 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 4 Jan 2010 15:27:37 +0100 Subject: Try to avoid repeats when acquiring already seen weapons/armour. Weapons: both type and brand is handled, separately. This means, once you've seen any lajatang, there is no more any bonus to get them -- you'll get 5 times as many quarterstaves, brand repeat protection comes only within the type. Armour: currently only brand is handled, type will have to be merged with the old code which suffered from no information about stash. --- crawl-ref/source/makeitem.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'crawl-ref/source/makeitem.cc') diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index bfa26805b1..2312bc5712 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -3293,6 +3293,27 @@ int items(int allow_uniques, // not just true-false, return (p); } +void reroll_brand(item_def &item, int item_level) +{ + ASSERT(!is_artefact(item)); + switch(item.base_type) + { + case OBJ_WEAPONS: + item.special = _determine_weapon_brand(item, item_level); + break; + case OBJ_MISSILES: + item.special = _determine_missile_brand(item, item_level); + break; + case OBJ_ARMOUR: + // Robe of the Archmagi has an ugly hack of unknown purpose, + // as one of side effects it won't ever generate here. + item.special = _determine_armour_ego(item, OBJ_ARMOUR, item_level); + break; + default: + ASSERT(!"can't reroll brands of this type"); + } +} + static int _roll_rod_enchant(int item_level) { int value = 0; -- cgit v1.2.3-54-g00ecf