diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-01-04 13:31:34 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-01-04 13:34:04 +0100 |
commit | 351147f56190d73b347c906e6ab30ddf30387a68 (patch) | |
tree | ffbf967d96fdb76ca17e5c8ee728f7400d888105 /crawl-ref/source/itemprop.cc | |
parent | 21e755bcfd70b2683ada62dfdb6cd67695db0f7a (diff) | |
download | crawl-ref-351147f56190d73b347c906e6ab30ddf30387a68.tar.gz crawl-ref-351147f56190d73b347c906e6ab30ddf30387a68.zip |
Track all seen weapon/armour base types and their brands, for acq purposes.
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 20 |
1 files changed, 20 insertions, 0 deletions
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; + } +} |