From 5562dfc2a3dd500be1a98a02703eb37496b5fb8e Mon Sep 17 00:00:00 2001 From: Stefan O'Rear Date: Sun, 8 Nov 2009 05:13:41 -0800 Subject: Relax the one mutation per level rule for DS Breaks saves. --- crawl-ref/source/player.cc | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/player.cc') diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 59a20295ac..07ba1e784a 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3180,10 +3180,24 @@ void level_change(bool skip_attribute_increase) break; case SP_DEMONSPAWN: - if (you.demon_trait[you.experience_level - 2] != NUM_MUTATIONS) { - mpr("Your demonic ancestry asserts itself...", MSGCH_INTRINSIC_GAIN); - perma_mutate(you.demon_trait[you.experience_level - 2], 1); + bool gave_message = false; + + for (unsigned i = 0; i < you.demonic_traits.size(); ++i) + { + if (you.demonic_traits[i].level_gained + == you.experience_level) + { + if (!gave_message) + { + mpr("Your demonic ancestry asserts itself...", + MSGCH_INTRINSIC_GAIN); + + gave_message = true; + } + perma_mutate(you.demonic_traits[i].mutation, 1); + } + } } if (!(you.experience_level % 4)) @@ -5572,7 +5586,7 @@ void player::init() mutation.init(0); demon_pow.init(0); - demon_trait.init(NUM_MUTATIONS); + demonic_traits.clear(); had_book.init(false); -- cgit v1.2.3-54-g00ecf