diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-01-04 15:27:37 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-01-04 15:42:43 +0100 |
commit | ad552ae6735e657e9e0a885d6d333d33f2b9d129 (patch) | |
tree | 726d9ec34bfb360608ebb6a106fc2579582d61e8 /crawl-ref/source/makeitem.cc | |
parent | f1fdc16676179c58bff565682afa989ee93e79b7 (diff) | |
download | crawl-ref-ad552ae6735e657e9e0a885d6d333d33f2b9d129.tar.gz crawl-ref-ad552ae6735e657e9e0a885d6d333d33f2b9d129.zip |
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.
Diffstat (limited to 'crawl-ref/source/makeitem.cc')
-rw-r--r-- | crawl-ref/source/makeitem.cc | 21 |
1 files changed, 21 insertions, 0 deletions
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; |