[Scummvm-git-logs] scummvm master -> c7b8025e4ee3732d1b378ad2cea6f2fbe354c754
antoniou79
noreply at scummvm.org
Wed Aug 14 11:58:23 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c7b8025e4e BLADERUNNER: Add debug command to show initial random seed
Commit: c7b8025e4ee3732d1b378ad2cea6f2fbe354c754
https://github.com/scummvm/scummvm/commit/c7b8025e4ee3732d1b378ad2cea6f2fbe354c754
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2024-08-14T14:53:26+03:00
Commit Message:
BLADERUNNER: Add debug command to show initial random seed
Also reveals the nature of the variable characters for the game
Debug command is "cheat"
Changed paths:
engines/bladerunner/bladerunner.cpp
engines/bladerunner/bladerunner.h
engines/bladerunner/debugger.cpp
engines/bladerunner/debugger.h
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 06a582cd24b..fb4ce6d7463 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -106,6 +106,7 @@ const char *BladeRunnerEngine::kCommonKeymapId = "bladerunner-common";
BladeRunnerEngine::BladeRunnerEngine(OSystem *syst, const ADGameDescription *desc)
: Engine(syst),
_rnd("bladerunner") {
+ _newGameRandomSeed = _rnd.getSeed();
_windowIsActive = true;
_gameIsRunning = true;
@@ -2811,8 +2812,9 @@ void BladeRunnerEngine::newGame(int difficulty) {
// Set a (new) seed for randomness when starting a new game.
// This also makes sure that if there's a custom random seed set in ScummVM's configuration,
// that's the one that will be used.
- _rnd.setSeed(Common::RandomSource::generateNewSeed());
- //debug("Random seed for the New Game is: %u", _rnd.getSeed());
+ _newGameRandomSeed = Common::RandomSource::generateNewSeed();
+ _rnd.setSeed(_newGameRandomSeed );
+ //debug("Random seed for the New Game is: %u", _newGameRandomSeed );
_settings->reset();
_combat->reset();
diff --git a/engines/bladerunner/bladerunner.h b/engines/bladerunner/bladerunner.h
index e713f33a13a..fa8811b05bf 100644
--- a/engines/bladerunner/bladerunner.h
+++ b/engines/bladerunner/bladerunner.h
@@ -213,6 +213,7 @@ public:
ZBuffer *_zbuffer;
Common::RandomSource _rnd;
+ uint32 _newGameRandomSeed;
Debugger *_debugger;
diff --git a/engines/bladerunner/debugger.cpp b/engines/bladerunner/debugger.cpp
index 5929d36e4cd..426bdda0d2c 100644
--- a/engines/bladerunner/debugger.cpp
+++ b/engines/bladerunner/debugger.cpp
@@ -145,6 +145,7 @@ Debugger::Debugger(BladeRunnerEngine *vm) : GUI::Debugger() {
registerCmd("outtake", WRAP_METHOD(Debugger, cmdOuttake));
registerCmd("playvqa", WRAP_METHOD(Debugger, cmdPlayVqa));
registerCmd("ammo", WRAP_METHOD(Debugger, cmdAmmo));
+ registerCmd("cheat", WRAP_METHOD(Debugger, cmdCheatReport));
#if BLADERUNNER_ORIGINAL_BUGS
#else
registerCmd("effect", WRAP_METHOD(Debugger, cmdEffect));
@@ -3262,4 +3263,70 @@ bool Debugger::cmdAmmo(int argc, const char** argv) {
return true;
}
+bool Debugger::cmdCheatReport(int argc, const char** argv) {
+ bool invalidSyntax = false;
+ if (argc == 1) {
+ debugPrintf("---\nNote: Currently playing in %s mode.\n---\n", getDifficultyDescription(_vm->_settings->getDifficulty()).c_str());
+ debugPrintf("Izo is ");
+ if ( _vm->_gameFlags->query(kFlagIzoIsReplicant)) {
+ debugPrintf("a Replicant\n");
+ } else {
+ debugPrintf("Human\n");
+ }
+
+ debugPrintf("Gordo is ");
+ if ( _vm->_gameFlags->query(kFlagGordoIsReplicant)) {
+ debugPrintf("a Replicant\n");
+ } else {
+ debugPrintf("Human\n");
+ }
+
+ debugPrintf("Lucy is ");
+ if ( _vm->_gameFlags->query(kFlagLucyIsReplicant)) {
+ debugPrintf("a Replicant\n");
+ } else {
+ debugPrintf("Human\n");
+ }
+
+ debugPrintf("Dektora is ");
+ if ( _vm->_gameFlags->query(kFlagDektoraIsReplicant)) {
+ debugPrintf("a Replicant\n");
+ } else {
+ debugPrintf("Human\n");
+ }
+
+ debugPrintf("Sadik is ");
+ if ( _vm->_gameFlags->query(kFlagSadikIsReplicant)) {
+ debugPrintf("a Replicant\n");
+ } else {
+ debugPrintf("Human\n");
+ }
+
+ debugPrintf("Luther/Lance is ");
+ if ( _vm->_gameFlags->query(kFlagLutherLanceIsReplicant)) {
+ debugPrintf("Replicant\n");
+ } else {
+ debugPrintf("Human\n");
+ }
+ debugPrintf("---\n");
+ debugPrintf("Random seed is ");
+ debugPrintf("%u\n", _vm->_newGameRandomSeed);
+ debugPrintf("---\n");
+ return true;
+
+ } else {
+ invalidSyntax = true;
+ }
+
+ if (invalidSyntax) {
+ // invalid syntax
+ debugPrintf("Show the random seed for the game and the nature (human or Replicant) for the potentially variable characters\n");
+ if (argv != nullptr && argv[0] != nullptr) {
+ debugPrintf("Usage: %s\n", argv[0]);
+ }
+ }
+
+ return true;
+}
+
} // End of namespace BladeRunner
diff --git a/engines/bladerunner/debugger.h b/engines/bladerunner/debugger.h
index a2b72e94dcc..42b0a545d53 100644
--- a/engines/bladerunner/debugger.h
+++ b/engines/bladerunner/debugger.h
@@ -136,6 +136,7 @@ public:
bool cmdOuttake(int argc, const char** argv);
bool cmdPlayVqa(int argc, const char** argv);
bool cmdAmmo(int argc, const char** argv);
+ bool cmdCheatReport(int argc, const char** argv);
#if BLADERUNNER_ORIGINAL_BUGS
#else
bool cmdEffect(int argc, const char **argv);
More information about the Scummvm-git-logs
mailing list