diff options
author | Strangerke | 2014-03-22 22:02:52 +0100 |
---|---|---|
committer | Strangerke | 2014-03-22 22:02:52 +0100 |
commit | c42e831817d3eef04f493c08cd288dfe41f764e6 (patch) | |
tree | f71cb1857708f23b250a1bc98e4a876d603607de /engines/mads/nebular | |
parent | eb82e63398c2050cbb72008cd849b8d1fda89c3e (diff) | |
download | scummvm-rg350-c42e831817d3eef04f493c08cd288dfe41f764e6.tar.gz scummvm-rg350-c42e831817d3eef04f493c08cd288dfe41f764e6.tar.bz2 scummvm-rg350-c42e831817d3eef04f493c08cd288dfe41f764e6.zip |
MADS: Introduce another getRandomNumber function with 2 parameters
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r-- | engines/mads/nebular/dialogs_nebular.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes2.cpp | 6 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes8.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index dc74f39fe8..6dabbec1b9 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -90,7 +90,7 @@ bool CopyProtectionDialog::getHogAnusEntry(HOGANUS &entry) { // Read in the total number of entries, and randomly pick an entry to use int numEntries = f.readUint16LE(); - int entryIndex = _vm->getRandomNumber(numEntries - 2) + 1; + int entryIndex = _vm->getRandomNumber(1, numEntries); // Read in the encrypted entry f.seek(28 * entryIndex + 2); diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp index 4acbe92475..cc896c6015 100644 --- a/engines/mads/nebular/nebular_scenes2.cpp +++ b/engines/mads/nebular/nebular_scenes2.cpp @@ -462,7 +462,7 @@ void Scene202::enter() { } void Scene202::setRandomKernelMessage() { - int vocabId = 92 + _vm->getRandomNumber(4); + int vocabId = _vm->getRandomNumber(92, 96); _scene->_kernelMessages.reset(); _game._abortTimersMode2 = ABORTMODE_1; _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 70, 120, _game.getQuote(vocabId)); @@ -555,7 +555,7 @@ void Scene202::step() { } if (!_scene->_activeAnimation && (_globals[33] != 2) && (_globals._v7 <= _scene->_frameStartTime) && (_game._scene._v8425C <= _scene->_frameStartTime)) { - int randVal = _vm->getRandomNumber(499) + 1; + int randVal = _vm->getRandomNumber(1, 500); int threshold = 1; if (_globals._v4) threshold = 26; @@ -614,7 +614,7 @@ void Scene202::step() { // } warning("TODO: word84260 = _scene->_activeAnimation->getCurrentFrame();"); - int randVal = _vm->getRandomNumber(999) + 1; + int randVal = _vm->getRandomNumber(1, 1000); int frameStep = -1; switch (_scene->_activeAnimation->getCurrentFrame()) { diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp index dd86b56a65..2a28edee1d 100644 --- a/engines/mads/nebular/nebular_scenes8.cpp +++ b/engines/mads/nebular/nebular_scenes8.cpp @@ -239,7 +239,7 @@ void Scene804::step() { switch (_scene->_activeAnimation->getCurrentFrame()) { case 1: - _globals[29] = _vm->getRandomNumber(29) + 1; + _globals[29] = _vm->getRandomNumber(1, 30); switch (_globals[29]) { case 1: _globals._v5 = 25; |