examine screen. Tightened up lines a bit.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2981 c06c8d41-db1a-0410-9941-cceddc491573
LBTLHHRZTKOBOGAEWQH7VFEDG4WY5IDUEIZARAUFR6SBVWTTMYJQC
K2GMFKXUWN5R3KCW6OYVXHN47MIQZKEEIOSAU6LFFKBNKF6JBVWAC
OQXMUX5JEITCP2QXJKKOQRLRVTD3LTSDWGI6HTK5GVDIAJ7VKO6AC
EGV2HM7SD7UQSWJGLR65NQJTUBAJ7WHLM67FMH4UFP7JRSFKREPAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
RR2J4VLJCZSAKY3HNS334KI4YUAPOMSETO2HGCGEEIUCUJAYAGSQC
SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC
JPYDWBRN75GC6UZ26MXJTCXGORTJOWGRDEU4JFPU52LYHGK6UI2QC
2IJDLTWK74ULETLFTIPUIY2MSG6RNONVAFNFE7MADPT6UNYSSBDAC
5BJPWUPLJFS34FUTFJVKA4A52YMIGV6EWDXLNSDCWBJWBGVSQFGQC
const std::vector<card_type> drawn_cards = get_drawn_cards(item);
if ( !drawn_cards.empty() )
{
description += "Drawn card(s): ";
for ( unsigned int i = 0; i < drawn_cards.size(); ++i )
{
if ( i != 0 )
description += ", ";
description += card_name(drawn_cards[i]);
}
description += "$";
}
// card), deck.props["card_flags"] holds the flags for each card,
// deck.props["num_marked"] is the number of marked cards left in the
// deck, and deck.props["non_brownie_draws"] is the number of
// non-marked draws you have to make from that deck before earning
// brownie points from it again.
// card), deck.props["drawn_cards"] holds the list of drawn cards
// (with index 0 being the first drawn), deck.props["card_flags"]
// holds the flags for each card, deck.props["num_marked"] is the
// number of marked cards left in the deck, and
// deck.props["non_brownie_draws"] is the number of non-marked draws
// you have to make from that deck before earning brownie points from
// it again.
const std::vector<card_type> get_drawn_cards(const item_def& deck)
{
std::vector<card_type> result;
if ( is_deck(deck) )
{
const CrawlHashTable &props = deck.props;
const CrawlVector &drawn = props["drawn_cards"].get_vector();
for ( unsigned int i = 0; i < drawn.size(); ++i )
{
const char tmp = drawn[i];
result.push_back(static_cast<card_type>(tmp));
}
}
return result;
}