aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-26 20:59:50 -0400
committerPaul Gilbert2016-07-15 19:15:43 -0400
commit35f18390636c74c35af55426d6f48d9db59707bd (patch)
tree07fb2fb825d8e5906aeaeca692eb512fc8a238df /engines/titanic/true_talk
parentf98ad3313499c8c6375f3216f5ae6ddb8faa3271 (diff)
downloadscummvm-rg350-35f18390636c74c35af55426d6f48d9db59707bd.tar.gz
scummvm-rg350-35f18390636c74c35af55426d6f48d9db59707bd.tar.bz2
scummvm-rg350-35f18390636c74c35af55426d6f48d9db59707bd.zip
TITANIC: More work on TTparser considerRequests
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp29
-rw-r--r--engines/titanic/true_talk/tt_sentence.cpp10
-rw-r--r--engines/titanic/true_talk/tt_sentence.h2
3 files changed, 33 insertions, 8 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index a0eb6a5e9a..cc3ee2fa51 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -819,6 +819,11 @@ int TTparser::considerRequests(TTword *word) {
break;
case SEEK_LOCATION:
+ addNode(5);
+ _sentenceConcept->createConcept(0, 5, word);
+ flag = true;
+ break;
+
case SEEK_OWNERSHIP:
case SEEK_STATE:
case SEEK_MODIFIERS:
@@ -837,15 +842,35 @@ int TTparser::considerRequests(TTword *word) {
break;
case SET_ACTION:
- case SET_COLOR:
+ if (_sentence->fn4(1, 104, _sentenceConcept) ||
+ _sentence->fn4(1, 107, _sentenceConcept)) {
+ concept = _sentenceConcept->_concept1P;
+ _sentenceConcept->_concept1P = nullptr;
+ addNode(15);
+ }
+
+ if (_sentence->check2C() && word->_id == 113)
+ addNode(4);
+
+ if (word->_wordClass == WC_ACTION)
+ _sentenceConcept->createConcept(0, 1, word);
+
+ flag = true;
+ break;
+
case ACTOR_IS_TO:
+ _sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 3);
+ flag = true;
+ break;
+
case ACTOR_IS_FROM:
+ _sentenceConcept->changeConcept(1, &_sentenceConcept->_concept0P, 4);
+ break;
case ACTOR_IS_OBJECT:
flag = resetConcept(&_sentenceConcept->_concept0P, 2);
break;
- case STATE_IDENTITY:
case WORD_TYPE_IS_SENTENCE_TYPE:
case COMPLEX_VERB:
// TODO
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 06ddb6b299..d619c9e2f3 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -186,16 +186,16 @@ exit:
return abortFlag;
}
-bool TTsentence::fn4(int mode, int wordId, TTconcept *concept) {
- if (!concept)
- return false;
+bool TTsentence::fn4(int mode, int wordId, TTconceptNode *node) {
+ if (!node)
+ node = &_sentenceConcept;
switch (mode) {
case 1:
- return _sentenceConcept._concept1P && _sentenceConcept._concept1P->getWordId() == wordId;
+ return node->_concept1P && node->_concept1P->getWordId() == wordId;
case 5:
- return _sentenceConcept._concept5P && _sentenceConcept._concept5P->getWordId() == wordId;
+ return node->_concept5P && node->_concept5P->getWordId() == wordId;
default:
return false;
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 83416cbd49..d168d48a61 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -95,7 +95,7 @@ public:
int storeVocabHit(TTword *word);
bool fn2(int conceptIndex, const TTstring &str, TTconceptNode *conceptNode);
- bool fn4(int mode, int wordId, TTconcept *concept);
+ bool fn4(int mode, int wordId, TTconceptNode *node);
};
} // End of namespace Titanic