The '%' screen only lists the mutations that are currently active, at the level they are currently active. Conversely, the 'A' screen shows them greyed out and with their full description in brackets if they are completely inactive, or else greyed out with the description for the currently active level, if not fully active.
Might still be buggy, thus needs testing.
Also clean up mutation listing on '%' screen to use comma_separated_line rather than all those manual checks for needed commas.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4274 c06c8d41-db1a-0410-9941-cceddc491573
Q7UVH4DI46F2E2KUPOTHZTAJKMMYM2UJ5KRUC5CJDZGR4AZCR52AC
N6AGSH77SEVF4RU4NZIV3SL7SYQ2BQ25EV5RXCGVTWAFBDCP3MRAC
NVSFIV2ZKP44XHCSCXG6OZVGL67OIFINC34J2EMKTA4KULCERUEAC
3ZWALZFSTSIVYXY4BAY6ANGINTDACZC6RSSJTEMQSTSUIE66YOBQC
K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC
QDTVLBRGHDTRUVT7I3O72K6TMOYAUSAJBZUHGOEFU2RKJNUPWZSQC
NO2HRD7RZS42S55UG4FQ5EFQDY6WYWKGIXHUKYLWF36HHE3VZ7WAC
LIBWXPN6HLJAIGEFJYLOL4HLIUD236U3WM5QPHIZ3DSB4CCUJERAC
JR2RAQ523LOWNDYJNK6AZVKI6WVMI622PIV72XWOVZYPXPUKSQWAC
7NDXS36TE7QVXTXJWMYSVG5UHCCLPIO4VL6NXFGTDK3ZNKE3A2IAC
F3QNVID4E6YMUGVIL34FR426GYY3W7GHW4XJN33LTJBAF6HBY46QC
6HQB2N6N75R2RGKJFWRUN7WAC2PNGWQFXTII5DTRLTHZ2BOTMTVAC
NVD2HSEW2ONWNYDDCTOMZZOUP6NG4DCXI4LNYYIY4BQEBDMJQK5AC
W52PCSHX72WAMWKG6L4BPUBVMO6E72KYYBNKAA7554KNOTY6V7WQC
MLZSEZWNNZMSIDQNAAIOJJR4K7VSVJICL5SAGHD3ROM7SYDVZABAC
ZCRK2DJ5VKECRQXZTWT4NUDL2VT5ZHUK7NT6NQPLRJ56TDX5PJSAC
LPW5S327G7WSDHNED5A2UB72HVH27YYNFZGBYWUW5XSV7U4HPNQAC
FBK5ECMQ6HJSQSN7C3DICKJIRJ3CSO3CHCQ3ONPBKLLSHDGPBQ7QC
7CMQLE4XIFMWDEUZAOKIKDW7BHAJCK5S26APMEZ6TEFEH63TEZ6AC
3UDBQWJX7TIIV3WJWCOIETL7NYQ4GPEU5SUXA247SUZXNEAQQMBQC
P2ZCF3BBG523ZEOD6XQA4X5YEHBTWH3IM33YVHXP2SQ5POXZIH4QC
PGTE3JC4J5U536IJTCJFXTUOSRE73JXZJINWAGCANOQOCGC7J6AAC
RB3ZDZXUZ3KVU5C4MFWTQB4J3PCQ5IQS4UVUBRS3TLSPFKBWNFDAC
BOJPQUU6D4LHA2PGXUZBGTOW54G7ISKFXC4UQHLBSVAI7KQGYW6QC
QS3ZRS3E6KL3YJHPKYEWCWJYRBJSXD5OOYF6Y25HZVECGPJRDB5QC
return (you.mutation[mut]);
if (mutation_is_fully_active(mut))
return (mlevel);
// For now, dynamic mutation only apply to vampires.
ASSERT(you.species == SP_VAMPIRE);
// Assumption: stat mutations are physical, and thus always fully active.
switch (you.hunger_state)
{
case HS_ENGORGED:
return (mlevel);
case HS_VERY_FULL:
case HS_FULL:
return (std::min(mlevel, 2));
case HS_SATIATED:
return (std::min(mlevel, 1));
}
return (0);
// for thirsty (or worse) vampires, only physical mutations are active
return (mutation_defs[mut].physical);
// ... as well as all mutations for vampires at Alive
if (you.hunger_state == HS_ENGORGED)
return (true);
return (false);
}
static bool _mutation_is_fully_inactive(mutation_type mut)
{
return (you.species == SP_VAMPIRE && you.hunger_state < HS_SATIATED
&& !you.demon_pow[mut] && !mutation_defs[mut].physical);
const bool is_greyed_out = !mutation_is_active((mutation_type) i);
if (is_greyed_out)
result += "<darkgrey>(";
const bool need_grey = !mutation_is_fully_active((mutation_type) i);
bool inactive = false;
if (need_grey)
{
result += "<darkgrey>";
if (_mutation_is_fully_inactive((mutation_type) i))
{
inactive = true;
result += "(";
}
}
if (you.species == SP_VAMPIRE && you.hunger_state >= HS_SATIATED)
rotting = false;
if (you.species == SP_VAMPIRE)
{
// The stat gain mutation always come through at Satiated or higher
// (mostly for convenience), and for consistency also their
// negative counterparts.
if (which_mutation == MUT_STRONG || which_mutation == MUT_CLEVER
|| which_mutation == MUT_AGILE || which_mutation == MUT_WEAK
|| which_mutation == MUT_DOPEY || which_mutation == MUT_CLUMSY)
{
if (you.hunger_state >= HS_FULL)
rotting = false;
}
else
{
// Else, chances depend on hunger state.
switch (you.hunger_state)
{
case HS_SATIATED:
rotting = !one_chance_in(3);
break;
case HS_FULL:
rotting = coinflip();
break;
case HS_VERY_FULL:
rotting = one_chance_in(3);
break;
case HS_ENGORGED:
rotting = false;
}
}
}