Don't offer Sac Exp when it would kill you.
authorNeil Moore <neil@s-z.org>
Fri, 30 Jan 2015 16:03:08 +0000 (11:03 -0500)
committerNeil Moore <neil@s-z.org>
Fri, 30 Jan 2015 16:22:52 +0000 (11:22 -0500)
crawl-ref/source/godabil.cc
crawl-ref/source/godabil.h
crawl-ref/source/sacrifice-data.h

index cc421ac..bf060b7 100644 (file)
@@ -6024,8 +6024,8 @@ static void _extra_sacrifice_code(ability_type sac)
     }
     else if (sac_def.sacrifice == ABIL_RU_SACRIFICE_EXPERIENCE)
     {
-        lose_level();
-        lose_level();
+        for (int i = 0; i < RU_SAC_XP_LEVELS; ++i)
+            lose_level();
     }
     else if (sac_def.sacrifice == ABIL_RU_SACRIFICE_SKILL)
     {
index 8252406..03e8477 100644 (file)
@@ -34,6 +34,8 @@ const char * const GOZAG_SHOP_COST_KEY       = "gozag_shop_cost_%d";
 #define GOZAG_MAX_BRIBABILITY 8
 #define GOZAG_MAX_POTIONS 3
 
+#define RU_SAC_XP_LEVELS 2
+
 struct bolt;
 class stack_iterator;
 
index cd3d97a..798a83d 100644 (file)
@@ -161,7 +161,7 @@ static const sacrifice_def sac_data[] =
   28,
   SK_NONE,
   nullptr,
-  nullptr,
+  []() { return you.experience_level > RU_SAC_XP_LEVELS; }
 },
 
 { ABIL_RU_SACRIFICE_SKILL, MUT_UNSKILLED,