diff options
Diffstat (limited to 'engines/titanic/true_talk')
34 files changed, 117 insertions, 117 deletions
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp index b327c3647e..76f28540ea 100644 --- a/engines/titanic/true_talk/barbot_script.cpp +++ b/engines/titanic/true_talk/barbot_script.cpp @@ -107,7 +107,7 @@ int BarbotScript::chooseResponse(const TTroomScript *roomScript, const TTsentenc applyResponse(); return 2; - + } else if (tag == MKTAG('B', 'A', 'R', 'U') && getRandomNumber(100) > 50) { selectResponse(250025); switch (getDialsBitset()) { @@ -120,7 +120,7 @@ int BarbotScript::chooseResponse(const TTroomScript *roomScript, const TTsentenc } applyResponse(); - return 2; + return 2; } if (tag == MKTAG('T', 'H', 'R', 'T') || tag == MKTAG('S', 'L', 'O', 'W') || @@ -165,7 +165,7 @@ int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sent dialogueId = ARRAY2[_arrIndex++]; } else if (getRandomNumber(100) > 35) { dialogueId = ARRAY2[0]; - _arrIndex = 1; + _arrIndex = 1; } else if (getRandomNumber(100) > 60) { switch (sentence->_field2C) { case 2: @@ -204,7 +204,7 @@ int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sent CTrueTalkManager::setFlags(32, getValue(32) - 1); CTrueTalkManager::setFlags(33, getValue(33) - 1); CTrueTalkManager::setFlags(34, getValue(34) - 1); - + TTtreeResult treeResult; int val34 = getState(); setState(0); @@ -314,7 +314,7 @@ int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sent return applySentenceIds(50382); } else if (flag2) { return applySentenceIds(51423); - } + } // Deliberate fall-through case 16: @@ -523,7 +523,7 @@ int BarbotScript::process(const TTroomScript *roomScript, const TTsentence *sent CTrueTalkManager::triggerAction(30, 0); return 2; } - + return applySentenceIds(50320); case 58: if (val2C == 6 || val2C == 10) @@ -935,7 +935,7 @@ int BarbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence * break; case MKTAG('P', 'H', 'I', 'L'): case MKTAG('R', 'C', 'K', 'T'): - case MKTAG('S', 'C', 'I', 'E'): + case MKTAG('S', 'C', 'I', 'E'): tagId = MKTAG('S', 'C', 'I', 'E'); break; case MKTAG('T', 'R', 'A', '2'): @@ -1011,7 +1011,7 @@ uint BarbotScript::getDialsBitset() const { bits |= 2; if (!getDialRegion(2)) bits |= 4; - + return bits; } @@ -1098,7 +1098,7 @@ int BarbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScrip } break; } - + case 10: { uint val = CTrueTalkManager::getStateValue(3); bool bit0 = (val & 1) != 0; diff --git a/engines/titanic/true_talk/barbot_script.h b/engines/titanic/true_talk/barbot_script.h index 1820d77216..a8c92b2927 100644 --- a/engines/titanic/true_talk/barbot_script.h +++ b/engines/titanic/true_talk/barbot_script.h @@ -74,7 +74,7 @@ public: virtual int handleQuote(const TTroomScript *roomScript, const TTsentence *sentence, uint val, uint tagId, uint remainder); - + /** * Handles updating NPC state based on specified dialogue Ids and dial positions */ diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp index b773e8af30..038285ec8d 100644 --- a/engines/titanic/true_talk/bellbot_script.cpp +++ b/engines/titanic/true_talk/bellbot_script.cpp @@ -245,7 +245,7 @@ int BellbotScript::process(const TTroomScript *roomScript, const TTsentence *sen && sentence->localWord("we") && sentence->localWord("in")) || (sentence->_field2C == 3 && sentence->localWord("rom") && sentence->localWord("is") && sentence->localWord("this")) - ) { + ) { uint id = getRangeValue(getRoomDialogueId(roomScript)); addResponse(getDialogueId(id ? id : 201384)); applyResponse(); @@ -258,7 +258,7 @@ int BellbotScript::process(const TTroomScript *roomScript, const TTsentence *sen result = processEntries(&_sentences[2], 0, roomScript, sentence); } else if (getValue(1) == 1) { result = processEntries(&_sentences[3], 0, roomScript, sentence); - + if (sentence->contains("shrinkbot")) { addResponse(getDialogueId(200583)); applyResponse(); @@ -521,7 +521,7 @@ int BellbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence default: break; } - + return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder); } @@ -835,7 +835,7 @@ int BellbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * applyFlag = true; } break; - + case 5: if (sentence->_field2C == 11 || sentence->_field2C == 13) { addResponse(getDialogueId(200492)); @@ -1497,7 +1497,7 @@ stateFlag = false; case 84: if (sentence->_field2C == 12) { addResponse(getDialogueId(202119)); - + switch (getValue(1)) { case 1: addResponse(getDialogueId(202024)); @@ -1631,7 +1631,7 @@ bool BellbotScript::randomResponse1(const TTroomScript *roomScript, uint id) { randomResponse3(roomScript, id); applyResponse(); } - + return false; } @@ -1729,7 +1729,7 @@ bool BellbotScript::checkCommonWords(const TTroomScript *roomScript, const TTsen addResponse(getDialogueId(200847)); } else if (sentence->localWord("canal")) { addResponse(getDialogueId(getValue(1) == 1 ? 200846 : 200847)); - } else if (sentence->localWord("firstclass") && + } else if (sentence->localWord("firstclass") && (sentence->localWord("stateroom") || sentence->localWord("room"))) { addResponse(getDialogueId(getValue(1) == 1 ? 200840 : 200306)); } else if (sentence->localWord("secondclass") && sentence->localWord("stateroom") && sentence->localWord("room")) { @@ -1790,12 +1790,12 @@ bool BellbotScript::checkCommonWords(const TTroomScript *roomScript, const TTsen } else { addResponse(getDialogueId(200686)); } - } else if (sentence->localWord("embarklobby") + } else if (sentence->localWord("embarklobby") || sentence->localWord("lobby")) { addResponse(getDialogueId(200850)); } else if (sentence->localWord("pellerator")) { addResponse(getDialogueId(200862)); - } else if (sentence->localWord("servicelift") + } else if (sentence->localWord("servicelift") || (sentence->localWord("service") && sentence->localWord("elevator"))) { addResponse(getDialogueId(200855)); } else if (sentence->localWord("elevator")) { diff --git a/engines/titanic/true_talk/bellbot_script.h b/engines/titanic/true_talk/bellbot_script.h index 6f57ee718f..7edb182301 100644 --- a/engines/titanic/true_talk/bellbot_script.h +++ b/engines/titanic/true_talk/bellbot_script.h @@ -78,7 +78,7 @@ private: bool checkCommonWords(const TTroomScript *roomScript, const TTsentence *sentence); uint getRoomDialogueId(const TTroomScript *roomScript); - + /** * Adds a description of the room to the conversation response */ diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp index f3a997e218..4df47e0af1 100644 --- a/engines/titanic/true_talk/deskbot_script.cpp +++ b/engines/titanic/true_talk/deskbot_script.cpp @@ -276,7 +276,7 @@ int DeskbotScript::handleQuote(const TTroomScript *roomScript, const TTsentence default: break; } - + return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder); } @@ -324,7 +324,7 @@ int DeskbotScript::updateState(uint oldId, uint newId, int index) { newId = getStateDialogueId(); if (newId == 240464 && getValue(1) != 1) newId = 240462; - + if (newId == 241635 && isDial1Medium()) { addResponse(getDialogueId(241556)); newId = getRangeValue(241632); @@ -408,7 +408,7 @@ int DeskbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScri default: break; } - + return 0; } @@ -480,7 +480,7 @@ uint DeskbotScript::addAssignedRoomDialogue2() { void DeskbotScript::addAssignedRoomDialogue3() { addResponse(getDialogueId(241513)); addResponse(getDialogueId(241510)); - + CTrueTalkManager::setFlags(1, 2); setDialRegion(0, 0); setDialRegion(1, 0); @@ -618,7 +618,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * if (isDial1Low() && getValue(1) == 4) { if (sentence->_field2C == 12 || sentence->_field2C == 13 || sentence->contains("do not")) { - + addResponse(getDialogueId(240447)); setDialRegion(0, 0); setDialRegion(1, 0); @@ -1148,7 +1148,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * addResponse(getDialogueId(241267)); break; } - + add241716(); applyFlag = true; stateFlag = false; @@ -1223,7 +1223,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * addResponse(getDialogueId(241711)); } - + applyFlag = true; stateFlag = false; break; @@ -1244,7 +1244,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * } } - + applyFlag = true; stateFlag = false; break; @@ -1254,7 +1254,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * || sentence->contains("balcony") || sentence->contains("neither") || sentence->contains("the 1") || sentence->contains("the 2") || sentence->contains("former") || sentence->contains("latter") - || sentence->contains("either")) { + || sentence->contains("either")) { addResponse(getDialogueId(241700)); addResponse(getDialogueId(241687)); } else { @@ -1299,7 +1299,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * || sentence->contains("princess") || sentence->contains("small") || sentence->contains("the 1") || sentence->contains("the 2") || sentence->contains("the 3") || sentence->contains("the 4") - || sentence->contains("big") || sentence->contains("large")) { + || sentence->contains("big") || sentence->contains("large")) { addResponse(getDialogueId(241700)); addResponse(getDialogueId(241739)); } else { @@ -1317,7 +1317,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * if (sentence->contains("constitutional") || sentence->contains("const") || sentence->contains("absolute") || sentence->contains("small") || sentence->contains("the 1") || sentence->contains("the 2") - || sentence->contains("big") || sentence->contains("large")) { + || sentence->contains("big") || sentence->contains("large")) { addResponse(getDialogueId(241700)); addResponse(getDialogueId(241739)); } else { @@ -1334,7 +1334,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * case 91: if (sentence->contains("benev") || sentence->contains("dict") || sentence->contains("small") || sentence->contains("the 1") - || sentence->contains("the 2") || sentence->contains("big") + || sentence->contains("the 2") || sentence->contains("big") || sentence->contains("large") || sentence->contains("former") || sentence->contains("latter")) { addResponse(getDialogueId(241700)); @@ -1384,7 +1384,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * || sentence->contains("suite") || sentence->contains("next door") || sentence->contains("the 1") || sentence->contains("the 2") || sentence->contains("former") || sentence->contains("latter") - || sentence->contains("same room")) { + || sentence->contains("same room")) { addAssignedRoom(); setState(0); CTrueTalkManager::setFlags(17, 0); @@ -1424,7 +1424,7 @@ int DeskbotScript::preprocess(const TTroomScript *roomScript, const TTsentence * stateFlag = false; } break; - + default: break; } diff --git a/engines/titanic/true_talk/dialogue_file.cpp b/engines/titanic/true_talk/dialogue_file.cpp index cbd3685315..e5438c5825 100644 --- a/engines/titanic/true_talk/dialogue_file.cpp +++ b/engines/titanic/true_talk/dialogue_file.cpp @@ -34,7 +34,7 @@ void DialogueIndexEntry::load(Common::SeekableReadStream &s) { CDialogueFile::CDialogueFile(const CString &filename, uint count) { if (!_file.open(filename)) error("Could not locate dialogue file - %s", filename.c_str()); - + _cache.resize(count); _file.readUint32LE(); // Skip over file Id diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp index 1ca1ab13e5..5c7403f187 100644 --- a/engines/titanic/true_talk/doorbot_script.cpp +++ b/engines/titanic/true_talk/doorbot_script.cpp @@ -70,7 +70,7 @@ void DoorbotScript::setupSentences() { _mappings.load("Mappings/Doorbot", 4); _entries.load("Sentences/Doorbot"); - + static const int SENTENCE_NUMS[11] = { 2, 100, 101, 102, 107, 110, 111, 124, 129, 131, 132 }; @@ -364,7 +364,7 @@ int DoorbotScript::process(const TTroomScript *roomScript, const TTsentence *sen case 32: return setResponse(10110, 0); - + case 33: if (sentence->contains("sieve") || sentence->contains("colander") || sentence->contains("vegetable") || sentence->contains("ground") @@ -497,7 +497,7 @@ int DoorbotScript::process(const TTroomScript *roomScript, const TTsentence *sen return setResponse(getDialogueId(220000)); break; } - + return 2; } @@ -672,7 +672,7 @@ int DoorbotScript::updateState(uint oldId, uint newId, int index) { bool flag39 = getValue(39) != 0; CTrueTalkManager::setFlags(38, 0); CTrueTalkManager::setFlags(39, 0); - + if (newId > 220890) { switch (newId) { case 221064: @@ -897,7 +897,7 @@ int DoorbotScript::doSentenceEntry(int val1, const int *srcIdP, const TTroomScri case 29: if (sentence->localWord("another") || sentence->localWord("more") || sentence->localWord("additional") || sentence->contains("another") || - sentence->contains("more") || sentence->contains("additional")) { + sentence->contains("more") || sentence->contains("additional")) { addResponse(getDialogueId(220058)); applyResponse(); return 2; diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp index e0636d045f..e902169ed0 100644 --- a/engines/titanic/true_talk/maitred_script.cpp +++ b/engines/titanic/true_talk/maitred_script.cpp @@ -106,7 +106,7 @@ int MaitreDScript::process(const TTroomScript *roomScript, const TTsentence *sen applyResponse(); } - return 2; + return 2; } if (++_answerCtr > 50 || sentence->localWord("stop") || sentence->localWord("enough") diff --git a/engines/titanic/true_talk/parrot_script.h b/engines/titanic/true_talk/parrot_script.h index ec7bec7629..530eed09fd 100644 --- a/engines/titanic/true_talk/parrot_script.h +++ b/engines/titanic/true_talk/parrot_script.h @@ -32,7 +32,7 @@ private: /** * Setup sentence data */ - void setupSentences(); + void setupSentences(); public: ParrotScript(int val1, const char *charClass, int v2, const char *charName, int v3, int val2, int v4, int v5, int v6, int v7); diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp index 2741e6b640..802e2b4ba6 100644 --- a/engines/titanic/true_talk/script_handler.cpp +++ b/engines/titanic/true_talk/script_handler.cpp @@ -78,7 +78,7 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip const TTstring &line) { if (!roomScript || !line.isValid()) return SS_5; - + TTsentence *sentence = new TTsentence(_inputCtr++, line, this, roomScript, npcScript); int result = _parser.preprocess(sentence); roomScript->scriptPreprocess(sentence); diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h index 01aa2ef1c5..e28eeed1ac 100644 --- a/engines/titanic/true_talk/script_handler.h +++ b/engines/titanic/true_talk/script_handler.h @@ -58,7 +58,7 @@ public: /** * Set the character and room */ - ScriptChangedResult scriptChanged(TTroomScript *roomScript, + ScriptChangedResult scriptChanged(TTroomScript *roomScript, TTnpcScript *npcScript, uint dialogueId); int processInput(TTroomScript *roomScript, TTnpcScript *npcScript, diff --git a/engines/titanic/true_talk/script_support.cpp b/engines/titanic/true_talk/script_support.cpp index c24e275827..14560e2d9f 100644 --- a/engines/titanic/true_talk/script_support.cpp +++ b/engines/titanic/true_talk/script_support.cpp @@ -36,7 +36,7 @@ int TTnpcScriptResponse::size() const { /*------------------------------------------------------------------------*/ -TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values, +TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values, bool isRandom, bool isSequential) : _id(id), _nextP(nullptr) { _mode = SF_NONE; diff --git a/engines/titanic/true_talk/script_support.h b/engines/titanic/true_talk/script_support.h index a41673bd5c..bdaec6e7c9 100644 --- a/engines/titanic/true_talk/script_support.h +++ b/engines/titanic/true_talk/script_support.h @@ -55,7 +55,7 @@ struct TTscriptRange { TTscriptRange() : _id(0), _nextP(nullptr), _priorIndex(0), _mode(SF_NONE) {} - TTscriptRange(uint id, const Common::Array<uint> &values, bool isRandom, + TTscriptRange(uint id, const Common::Array<uint> &values, bool isRandom, bool isSequential); }; diff --git a/engines/titanic/true_talk/succubus_script.h b/engines/titanic/true_talk/succubus_script.h index d5cea7e66f..782e3eeb04 100644 --- a/engines/titanic/true_talk/succubus_script.h +++ b/engines/titanic/true_talk/succubus_script.h @@ -34,7 +34,7 @@ private: /** * Setup sentence data */ - void setupSentences(); + void setupSentences(); /** * Add a response and optionally set the state diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp index be9ca667de..ed45ab26a0 100644 --- a/engines/titanic/true_talk/true_talk_manager.cpp +++ b/engines/titanic/true_talk/true_talk_manager.cpp @@ -45,7 +45,7 @@ CTrueTalkNPC *CTrueTalkManager::_currentNPC; /*------------------------------------------------------------------------*/ -CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : +CTrueTalkManager::CTrueTalkManager(CGameManager *owner) : _gameManager(owner), _scripts(&_titleEngine), _currentCharId(0), _dialogueFile(nullptr), _dialogueId(0) { _titleEngine.setup(3, 3); @@ -209,7 +209,7 @@ void CTrueTalkManager::preLoad() { void CTrueTalkManager::removeCompleted() { for (TTtalkerList::iterator i = _talkers.begin(); i != _talkers.end(); ) { TTtalker *talker = *i; - + if (talker->_done) { i = _talkers.erase(i); delete talker; @@ -222,7 +222,7 @@ void CTrueTalkManager::removeCompleted() { void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) { TTnpcScript *npcScript = getNpcScript(npc); TTroomScript *roomScript = getRoomScript(); - + _titleEngine.reset(); uint charId = npcScript->charId(); loadAssets(npc, charId); @@ -337,7 +337,7 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView loadAssets(npc, npcScript->charId()); setDialogue(npc, roomScript, view); } - + _currentNPC = nullptr; } @@ -376,7 +376,7 @@ CString CTrueTalkManager::readDialogueString() { size_t entrySize = textRes->size(); byte *tempBuffer = (entrySize < STRING_BUFFER_SIZE) ? buffer : new byte[entrySize + 1]; - + _dialogueFile->read(textRes, tempBuffer, entrySize); buffer[entrySize] = '\0'; @@ -406,7 +406,7 @@ uint CTrueTalkManager::readDialogueSpeech() { for (uint idx = 0; idx < _titleEngine._indexes.size(); ++idx) { CWaveFile *waveFile = _gameManager->_sound.getTrueTalkSound( _dialogueFile, _titleEngine._indexes[idx] - _dialogueId); - if (waveFile) { + if (waveFile) { _speechDuration += waveFile->getDuration(); } } diff --git a/engines/titanic/true_talk/tt_action.h b/engines/titanic/true_talk/tt_action.h index 29e2bc4e4a..c6f49af16d 100644 --- a/engines/titanic/true_talk/tt_action.h +++ b/engines/titanic/true_talk/tt_action.h @@ -29,7 +29,7 @@ namespace Titanic { class TTaction : public TTmajorWord { private: - static bool _staticFlag; + static bool _staticFlag; protected: int _field30; public: diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp index c614e14dae..3c52c9f13b 100644 --- a/engines/titanic/true_talk/tt_concept.cpp +++ b/engines/titanic/true_talk/tt_concept.cpp @@ -27,7 +27,7 @@ namespace Titanic { -TTconcept::TTconcept() : _string1(" "), _string2(" "), +TTconcept::TTconcept() : _string1(" "), _string2(" "), _scriptP(nullptr), _wordP(nullptr) { if (setStatus()) setScriptType(ST_UNKNOWN_SCRIPT); @@ -51,7 +51,7 @@ TTconcept::TTconcept(TTscriptBase *script, ScriptType scriptType) : TTconcept::TTconcept(TTword *word, ScriptType scriptType) : _string1(" "), _string2(" "), _wordP(nullptr), _scriptP(nullptr) { - + if (!word || !setStatus() || word->getStatus()) { _status = SS_5; } else { @@ -74,7 +74,7 @@ TTconcept::TTconcept(TTconcept &src) : if (setStatus()) { _status = SS_VALID; _scriptP = src._scriptP; - + if (src._wordP) { _status = initializeWordRef(src._wordP); initialize(src); @@ -177,7 +177,7 @@ void TTconcept::initialize(TTconcept &src) { _field30 = src._field30; _field34 = src._field34; - + if (src._flag) { g_vm->_exeResources._owner->setParserConcept(this, &src); src.setFlag(true); @@ -225,7 +225,7 @@ int TTconcept::setOwner(TTconcept *src) { int TTconcept::setOwner(TTword *src, bool dontDup) { TTword *word = dontDup ? src : src->copy(); - + if (word) { if (!_word2P) { _word2P = word; diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h index 88afb6f28b..430b3b6a8c 100644 --- a/engines/titanic/true_talk/tt_concept.h +++ b/engines/titanic/true_talk/tt_concept.h @@ -125,8 +125,8 @@ public: /** * Returns true if the word is of the specified class */ - bool isWordClass(WordClass wordClass) const { - return _wordP && _wordP->isClass(wordClass); + bool isWordClass(WordClass wordClass) const { + return _wordP && _wordP->isClass(wordClass); } void setFlag(bool val) { _flag = val; } diff --git a/engines/titanic/true_talk/tt_node.cpp b/engines/titanic/true_talk/tt_node.cpp index cbbb1dd756..fece3b8889 100644 --- a/engines/titanic/true_talk/tt_node.cpp +++ b/engines/titanic/true_talk/tt_node.cpp @@ -78,7 +78,7 @@ TTnode *TTnode::getHead() { TTnode *TTnode::getTail() { if (_nextP == nullptr) return this; - + TTnode *node = _nextP; while (node->_nextP) node = node->_nextP; diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h index b9afdfad8a..bdca568b09 100644 --- a/engines/titanic/true_talk/tt_npc_script.h +++ b/engines/titanic/true_talk/tt_npc_script.h @@ -259,7 +259,7 @@ public: * and adds it to the response */ virtual void selectResponse(int id); - + /** * Handles scanning the word list for a given Id, and if * found adds it to the sentence concept list @@ -275,7 +275,7 @@ public: * either a random value, or each value in turn */ virtual uint getRangeValue(uint id); - + /** * Resets the prior used index for the specified range */ @@ -295,7 +295,7 @@ public: * Returns a bitset of the dials being off or not */ virtual uint getDialsBitset() const { return 0; } - + virtual const TTscriptMapping *getMapping(int index); virtual int doSentenceEntry(int val1, const int *srcIdP, const TTroomScript *roomScript, const TTsentence *sentence); @@ -303,7 +303,7 @@ public: * Handles any post-response NPC processing */ virtual void postResponse(int v1, const TTsentenceEntry *entry, const TTroomScript *roomScript, const TTsentence *sentence) {} - + virtual void save(SimpleFile *file); virtual void load(SimpleFile *file); virtual void saveBody(SimpleFile *file); @@ -337,7 +337,7 @@ public: * Handles a randomzied response */ virtual bool randomResponse(uint index); - + virtual uint translateId(uint id) const; void preLoad(); diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index 95a302d53c..d67f5235c4 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -147,16 +147,16 @@ int TTparser::normalize(TTsentence *sentence) { case '!': sentence->set38(3); break; - + case '\'': if (!normalizeContraction(srcLine, index, *destLine)) flag = true; break; - + case '.': sentence->set38(1); break; - + case ':': commandVal = isEmoticon(srcLine, index); if (commandVal) { @@ -166,7 +166,7 @@ int TTparser::normalize(TTsentence *sentence) { flag = true; } break; - + case ';': commandVal = isEmoticon(srcLine, index); if (commandVal == 6) { @@ -177,7 +177,7 @@ int TTparser::normalize(TTsentence *sentence) { index += 2; } break; - + case '<': ++index; commandVal = isEmoticon(srcLine, index); @@ -315,7 +315,7 @@ bool TTparser::normalizeContraction(const TTstring &srcLine, int srcIndex, TTstr destLine.deleteLastChar(); destLine.deleteLastChar(); destLine += "m"; - } else if (srcLine.hasSuffix(" sha") || + } else if (srcLine.hasSuffix(" sha") || (srcIndex == 4 && srcLine.hasSuffix("sha"))) { // shan't -> shall not destLine.deleteLastChar(); @@ -726,7 +726,7 @@ int TTparser::loadRequests(TTword *word) { int TTparser::considerRequests(TTword *word) { if (!_nodesP || !word) return 0; - + TTconcept *concept = nullptr; int status = 0; bool flag = false; @@ -802,7 +802,7 @@ int TTparser::considerRequests(TTword *word) { } else { status = _sentenceConcept->createConcept(0, 2, word); } - + if (!status && !_sentenceConcept->_concept4P && _sentenceConcept->_concept0P) { TTconcept *oldConcept = _sentenceConcept->_concept2P; flag = filterConcepts(5, 2); @@ -814,14 +814,14 @@ int TTparser::considerRequests(TTword *word) { } } break; - + case SEEK_OBJECT_OVERRIDE: if ((word->_wordClass == WC_THING || word->_wordClass == WC_PRONOUN) && _sentence->fn2(2, TTstring("thePlayer"), _sentenceConcept) && !_sentenceConcept->_concept3P) { _sentenceConcept->_concept3P = _sentenceConcept->_concept2P; _sentenceConcept->_concept2P = nullptr; - + flag = filterConcepts(5, 2); if (!flag) { status = _sentenceConcept->createConcept(0, 2, word); @@ -893,7 +893,7 @@ int TTparser::considerRequests(TTword *word) { if (word->_id == 601) { if (_conceptP->findByWordClass(WC_THING)) status = _conceptP->setOwner(word, false); - + flag = true; } break; @@ -992,11 +992,11 @@ int TTparser::considerRequests(TTword *word) { oldNode->_field1C = 2; _sentenceConcept = oldNode->addSibling(); concept = nullptr; - + _sentenceConcept->_concept1P = oldNode->_concept1P; _sentenceConcept->_concept5P = oldNode->_concept5P; _sentenceConcept->_concept2P = oldNode->_concept2P; - + if (seekVal) { seekVal = 0; @@ -1107,7 +1107,7 @@ int TTparser::considerRequests(TTword *word) { if (!_sentenceConcept->_concept0P) { newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0); newConceptP = new TTconcept(newPictP); - + _sentenceConcept->_concept0P = newConceptP; delete newPictP; addNode(4); @@ -1195,7 +1195,7 @@ int TTparser::considerRequests(TTword *word) { case MKTAG('H', 'E', 'L', 'P'): if (_sentence->_field2C == 1) _sentence->_field2C = 18; - + flag = true; break; @@ -1273,7 +1273,7 @@ int TTparser::considerRequests(TTword *word) { break; } - TTparserNode *nextP = dynamic_cast<TTparserNode *>(nodeP->_nextP); + TTparserNode *nextP = dynamic_cast<TTparserNode *>(nodeP->_nextP); if (flag) delete nodeP; nodeP = nextP; @@ -1288,7 +1288,7 @@ int TTparser::processRequests(TTword *word) { switch (status) { case 0: status = considerRequests(word); - + // Iterate through the words while (_currentWordP) { considerRequests(_currentWordP); @@ -1388,7 +1388,7 @@ int TTparser::checkForAction() { if (_conceptP && _currentWordP) { // Firstly we need to get the next word to process, and remove it from // the list pointed to by _currentWordP - TTword *word = _currentWordP; + TTword *word = _currentWordP; if (word->_nextP) { // Chain of words, so we need to find the last word of the chain, // and set the last-but-one's _nextP to nullptr to detach the last one @@ -1410,7 +1410,7 @@ int TTparser::checkForAction() { word->_text == "done") { TTstring doStr("do"); TTaction *action = new TTaction(doStr, WC_ACTION, 112, 0, _sentenceConcept->get18()); - + if (!action->isValid()) { status = SS_4; } else { diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h index 201de7eb0e..5fd997a985 100644 --- a/engines/titanic/true_talk/tt_parser.h +++ b/engines/titanic/true_talk/tt_parser.h @@ -90,7 +90,7 @@ private: * spaces and lowercasing everything */ int normalize(TTsentence *sentence); - + /** * Submethod called by normalize to handle expanding contacted word pairs * like can't, should've, and so on. @@ -118,7 +118,7 @@ private: * @param startIndex Starting index in the start to check * @param strings List of strings to check for. Strings come in pairs, with the * first being the string to match, and the second the replacement - * @returns Index of the start of the following word + * @returns Index of the start of the following word */ static int searchAndReplace(TTstring &line, int startIndex, const StringArray &strings); diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h index 18cb88278f..988f2a7437 100644 --- a/engines/titanic/true_talk/tt_picture.h +++ b/engines/titanic/true_talk/tt_picture.h @@ -53,7 +53,7 @@ public: * Checks whether the word's tag is a known type */ virtual bool checkTag() const; - + /** * Compare the word's tag to a given tag value */ @@ -63,7 +63,7 @@ public: * Return the tag associated with the word */ virtual uint getTag() const; - + virtual bool proc9(int val) const; virtual int proc10() const; diff --git a/engines/titanic/true_talk/tt_pronoun.h b/engines/titanic/true_talk/tt_pronoun.h index ccc077152c..f7d61780fa 100644 --- a/engines/titanic/true_talk/tt_pronoun.h +++ b/engines/titanic/true_talk/tt_pronoun.h @@ -29,7 +29,7 @@ namespace Titanic { class TTpronoun : public TTmajorWord { private: - static bool _staticFlag; + static bool _staticFlag; protected: int _field30; public: @@ -48,7 +48,7 @@ public: */ virtual TTword *copy() const; - virtual bool comparePronounTo(int val) const { + virtual bool comparePronounTo(int val) const { return _field30 == val; } diff --git a/engines/titanic/true_talk/tt_quotes_tree.cpp b/engines/titanic/true_talk/tt_quotes_tree.cpp index 1f073b83f2..16453a10ae 100644 --- a/engines/titanic/true_talk/tt_quotes_tree.cpp +++ b/engines/titanic/true_talk/tt_quotes_tree.cpp @@ -33,12 +33,12 @@ static uint TABLE_INDEXES[3] = { 922, 1015, 1018 }; void TTquotesTree::load() { Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/TREE"); - + for (int idx = 0; idx < QUOTES_TREE_COUNT; ++idx) { TTquotesTreeEntry &rec = _entries[idx]; assert(r->pos() < r->size()); - - rec._id = r->readUint32LE(); + + rec._id = r->readUint32LE(); if (rec._id == 0) { // Nothing needed } else { @@ -64,14 +64,14 @@ int TTquotesTree::search(const char *str, QuoteTreeNum treeNum, const TTquotesTreeEntry *bTree = &_entries[TABLE_INDEXES[treeNum]]; if (!search1(&str, bTree, buffer, tagId) || !buffer->_treeItemP) return -1; - + if (remainder) { while (*str) { if (*str >= 'a' && *str != 's') *remainder += *str; } } - + return buffer->_treeItemP->_id & 0xffffff; } @@ -83,7 +83,7 @@ bool TTquotesTree::search1(const char **str, const TTquotesTreeEntry *bTree, const char *strP = *str; bool flag = false; - for (uint mode = bTree->_id >> 24; mode != 0; + for (uint mode = bTree->_id >> 24; mode != 0; ++bTree, mode = bTree->_id >> 24) { switch (mode) { @@ -91,11 +91,11 @@ bool TTquotesTree::search1(const char **str, const TTquotesTreeEntry *bTree, if (compareWord(str, bTree->_string.c_str())) flag = true; break; - + case 2: compareWord(str, bTree->_string.c_str()); break; - + case 5: if (READ_LE_UINT32(bTree->_string.c_str()) == tagId) flag = true; diff --git a/engines/titanic/true_talk/tt_response.cpp b/engines/titanic/true_talk/tt_response.cpp index f007f98f97..1c784ad320 100644 --- a/engines/titanic/true_talk/tt_response.cpp +++ b/engines/titanic/true_talk/tt_response.cpp @@ -32,7 +32,7 @@ TTresponse::TTresponse(int dialogueId, int val2) : _field0(val2), _text(" "), _dialogueId(dialogueId), _nextP(nullptr), _linkP(nullptr) { } -TTresponse::TTresponse(const TTresponse *src) : _field0(src->_field0), +TTresponse::TTresponse(const TTresponse *src) : _field0(src->_field0), _text(src->_text), _dialogueId(src->_dialogueId), _nextP(src->_nextP), _linkP(src->_linkP) { } @@ -52,7 +52,7 @@ TTresponse::~TTresponse() { TTresponse *TTresponse::copyChain() const { TTresponse *returnResponseP = new TTresponse(this); - for (TTresponse *srcP = _nextP, *destP = returnResponseP; + for (TTresponse *srcP = _nextP, *destP = returnResponseP; srcP; srcP = srcP->_nextP, destP = destP->_nextP) { destP->_nextP = new TTresponse(*srcP); } diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp index a49a5a5bd1..9b7be0a976 100644 --- a/engines/titanic/true_talk/tt_room_script.cpp +++ b/engines/titanic/true_talk/tt_room_script.cpp @@ -49,7 +49,7 @@ void TTroomScript::proc9(int v) { ScriptChangedResult TTroomScript::scriptChanged(TTscriptBase *npcScript, int id) { if (id == 1) _field54 = 1; - + return SCR_1; } diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h index 39a50ac30d..0f47830a12 100644 --- a/engines/titanic/true_talk/tt_room_script.h +++ b/engines/titanic/true_talk/tt_room_script.h @@ -49,12 +49,12 @@ public: virtual bool proc8() const = 0; virtual void proc9(int v) = 0; - + /** * Called when the script changes */ virtual ScriptChangedResult scriptChanged(TTscriptBase *npcScript, int id) = 0; - + virtual bool proc11() const = 0; }; diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h index 869b0beb64..30a296a444 100644 --- a/engines/titanic/true_talk/tt_script_base.h +++ b/engines/titanic/true_talk/tt_script_base.h @@ -60,7 +60,7 @@ protected: * Delete any responses set up for the script */ void deleteResponses(); - + /** * Creates and appends a new response fragment to the script specified by * the given conversation Id @@ -83,7 +83,7 @@ protected: * Set the script state */ void setState(int state) { _state = state; } - + /** * Get the current state */ diff --git a/engines/titanic/true_talk/tt_scripts.cpp b/engines/titanic/true_talk/tt_scripts.cpp index f8ea65a475..4c01fd1ead 100644 --- a/engines/titanic/true_talk/tt_scripts.cpp +++ b/engines/titanic/true_talk/tt_scripts.cpp @@ -32,7 +32,7 @@ #include "titanic/true_talk/succubus_script.h" namespace Titanic { - + TTnpcScript *TTnpcScriptList::findById(int charId) const { for (TTnpcScriptList::const_iterator i = begin(); i != end(); ++i) { const TTnpcScriptListItem *item = *i; diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h index 5b12d93418..69a94f6bf6 100644 --- a/engines/titanic/true_talk/tt_string.h +++ b/engines/titanic/true_talk/tt_string.h @@ -39,7 +39,7 @@ struct TTstringData { }; enum TTstringStatus { - SS_VALID = 0, SS_1 = 1, SS_2 = 2, SS_3 = 3, SS_4 = 4, + SS_VALID = 0, SS_1 = 1, SS_2 = 2, SS_3 = 3, SS_4 = 4, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 }; @@ -127,7 +127,7 @@ public: * Get a char * pointer to the string data */ const char *c_str() const { return _data->_string.c_str(); } - + /** * Automatic operator to convert to a const char * */ diff --git a/engines/titanic/true_talk/tt_synonym.cpp b/engines/titanic/true_talk/tt_synonym.cpp index b476efefcb..bb78e734ca 100644 --- a/engines/titanic/true_talk/tt_synonym.cpp +++ b/engines/titanic/true_talk/tt_synonym.cpp @@ -24,7 +24,7 @@ namespace Titanic { -TTsynonym::TTsynonym() : TTstringNode(), _file(HANDLE_STDIN), +TTsynonym::TTsynonym() : TTstringNode(), _file(HANDLE_STDIN), _mode(0), _field1C(0) { } @@ -72,7 +72,7 @@ int TTsynonym::save(SimpleFile *file) { } file->writeFormat("%c", ' '); - + if (synP->_file) { file->writeFormat("%2.0d", synP->_file); } else { diff --git a/engines/titanic/true_talk/tt_title_script.cpp b/engines/titanic/true_talk/tt_title_script.cpp index 85b56d0e1e..2effb96cc7 100644 --- a/engines/titanic/true_talk/tt_title_script.cpp +++ b/engines/titanic/true_talk/tt_title_script.cpp @@ -25,7 +25,7 @@ namespace Titanic { TTTitleScript::TTTitleScript() : TTscriptBase(1, "", 0, "", 0, -1, -1, -1, 0), - _field50(0), _field5C(-1), _field60(0) { + _field50(0), _field5C(-1), _field60(0) { } } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h index 7fd61c38ac..7a42614f43 100644 --- a/engines/titanic/true_talk/tt_word.h +++ b/engines/titanic/true_talk/tt_word.h @@ -32,7 +32,7 @@ namespace Titanic { /** * Types of words */ -enum WordClass { +enum WordClass { WC_UNKNOWN = 0, WC_ACTION = 1, WC_THING = 2, WC_ABSTRACT = 3, WC_ARTICLE = 4, WC_CONJUNCTION = 5, WC_PRONOUN = 6, WC_PREPOSITION = 7, WC_ADJECTIVE = 8, WC_ADVERB = 9 @@ -155,7 +155,7 @@ public: * Creates a copy of the word */ virtual TTword *copy() const; - + virtual bool proc2(int val) const { return false; } virtual int proc3() const { return -1; } virtual void proc4() {} @@ -165,7 +165,7 @@ public: * Checks whether the word's tag is a known type */ virtual bool checkTag() const { return false; } - + /** * Compare the word's tag to a given tag value */ @@ -175,7 +175,7 @@ public: * Return the tag associated with the word */ virtual uint getTag() const { return 0; } - + virtual bool proc9(int val) const { return false; } virtual int proc10() const { return 0; } virtual void proc11() {} |