aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2013-10-01 06:50:27 +0200
committerStrangerke2013-10-01 06:50:27 +0200
commit6c11712373c536a0a0e84c7e4f5d5f39ce79467e (patch)
tree1bff88ef848ab158efb88de945802ae81b162d56
parent9b8566ae18fcd1028f71f8f5d6a4498da1abc1e0 (diff)
downloadscummvm-rg350-6c11712373c536a0a0e84c7e4f5d5f39ce79467e.tar.gz
scummvm-rg350-6c11712373c536a0a0e84c7e4f5d5f39ce79467e.tar.bz2
scummvm-rg350-6c11712373c536a0a0e84c7e4f5d5f39ce79467e.zip
AVALANCHE: More refactoring
-rw-r--r--engines/avalanche/animation.h1
-rw-r--r--engines/avalanche/avalanche.h7
-rw-r--r--engines/avalanche/avalot.cpp8
-rw-r--r--engines/avalanche/parser.cpp19
-rw-r--r--engines/avalanche/parser.h2
5 files changed, 22 insertions, 15 deletions
diff --git a/engines/avalanche/animation.h b/engines/avalanche/animation.h
index 591e955e8f..d5d85106d8 100644
--- a/engines/avalanche/animation.h
+++ b/engines/avalanche/animation.h
@@ -141,6 +141,7 @@ public:
private:
Direction _direction; // The direction Avvy is currently facing.
Direction _oldDirection;
+ bool _arrowTriggered; // And has the arrow been triggered?
byte _geidaSpin, _geidaTime; // For the making "Geida dizzy" joke.
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index db4434a009..e9e764359e 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -256,9 +256,8 @@ public:
bool _showDebugLines;
byte _lineNum; // Number of lines.
LineType _lines[50]; // For Also.
- bool _dropsOk, _soundFx, _cheat;
- Common::String _mouseText;
- bool _weirdWord;
+ bool _dropsOk;
+ bool _cheat; // CHECKME: Currently unused
bool _letMeOut;
Common::String _scroll[15];
byte _scrollNum, _whichwas;
@@ -299,6 +298,7 @@ public:
bool _doingSpriteRun; // Only set to True if we're doing a sprite_run at this moment. This stops the trippancy system from moving any of the sprites.
bool _holdTheDawn; // If this is true, calling Dawn will do nothing. It's used, for example, at the start, to stop Load from dawning.
bool _isLoaded; // Is it a loaded gamestate?
+ bool _soundFx;
void handleKeyDown(Common::Event &event); // To replace Basher::keyboard_link() and Basher::typein().
void setup();
@@ -361,6 +361,7 @@ private:
byte _lastRoomNotMap;
bool _passedCwytalotInHerts; // Have you passed Cwytalot in Herts?
byte _roomCount[100]; // Add one to each every time you enter a room
+ Common::String _mouseText;
Common::File file;
Common::String readAlsoStringFromFile();
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index 922be91806..79f89535b3 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -421,12 +421,8 @@ void AvalancheEngine::callVerb(VerbCode id) {
"situations. However, at the moment there is nothing assigned to it. You may press alt-A to see " \
"what the current setting of this key is.");
_dialogs->displayText(tmpStr);
- } else {
- _weirdWord = false;
- _parser->_polite = true;
- _parser->_verb = id;
- _parser->doThat();
- }
+ } else
+ _parser->doVerb(id);
}
/**
diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp
index 658c8fef9a..2064fa7dec 100644
--- a/engines/avalanche/parser.cpp
+++ b/engines/avalanche/parser.cpp
@@ -50,7 +50,7 @@ void Parser::init() {
_inputText.clear();
_inputTextPos = 0;
- _vm->_weirdWord = false;
+ _weirdWord = false;
// Initailaze the vocabulary.
// Verbs: 1-49
@@ -712,7 +712,7 @@ void Parser::parse() {
// Are we being interrogated right now?
if (_vm->_interrogation > 0) {
storeInterrogation(_vm->_interrogation);
- _vm->_weirdWord = true;
+ _weirdWord = true;
return;
}
@@ -814,7 +814,7 @@ void Parser::parse() {
}
if (doPronouns()) {
- _vm->_weirdWord = true;
+ _weirdWord = true;
_thats = kNothing;
return;
}
@@ -869,9 +869,9 @@ void Parser::parse() {
if ((!unkString.empty()) && (_verb != kVerbCodeExam) && (_verb != kVerbCodeTalk) && (_verb != kVerbCodeSave) && (_verb != kVerbCodeLoad) && (_verb != kVerbCodeDir)) {
Common::String tmpStr = Common::String::format("Sorry, but I have no idea what \"%s\" means. Can you rephrase it?", unkString.c_str());
_vm->_dialogs->displayText(tmpStr);
- _vm->_weirdWord = true;
+ _weirdWord = true;
} else
- _vm->_weirdWord = false;
+ _weirdWord = false;
if (_thats.empty())
_thats = kNothing;
@@ -1590,7 +1590,7 @@ void Parser::doThat() {
return;
}
- if (_vm->_weirdWord)
+ if (_weirdWord)
return;
if (_thing < 200)
@@ -2351,6 +2351,13 @@ void Parser::verbOpt(byte verb, Common::String &answer, char &ansKey) {
}
}
+void Parser::doVerb(VerbCode id) {
+ _weirdWord = false;
+ _polite = true;
+ _verb = id;
+ doThat();
+}
+
void Parser::resetVariables() {
_wearing = 0;
_sworeNum = 0;
diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h
index f7d3eb1d3c..f20aa9015a 100644
--- a/engines/avalanche/parser.h
+++ b/engines/avalanche/parser.h
@@ -69,6 +69,7 @@ public:
byte _inputTextPos; // Original name: curpos
bool _quote; // 66 or 99 next?
bool _cursorState;
+ bool _weirdWord;
byte _wearing; // what you're wearing
@@ -89,6 +90,7 @@ public:
void cursorOff();
void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
int16 getPos(const Common::String &crit, const Common::String &src); // Returns the index of the first appearance of crit in src.
+ void doVerb(VerbCode id);
void resetVariables();
void synchronize(Common::Serializer &sz);