diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-01 12:06:58 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-10-01 12:06:58 +0000 |
commit | a7a25900ebaa8cd9e59f843e31f2a170ea4032b4 (patch) | |
tree | b27e424a7799539642599111f5ae185cd51ad462 /crawl-ref | |
parent | d22abf31c5f56320e1ee6c5ff25a75b8bd09b6c0 (diff) | |
download | crawl-ref-a7a25900ebaa8cd9e59f843e31f2a170ea4032b4.tar.gz crawl-ref-a7a25900ebaa8cd9e59f843e31f2a170ea4032b4.zip |
The player now dies if the Focus card causes any stat to go below 1.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2285 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-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 d25fe404e5..848daedd07 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -1218,9 +1218,45 @@ static void focus_card(int power, deck_rarity_type rarity) (*max_statp[worst_stat])--; (*base_statp[best_stat])++; (*base_statp[worst_stat])--; + + // Did focusing kill the player? + kill_method_type kill_types[3] = { + KILLED_BY_WEAKNESS, + KILLED_BY_CLUMSINESS, + KILLED_BY_STUPIDITY + }; + + std::string cause = "the Focus 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 (*max_statp[i] < 1 || *base_statp[i] < 1) + ouch(INSTANT_DEATH, 0, kill_types[i], cause.c_str(), true); + + // The player survived! you.redraw_strength = true; you.redraw_intelligence = true; you.redraw_dexterity = true; + + burden_change(); } static void shuffle_card(int power, deck_rarity_type rarity) @@ -1252,7 +1288,7 @@ static void shuffle_card(int power, deck_rarity_type rarity) KILLED_BY_STUPIDITY }; - std::string cause = "drawing a card"; + std::string cause = "the Shuffle card"; if (crawl_state.is_god_acting()) { |