Cap the effective move time at 10 aut for hunger/regen purposes.
authorAdam Borowski <kilobyte@angband.pl>
Tue, 22 Jun 2010 14:34:51 +0000 (16:34 +0200)
committerAdam Borowski <kilobyte@angband.pl>
Tue, 22 Jun 2010 22:21:24 +0000 (00:21 +0200)
This takes care of naga / CB hunger issues, without letting them dance
in place for cheap healing.

crawl-ref/source/main.cc

index fcd2d5f..51080c3 100644 (file)
@@ -2645,13 +2645,17 @@ void world_reacts()
 
     _decrement_durations();
 
+    int capped_time = you.time_taken;
+    if (you.walking && capped_time > BASELINE_DELAY)
+        capped_time = BASELINE_DELAY;
+
     int food_use = player_hunger_rate();
-    food_use = div_rand_round(food_use * you.time_taken, BASELINE_DELAY);
+    food_use = div_rand_round(food_use * capped_time, BASELINE_DELAY);
 
     if (food_use > 0 && you.hunger >= 40)
         make_hungry(food_use, true);
 
-    _regenerate_hp_and_mp(you.time_taken);
+    _regenerate_hp_and_mp(capped_time);
 
     // If you're wielding a rod, it'll gradually recharge.
     recharge_rods(you.time_taken, false);