however many are left.) Cost is 2MP + food + piety. This of course makes Nemelex completely, totally and absolutely broken; it's only the beginning of the Nemelex revamp.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1432 c06c8d41-db1a-0410-9941-cceddc491573
2IJDLTWK74ULETLFTIPUIY2MSG6RNONVAFNFE7MADPT6UNYSSBDAC
WXSNNK2RXP3DQFAEQGQUZJHFWXJC7ZKG2WURZGL566UDM4YXFSWQC
JW2KRJHES33W7UTWZ6NDO4TLMK4EFU4HKZXBWR2UJOMPCCOTR4CQC
WHY6LRRJ5T2NSBE3IUCR4X3TOAH7TTK5NPUPUIFT7TPNJ6J4HBDAC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
LOJYD6QZRNLNDDZJKVBMKQIBPTKSRN2ETCYGNVV47M7L3QLUJUJAC
QKGDOYIYKE6B36ION5O2DRW65DWWPZMYNWJVH7LJJ7FPGGM2MYAQC
RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC
static void cards(card_type which_card);
static const char* card_name(card_type card)
{
switch (card)
{
case CARD_BLANK: return "a blank card";
case CARD_BUTTERFLY: return "Butterfly";
case CARD_WRAITH: return "the Wraith";
case CARD_EXPERIENCE: return "Experience";
case CARD_WEALTH: return "Wealth";
case CARD_INTELLIGENCE: return "the Brain";
case CARD_STRENGTH: return "Strength";
case CARD_QUICKSILVER: return "Quicksilver";
case CARD_STUPIDITY: return "Stupidity";
case CARD_WEAKNESS: return "Weakness";
case CARD_SLOTH: return "the Slug";
case CARD_SHUFFLE: return "Shuffle";
case CARD_FREAK: return "the Freak";
case CARD_DEATH: return "Death";
case CARD_NORMALITY: return "Normality";
case CARD_SHADOW: return "the Shadow";
case CARD_GATE: return "the Gate";
case CARD_STATUE: return "the Crystal Statue";
case CARD_ACQUISITION: return "Acquisition";
case CARD_HASTEN: return "Haste";
case CARD_DEMON_LESSER: return "a little demon";
case CARD_DEMON_COMMON: return "a demon";
case CARD_DEMON_GREATER: return "a huge demon";
case CARD_DEMON_SWARM: return "a swarm of little demons";
case CARD_YAK: return "a huge, shaggy yak";
case CARD_FIEND: return "a huge, scaly devil";
case CARD_DRAGON: return "a huge, scaly dragon";
case CARD_GOLEM: return "a statue";
case CARD_THING_FUGLY: return "a very ugly thing";
case CARD_LICH: return "a very irritated-looking skeletal thing";
case CARD_HORROR_UNSEEN:
return player_see_invis() ? "a hideous abomination" : "a blank card";
case CARD_BLINK: return "Blink";
case CARD_TELEPORT: return "the Portal of Delayed Transposition";
case CARD_TELEPORT_NOW: return "the Portal of Instantaneous Transposition";
case CARD_RAGE: return "Rage";
case CARD_LEVITY: return "Levity";
case CARD_VENOM: return "Venom";
case CARD_XOM: return "the card of Xom";
case CARD_SLOW: return "Slowness";
case CARD_DECAY: return "Decay";
case CARD_HEALING: return "the Elixir of Health";
case CARD_HEAL_WOUNDS: return "the Symbol of Immediate Regeneration";
case CARD_TORMENT: return "the Symbol of Torment";
case CARD_FOUNTAIN: return "the Fountain";
case CARD_ALTAR: return "the Altar";
case CARD_FAMINE: return "Famine";
case CARD_FEAST: return "the Feast";
case CARD_WILD_MAGIC: return "Wild Magic";
case CARD_VIOLENCE: return "Violence";
case CARD_PROTECTION: return "Protection";
case CARD_KNOWLEDGE: return "Knowledge";
case CARD_MAZE: return "the Maze";
case CARD_PANDEMONIUM: return "Pandemonium";
case CARD_IMPRISONMENT: return "the Prison";
case CARD_RULES_FOR_BRIDGE: return "the rules for contract bridge";
case NUM_CARDS: case CARD_RANDOM: return "a buggy card";
}
return "a very buggy card";
}
return chosen;
}
static void cards(card_type which_card);
// returns the deck type, of DECK_OF_PUNISHMENT if none
deck_type subtype_to_decktype(int subtype)
{
switch ( subtype )
{
case MISC_DECK_OF_WONDERS:
return DECK_OF_WONDERS;
case MISC_DECK_OF_POWER:
return DECK_OF_POWER;
case MISC_DECK_OF_SUMMONINGS:
return DECK_OF_SUMMONING;
case MISC_DECK_OF_TRICKS:
return DECK_OF_TRICKS;
default: // sentinel
return DECK_OF_PUNISHMENT;
}
}
bool deck_triple_draw()
{
if (you.equip[EQ_WEAPON] == -1)
{
mpr("You aren't wielding a deck!");
return false;
}
item_def& item(you.inv[you.equip[EQ_WEAPON]]);
if ( item.base_type != OBJ_MISCELLANY ||
subtype_to_decktype(item.sub_type) == DECK_OF_PUNISHMENT )
{
mpr("You aren't wielding a deck!");
return false;
}
const deck_type dtype = subtype_to_decktype(item.sub_type);
if (item.plus == 1)
{
// only one card to draw, so just draw it
deck_of_cards(dtype);
return true;
}
const int num_to_draw = (item.plus < 3 ? item.plus : 3);
std::vector<card_type> draws;
for ( int i = 0; i < num_to_draw; ++i )
draws.push_back(choose_one_card(dtype, false));
mpr("You draw... (choose one card)");
for ( int i = 0; i < num_to_draw; ++i )
msg::streams(MSGCH_PROMPT) << (static_cast<char>(i + 'a')) << " - "
<< card_name(draws[i]) << std::endl;
int selected = -1;
while ( 1 )
{
int keyin = get_ch();
if ( isalpha(keyin) )
keyin = tolower(keyin);
if (keyin >= 'a' && keyin < 'a' + num_to_draw)
{
selected = keyin - 'a';
break;
}
else
canned_msg(MSG_HUH);
}
cards(draws[selected]);
// remove the cards from the deck
item.plus -= num_to_draw;
if (item.plus <= 0)
{
mpr("The deck of cards disappears in a puff of smoke.");
unwield_item(you.equip[EQ_WEAPON]);
dec_inv_item_quantity( you.equip[EQ_WEAPON], 1 );
}
return true;
}
void deck_of_cards(deck_type which_deck)
{
int brownie_points = 0; // for passing to did_god_conduct() {dlb}
mpr("You draw a card...");
const card_type chosen = choose_one_card(which_deck, true);