summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mutation.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-04 01:10:28 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-04 01:10:28 +0000
commite2a897ff86075780500e148cfe9689d9d347cf0e (patch)
treee76b809f72d17e664876437de70e7d486d00d540 /crawl-ref/source/mutation.cc
parent1f78bee0174371f6551ebd64c30ddebc53c97700 (diff)
downloadcrawl-ref-e2a897ff86075780500e148cfe9689d9d347cf0e.tar.gz
crawl-ref-e2a897ff86075780500e148cfe9689d9d347cf0e.zip
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
Diffstat (limited to 'crawl-ref/source/mutation.cc')
-rw-r--r--crawl-ref/source/mutation.cc30
1 files changed, 23 insertions, 7 deletions
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 += "</lightblue><cyan>";
result += naga_speed_descrip[you.mutation[MUT_FAST]];
- if ( you.mutation[MUT_FAST] )
+ if (you.mutation[MUT_FAST])
result += "</cyan>";
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.