Class engine.generator.interface.PlayerRest
Handles player resting
Methods
engine.generator.interface.PlayerRest:restInit (turns, what, past, on_end, on_very_end)
Initializes resting
engine.generator.interface.PlayerRest:onRestStart ()
We started resting Rewrite this method to do whatever you need
engine.generator.interface.PlayerRest:onRestStop ()
We stopped resting Rewrite this method to do whatever you need
engine.generator.interface.PlayerRest:restStep ()
Rest a turn For a turn based game you want in you player's act() something like the usage example
engine.generator.interface.PlayerRest:restCheck ()
Can we continue resting?
engine.generator.interface.PlayerRest:restStop (msg)
Stops resting
Methods
- engine.generator.interface.PlayerRest:restInit (turns, what, past, on_end, on_very_end)
-
Initializes resting
Parameters:
- turns
- what
- past
- on_end
- on_very_end
- engine.generator.interface.PlayerRest:onRestStart ()
- We started resting Rewrite this method to do whatever you need
- engine.generator.interface.PlayerRest:onRestStop ()
- We stopped resting Rewrite this method to do whatever you need
- engine.generator.interface.PlayerRest:restStep ()
-
Rest a turn
For a turn based game you want in you player's act() something like the usage example
Returns:
-
true if we can continue to rest
Or
-
false if we can't continue
Usage:
if not self:restStep() then game.paused = true end
- engine.generator.interface.PlayerRest:restCheck ()
-
Can we continue resting?
Rewrite this method to check for mana, life, whatever. By default we always return false so resting will never workReturns:
-
true if we can continue to rest
Or
-
false if we can't continue
- engine.generator.interface.PlayerRest:restStop (msg)
-
Stops resting
Parameters:
- msg