aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/minigames
diff options
context:
space:
mode:
authorSven Hesse2012-01-29 00:00:04 +0100
committerSven Hesse2012-01-29 00:10:11 +0100
commit2f7ae1109bb94ab9b0bf1fe20d554c7124eb8465 (patch)
treef13ab5ba5722ffdf3a1620c1d267cde08e270c57 /engines/gob/minigames
parentcaeae1a7d66843823a31bb99e081da0165a18a22 (diff)
downloadscummvm-rg350-2f7ae1109bb94ab9b0bf1fe20d554c7124eb8465.tar.gz
scummvm-rg350-2f7ae1109bb94ab9b0bf1fe20d554c7124eb8465.tar.bz2
scummvm-rg350-2f7ae1109bb94ab9b0bf1fe20d554c7124eb8465.zip
GOB: Add a cheat debug command
- Cheat the Diving minigame to a win - Get the mastermind solution
Diffstat (limited to 'engines/gob/minigames')
-rw-r--r--engines/gob/minigames/geisha/diving.cpp13
-rw-r--r--engines/gob/minigames/geisha/diving.h4
2 files changed, 16 insertions, 1 deletions
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();