aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_external.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-02-16 03:01:46 +0000
committerMatthew Hoops2010-02-16 03:01:46 +0000
commit5fd7dbb4061d808e4bc4c0cfba5e2eabf2687544 (patch)
treefe996c14b52c9211651a8106fb9637e3822bba80 /engines/mohawk/riven_external.cpp
parentb3ab83d8c125f8a7d8bafce04a3db11c3cdddec1 (diff)
downloadscummvm-rg350-5fd7dbb4061d808e4bc4c0cfba5e2eabf2687544.tar.gz
scummvm-rg350-5fd7dbb4061d808e4bc4c0cfba5e2eabf2687544.tar.bz2
scummvm-rg350-5fd7dbb4061d808e4bc4c0cfba5e2eabf2687544.zip
Move Riven variable randomization to initVars() and implement randomization for the dome and prison combinations.
svn-id: r48070
Diffstat (limited to 'engines/mohawk/riven_external.cpp')
-rw-r--r--engines/mohawk/riven_external.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp
index 51bfcd409d..edabc10946 100644
--- a/engines/mohawk/riven_external.cpp
+++ b/engines/mohawk/riven_external.cpp
@@ -29,20 +29,16 @@
#include "mohawk/sound.h"
#include "mohawk/video/video.h"
-#include "common/EventRecorder.h"
#include "gui/message.h"
+#include "common/events.h"
namespace Mohawk {
RivenExternal::RivenExternal(MohawkEngine_Riven *vm) : _vm(vm) {
setupCommands();
- _rnd = new Common::RandomSource();
- g_eventRec.registerRandomSource(*_rnd, "riven");
}
RivenExternal::~RivenExternal() {
- delete _rnd;
-
for (uint32 i = 0; i < _externalCommands.size(); i++)
delete _externalCommands[i];
@@ -1052,27 +1048,27 @@ void RivenExternal::xhandlecontrolmid(uint16 argc, uint16 *argv) {
void RivenExternal::xjplaybeetle_550(uint16 argc, uint16 *argv) {
// Play a beetle animation 25% of the time
- *_vm->matchVarToString("jplaybeetle") = (_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
+ *_vm->matchVarToString("jplaybeetle") = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
}
void RivenExternal::xjplaybeetle_600(uint16 argc, uint16 *argv) {
// Play a beetle animation 25% of the time
- *_vm->matchVarToString("jplaybeetle") = (_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
+ *_vm->matchVarToString("jplaybeetle") = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
}
void RivenExternal::xjplaybeetle_950(uint16 argc, uint16 *argv) {
// Play a beetle animation 25% of the time
- *_vm->matchVarToString("jplaybeetle") = (_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
+ *_vm->matchVarToString("jplaybeetle") = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
}
void RivenExternal::xjplaybeetle_1050(uint16 argc, uint16 *argv) {
// Play a beetle animation 25% of the time
- *_vm->matchVarToString("jplaybeetle") = (_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
+ *_vm->matchVarToString("jplaybeetle") = (_vm->_rnd->getRandomNumberRng(0, 3) == 0) ? 1 : 0;
}
void RivenExternal::xjplaybeetle_1450(uint16 argc, uint16 *argv) {
// Play a beetle animation 25% of the time as long as the girl is not present
- *_vm->matchVarToString("jplaybeetle") = (_rnd->getRandomNumberRng(0, 3) == 0 && *_vm->matchVarToString("jgirl") != 1) ? 1 : 0;
+ *_vm->matchVarToString("jplaybeetle") = (_vm->_rnd->getRandomNumberRng(0, 3) == 0 && *_vm->matchVarToString("jgirl") != 1) ? 1 : 0;
}
void RivenExternal::xjlagoon700_alert(uint16 argc, uint16 *argv) {
@@ -1375,15 +1371,6 @@ void RivenExternal::xtatrusgivesbooks(uint16 argc, uint16 *argv) {
// Give the player Atrus' Journal and the Trap book
*_vm->matchVarToString("aatrusbook") = 1;
*_vm->matchVarToString("atrapbook") = 1;
-
- // Randomize the telescope combination
- uint32 *teleCombo = _vm->matchVarToString("tcorrectorder");
- for (byte i = 0; i < 5; i++) {
- *teleCombo *= 10;
- *teleCombo += _rnd->getRandomNumberRng(1, 5);
- }
-
- // TODO: Randomize Dome Combination
}
// Trap Book is removed from inventory