summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mutation.cc
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-06-03 01:28:39 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-06-03 01:55:17 -0400
commit51bfb8de72b7fe848c31fa6ce10e2c94b959eb64 (patch)
tree0489dd7dd6fee1707b7188e776f79ba8f81b6a6e /crawl-ref/source/mutation.cc
parent4e31f848abaaeb808b4209e9437f320d755b01c0 (diff)
downloadcrawl-ref-51bfb8de72b7fe848c31fa6ce10e2c94b959eb64.tar.gz
crawl-ref-51bfb8de72b7fe848c31fa6ce10e2c94b959eb64.zip
Replace some you.mutaiton[] calls with player_mutation_level()
It's still inconsistant, but at least some more non setting uses are now using player_mutation_level().
Diffstat (limited to 'crawl-ref/source/mutation.cc')
-rw-r--r--crawl-ref/source/mutation.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index 63106f08fc..3ccf46f7d2 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1004,7 +1004,7 @@ static bool _accept_mutation(mutation_type mutat, bool ignore_rarity = false)
const mutation_def& mdef = get_mutation_def(mutat);
- if (you.mutation[mutat] >= mdef.levels)
+ if (player_mutation_level(mutat) >= mdef.levels)
return false;
if (ignore_rarity)
@@ -1587,7 +1587,7 @@ bool mutate(mutation_type which_mutation, const string &reason, bool failMsg,
const mutation_def& mdef = get_mutation_def(mutat);
- if (you.mutation[mutat] >= mdef.levels)
+ if (player_mutation_level(mutat) >= mdef.levels)
{
bool found = false;
if (you.species == SP_DEMONSPAWN)
@@ -1696,13 +1696,13 @@ bool mutate(mutation_type which_mutation, const string &reason, bool failMsg,
case MUT_HOOVES:
case MUT_TALONS:
// Hooves and talons force boots off at 3.
- if (you.mutation[mutat] >= 3 && !you.melded[EQ_BOOTS])
+ if (player_mutation_level(mutat) >= 3 && !you.melded[EQ_BOOTS])
remove_one_equip(EQ_BOOTS, false, true);
break;
case MUT_CLAWS:
// Claws force gloves off at 3.
- if (you.mutation[mutat] >= 3 && !you.melded[EQ_GLOVES])
+ if (player_mutation_level(mutat) >= 3 && !you.melded[EQ_GLOVES])
remove_one_equip(EQ_GLOVES, false, true);
break;
@@ -1711,7 +1711,7 @@ bool mutate(mutation_type which_mutation, const string &reason, bool failMsg,
// Horns & Antennae 3 removes all headgear. Same algorithm as with
// glove removal.
- if (you.mutation[mutat] >= 3 && !you.melded[EQ_HELMET])
+ if (player_mutation_level(mutat) >= 3 && !you.melded[EQ_HELMET])
remove_one_equip(EQ_HELMET, false, true);
// Intentional fall-through
case MUT_BEAK:
@@ -1781,7 +1781,7 @@ static bool _delete_single_mutation_level(mutation_type mutat,
const string &reason,
bool transient = false)
{
- if (you.mutation[mutat] == 0)
+ if (player_mutation_level(mutat) == 0)
return false;
if (you.innate_mutation[mutat] >= you.mutation[mutat])
@@ -1903,7 +1903,7 @@ bool delete_mutation(mutation_type which_mutation, const string &reason,
mutat = static_cast<mutation_type>(random2(NUM_MUTATIONS));
- if (you.mutation[mutat] == 0
+ if (player_mutation_level(mutat) == 0
&& mutat != MUT_STRONG
&& mutat != MUT_CLEVER
&& mutat != MUT_AGILE
@@ -2425,7 +2425,7 @@ bool perma_mutate(mutation_type which_mut, int how_much, const string &reason)
while (how_much-- > 0)
{
dprf("Perma Mutate: %d, %d, %d", cap, you.mutation[which_mut], you.innate_mutation[which_mut]);
- if (you.mutation[which_mut] == cap
+ if (player_mutation_level(which_mut) == cap
&& you.innate_mutation[which_mut] > 0
&& you.innate_mutation[which_mut] == cap-1)
{