Skip to content

Commit

Permalink
ACCESS: Implement moveCanoe
Browse files Browse the repository at this point in the history
  • Loading branch information
Strangerke authored and dreammaster committed Dec 13, 2014
1 parent 0c4fdc6 commit 51ccd0c
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 7 deletions.
7 changes: 4 additions & 3 deletions engines/access/amazon/amazon_resources.cpp
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions engines/access/amazon/amazon_resources.h
Expand Up @@ -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];

Expand Down
98 changes: 95 additions & 3 deletions engines/access/amazon/amazon_scripts.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -1864,7 +1956,7 @@ void AmazonScripts::RIVER() {

riverSound();
pan();
MOVECANOE();
moveCanoe();

if (_vm->_room->_function == 1) {
CHICKENOUTFLG = false;
Expand Down
2 changes: 1 addition & 1 deletion engines/access/amazon/amazon_scripts.h
Expand Up @@ -100,7 +100,7 @@ class AmazonScripts: public Scripts {
void checkRiverPan();
bool riverJumpTest();
void riverSound();
void MOVECANOE();
void moveCanoe();
void UPDATEOBSTACLES();
void riverSetPhysX();
void RIVERCOLLIDE();
Expand Down

0 comments on commit 51ccd0c

Please sign in to comment.