From e2a897ff86075780500e148cfe9689d9d347cf0e Mon Sep 17 00:00:00 2001 From: dolorous Date: Fri, 4 Jul 2008 01:10:28 +0000 Subject: In mutation_name(), display the species-specific special cases properly (e.g. trolls' having claws sharper than steel for hands). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6380 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/mutation.cc | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/mutation.cc') diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc index c134478145..3688ed7605 100644 --- a/crawl-ref/source/mutation.cc +++ b/crawl-ref/source/mutation.cc @@ -1090,7 +1090,7 @@ formatted_string describe_mutations() if (you.mutation[MUT_FAST]) result += ""; result += naga_speed_descrip[you.mutation[MUT_FAST]]; - if ( you.mutation[MUT_FAST] ) + if (you.mutation[MUT_FAST]) result += ""; result += EOL; have_any = true; @@ -2372,7 +2372,7 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg, case MUT_CLAWS: mpr((you.species == SP_TROLL ? troll_claw_lose - : lose_mutation[mutat])[you.mutation[mutat] - 1], + : lose_mutation[mutat])[you.mutation[mutat] - 1], MSGCH_MUTATION); break; @@ -2476,21 +2476,37 @@ const char *mutation_name(mutation_type which_mutat, int level) if (!_mutation_is_fully_inactive(which_mutat)) level = player_mutation_level(which_mutat); else // give description of fully active mutation - level = you.mutation[ which_mutat ]; + level = you.mutation[which_mutat]; } if (which_mutat == MUT_STRONG || which_mutat == MUT_CLEVER || which_mutat == MUT_AGILE || which_mutat == MUT_WEAK || which_mutat == MUT_DOPEY || which_mutat == MUT_CLUMSY) { - snprintf( mut_string, sizeof( mut_string ), "%s%d).", - mutation_descrip[ which_mutat ][0], level ); + snprintf(mut_string, sizeof(mut_string), "%s%d).", + mutation_descrip[which_mutat][0], level); return (mut_string); } - return (mutation_descrip[ which_mutat ][ level - 1 ]); -} // end mutation_name() + if (which_mutat == MUT_CLAWS + && (you.species == SP_TROLL || you.species == SP_GHOUL)) + { + return (troll_claw_descrip[level]); + } + + if (which_mutat == MUT_FAST && you.species == SP_NAGA) + return (naga_speed_descrip[level]); + + if (which_mutat == MUT_DEFORMED + && (you.species == SP_NAGA || you.species == SP_CENTAUR)) + { + return ((you.species == SP_NAGA ? naga_deformed_descrip + : centaur_deformed_descrip)[level - 1]); + } + + return (mutation_descrip[which_mutat][level - 1]); +} // Use an attribute counter for how many demonic mutations a demonspawn // has. -- cgit v1.2.3-54-g00ecf