diff options
Diffstat (limited to 'engines/gob')
-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); |