HYPNO: implemented infinite health and ammo cheat for arcade sequences in wet

This commit is contained in:
neuromancer
2022-04-27 21:33:02 +02:00
parent 9b1c1a7efc
commit c1ee795b8d
4 changed files with 16 additions and 4 deletions
+2 -1
View File
@@ -462,7 +462,8 @@ void HypnoEngine::runArcade(ArcadeShooting *arc) {
if (it->attackFrames.size() > 0) {
uint32 attackFrame = it->attackFrames.front();
if (frame > 0 && frame >= (int)(attackFrame - 2) && !it->destroyed) {
_health = _health - it->attackWeight;
if (!_infiniteHealthCheat)
_health = _health - it->attackWeight;
hitPlayer();
it->attackFrames.pop_front();
}
+6
View File
@@ -69,6 +69,12 @@ HypnoEngine::HypnoEngine(OSystem *syst, const ADGameDescription *gd)
if (!Common::parseBool(ConfMan.get("cheats"), _cheatsEnabled))
error("Failed to parse bool from cheats options");
if (!Common::parseBool(ConfMan.get("infiniteHealth"), _infiniteHealthCheat))
error("Failed to parse bool from cheats options");
if (!Common::parseBool(ConfMan.get("infiniteAmmo"), _infiniteAmmoCheat))
error("Failed to parse bool from cheats options");
if (!Common::parseBool(ConfMan.get("restored"), _restoredContentEnabled))
error("Failed to parse bool from restored options");
// Add quit level
+2
View File
@@ -100,6 +100,8 @@ public:
Common::Platform _platform;
Common::String _variant;
bool _cheatsEnabled;
bool _infiniteHealthCheat;
bool _infiniteAmmoCheat;
bool _restoredContentEnabled;
Audio::SoundHandle _soundHandle;
+6 -3
View File
@@ -659,7 +659,8 @@ bool WetEngine::clickedSecondaryShoot(const Common::Point &mousePos) {
if (_ammo <= 0)
return false;
_ammo--;
if (!_infiniteAmmoCheat)
_ammo--;
incShotsFired();
return clickedPrimaryShoot(mousePos);
}
@@ -668,7 +669,8 @@ void WetEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {
if (s->name == "SP_SWITCH_R" || s->name == "SP_SWITCH_L") {
_health = 0;
} else if (s->name == "SP_LIZARD1") {
_health = _health - 15;
if (!_infiniteHealthCheat)
_health = _health - 15;
_background->decoder->pauseVideo(true);
MVideo video(arc->additionalVideo, Common::Point(0, 0), false, true, false);
runIntro(video);
@@ -688,7 +690,8 @@ void WetEngine::missedTarget(Shoot *s, ArcadeShooting *arc) {
drawScreen();
_skipDefeatVideo = true;
} else if (s->attackFrames.empty()) {
_health = _health - s->attackWeight;
if (!_infiniteHealthCheat)
_health = _health - s->attackWeight;
hitPlayer();
}
}