Skip to content
Snippets Groups Projects
Commit 2cd0e052 authored by dg's avatar dg
Browse files

Resting now gradually improves your life/mana/stamina regen rate, so that it...

Resting now gradually improves your life/mana/stamina regen rate, so that it does not affect short restst much but reduces waiting time on long ones


git-svn-id: http://svn.net-core.org/repos/t-engine4@938 51575b47-30f0-44d4-a5cc-537603b46e54
parent 951cd293
No related branches found
No related tags found
No related merge requests found
......@@ -337,6 +337,12 @@ function _M:restCheck()
local spotted = spotHostiles(self)
if spotted then return false, ("hostile spotted (%s%s)"):format(spotted.actor.name, game.level.map:isOnScreen(spotted.x, spotted.y) and "" or " - offscreen") end
-- Resting improves regen
local perc = math.min(self.resting.cnt / 10, 4)
self:heal(self.life_regen * perc)
self:incStamina(self.stamina_regen * perc)
self:incMana(self.mana_regen * perc)
-- Check ressources, make sure they CAN go up, otherwise we will never stop
if not self.resting.rest_turns then
if self.air_regen < 0 then return false, "loosing breath!" end
......
......@@ -34,7 +34,7 @@ function _M:init()
self.profile_font = core.display.newFont("/data/font/VeraIt.ttf", 14)
engine.Game.init(self, engine.KeyBind.new())
self.background = core.display.loadImage("/data/gfx/mainmenu/background.jpg")
self.background = core.display.loadImage("/data/gfx/mainmenu/background.png")
end
function _M:run()
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment