GOB: Hook up the Penetration minigame in the cheater
This commit is contained in:
parent
3d537e763c
commit
c37577a950
5 changed files with 36 additions and 6 deletions
|
@ -31,6 +31,7 @@ namespace Gob {
|
||||||
|
|
||||||
namespace Geisha {
|
namespace Geisha {
|
||||||
class Diving;
|
class Diving;
|
||||||
|
class Penetration;
|
||||||
}
|
}
|
||||||
|
|
||||||
class GobEngine;
|
class GobEngine;
|
||||||
|
@ -48,13 +49,14 @@ protected:
|
||||||
|
|
||||||
class Cheater_Geisha : public Cheater {
|
class Cheater_Geisha : public Cheater {
|
||||||
public:
|
public:
|
||||||
Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving);
|
Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving, Geisha::Penetration *penetration);
|
||||||
~Cheater_Geisha();
|
~Cheater_Geisha();
|
||||||
|
|
||||||
bool cheat(GUI::Debugger &console);
|
bool cheat(GUI::Debugger &console);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Geisha::Diving *_diving;
|
Geisha::Diving *_diving;
|
||||||
|
Geisha::Penetration *_penetration;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // End of namespace Gob
|
} // End of namespace Gob
|
||||||
|
|
|
@ -27,11 +27,12 @@
|
||||||
#include "gob/inter.h"
|
#include "gob/inter.h"
|
||||||
|
|
||||||
#include "gob/minigames/geisha/diving.h"
|
#include "gob/minigames/geisha/diving.h"
|
||||||
|
#include "gob/minigames/geisha/penetration.h"
|
||||||
|
|
||||||
namespace Gob {
|
namespace Gob {
|
||||||
|
|
||||||
Cheater_Geisha::Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving) :
|
Cheater_Geisha::Cheater_Geisha(GobEngine *vm, Geisha::Diving *diving, Geisha::Penetration *penetration) :
|
||||||
Cheater(vm), _diving(diving) {
|
Cheater(vm), _diving(diving), _penetration(penetration) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +46,12 @@ bool Cheater_Geisha::cheat(GUI::Debugger &console) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A cheat to get around the Penetration minigame
|
||||||
|
if (_penetration->isPlaying()) {
|
||||||
|
_penetration->cheatWin();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// A cheat to get around the mastermind puzzle
|
// A cheat to get around the mastermind puzzle
|
||||||
if (_vm->isCurrentTot("hard.tot") && _vm->_inter->_variables) {
|
if (_vm->isCurrentTot("hard.tot") && _vm->_inter->_variables) {
|
||||||
uint32 digit1 = READ_VARO_UINT32(0x768);
|
uint32 digit1 = READ_VARO_UINT32(0x768);
|
||||||
|
|
|
@ -55,7 +55,7 @@ Inter_Geisha::Inter_Geisha(GobEngine *vm) : Inter_v1(vm),
|
||||||
_diving = new Geisha::Diving(vm);
|
_diving = new Geisha::Diving(vm);
|
||||||
_penetration = new Geisha::Penetration(vm);
|
_penetration = new Geisha::Penetration(vm);
|
||||||
|
|
||||||
_cheater = new Cheater_Geisha(vm, _diving);
|
_cheater = new Cheater_Geisha(vm, _diving, _penetration);
|
||||||
|
|
||||||
_vm->_console->registerCheater(_cheater);
|
_vm->_console->registerCheater(_cheater);
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,7 +377,7 @@ Penetration::ManagedSub::~ManagedSub() {
|
||||||
|
|
||||||
|
|
||||||
Penetration::Penetration(GobEngine *vm) : _vm(vm), _background(0), _sprites(0), _objects(0), _sub(0),
|
Penetration::Penetration(GobEngine *vm) : _vm(vm), _background(0), _sprites(0), _objects(0), _sub(0),
|
||||||
_shieldMeter(0), _healthMeter(0), _floor(0) {
|
_shieldMeter(0), _healthMeter(0), _floor(0), _isPlaying(false) {
|
||||||
|
|
||||||
_background = new Surface(320, 200, 1);
|
_background = new Surface(320, 200, 1);
|
||||||
|
|
||||||
|
@ -404,6 +404,8 @@ bool Penetration::play(bool hasAccessPass, bool hasMaxEnergy, bool testMode) {
|
||||||
_hasMaxEnergy = hasMaxEnergy;
|
_hasMaxEnergy = hasMaxEnergy;
|
||||||
_testMode = testMode;
|
_testMode = testMode;
|
||||||
|
|
||||||
|
_isPlaying = true;
|
||||||
|
|
||||||
init();
|
init();
|
||||||
initScreen();
|
initScreen();
|
||||||
|
|
||||||
|
@ -432,9 +434,19 @@ bool Penetration::play(bool hasAccessPass, bool hasMaxEnergy, bool testMode) {
|
||||||
deinit();
|
deinit();
|
||||||
drawEndText();
|
drawEndText();
|
||||||
|
|
||||||
|
_isPlaying = false;
|
||||||
|
|
||||||
return hasWon();
|
return hasWon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Penetration::isPlaying() const {
|
||||||
|
return _isPlaying;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Penetration::cheatWin() {
|
||||||
|
_floor = 3;
|
||||||
|
}
|
||||||
|
|
||||||
void Penetration::init() {
|
void Penetration::init() {
|
||||||
// Load sounds
|
// Load sounds
|
||||||
_vm->_sound->sampleLoad(&_soundShield, SOUND_SND, "boucl.snd");
|
_vm->_sound->sampleLoad(&_soundShield, SOUND_SND, "boucl.snd");
|
||||||
|
@ -748,6 +760,10 @@ void Penetration::checkInput() {
|
||||||
_keys[kKeyRight] = true;
|
_keys[kKeyRight] = true;
|
||||||
else if (event.kbd.keycode == Common::KEYCODE_SPACE)
|
else if (event.kbd.keycode == Common::KEYCODE_SPACE)
|
||||||
_keys[kKeySpace] = true;
|
_keys[kKeySpace] = true;
|
||||||
|
else if (event.kbd.keycode == Common::KEYCODE_d) {
|
||||||
|
_vm->getDebugger()->attach();
|
||||||
|
_vm->getDebugger()->onFrame();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Common::EVENT_KEYUP:
|
case Common::EVENT_KEYUP:
|
||||||
|
|
|
@ -50,6 +50,9 @@ public:
|
||||||
|
|
||||||
bool play(bool hasAccessPass, bool hasMaxEnergy, bool testMode);
|
bool play(bool hasAccessPass, bool hasMaxEnergy, bool testMode);
|
||||||
|
|
||||||
|
bool isPlaying() const;
|
||||||
|
void cheatWin();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const int kModeCount = 2;
|
static const int kModeCount = 2;
|
||||||
static const int kFloorCount = 3;
|
static const int kFloorCount = 3;
|
||||||
|
@ -141,6 +144,8 @@ private:
|
||||||
SoundDesc _soundShoot;
|
SoundDesc _soundShoot;
|
||||||
SoundDesc _soundExit;
|
SoundDesc _soundExit;
|
||||||
|
|
||||||
|
bool _isPlaying;
|
||||||
|
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
void deinit();
|
void deinit();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue