diff options
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r-- | engines/titanic/true_talk/tt_concept_node.cpp | 14 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_concept_node.h | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 30 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_sentence.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_sentence.h | 2 |
5 files changed, 60 insertions, 2 deletions
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp index a98200bce3..454ca59971 100644 --- a/engines/titanic/true_talk/tt_concept_node.cpp +++ b/engines/titanic/true_talk/tt_concept_node.cpp @@ -148,4 +148,18 @@ int TTconceptNode::changeConcept(int mode, TTconcept **conceptPP, int conceptInd } } +bool TTconceptNode::createConcept(int mode, int conceptIndex, TTword *word) { + TTconcept *newConcept = new TTconcept(word, ST_UNKNOWN_SCRIPT); + TTconcept **conceptPP = setConcept(conceptIndex, newConcept); + + if (mode == 0 || (mode == 1 && !*conceptPP)) { + delete *conceptPP; + *conceptPP = newConcept; + return false; + } else { + delete newConcept; + return true; + } +} + } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_concept_node.h b/engines/titanic/true_talk/tt_concept_node.h index 5e49e37abe..9a1c3a9912 100644 --- a/engines/titanic/true_talk/tt_concept_node.h +++ b/engines/titanic/true_talk/tt_concept_node.h @@ -60,10 +60,14 @@ public: TTconcept **setConcept(int conceptIndex, TTconcept *src); int replaceConcept(int mode, int conceptIndex, TTconcept *concept); int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex); + bool createConcept(int mode, int conceptIndex, TTword *word); int concept1WordId() const { return _concept1P ? _concept1P->getWordId() : 0; } + int concept5WordId() const { + return _concept5P ? _concept5P->getWordId() : 0; + } }; } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index c8bee25351..3741ab7e5f 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -791,9 +791,14 @@ int TTparser::considerRequests(TTword *word) { case SEEK_ACTOR: if (_sentenceConcept->_concept0P) { + if (_sentenceConcept->_concept0P->compareTo("?") && + _sentenceConcept->_concept1P->isWordId(113) && + word->_wordClass == WC_THING) { + // TODO + } - } - else { + + } else { } break; @@ -804,12 +809,33 @@ int TTparser::considerRequests(TTword *word) { case SEEK_FROM: case SEEK_TO_OVERRIDE: case SEEK_FROM_OVERRIDE: + if (_sentenceConcept->_concept4P) { + delete _sentenceConcept->_concept4P; + _sentenceConcept->_concept4P = nullptr; + } + + addNode(8); + flag = true; + break; + case SEEK_LOCATION: case SEEK_OWNERSHIP: case SEEK_STATE: case SEEK_MODIFIERS: case SEEK_NEW_FRAME: case SEEK_STATE_OBJECT: + if (!_sentenceConcept->_concept5P) { + addToConceptList(word); + } else if (_sentenceConcept->concept5WordId() == 113 || + _sentenceConcept->concept5WordId() == 112) { + _sentenceConcept->createConcept(1, 2, word); + } else { + addToConceptList(word); + } + + flag = true; + break; + case SET_ACTION: case SET_COLOR: case ACTOR_IS_TO: diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp index d269f41b0c..06ddb6b299 100644 --- a/engines/titanic/true_talk/tt_sentence.cpp +++ b/engines/titanic/true_talk/tt_sentence.cpp @@ -218,4 +218,16 @@ TTconcept *TTsentence::getFrameSlot(int conceptIndex, TTconceptNode *conceptNode return newConcept; } +int TTsentence::is18(int val, const TTconceptNode *node) const { + if (!node) + node = &_sentenceConcept; + return node->_field18 == val; +} + +int TTsentence::is1C(int val, const TTconceptNode *node) const { + if (!node) + node = &_sentenceConcept; + return node->_field1C == val; +} + } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h index 00f31b4f31..83416cbd49 100644 --- a/engines/titanic/true_talk/tt_sentence.h +++ b/engines/titanic/true_talk/tt_sentence.h @@ -80,6 +80,8 @@ public: return conceptNode ? conceptNode->get18() : 0; } int get58() const { return _field58; } + int is18(int val, const TTconceptNode *node) const; + int is1C(int val, const TTconceptNode *node) const; int getStatus() const { return _status; } |