diff options
author | Eugene Sandulenko | 2016-01-07 18:30:44 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-01-07 18:30:44 +0100 |
commit | 7bdb942cacea2d950c2b7fadd96e9bcdca06f8b4 (patch) | |
tree | 439fb91f6ad8cbe665a13355a7538d1dff4564d5 /engines | |
parent | 83dcdf9c63e8936b2f9a679dacd36fa418ae7ee0 (diff) | |
download | scummvm-rg350-7bdb942cacea2d950c2b7fadd96e9bcdca06f8b4.tar.gz scummvm-rg350-7bdb942cacea2d950c2b7fadd96e9bcdca06f8b4.tar.bz2 scummvm-rg350-7bdb942cacea2d950c2b7fadd96e9bcdca06f8b4.zip |
WAGE: Implement WageEngine::regen()
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/wage.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 31df42474f..1f0769c561 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -385,7 +385,15 @@ void WageEngine::redrawScene() { } void WageEngine::regen() { - warning("STUB WageEngine::regen()"); + Chr *player = _world->_player; + int curHp = player->_context._statVariables[PHYS_HIT_CUR]; + int maxHp = player->_context._statVariables[PHYS_HIT_BAS]; + int delta = maxHp - curHp; + + if (delta > 0) { + int bonus = (int)(delta / (8 + _rnd->getRandomNumber(2))); + player->_context._statVariables[PHYS_HIT_CUR] += bonus; + } } void WageEngine::processTurnInternal(Common::String *textInput, Designed *clickInput) { |