diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-01 00:09:26 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-01 00:09:26 +0000 |
commit | fa99383f22dc88727a46e209d9d080b460262782 (patch) | |
tree | 8fa21fed4c8d9a0e5ea26dee27b5bc035e32f56b /crawl-ref/source/decks.cc | |
parent | ea0a6471b7ef66c9d8964cc8a5e5d77ae1d72efb (diff) | |
download | crawl-ref-fa99383f22dc88727a46e209d9d080b460262782.tar.gz crawl-ref-fa99383f22dc88727a46e209d9d080b460262782.zip |
The Shuffle card now kills the player if any stats are lowered below
1.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2271 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/decks.cc')
-rw-r--r-- | crawl-ref/source/decks.cc | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index d89d2d21b8..06207d0788 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -1078,7 +1078,41 @@ static void shuffle_card(int power, deck_rarity_type rarity) new_base[perm[i]] = old_base[i] - modifiers[i] + modifiers[perm[i]]; new_max[perm[i]] = old_max[i] - modifiers[i] + modifiers[perm[i]]; } - + + // Did the shuffling kill the player? + kill_method_type kill_types[3] = { + KILLED_BY_WEAKNESS, + KILLED_BY_CLUMSINESS, + KILLED_BY_STUPIDITY + }; + + std::string cause = "drawing a card"; + + if (crawl_state.is_god_acting()) + { + god_type which_god = crawl_state.which_god_acting(); + if (crawl_state.is_god_retribution()) { + cause = "the wrath of "; + cause += god_name(which_god); + } + else + { + if (which_god == GOD_XOM) + cause = "the capriciousness of Xom"; + else + { + cause = "the 'helpfullness' of "; + cause += god_name(which_god); + } + } + } + + for ( int i = 0; i < 3; ++i ) + if (new_base[i] < 1 || new_max[i] < 1) + ouch(INSTANT_DEATH, 0, kill_types[i], cause.c_str(), true); + + // The player survived! + // Sometimes you just long for Python. you.strength = new_base[0]; you.dex = new_base[1]; @@ -1092,6 +1126,8 @@ static void shuffle_card(int power, deck_rarity_type rarity) you.redraw_intelligence = true; you.redraw_dexterity = true; you.redraw_evasion = true; + + burden_change(); } static void helix_card(int power, deck_rarity_type rarity) |