aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-11-24 21:10:29 +0100
committerPaul Gilbert2014-12-12 22:43:03 -0500
commit51ccd0c1fbbb2065441e6c7fbbe7f6ec6c3c3e3e (patch)
tree2ab73f65bb44bb71c48b1cef30f1082ce3492f8e
parent0c4fdc6a4896a4690af45aa0aabe77d90fffcaaf (diff)
downloadscummvm-rg350-51ccd0c1fbbb2065441e6c7fbbe7f6ec6c3c3e3e.tar.gz
scummvm-rg350-51ccd0c1fbbb2065441e6c7fbbe7f6ec6c3c3e3e.tar.bz2
scummvm-rg350-51ccd0c1fbbb2065441e6c7fbbe7f6ec6c3c3e3e.zip
ACCESS: Implement moveCanoe
-rw-r--r--engines/access/amazon/amazon_resources.cpp7
-rw-r--r--engines/access/amazon/amazon_resources.h3
-rw-r--r--engines/access/amazon/amazon_scripts.cpp98
-rw-r--r--engines/access/amazon/amazon_scripts.h2
4 files changed, 103 insertions, 7 deletions
diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp
index 23929ef4ba..08b57957ec 100644
--- a/engines/access/amazon/amazon_resources.cpp
+++ b/engines/access/amazon/amazon_resources.cpp
@@ -1209,9 +1209,10 @@ const char *const NO_HELP_MESSAGE =
"WE ARE UNABLE TO PROVIDE YOU WITH ANY MORE HINTS. YOUR IQ \
HAS DECREASED SO FAR THAT WE CAN NO LONGER PUT THE HINTS IN TERMS \
YOU CAN UNDERSTAND.";
-const char *const NO_HINTS_MESSAGE =
- "THE HELP SYSTEM HAS BEEN TURNED OFF FOR THIS GAME.";
-
+const char *const NO_HINTS_MESSAGE = "THE HELP SYSTEM HAS BEEN TURNED OFF FOR THIS GAME.";
+const char *const HIT1 = "YOU HIT THE ROCKS AND THE CANOE BEGINS TO LEAK.";
+const char *const HIT2 = "YOU HIT THE ROCKS AND THE CANOE DEVELOPS SERIOUS LEAKS.";
+const char *const BAR_MESSAGE = "YOU ARE TOO BUSY TRYING TO KEEP FROM SINKING TO DO THAT";
const byte DEATH_SCREENS[58] = {
0, 1, 0, 0, 0, 0, 0, 0, 2, 0,
diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h
index 99ce40e965..65a38dc660 100644
--- a/engines/access/amazon/amazon_resources.h
+++ b/engines/access/amazon/amazon_resources.h
@@ -62,6 +62,9 @@ extern const byte FONT6x6_DATA[];
extern const char *const NO_HELP_MESSAGE;
extern const char *const NO_HINTS_MESSAGE;
+extern const char *const HIT1;
+extern const char *const HIT2;
+extern const char *const BAR_MESSAGE;
extern const byte DEATH_SCREENS[58];
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index 3f0e53e6df..5e53e0b946 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -22,6 +22,7 @@
#include "common/scummsys.h"
#include "access/access.h"
+#include "access/resources.h"
#include "access/amazon/amazon_game.h"
#include "access/amazon/amazon_resources.h"
#include "access/amazon/amazon_scripts.h"
@@ -1801,8 +1802,99 @@ void AmazonScripts::riverSound() {
_vm->_sound->playSound(1);
}
-void AmazonScripts::MOVECANOE() {
- warning("TODO: MOVECANOE();");
+void AmazonScripts::moveCanoe() {
+ if (_game->_canoeDir != 0) {
+ _game->_canoeYPos += _game->_canoeDir;
+ ++_game->_canoeMoveCount;
+ if (_game->_canoeMoveCount == 5) {
+ _game->_canoeLane += _game->_canoeDir;
+ _game->_canoeDir = 0;
+ }
+ return;
+ }
+
+ _vm->_events->pollEvents();
+ if (_vm->_events->_leftButton) {
+ Common::Point pt = _vm->_events->calcRawMouse();
+ if (pt.y < 180) {
+ if (_vm->_events->_mousePos.x < RMOUSE[8][0]) {
+ printString(BAR_MESSAGE);
+ return;
+ }
+ _game->_saveRiver = 1;
+ _vm->_rScrollRow = _vm->_screen->_scrollRow;
+ _vm->_rScrollCol = _vm->_screen->_scrollCol;
+ _vm->_rScrollX = _vm->_screen->_scrollX;
+ _vm->_rScrollY = _vm->_screen->_scrollY;
+ _vm->_rOldRectCount = _vm->_oldRects.size();
+ _vm->_rNewRectCount = _vm->_newRects.size();
+ // _vm->_rKeyFlag = KEYFLG;
+ _vm->_mapOffset = _game->_mapPtr - MAPTBL[_game->_riverFlag];
+ _vm->doLoadSave();
+ if (_vm->_room->_function == 1) {
+ _endFlag = true;
+ _returnCode = 0;
+ } else {
+ _game->_saveRiver = 0;
+ _vm->_room->buildScreen();
+ _vm->copyBF2Vid();
+ }
+ return;
+ }
+
+ if (pt.y <= _game->_canoeYPos) {
+ if (_game->_canoeLane == 0)
+ return;
+
+ _game->_canoeDir = -1;
+ _game->_canoeMoveCount = 0;
+ _game->_canoeYPos += _game->_canoeDir;
+ ++_game->_canoeMoveCount;
+ if (_game->_canoeMoveCount == 5) {
+ _game->_canoeLane += _game->_canoeDir;
+ _game->_canoeDir = 0;
+ }
+ } else {
+ if (_game->_canoeLane == 7)
+ return;
+
+ _game->_canoeDir = 1;
+ _game->_canoeMoveCount = 0;
+ _game->_canoeYPos += _game->_canoeDir;
+ ++_game->_canoeMoveCount;
+ if (_game->_canoeMoveCount == 5) {
+ _game->_canoeLane += _game->_canoeDir;
+ _game->_canoeDir = 0;
+ }
+ }
+ return;
+ }
+
+ if (_vm->_player->_move == UP) {
+ if (_game->_canoeLane == 0)
+ return;
+
+ _game->_canoeDir = -1;
+ _game->_canoeMoveCount = 0;
+ _game->_canoeYPos += _game->_canoeDir;
+ ++_game->_canoeMoveCount;
+ if (_game->_canoeMoveCount == 5) {
+ _game->_canoeLane += _game->_canoeDir;
+ _game->_canoeDir = 0;
+ }
+ } else if (_vm->_player->_move == DOWN) {
+ if (_game->_canoeLane == 7)
+ return;
+
+ _game->_canoeDir = 1;
+ _game->_canoeMoveCount = 0;
+ _game->_canoeYPos += _game->_canoeDir;
+ ++_game->_canoeMoveCount;
+ if (_game->_canoeMoveCount == 5) {
+ _game->_canoeLane += _game->_canoeDir;
+ _game->_canoeDir = 0;
+ }
+ }
}
void AmazonScripts::UPDATEOBSTACLES() {
@@ -1864,7 +1956,7 @@ void AmazonScripts::RIVER() {
riverSound();
pan();
- MOVECANOE();
+ moveCanoe();
if (_vm->_room->_function == 1) {
CHICKENOUTFLG = false;
diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h
index 1e3290e8e7..20fca8ea70 100644
--- a/engines/access/amazon/amazon_scripts.h
+++ b/engines/access/amazon/amazon_scripts.h
@@ -100,7 +100,7 @@ protected:
void checkRiverPan();
bool riverJumpTest();
void riverSound();
- void MOVECANOE();
+ void moveCanoe();
void UPDATEOBSTACLES();
void riverSetPhysX();
void RIVERCOLLIDE();