summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mutation.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-05 10:24:00 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-05 10:24:00 +0000
commit18b6b142985a2bc519b4dcf0a2eefdf6cbfda39a (patch)
treebf267d2ed135326b4d197b3f4f3906ce8d12aad5 /crawl-ref/source/mutation.cc
parent7281afe5a1be67e703d237807834c656f945daaf (diff)
downloadcrawl-ref-18b6b142985a2bc519b4dcf0a2eefdf6cbfda39a.tar.gz
crawl-ref-18b6b142985a2bc519b4dcf0a2eefdf6cbfda39a.zip
Fix non-active hooves/talons not conflicting.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9334 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/mutation.cc')
-rw-r--r--crawl-ref/source/mutation.cc86
1 files changed, 46 insertions, 40 deletions
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index f6aa7ccb1e..d0dc286ae2 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -1966,8 +1966,10 @@ static int _handle_conflicting_mutations(mutation_type mutation,
// other, so we just fail.
const mutation_type fail_conflict[][2] = {
{ MUT_REGENERATION, MUT_SLOW_METABOLISM },
- { MUT_FANGS, MUT_BEAK }
+ { MUT_FANGS, MUT_BEAK },
+ { MUT_HOOVES, MUT_TALONS }
};
+
for (unsigned i = 0; i < ARRAYSZ(fail_conflict); ++i)
{
for (int j = 0; j < 2; ++j)
@@ -2012,6 +2014,47 @@ static int _handle_conflicting_mutations(mutation_type mutation,
return (0);
}
+static bool _physiology_mutation_conflict(mutation_type mutat)
+{
+ // Only Nagas and Draconians can get this one.
+ if (mutat == MUT_STINGER
+ && you.species != SP_NAGA && !player_genus(GENPC_DRACONIAN))
+ {
+ return (true);
+ }
+
+ if ((mutat == MUT_HOOVES || mutat == MUT_TALONS) && !player_has_feet())
+ return (true);
+
+ // Already innate.
+ if (mutat == MUT_BREATHE_POISON && you.species != SP_NAGA)
+ return (true);
+
+ // Red Draconians can already breathe flames.
+ if (mutat == MUT_BREATHE_FLAMES && you.species == SP_RED_DRACONIAN)
+ return (true);
+
+ // Green Draconians can already breathe poison, so they don't need
+ // to spit it.
+ if (mutat == MUT_SPIT_POISON && you.species == SP_GREEN_DRACONIAN)
+ return (true);
+
+ // Only Draconians can get wings.
+ if (mutat == MUT_BIG_WINGS && !player_genus(GENPC_DRACONIAN))
+ return (true);
+
+ // Vampires' healing and thirst rates depend on their blood level.
+ if (you.species == SP_VAMPIRE
+ && (mutat == MUT_CARNIVOROUS || mutat == MUT_HERBIVOROUS
+ || mutat == MUT_REGENERATION || mutat == MUT_SLOW_HEALING
+ || mutat == MUT_FAST_METABOLISM || mutat == MUT_SLOW_METABOLISM))
+ {
+ return (true);
+ }
+
+ return (false);
+}
+
bool mutate(mutation_type which_mutation, bool failMsg,
bool force_mutation, bool god_gift, bool stat_gain_potion,
bool demonspawn, bool non_fatal)
@@ -2174,45 +2217,8 @@ bool mutate(mutation_type which_mutation, bool failMsg,
}
}
- // Only Nagas and Draconians can get this one.
- if (mutat == MUT_STINGER
- && !(you.species == SP_NAGA || player_genus(GENPC_DRACONIAN)))
- {
- return (false);
- }
-
- // Putting boots on after they are forced off. -- bwr
- if ((mutat == MUT_HOOVES || mutat == MUT_TALONS)
- && !player_has_feet())
- {
+ if (_physiology_mutation_conflict(mutat))
return (false);
- }
-
- // Already innate.
- if (mutat == MUT_BREATHE_POISON && you.species != SP_NAGA)
- return (false);
-
- // Red Draconians can already breathe flames.
- if (mutat == MUT_BREATHE_FLAMES && you.species == SP_RED_DRACONIAN)
- return (false);
-
- // Green Draconians can already breathe poison, so they don't need
- // to spit it.
- if (mutat == MUT_SPIT_POISON && you.species == SP_GREEN_DRACONIAN)
- return (false);
-
- // Only Draconians can get wings.
- if (mutat == MUT_BIG_WINGS && !player_genus(GENPC_DRACONIAN))
- return (false);
-
- // Vampires' healing and thirst rates depend on their blood level.
- if (you.species == SP_VAMPIRE
- && (mutat == MUT_CARNIVOROUS || mutat == MUT_HERBIVOROUS
- || mutat == MUT_REGENERATION || mutat == MUT_SLOW_HEALING
- || mutat == MUT_FAST_METABOLISM || mutat == MUT_SLOW_METABOLISM))
- {
- return (false);
- }
const mutation_def& mdef = get_mutation_def(mutat);
@@ -2424,7 +2430,7 @@ bool delete_mutation(mutation_type which_mutation, bool failMsg,
break;
}
- // For all those various scale mutations.
+ // For all those scale mutations.
you.redraw_armour_class = true;
you.mutation[mutat]--;