diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-02 17:36:45 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-05-02 17:36:45 +0000 |
commit | b398da9e134edff4ae3f31ced785d53bdd8a0e19 (patch) | |
tree | eec7918a11e5378e3acfab86c827d0effcc9ad2c /crawl-ref/source/decks.cc | |
parent | aed0d786749b975380cb9c99b09d778c8aec7171 (diff) | |
download | crawl-ref-b398da9e134edff4ae3f31ced785d53bdd8a0e19.tar.gz crawl-ref-b398da9e134edff4ae3f31ced785d53bdd8a0e19.zip |
Let the Helix card remove a random bad mutation, instead of hardcoding a
list of bad mutations.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4813 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/decks.cc')
-rw-r--r-- | crawl-ref/source/decks.cc | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc index b08a51ca75..ed216b6b0e 100644 --- a/crawl-ref/source/decks.cc +++ b/crawl-ref/source/decks.cc @@ -1998,35 +1998,9 @@ static void _experience_card(int power, deck_rarity_type rarity) level_change(); } -const mutation_type bad_mutations[] = { - MUT_FAST_METABOLISM, MUT_WEAK, MUT_DOPEY, MUT_CLUMSY, - MUT_TELEPORT, MUT_DEFORMED, MUT_SCREAM, MUT_DETERIORATION, - MUT_BLURRY_VISION, MUT_FRAIL -}; - -static bool _has_bad_mutation() -{ - for ( unsigned int i = 0; i < ARRAYSZ(bad_mutations); ++i ) - if (you.mutation[bad_mutations[i]] > you.demon_pow[bad_mutations[i]]) - return true; - - return false; -} - static void _remove_bad_mutation() { - mutation_type which_mut = NUM_MUTATIONS; - int numfound = 0; - for ( unsigned int i = 0; i < ARRAYSZ(bad_mutations); ++i ) - if (you.mutation[bad_mutations[i]] > you.demon_pow[bad_mutations[i]]) - { - if ( one_chance_in(++numfound) ) - which_mut = bad_mutations[i]; - } - - if ( numfound ) - delete_mutation(which_mut); - else + if (!delete_mutation(RANDOM_BAD_MUTATION, false)) mpr("You feel transcendent for a moment."); } @@ -2087,7 +2061,7 @@ static void _helix_card(int power, deck_rarity_type rarity) } else { - switch ( _has_bad_mutation() ? random2(3) : random2(2) + 1 ) + switch ( random2(3) ) { case 0: _remove_bad_mutation(); |