can_safely_mutate() to a check whether or not the player can mutate without decomposing. Since both Zin and Xom force their mutations, and doing so ignores the "mutation resistance" mutations, checking for the latter is redundant.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4648 c06c8d41-db1a-0410-9941-cceddc491573
UEEDQIFBOUZOXHCWGSEBED4Z3SYGN3DVHOVRJYQVWQQ6BIDLWAQAC
RNBFKGMD32MPNMPVMJ4O7D2ODKBDA2S7EO5P7R3IDI43Y4FNILQAC
2P3K34UUGGHI6WY26KGK6FHDDYPD7LP52FOVG2KYA3EGOJT2MVHAC
U52YN2JQUGBRV434NNAKL3YXFLG3JDYBW3VV3HOIEJGGBFZRT6WQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
JCWJWGMQIKQGSSFJUQRKNIWW3HBOJSHYDTOPPE5BWOJTIJTDYUTAC
UWEN2EZXAWVDX4BTX6RHJEPTC6ZC7SRG4LAP27LLFILDPQ4BRBGAC
HQSI2RK5QGNSOR5Y67GZDK4ZWFZ5DSRPASXAV4VHYVB5TUXFZWJQC
3ZWALZFSTSIVYXY4BAY6ANGINTDACZC6RSSJTEMQSTSUIE66YOBQC
EWFP6RFDHTEGD6SX36LYRLQB3APIKGAHNBKWPD56RGYBUE4FWJUQC
CMNLYUECIMEZSOYG4KOSINOPER5OM7PPCGIHCM7LQVWEO77XFUYQC
KFULGQQOHWUTXOM3BXCCYPGGVGGY4Z6265XUFRCBPNLTZAEHJZSQC
4BSWRAIA7TLRFRZ4RMLOVDHWDWBGJCAQZUOPXPJYW6OJY6B3HPLQC
VTOAGJSPELAK6F253GZOWSHPIVECXSDQQQ2APUTFQXZFG5V6H4LQC
ZCRK2DJ5VKECRQXZTWT4NUDL2VT5ZHUK7NT6NQPLRJ56TDX5PJSAC
LS5XCCGKQHSJQGWLWLGTP2F5OYWK4ND5AQQAGRN6H2HVBSXNCCZAC
HIRKGUMNJPWKSVTR6TVBPD3MWNA63CEHCLCIPWEMGDFHVB3NPLDQC
// Is there any sense in trying to mutate?
//
// Avoid the following cases:
// * undead players who can decompose (potentially lethal)
// * players with the full mutation resistance mutation (useless)
//
// Don't avoid the following cases:
// * players with amulets of resist mutation (sometimes fails)
// * players who resist mutation due to high Zin piety (same reason)
// Can the player mutate without decomposing?
bool mutate(mutation_type which_mutation, bool failMsg, bool force_mutation,
bool demonspawn)
bool mutate(mutation_type which_mutation, bool failMsg,
bool force_mutation, bool demonspawn)
mpr("You feel rather odd for a moment.", MSGCH_MUTATION);
return false;
if (player_mutation_level(MUT_MUTATION_RESISTANCE) > 1
&& (player_mutation_level(MUT_MUTATION_RESISTANCE) == 3
|| coinflip()))
{
mpr("You feel rather odd for a moment.", MSGCH_MUTATION);
return false;
}
const int temp_rand = random2(12);
which_bad_one = ((temp_rand >= 11) ? MUT_CARNIVOROUS :
(temp_rand == 10) ? MUT_HERBIVOROUS :
(temp_rand == 9) ? MUT_FAST_METABOLISM :
(temp_rand == 8) ? MUT_WEAK :
(temp_rand == 7) ? MUT_DOPEY :
(temp_rand == 6) ? MUT_CLUMSY :
(temp_rand == 5) ? MUT_TELEPORT :
(temp_rand == 4) ? MUT_DEFORMED :
(temp_rand == 3) ? MUT_SCREAM :
(temp_rand == 2) ? MUT_DETERIORATION :
(temp_rand == 1) ? MUT_BLURRY_VISION
: MUT_FRAIL);
switch (random2(12))
{
case 0: mutat = MUT_CARNIVOROUS; break;
case 1: mutat = MUT_HERBIVOROUS; break;
case 2: mutat = MUT_FAST; break;
case 3: mutat = MUT_WEAK; break;
case 4: mutat = MUT_DOPEY; break;
case 5: mutat = MUT_CLUMSY; break;
case 6: mutat = MUT_TELEPORT; break;
case 7: mutat = MUT_DEFORMED; break;
case 8: mutat = MUT_SCREAM; break;
case 9: mutat = MUT_DETERIORATION; break;
case 10: mutat = MUT_BLURRY_VISION; break;
case 11: mutat = MUT_FRAIL; break;
}