From 2f7ae1109bb94ab9b0bf1fe20d554c7124eb8465 Mon Sep 17 00:00:00 2001 From: Sven Hesse Date: Sun, 29 Jan 2012 00:00:04 +0100 Subject: GOB: Add a cheat debug command - Cheat the Diving minigame to a win - Get the mastermind solution --- engines/gob/minigames/geisha/diving.cpp | 13 ++++++++++++- engines/gob/minigames/geisha/diving.h | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'engines/gob/minigames') diff --git a/engines/gob/minigames/geisha/diving.cpp b/engines/gob/minigames/geisha/diving.cpp index 3f7d6fc4b3..e097c1d523 100644 --- a/engines/gob/minigames/geisha/diving.cpp +++ b/engines/gob/minigames/geisha/diving.cpp @@ -92,7 +92,7 @@ const Diving::PlantLevel Diving::kPlantLevels[] = { Diving::Diving(GobEngine *vm) : _vm(vm), _background(0), _objects(0), _gui(0), _okoAnim(0), _lungs(0), _heart(0), - _blackPearl(0), _airMeter(0), _healthMeter(0) { + _blackPearl(0), _airMeter(0), _healthMeter(0), _isPlaying(false) { _blackPearl = new Surface(11, 8, 1); @@ -127,6 +127,7 @@ Diving::~Diving() { bool Diving::play(uint16 playerCount, bool hasPearlLocation) { _hasPearlLocation = hasPearlLocation; + _isPlaying = true; // Fade to black _vm->_palAnim->fade(0, 0, 0); @@ -194,10 +195,20 @@ bool Diving::play(uint16 playerCount, bool hasPearlLocation) { deinit(); + _isPlaying = false; + // The game succeeded when we got 2 black pearls return _blackPearlCount >= 2; } +bool Diving::isPlaying() const { + return _isPlaying; +} + +void Diving::cheatWin() { + _blackPearlCount = 2; +} + void Diving::init() { // Load sounds _vm->_sound->sampleLoad(&_soundShoot , SOUND_SND, "tirgim.snd"); diff --git a/engines/gob/minigames/geisha/diving.h b/engines/gob/minigames/geisha/diving.h index 65ae06ec3e..089d60b260 100644 --- a/engines/gob/minigames/geisha/diving.h +++ b/engines/gob/minigames/geisha/diving.h @@ -51,6 +51,9 @@ public: bool play(uint16 playerCount, bool hasPearlLocation); + bool isPlaying() const; + void cheatWin(); + private: static const uint kEvilFishCount = 3; static const uint kDecorFishCount = 3; @@ -148,6 +151,7 @@ private: SoundDesc _soundBlackPearl; bool _hasPearlLocation; + bool _isPlaying; void init(); -- cgit v1.2.3