aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2014-09-18 08:34:47 +0200
committerStrangerke2014-09-18 08:34:47 +0200
commita597838490981e89ddefcc79fb21127044802b25 (patch)
treede682505420ca6c2f83e5026228c98788cbedac4
parent2afca5a06eafff24b2892c7270ab994b04ffb8d4 (diff)
downloadscummvm-rg350-a597838490981e89ddefcc79fb21127044802b25.tar.gz
scummvm-rg350-a597838490981e89ddefcc79fb21127044802b25.tar.bz2
scummvm-rg350-a597838490981e89ddefcc79fb21127044802b25.zip
ACCESS: Implement guard()
-rw-r--r--engines/access/amazon/amazon_scripts.cpp69
-rw-r--r--engines/access/amazon/amazon_scripts.h3
2 files changed, 71 insertions, 1 deletions
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index 8d63da2c8f..a932dad216 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -236,6 +236,73 @@ void AmazonScripts::mWhile(int param1) {
}
}
+void AmazonScripts::guardSee() {
+ warning("TODO: guardSee()");
+}
+
+void AmazonScripts::setGuardFrame() {
+ warning("TODO: setGuardFrame()");
+}
+
+void AmazonScripts::guard() {
+ if (_vm->_timers[8]._flag != 0)
+ return;
+
+ ++_vm->_timers[8]._flag;
+ ++_game->_guard._guardCel;
+ int curCel = _game->_guard._guardCel;
+
+ switch (_game->_guardLocation) {
+ case 1:
+ if (curCel <= 8 || curCel > 13)
+ _game->_guard._guardCel = curCel = 8;
+
+ _game->_guard._position.y = _vm->_player->_walkOffDown[curCel - 8];
+ guardSee();
+ if (_game->_guard._position.y >= 272) {
+ _game->_guard._position.y = 272;
+ _game->_guardLocation = 2;
+ }
+ break;
+ case 2:
+ if (curCel <= 43 || curCel > 48)
+ _game->_guard._guardCel = curCel = 43;
+
+ _game->_guard._position.x = _vm->_player->_walkOffLeft[curCel - 43];
+ guardSee();
+ if (_game->_guard._position.x <= 56) {
+ _game->_guard._position.x = 56;
+ _game->_guardLocation = 3;
+ }
+ break;
+ case 3:
+ if (curCel <= 0 || curCel > 5)
+ _game->_guard._guardCel = curCel = 0;
+
+ _game->_guard._position.y = _vm->_player->_walkOffUp[curCel];
+ guardSee();
+ if (_game->_guard._position.y <= 89) {
+ _game->_guard._position.y = 89;
+ _game->_guardLocation = 4;
+ warning("CHECME: unused flag121");
+ }
+ break;
+ default:
+ if (curCel <= 43 || curCel > 48)
+ _game->_guard._guardCel = curCel = 43;
+
+ _game->_guard._position.x = _vm->_player->_walkOffRight[curCel - 43];
+ guardSee();
+ if (_game->_guard._position.x >= 127) {
+ _game->_guard._position.x = 127;
+ _game->_guardLocation = 1;
+ }
+ break;
+ }
+
+ setGuardFrame();
+}
+
void AmazonScripts::loadBackground(int param1, int param2) {
_vm->_files->_loadPalFlag = false;
_vm->_files->loadScreen(param1, param2);
@@ -320,7 +387,7 @@ void AmazonScripts::executeSpecial(int commandIndex, int param1, int param2) {
mWhile(param1);
break;
case 9:
- warning("TODO GUARD");
+ guard();
break;
case 10:
warning("TODO NEWMUSIC");
diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h
index 7afa0ea577..50bd2ac9b1 100644
--- a/engines/access/amazon/amazon_scripts.h
+++ b/engines/access/amazon/amazon_scripts.h
@@ -43,6 +43,9 @@ protected:
void mWhile1();
void mWhile2();
void mWhile(int param1);
+ void guardSee();
+ void setGuardFrame();
+ void guard();
void loadBackground(int param1, int param2);
void plotInactive();
void setInactive();