diff options
author | Sven Hesse | 2012-01-27 15:07:26 +0100 |
---|---|---|
committer | Sven Hesse | 2012-01-27 15:07:26 +0100 |
commit | 0fd9abfe01d517c12b6855b6777a7e062ec1cc78 (patch) | |
tree | 1920164ff1789ef7b0fd7c0d04b63b6c44c3f092 /engines/gob/minigames | |
parent | cf45f49f72dba59c94ac4d2c0e1bcbebf1482b8f (diff) | |
download | scummvm-rg350-0fd9abfe01d517c12b6855b6777a7e062ec1cc78.tar.gz scummvm-rg350-0fd9abfe01d517c12b6855b6777a7e062ec1cc78.tar.bz2 scummvm-rg350-0fd9abfe01d517c12b6855b6777a7e062ec1cc78.zip |
GOB: Play the correct animation when Oko's picking up pearls
Diffstat (limited to 'engines/gob/minigames')
-rw-r--r-- | engines/gob/minigames/geisha/diving.cpp | 4 | ||||
-rw-r--r-- | engines/gob/minigames/geisha/oko.cpp | 17 | ||||
-rw-r--r-- | engines/gob/minigames/geisha/oko.h | 3 |
3 files changed, 19 insertions, 5 deletions
diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp index d59d3430ad..4b08a21fb4 100644 --- a/engines/gob/minigames/geisha/diving.cpp +++ b/engines/gob/minigames/geisha/diving.cpp @@ -121,10 +121,10 @@ bool Diving::play(uint16 playerCount, bool hasPearlLocation) { shoot(mouseX, mouseY); if (key == kKeyDown) { - if (_oko->isAtBottom()) + _oko->sink(); + if ((_oko->getState() == Oko::kStatePick) && (_oko->getFrame() == 0)) getPearl(); - _oko->sink(); } else if (key == kKeyUp) _oko->raise(); diff --git a/engines/gob/minigames/geisha/oko.cpp b/engines/gob/minigames/geisha/oko.cpp index e4cf32f5b2..5da1947acf 100644 --- a/engines/gob/minigames/geisha/oko.cpp +++ b/engines/gob/minigames/geisha/oko.cpp @@ -33,7 +33,8 @@ enum kOkoAnimation { kOkoAnimationSwim = 1, kOkoAnimationSink = 8, kOkoAnimationRaise = 7, - kOkoAnimationBreathe = 2 + kOkoAnimationBreathe = 2, + kOkoAnimationPick = 3 }; static const int16 kOkoPositionX = 110; @@ -78,6 +79,15 @@ void Oko::advance() { } break; + case kStatePick: + if (wasLastFrame) { + _level = 1; + setAnimation(kOkoAnimationSwim); + setPosition(kOkoPositionX, kLevelPositionX[_level]); + _state = kStateSwim; + } + break; + default: break; } @@ -87,8 +97,11 @@ void Oko::sink() { if (_state != kStateSwim) return; - if (_level >= (kLevelCount - 1)) + if (_level >= (kLevelCount - 1)) { + setAnimation(kOkoAnimationPick); + _state = kStatePick; return; + } setAnimation(kOkoAnimationSink); setPosition(kOkoPositionX, kLevelPositionX[_level]); diff --git a/engines/gob/minigames/geisha/oko.h b/engines/gob/minigames/geisha/oko.h index 892f0b81fa..0dee53ce45 100644 --- a/engines/gob/minigames/geisha/oko.h +++ b/engines/gob/minigames/geisha/oko.h @@ -40,7 +40,8 @@ public: kStateSwim, kStateSink, kStateRaise, - kStateBreathe + kStateBreathe, + kStatePick }; Oko(const ANIFile &ani, Sound &sound, SoundDesc &breathe); |