summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-16 22:40:45 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-16 22:40:45 +0000
commit847752c849c2f96b2821337d60d548b2454557ec (patch)
tree05ea57ae4825c310650d0da0021ea63c293b92b6 /crawl-ref/source/player.cc
parentc3eff4baabd161aa07c65d05941c183902d90342 (diff)
downloadcrawl-ref-847752c849c2f96b2821337d60d548b2454557ec.tar.gz
crawl-ref-847752c849c2f96b2821337d60d548b2454557ec.zip
Change vampire mutation system to be more dynamic.
* Alive : full mutations effects, always mutate. * Very Full: mutations up to level 2, mutation chance 66% * Full : mutations up to level 2, mutation chance 50% * Satiated : mutations at level 1, mutation chance 33%, else rotting * Thirsty or worse: only physical and innate mutations, never mutate. 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
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc24
1 files changed, 21 insertions, 3 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index d268662df3..c06ff1a2d9 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -6111,12 +6111,30 @@ mon_holy_type player::holiness() const
return (MH_NATURAL);
}
+// Output active level of player mutation.
+// Might be lower than real mutation for non-"Alive" Vampires.
int player_mutation_level(mutation_type mut)
{
- if (!mutation_is_active(mut))
- return 0;
+ const int mlevel = you.mutation[mut];
+
+ if (mutation_is_fully_active(mut))
+ return (mlevel);
+
+ // For now, dynamic mutation only apply to vampires.
+ ASSERT(you.species == SP_VAMPIRE);
- return (you.mutation[mut]);
+ // 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);
}
int player::res_fire() const