git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10291 c06c8d41-db1a-0410-9941-cceddc491573
R6OIKZAWLEAS6COYSOHY37CINPIOTSOVJ5OLJISPUCP64IJAGSGQC
// delete_mutation(RANDOM_BAD_MUTATION) defaults to removing a
// random mutation if the player has no bad mutations, so any newly
// added bad mutations need to be included here.
const mutation_type bad_muts[] = {
MUT_HERBIVOROUS, MUT_CARNIVOROUS, MUT_FRAIL,
MUT_SLOW_HEALING, MUT_FAST_METABOLISM, MUT_WEAK,
MUT_DOPEY, MUT_CLUMSY, MUT_DEFORMED,
MUT_TELEPORT, MUT_SCREAM, MUT_BERSERK,
MUT_BLURRY_VISION, MUT_LOW_MAGIC, MUT_DETERIORATION
};
bool done = false;
for (int tries = 0; !done && tries < 100; ++tries)
{
mutation_type mutat = RANDOM_ELEMENT(bad_muts);
if (you.mutation[mutat] > 0)
done = delete_mutation(mutat, true, false, true);
}
if (!done)
// Ensure that only bad mutations are removed.
if (!delete_mutation(RANDOM_BAD_MUTATION, false, false, true, true))