aboutsummaryrefslogtreecommitdiff
path: root/engines/access/amazon
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-17 23:04:05 -0400
committerPaul Gilbert2014-08-17 23:04:05 -0400
commitd31b27ba1b26a38401387f85ca2ce46be455d0a2 (patch)
tree1fc97c8c05c17a0033ae0a2ed021a23573476726 /engines/access/amazon
parent9150e1816c57e3852fd86123ba8e0d1c9dee8ff4 (diff)
downloadscummvm-rg350-d31b27ba1b26a38401387f85ca2ce46be455d0a2.tar.gz
scummvm-rg350-d31b27ba1b26a38401387f85ca2ce46be455d0a2.tar.bz2
scummvm-rg350-d31b27ba1b26a38401387f85ca2ce46be455d0a2.zip
ACCESS: Partially implement cmdHelp
Diffstat (limited to 'engines/access/amazon')
-rw-r--r--engines/access/amazon/amazon_game.cpp6
-rw-r--r--engines/access/amazon/amazon_game.h5
-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.cpp29
-rw-r--r--engines/access/amazon/amazon_scripts.h6
6 files changed, 52 insertions, 4 deletions
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index 663d6996d2..857d1b3551 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -51,7 +51,9 @@ AmazonEngine::AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc)
_rawInactiveX = 0;
_rawInactiveY = 0;
_inactiveYOff = 0;
+
Common::fill(&_esTabTable[0], &_esTabTable[100], 0);
+ _hintLevel = 0;
}
AmazonEngine::~AmazonEngine() {
@@ -182,6 +184,10 @@ void AmazonEngine::setupGame() {
_player->_playerY = _player->_rawPlayer.y = TRAVEL_POS[_player->_roomNumber][1];
}
+void AmazonEngine::drawHelp() {
+ error("TODO: drawHelp");
+}
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_game.h b/engines/access/amazon/amazon_game.h
index 848af85f30..c331830501 100644
--- a/engines/access/amazon/amazon_game.h
+++ b/engines/access/amazon/amazon_game.h
@@ -93,10 +93,15 @@ public:
int &_aniFlag;
int &_allenFlag;
int &_noSound;
+
+ // Other game specific fields
+ int _hintLevel;
public:
AmazonEngine(OSystem *syst, const AccessGameDescription *gameDesc);
virtual ~AmazonEngine();
+
+ void drawHelp();
};
} // End of namespace Amazon
diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp
index b7a2472a3c..1f666e1abb 100644
--- a/engines/access/amazon/amazon_resources.cpp
+++ b/engines/access/amazon/amazon_resources.cpp
@@ -1187,6 +1187,13 @@ const byte FONT6x6_DATA[] = {
0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4d, 0x4f, 0x56, 0x49,
};
+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.";
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h
index 838bd29b70..d618ca54c2 100644
--- a/engines/access/amazon/amazon_resources.h
+++ b/engines/access/amazon/amazon_resources.h
@@ -49,6 +49,9 @@ extern const int FONT6x6_INDEX[];
extern const byte FONT6x6_DATA[];
+extern const char *const NO_HELP_MESSAGE;
+extern const char *const NO_HINTS_MESSAGE;
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index 38cf9d6a84..104473ac7d 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -22,6 +22,8 @@
#include "common/scummsys.h"
#include "access/access.h"
+#include "access/amazon/amazon_game.h"
+#include "access/amazon/amazon_resources.h"
#include "access/amazon/amazon_scripts.h"
namespace Access {
@@ -29,6 +31,7 @@ namespace Access {
namespace Amazon {
AmazonScripts::AmazonScripts(AccessEngine *vm) : Scripts(vm) {
+ _game = (AmazonEngine *)_vm;
}
void AmazonScripts::executeSpecial(int commandIndex, int param1, int param2) {
@@ -75,7 +78,7 @@ typedef void(AmazonScripts::*AmazonScriptMethodPtr)();
void AmazonScripts::executeCommand(int commandIndex) {
static const AmazonScriptMethodPtr COMMAND_LIST[] = {
- &AmazonScripts::CMDHELP, &AmazonScripts::CMDCYCLEBACK,
+ &AmazonScripts::cmdHelp, &AmazonScripts::CMDCYCLEBACK,
&AmazonScripts::CMDCHAPTER, &AmazonScripts::cmdSetHelp,
&AmazonScripts::cmdCenterPanel, &AmazonScripts::cmdMainPanel,
&AmazonScripts::CMDRETFLASH
@@ -87,8 +90,28 @@ void AmazonScripts::executeCommand(int commandIndex) {
Scripts::executeCommand(commandIndex);
}
-void AmazonScripts::CMDHELP() {
- error("TODO CMDHELP");
+void AmazonScripts::cmdHelp() {
+ Common::String helpMessage = readString();
+
+ if (_game->_helpLevel == 0) {
+ _game->_timers.saveTimers();
+ _game->_useItem = 0;
+
+ if (_game->_noHints) {
+ printString(NO_HELP_MESSAGE);
+ return;
+ } else if (_game->_hintLevel == 0) {
+ printString(NO_HINTS_MESSAGE);
+ return;
+ }
+ }
+
+ int level = _game->_hintLevel - 1;
+ if (level < _game->_helpLevel)
+ _game->_moreHelp = 0;
+
+ _game->drawHelp();
+ error("TODO: more cmdHelp");
}
void AmazonScripts::CMDCYCLEBACK() {
diff --git a/engines/access/amazon/amazon_scripts.h b/engines/access/amazon/amazon_scripts.h
index c9a889e3ad..978ef0105c 100644
--- a/engines/access/amazon/amazon_scripts.h
+++ b/engines/access/amazon/amazon_scripts.h
@@ -30,12 +30,16 @@ namespace Access {
namespace Amazon {
+class AmazonEngine;
+
class AmazonScripts: public Scripts {
+private:
+ AmazonEngine *_game;
protected:
virtual void executeSpecial(int commandIndex, int param1, int param2);
virtual void executeCommand(int commandIndex);
- void CMDHELP();
+ void cmdHelp();
void CMDCYCLEBACK();
void CMDCHAPTER();
void cmdSetHelp();