diff options
author | Sven Hesse | 2012-06-05 17:01:40 +0200 |
---|---|---|
committer | Sven Hesse | 2012-06-05 17:01:40 +0200 |
commit | 4392e4d7aab9114ff66a1fcda34d21f404b4ebcd (patch) | |
tree | 367134fbcfdf9761f3d344b20828c17d9e1570d8 /engines/gob/minigames/geisha/penetration.cpp | |
parent | 73776406686709bc79ff9c6423937dce0e43c5d6 (diff) | |
download | scummvm-rg350-4392e4d7aab9114ff66a1fcda34d21f404b4ebcd.tar.gz scummvm-rg350-4392e4d7aab9114ff66a1fcda34d21f404b4ebcd.tar.bz2 scummvm-rg350-4392e4d7aab9114ff66a1fcda34d21f404b4ebcd.zip |
GOB: Implement health gain/loss for mouths
Diffstat (limited to 'engines/gob/minigames/geisha/penetration.cpp')
-rw-r--r-- | engines/gob/minigames/geisha/penetration.cpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp index 1321842d07..a188995372 100644 --- a/engines/gob/minigames/geisha/penetration.cpp +++ b/engines/gob/minigames/geisha/penetration.cpp @@ -226,8 +226,8 @@ Penetration::Penetration(GobEngine *vm) : _vm(vm), _background(0), _sprites(0), _background = new Surface(320, 200, 1); - _shieldMeter = new Meter(11, 119, 92, 3, kColorShield, kColorBlack, 1020, Meter::kFillToRight); - _healthMeter = new Meter(11, 137, 92, 3, kColorHealth, kColorBlack, 1020, Meter::kFillToRight); + _shieldMeter = new Meter(11, 119, 92, 3, kColorShield, kColorBlack, 920, Meter::kFillToRight); + _healthMeter = new Meter(11, 137, 92, 3, kColorHealth, kColorBlack, 920, Meter::kFillToRight); _map = new Surface(kMapWidth * kMapTileWidth + kPlayAreaWidth , kMapHeight * kMapTileHeight + kPlayAreaHeight, 1); @@ -563,15 +563,29 @@ void Penetration::checkMouths() { m->mouth->activate(); - // Play the mouth sound - if (m->type == kMouthTypeBite) + // Play the mouth sound and do health gain/loss + if (m->type == kMouthTypeBite) { _vm->_sound->blasterPlay(&_soundBite, 1, 0); - else if (m->type == kMouthTypeKiss) + healthLose(230); + } else if (m->type == kMouthTypeKiss) { _vm->_sound->blasterPlay(&_soundKiss, 1, 0); + healthGain(120); + } } } } +void Penetration::healthGain(int amount) { + if (_shieldMeter->getValue() > 0) + _healthMeter->increase(_shieldMeter->increase(amount)); + else + _healthMeter->increase(amount); +} + +void Penetration::healthLose(int amount) { + _healthMeter->decrease(_shieldMeter->decrease(amount)); +} + void Penetration::updateAnims() { int16 left = 0, top = 0, right = 0, bottom = 0; |