From 351147f56190d73b347c906e6ab30ddf30387a68 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 4 Jan 2010 13:31:34 +0100 Subject: Track all seen weapon/armour base types and their brands, for acq purposes. --- crawl-ref/source/itemprop.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crawl-ref/source/itemprop.cc') diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index a29eae68ff..7133545758 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -583,6 +583,14 @@ void set_ident_flags( item_def &item, unsigned long flags ) // don't note twice in those cases. item.flags |= (ISFLAG_NOTED_ID | ISFLAG_NOTED_GET); } + + if (item.flags & ISFLAG_KNOW_TYPE && !is_artefact(item)) + { + if (item.base_type == OBJ_WEAPONS) + you.seen_weapon[item.sub_type] |= 1 << item.special; + if (item.base_type == OBJ_ARMOUR) + you.seen_armour[item.sub_type] |= 1 << item.special; + } } void unset_ident_flags( item_def &item, unsigned long flags ) @@ -2494,3 +2502,15 @@ const char* weapon_base_name(unsigned char subtype) { return Weapon_prop[Weapon_index[subtype]].name; } + +void seen_item(const item_def &item) +{ + if (!is_artefact(item)) + { + // Known brands will be set in set_item_flags(). + if (item.base_type == OBJ_WEAPONS) + you.seen_weapon[item.sub_type] |= 1 << SP_UNKNOWN_BRAND; + if (item.base_type == OBJ_ARMOUR) + you.seen_armour[item.sub_type] |= 1 << SP_UNKNOWN_BRAND; + } +} -- cgit v1.2.3-54-g00ecf