aboutsummaryrefslogtreecommitdiff
path: root/engines/mads/nebular
diff options
context:
space:
mode:
authorPaul Gilbert2014-03-29 11:18:07 -0400
committerPaul Gilbert2014-03-29 11:18:07 -0400
commit71b1343adf6e886cfd2e1a0040a12b5025672d14 (patch)
treef21fb355b8fc2aeab61b8078c929a29f43decc26 /engines/mads/nebular
parentd801c2ffdd1b2e5cfefcea18309a4779e0a824a1 (diff)
downloadscummvm-rg350-71b1343adf6e886cfd2e1a0040a12b5025672d14.tar.gz
scummvm-rg350-71b1343adf6e886cfd2e1a0040a12b5025672d14.tar.bz2
scummvm-rg350-71b1343adf6e886cfd2e1a0040a12b5025672d14.zip
MADS: Implemented NebularGame::step
Diffstat (limited to 'engines/mads/nebular')
-rw-r--r--engines/mads/nebular/game_nebular.cpp65
-rw-r--r--engines/mads/nebular/game_nebular.h2
-rw-r--r--engines/mads/nebular/globals_nebular.h2
-rw-r--r--engines/mads/nebular/nebular_scenes2.cpp4
4 files changed, 71 insertions, 2 deletions
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 55a348a489..34af685981 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -280,6 +280,71 @@ void GameNebular::doObjectAction() {
warning("TODO: GameNebular::doObjectAction");
}
+void GameNebular::step() {
+ if (_player._visible && _player._stepEnabled && !_player._moving &&
+ (_player._facing == _player._turnToFacing)) {
+ if (_scene._frameStartTime >= *((uint32 *)&_globals[kWalkerTiming])) {
+ if (!_player._stopWalkerIndex) {
+ int randomVal = _vm->getRandomNumber(29999);;
+ if (_globals[kSexOfRex] == REX_MALE) {
+ switch (_player._facing) {
+ case FACING_SOUTHWEST:
+ case FACING_SOUTHEAST:
+ case FACING_NORTHWEST:
+ case FACING_NORTHEAST:
+ if (randomVal < 200) {
+ _player.addWalker(-1, 0);
+ _player.addWalker(1, 0);
+ }
+ break;
+
+ case FACING_WEST:
+ case FACING_EAST:
+ if (randomVal < 500) {
+ for (int count = 0; count < 10; ++count) {
+ _player.addWalker(1, 0);
+ }
+ }
+ break;
+
+ case 2:
+ if (randomVal < 500) {
+ for (int count = 0; count < 10; ++count) {
+ _player.addWalker((randomVal < 250) ? 1 : 2, 0);
+ }
+ } else if (randomVal < 750) {
+ for (int count = 0; count < 5; ++count) {
+ _player.addWalker(1, 0);
+ }
+
+ _player.addWalker(0, 0);
+ _player.addWalker(0, 0);
+
+ for (int count = 0; count < 5; ++count) {
+ _player.addWalker(2, 0);
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ *((uint32 *)&_globals[kWalkerTiming]) += 6;
+ }
+ }
+
+ // Below is countdown to set the timebomb off in room 604
+ if (_globals[kTimebombStatus] == TIMEBOMB_ACTIVATED) {
+ int diff = _scene._frameStartTime - *((uint32 *)&_globals[kTimebombClock]);
+ if ((diff >= 0) && (diff <= 60)) {
+ *((uint32 *)&_globals[kTimebombTimer]) += diff;
+ } else {
+ ++*((uint32 *)&_globals[kTimebombTimer]);
+ }
+ *((uint32 *)&_globals[kTimebombClock]) = _scene._frameStartTime;
+ }
+}
+
} // End of namespace Nebular
} // End of namespace MADS
diff --git a/engines/mads/nebular/game_nebular.h b/engines/mads/nebular/game_nebular.h
index d3d908d153..5b88f631e3 100644
--- a/engines/mads/nebular/game_nebular.h
+++ b/engines/mads/nebular/game_nebular.h
@@ -66,6 +66,8 @@ public:
StoryMode _storyMode;
virtual void doObjectAction();
+
+ virtual void step();
};
diff --git a/engines/mads/nebular/globals_nebular.h b/engines/mads/nebular/globals_nebular.h
index 992e00ab72..14bb2fb5af 100644
--- a/engines/mads/nebular/globals_nebular.h
+++ b/engines/mads/nebular/globals_nebular.h
@@ -207,6 +207,8 @@ enum GlobalId {
/* Enums used for specific individual globals */
/* Section #1 */
+// Rex's sex/swimming state
+enum { REX_MALE = 0, REX_MALE_SWIMMER = 1, REX_FEMALE = 2 };
// State of Meteorologist in the outpost
enum { METEOROLOGIST_ABSENT = 0, METEOROLOGIST_PRESENT = 1, METEOROLOGIST_GONE = 2 };
diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp
index 99c6cf4103..da9341a71a 100644
--- a/engines/mads/nebular/nebular_scenes2.cpp
+++ b/engines/mads/nebular/nebular_scenes2.cpp
@@ -458,7 +458,7 @@ void Scene202::enter() {
void Scene202::setRandomKernelMessage() {
int vocabId = _vm->getRandomNumber(92, 96);
_scene->_kernelMessages.reset();
- _game._abortTimersMode2 = ABORTMODE_1;
+ _game._triggerSetupMode = KERNEL_TRIGGER_DAEMON;
_scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 70, 120, _game.getQuote(vocabId));
_activeMsgFl = true;
}
@@ -495,7 +495,7 @@ void Scene202::step() {
action->_activeAction._verbId = 3;
action->_activeAction._objectNameId = 39;
action->_activeAction._indirectObjectId = 438;
- _game._abortTimersMode2 = ABORTMODE_0;
+ _game._triggerSetupMode = KERNEL_TRIGGER_PARSER;
_scene->_sequences.addTimer(120, 2);
_globals._abortVal = -1;
} else if (_globals[kMeteorologistWatch] == 2) {