scummvm/engines/titanic/true_talk/bellbot_script.cpp

1261 lines
29 KiB
C++
Raw Normal View History

/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#include "common/textconsole.h"
#include "titanic/true_talk/bellbot_script.h"
#include "titanic/true_talk/true_talk_manager.h"
#include "titanic/pet_control/pet_control.h"
#include "titanic/core/node_item.h"
#include "titanic/titanic.h"
namespace Titanic {
uint BellbotScript::_oldId;
BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
const char *charName, int v3, int val2) :
2016-05-14 04:12:47 +00:00
TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
_field2D0(0), _field2D4(0), _field2D8(0), _field2DC(0) {
CTrueTalkManager::setFlags(25, 0);
CTrueTalkManager::setFlags(24, 0);
CTrueTalkManager::setFlags(40, 0);
CTrueTalkManager::setFlags(26, 0);
2016-06-06 10:52:33 +00:00
setupDials(0, 0, 0);
_array[0] = 100;
_array[1] = 0;
loadRanges("Ranges/Bellbot");
loadResponses("Responses/Bellbot", 4);
setupSentences();
_tagMappings.load("TagMap/Bellbot");
_words.load("Words/Bellbot");
_quotes.load("Quotes/Bellbot");
_states.load("States/Bellbot");
2016-07-30 01:57:35 +00:00
_preResponses.load("PreResponses/Bellbot");
}
void BellbotScript::setupSentences() {
_mappings.load("Mappings/Bellbot", 1);
_entries.load("Sentences/Bellbot");
_field2DC = 0;
_field68 = 0;
_entryCount = 0;
}
int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
// TODO
return 0;
}
ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
warning("TODO");
return SCR_1;
}
int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
uint val, uint tagId, uint remainder) {
switch (tagId) {
case MKTAG('A', 'D', 'V', 'T'):
case MKTAG('A', 'R', 'T', 'I'):
case MKTAG('A', 'R', 'T', 'Y'):
case MKTAG('B', 'R', 'N', 'D'):
case MKTAG('C', 'O', 'M', 'D'):
case MKTAG('D', 'N', 'C', 'E'):
case MKTAG('H', 'B', 'B', 'Y'):
case MKTAG('L', 'I', 'T', 'R'):
case MKTAG('M', 'A', 'G', 'S'):
case MKTAG('M', 'C', 'P', 'Y'):
case MKTAG('M', 'I', 'N', 'S'):
case MKTAG('M', 'U', 'S', 'I'):
case MKTAG('N', 'I', 'K', 'E'):
case MKTAG('S', 'F', 'S', 'F'):
case MKTAG('S', 'O', 'A', 'P'):
case MKTAG('S', 'O', 'N', 'G'):
case MKTAG('S', 'P', 'R', 'T'):
case MKTAG('T', 'E', 'A', 'M'):
case MKTAG('T', 'V', 'S', 'H'):
case MKTAG('W', 'W', 'E', 'B'):
tagId = MKTAG('E', 'N', 'T', 'N');
break;
case MKTAG('A', 'C', 'T', 'R'):
case MKTAG('A', 'C', 'T', 'S'):
case MKTAG('A', 'U', 'T', 'H'):
case MKTAG('B', 'A', 'R', 'K'):
case MKTAG('B', 'A', 'R', 'U'):
case MKTAG('B', 'L', 'F', '1'):
case MKTAG('B', 'L', 'F', '2'):
case MKTAG('B', 'L', 'P', '1'):
case MKTAG('B', 'L', 'P', '2'):
case MKTAG('B', 'L', 'P', '3'):
case MKTAG('B', 'L', 'P', '4'):
case MKTAG('B', 'L', 'R', '1'):
case MKTAG('B', 'L', 'R', '2'):
case MKTAG('B', 'L', 'T', '1'):
case MKTAG('B', 'L', 'T', '2'):
case MKTAG('B', 'L', 'T', '3'):
case MKTAG('B', 'L', 'T', '4'):
case MKTAG('B', 'L', 'T', '5'):
case MKTAG('C', 'O', 'P', 'S'):
case MKTAG('D', 'C', 'T', 'R'):
case MKTAG('F', 'A', 'S', 'H'):
case MKTAG('F', 'A', 'M', 'E'):
case MKTAG('H', 'E', 'R', 'D'):
case MKTAG('H', 'O', 'S', 'T'):
case MKTAG('K', 'N', 'O', 'B'):
case MKTAG('N', 'H', 'R', 'O'):
case MKTAG('R', 'A', 'C', 'E'):
case MKTAG('S', 'C', 'I', 'T'):
case MKTAG('T', 'O', 'U', 'P'):
case MKTAG('T', 'W', 'A', 'T'):
case MKTAG('W', 'E', 'A', 'T'):
tagId = MKTAG('P', 'R', 'S', 'N');
break;
case MKTAG('C', 'H', 'S', 'E'):
case MKTAG('C', 'M', 'N', 't'):
case MKTAG('F', 'I', 'L', 'M'):
case MKTAG('J', 'F', 'O', 'D'):
case MKTAG('L', 'I', 'Q', 'D'):
tagId = MKTAG('F', 'O', 'O', 'D');
break;
case MKTAG('C', 'R', 'I', 'M'):
case MKTAG('C', 'S', 'P', 'Y'):
case MKTAG('D', 'R', 'U', 'G'):
tagId = MKTAG('V', 'B', 'A', 'D');
break;
case MKTAG('E', 'A', 'R', 'T'):
case MKTAG('H', 'O', 'M', 'E'):
case MKTAG('N', 'P', 'L', 'C'):
case MKTAG('P', 'L', 'A', 'N'):
tagId = MKTAG('P', 'L', 'A', 'C');
break;
case MKTAG('F', 'A', 'U', 'N'):
case MKTAG('F', 'I', 'S', 'H'):
case MKTAG('F', 'L', 'O', 'R'):
tagId = MKTAG('N', 'A', 'T', 'R');
break;
case MKTAG('H', 'H', 'L', 'D'):
case MKTAG('T', 'O', 'Y', 'S'):
case MKTAG('W', 'E', 'A', 'P'):
tagId = MKTAG('M', 'A', 'C', 'H');
break;
case MKTAG('M', 'L', 'T', 'Y'):
case MKTAG('P', 'G', 'R', 'P'):
case MKTAG('P', 'T', 'I', 'C'):
tagId = MKTAG('G', 'R', 'U', 'P');
break;
case MKTAG('P', 'K', 'U', 'P'):
case MKTAG('S', 'E', 'X', '1'):
case MKTAG('S', 'W', 'E', 'R'):
tagId = MKTAG('R', 'U', 'D', 'E');
break;
case MKTAG('P', 'H', 'I', 'L'):
case MKTAG('R', 'C', 'K', 'T'):
tagId = MKTAG('S', 'C', 'I', 'E');
break;
case MKTAG('T', 'R', 'A', '2'):
case MKTAG('T', 'R', 'A', '3'):
tagId = MKTAG('T', 'R', 'A', 'V');
break;
default:
break;
}
return TTnpcScript::handleQuote(roomScript, sentence, val, tagId, remainder);
}
int BellbotScript::updateState(uint oldId, uint newId, int index) {
if (!getValue(25)) {
newId = 202043 - getValue(1) <= 2 ? 994 : 0;
CTrueTalkManager::setFlags(25, 1);
}
if (oldId == _oldId && _rangeResetCtr >= 3) {
TTscriptRange *range = findRange(oldId);
if (range)
range->_priorIndex = 0;
_rangeResetCtr = 0;
return getRangeValue(200370);
}
if (oldId != _oldId) {
_oldId = oldId;
_rangeResetCtr = 0;
}
if (oldId >= 201709 && oldId <= 201754) {
addResponse(getDialogueId(201705));
addResponse(getDialogueId(201706));
newId = getRangeValue(201707);
}
if (newId == 202276)
newId = addLocation();
if (newId == 202275)
newId = getStateDialogueId();
if (getValue(1) >= 2) {
if (newId == 200840 || newId == 200845 || newId == 200846 || newId == 200851) {
if (getValue(1) == 2) {
newId = 202047;
} else {
newId = getRangeValue(202848);
}
}
}
if (getValue(1) >= 3) {
if (newId == 200841 || newId == 200842 || newId == 200843 ||
newId == 200847 || newId == 200848 || newId == 200854) {
newId = getRangeValue(202038);
}
}
if (newId == 200264 && getValue(1) == 1)
newId = 200267;
if (newId == 202231 && getValue(1) == 1)
newId = 200848;
int v4 = getValue(4);
if (newId == 200187 && v4) {
return 200188;
} else if (newId == 200188 && !v4) {
return 200187;
} else if (newId == 200014 && (v4 == 1 || v4 == 2)) {
return 200011;
} else if (newId == 200011 && !v4) {
return 200014;
}
if (oldId == 200612) {
CTrueTalkManager::setFlags(25, 2);
CTrueTalkManager::setFlags(5, 1);
}
if (newId == 200423 || newId == 200424 || newId == 200425) {
if (getValue(5)) {
CTrueTalkManager::triggerAction(16, 0);
} else {
newId = 200611;
}
}
if (oldId == 200261 && getRandomNumber(10) == 1) {
if (getValue(1) >= 3)
newId = getRangeValue(200283);
else if (getValue(1) == 2)
newId = getRangeValue(200279);
}
if (oldId == 200962) {
if (getValue(1) == 2)
return 200963;
if (getValue(1) == 1)
return 200964;
}
if (oldId == 200989 && getValue(1) <= 2)
return 200990;
if (oldId == 201760) {
CGameManager *gameManager = g_vm->_trueTalkManager->getGameManager();
CPetControl *pet = getPetControl(gameManager);
if (pet) {
bool canSummon = pet->canSummonBot("DoorBot");
if (canSummon) {
CTrueTalkManager::_v9 = 101;
CTrueTalkManager::triggerAction(5, 0);
} else {
newId = 201857;
}
}
}
setValue23(newId);
return newId;
}
2016-07-30 01:57:35 +00:00
int BellbotScript::preResponse(uint id) {
int newId = _preResponses.find(id);
if (newId == 202277) {
applyResponse();
CTrueTalkManager::triggerAction(1, 0);
}
if (newId == 200769) {
applyResponse();
CTrueTalkManager::triggerAction(18, 0);
}
if (id == 21790)
CTrueTalkManager::triggerAction(13, 0);
return newId;
}
int BellbotScript::doSentenceEntry(int val1, const int *srcIdP, TTroomScript *roomScript, TTsentence *sentence) {
switch (val1) {
case 1:
addResponse(getDialogueId(*srcIdP));
applyResponse();
return 2;
case 2:
addResponse(getDialogueId(*srcIdP));
addResponse(getDialogueId(getRandomNumber(2) == 1 ? 200192 : 200157));
addResponse(getDialogueId(200176));
applyResponse();
return 2;
case 21:
if (CTrueTalkManager::getStateValue(7) == 0) {
selectResponse(21372);
applyResponse();
return 2;
}
if (!sentence->localWord("broken") && !sentence->contains("broken") &&
CTrueTalkManager::_currentNPC) {
CNodeItem *node = CTrueTalkManager::_currentNPC->getNode();
if (node) {
CString nodeName = node->getName();
if (nodeName == "5" || nodeName == "6" || nodeName == "7") {
CTrueTalkManager::triggerAction(29, 2);
selectResponse(201571);
applyResponse();
return 2;
}
}
}
CTrueTalkManager::triggerAction(29, 1);
selectResponse(201771);
applyResponse();
return 2;
case 22:
if (CTrueTalkManager::getStateValue(7) == 0) {
selectResponse(21372);
applyResponse();
return 2;
}
if (!sentence->localWord("broken") && !sentence->contains("broken") &&
CTrueTalkManager::_currentNPC) {
CNodeItem *node = CTrueTalkManager::_currentNPC->getNode();
if (node) {
CString nodeName = node->getName();
if (nodeName == "5" || nodeName == "6" || nodeName != "7") {
CTrueTalkManager::triggerAction(29, 2);
selectResponse(201571);
applyResponse();
return 2;
}
}
}
CTrueTalkManager::triggerAction(29, 1);
selectResponse(201771);
applyResponse();
return 2;
case 23:
case 24:
if (CTrueTalkManager::getStateValue(7) == 0) {
selectResponse(21372);
applyResponse();
return 2;
}
CTrueTalkManager::triggerAction(29, val1 == 23 ? 3 : 4);
break;
default:
break;
}
return 0;
}
bool BellbotScript::randomResponse(uint index) {
if (getRandomNumber(100) > 10 || getRandomNumber(10) <= index)
return 0;
if (getRandomNumber(100) > 95) {
deleteResponses();
addResponse(getDialogueId(201695));
applyResponse();
} else {
setResponseFromArray(index, 201696);
}
return true;
}
int BellbotScript::addLocation() {
addResponse(getDialogueId(202228));
int roomNum, floorNum, elevatorNum;
getAssignedRoom(&roomNum, &floorNum, &elevatorNum);
addResponse(getDialogueId(202071 + roomNum));
addResponse(getDialogueId(201933 + floorNum));
addResponse(getDialogueId(201916 + elevatorNum));
return 200858;
}
int BellbotScript::getStateDialogueId() const {
switch (getValue(1)) {
case 1:
return 201253;
case 2:
return 200282;
default:
return 201246;
}
}
void BellbotScript::setValue23(uint id) {
uint val = 0;
for (uint idx = 0; idx < _states.size() && !val; ++idx) {
2016-07-30 01:57:35 +00:00
TTmapEntry &us = _states[idx];
if (us._src == id)
val = us._dest;
}
CTrueTalkManager::setFlags(23, val);
}
int BellbotScript::preProcess(TTroomScript *roomScript, TTsentence *sentence) {
if (!roomScript || !sentence)
return true;
bool applyFlag = false, stateFlag = true;
switch (getValue(23)) {
case 1:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200818));
applyFlag = true;
}
if (sentence->_field2C == 12) {
addResponse(getDialogueId(200817));
applyFlag = true;
}
break;
case 2:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200835));
addResponse(getDialogueId(200830));
applyFlag = true;
} else if (sentence->_field2C == 12) {
addResponse(getDialogueId(200834));
addResponse(getDialogueId(200830));
applyFlag = true;
}
break;
case 3:
if (sentence->_field2C >= 11 && sentence->_field2C <= 13) {
addResponse(getDialogueId(200831));
addResponse(getDialogueId(200833));
applyFlag = true;
}
break;
case 4:
if (sentence->_field2C == 11) {
addResponse(getDialogueId(200872));
applyFlag = true;
}
if (sentence->_field2C == 12 || sentence->_field2C == 13) {
addResponse(getDialogueId(200873));
applyFlag = true;
}
break;
case 5:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200492));
applyFlag = true;
}
if (sentence->_field2C == 12) {
addResponse(getDialogueId(200491));
applyFlag = true;
}
break;
case 6:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200496));
applyResponse();
setState(0);
CTrueTalkManager::setFlags(23, 7);
return 2;
}
if (sentence->_field2C == 12) {
addResponse(getDialogueId(200127));
applyFlag = true;
}
break;
case 7:
addResponse(getDialogueId(200504));
addResponse(getDialogueId(200496));
applyFlag = true;
stateFlag = false;
break;
case 8:
addResponse(getDialogueId(200494));
applyFlag = true;
stateFlag = false;
break;
case 9:
addResponse(getDialogueId(sentence->localWord("guess") ? 200495 : 200493));
applyFlag = true;
break;
case 10:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200317));
applyResponse();
setState(0);
CTrueTalkManager::setFlags(23, 11);
return 2;
}
addResponse(getDialogueId(sentence->_field2C == 12 ? 200316 : 200315));
applyFlag = true;
break;
case 11:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200055));
} else if (sentence->_field2C == 12) {
addResponse(getDialogueId(200318));
} else {
addResponse(getDialogueId(200315));
}
applyFlag = true;
break;
case 12:
if (sentence->_field2C == 6) {
addResponse(getDialogueId(200259));
applyFlag = true;
}
break;
case 13:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200207));
applyFlag = true;
} else if (sentence->_field2C == 12) {
addResponse(getDialogueId(200206));
applyFlag = true;
}
break;
case 14:
if (sentence->_field2C == 6) {
addResponse(getDialogueId(200349));
applyFlag = true;
}
case 15:
if (sentence->_field2C == 6) {
addResponse(getDialogueId(200130));
applyResponse();
setState(0);
CTrueTalkManager::setFlags(23, 16);
return 2;
}
break;
case 16:
if (sentence->localWord("invented")) {
addResponse(getDialogueId(200131));
applyFlag = true;
}
break;
case 17:
if ((sentence->_field2C == 3 && sentence->localWord("code"))
|| (sentence->localWord("which") && sentence->localWord("is"))
|| sentence->localWord("remember")
|| sentence->localWord("know")
) {
addResponse(getDialogueId(200044));
applyFlag = true;
stateFlag = false;
}
break;
case 19:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200223));
applyFlag = true;
}
break;
case 20:
addResponse(getDialogueId(200254));
applyFlag = true;
break;
case 21:
if (sentence->contains("hiker") || sentence->contains("hug")) {
addResponse(getDialogueId(200379));
applyFlag = true;
}
break;
case 22:
if (sentence->localWord("get") || sentence->localWord("it")) {
addResponse(getDialogueId(200474));
applyFlag = true;
}
break;
case 23:
addResponse(getDialogueId(sentence->localWord("long") ? 200870 : 200871));
applyFlag = true;
break;
case 24:
addResponse(getDialogueId(200793));
applyFlag = true;
stateFlag = false;
break;
case 25:
if (sentence->localWord("parrot")) {
addResponse(getDialogueId(200255));
applyFlag = true;
stateFlag = false;
}
break;
case 26:
if (sentence->localWord("cage")) {
addResponse(getDialogueId(200380));
applyFlag = true;
stateFlag = false;
}
break;
case 27:
addResponse(getDialogueId(200347));
applyFlag = true;
stateFlag = false;
break;
case 28:
if (sentence->localWord("perch")) {
addResponse(getDialogueId(200242));
applyFlag = true;
stateFlag = false;
}
break;
case 29:
if (sentence->localWord("brain") || sentence->localWord("titania")) {
addResponse(getDialogueId(200392));
applyFlag = true;
stateFlag = false;
}
break;
case 30:
if ((sentence->localWord("did") || sentence->localWord("not"))
|| (sentence->localWord("would") || sentence->localWord("not"))
|| (sentence->localWord("could") || sentence->localWord("not"))
|| sentence->localWord("tried")) {
addResponse(getDialogueId(200416));
applyFlag = true;
}
break;
case 31:
addResponse(getDialogueId(sentence->_field2C == 11 ? 200810 : 200811));
applyFlag = true;
break;
case 32:
addResponse(getDialogueId(sentence->_field2C == 11 ? 200810 : 200812));
applyFlag = true;
break;
case 33:
addResponse(getDialogueId(200822));
applyFlag = true;
break;
case 34:
addResponse(getDialogueId(200824));
applyFlag = true;
break;
case 35:
if (sentence->_field2C == 3 && sentence->localWord("it")
&& (sentence->localWord("for") || sentence->localWord("do"))) {
addResponse(getDialogueId(200768));
applyFlag = true;
}
break;
case 36:
if (sentence->_field2C == 11) {
CTrueTalkManager::triggerAction(14, 0);
addResponse(getDialogueId(200761));
applyFlag = true;
}
break;
case 37:
addResponse(getDialogueId(200630));
applyFlag = true;
break;
case 38:
if (sentence->_field2C == 12) {
addResponse(getDialogueId(200631));
applyFlag = true;
}
break;
case 39:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200632));
stateFlag = false;
} else {
addResponse(getDialogueId(200633));
}
applyFlag = true;
break;
case 40:
addResponse(getDialogueId(200633));
applyFlag = true;
break;
case 41:
addResponse(getDialogueId(sentence->contains("42") ? 200139 : 200627));
applyFlag = true;
break;
case 42:
if ((sentence->localWord("carry") && sentence->localWord("on"))
|| (sentence->localWord("go") && sentence->localWord("on"))
|| sentence->localWord("more")
|| sentence->localWord("going")
|| sentence->localWord("elaborate")
|| sentence->localWord("suspicious")
|| sentence->localWord("they")) {
addResponse(getDialogueId(200642));
applyFlag = true;
stateFlag = false;
}
break;
case 43:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200643));
applyFlag = true;
}
break;
case 44:
case44:
if (better(sentence, 200615, 200613)) {
applyFlag = true;
stateFlag = false;
}
break;
case 45:
if (sentence->contains("surprise")) {
addResponse(getDialogueId(200614));
applyFlag = true;
stateFlag = false;
break;
}
goto case44;
case 46:
if (sentence->contains("good")) {
addResponse(getDialogueId(200616));
applyFlag = true;
stateFlag = false;
break;
}
goto case44;
case 47:
if (sentence->_field2C == 12)
addResponse(getDialogueId(200368));
addResponse(getDialogueId(200366));
applyFlag = true;
stateFlag = false;
break;
case 48:
if ((sentence->localWord("carry") && sentence->localWord("on"))
|| sentence->localWord("more")
|| (sentence->localWord("go") && sentence->localWord("on"))
|| sentence->localWord("going")
|| sentence->localWord("yes")
|| sentence->localWord("really")) {
addResponse(getDialogueId(200367));
applyFlag = true;
}
break;
case 49:
if (sentence->_field2C >= 11 && sentence->_field2C <= 13) {
addResponse(getDialogueId(200407));
applyFlag = true;
stateFlag = false;
}
break;
case 50:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200408));
stateFlag = false;
} else {
addResponse(getDialogueId(200409));
}
applyFlag = true;
break;
case 51:
if (sentence->localWord("no") || sentence->localWord("it")
|| sentence->localWord("is") || sentence->localWord("not")
|| sentence->contains("yeah right")) {
addResponse(getDialogueId(200636));
applyFlag = true;
}
break;
case 52:
if (sentence->_field2C >= 11 && sentence->_field2C <= 13) {
addResponse(getDialogueId(200872));
applyFlag = true;
}
break;
case 53:
if (sentence->_field2C == 12) {
addResponse(getDialogueId(200525));
applyFlag = true;
} else if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200526));
applyFlag = true;
}
break;
case 54:
if (sentence->_field2C == 12) {
addResponse(getDialogueId(200095));
applyFlag = true;
stateFlag = false;
}
break;
case 55:
if (sentence->_field2C == 6) {
addResponse(getDialogueId(200112));
applyFlag = true;
}
break;
case 56:
if (sentence->localWord("sure")
|| (sentence->localWord("nothing") && sentence->localWord("else"))) {
addResponse(getDialogueId(200649));
applyFlag = true;
stateFlag = false;
}
break;
case 57:
if (sentence->localWord("bad")
|| (sentence->localWord("not") && sentence->localWord("good"))) {
addResponse(getDialogueId(200654));
} else {
addResponse(getDialogueId(200655));
stateFlag = false;
}
applyFlag = true;
break;
case 58:
if (sentence->localWord("more")
|| (sentence->localWord("go") && sentence->localWord("on"))
|| (sentence->_field2C == 11 && sentence->localWord("really"))) {
addResponse(getDialogueId(200650));
applyFlag = true;
stateFlag = false;
}
break;
case 59:
if (!sentence->localWord("shutup")) {
addResponse(getDialogueId(200651));
applyFlag = true;
stateFlag = false;
}
break;
case 60:
if (sentence->_field2C == 3 && sentence->localWord("they") && sentence->localWord("do")) {
addResponse(getDialogueId(200652));
applyFlag = true;
stateFlag = false;
}
break;
case 61:
if ((sentence->localWord("that") && sentence->localWord("all"))
|| (sentence->localWord("anything") && sentence->localWord("else"))) {
addResponse(getDialogueId(200653));
applyFlag = true;
}
break;
case 62:
if (sentence->localWord("meant") || sentence->localWord("woman")) {
addResponse(getDialogueId(200743));
applyFlag = true;
}
break;
case 63:
addResponse(getDialogueId(200208));
applyFlag = true;
break;
case 64:
if (sentence->localWord("rowboat")) {
addResponse(getDialogueId(200052));
applyFlag = true;
}
break;
case 65:
if (sentence->localWord("sorry")) {
addResponse(getDialogueId(200056));
applyFlag = true;
stateFlag = false;
}
break;
case 66:
if (sentence->localWord("sorry")) {
addResponse(getDialogueId(200057));
applyFlag = true;
stateFlag = false;
}
break;
case 67:
if (sentence->localWord("sorry")) {
addResponse(getDialogueId(200055));
applyFlag = true;
stateFlag = false;
}
break;
case 68:
if ((sentence->localWord("i") && sentence->localWord("care"))
|| sentence->localWord("do")
|| sentence->localWord("me")) {
addResponse(getDialogueId(201006));
applyFlag = true;
}
break;
case 69:
if ((sentence->localWord("what") && sentence->localWord("happen"))
|| sentence->localWord("filigon")) {
addResponse(getDialogueId(201011));
applyFlag = true;
stateFlag = false;
}
break;
case 70:
if (sentence->_field2C == 12) {
addResponse(getDialogueId(201012));
applyFlag = true;
stateFlag = false;
}
break;
case 71:
if (sentence->localWord("why")) {
addResponse(getDialogueId(201013));
applyFlag = true;
}
break;
case 72:
if (sentence->_field2C == 12) {
addResponse(getDialogueId(200921));
applyFlag = true;
} else if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(200920));
applyFlag = true;
}
break;
case 73:
if (sentence->localWord("mood") && (charId() == 7 || charId() == 5)) {
addResponse(getDialogueId(201021));
applyFlag = true;
stateFlag = false;
}
break;
case 74:
if (sentence->_field2C == 6) {
addResponse(getDialogueId(201022));
applyFlag = true;
stateFlag = false;
}
break;
case 75:
if (sentence->_field2C == 3) {
if (sentence->localWord("that") || sentence->localWord("worb")) {
addResponse(getDialogueId(201802));
applyFlag = true;
}
}
break;
case 76:
if (sentence->_field2C == 2 && (sentence->localWord("that") || sentence->localWord("gat"))) {
addResponse(getDialogueId(201034));
applyFlag = true;
stateFlag = false;
}
break;
case 77:
if (sentence->_field2C == 4 || sentence->_field2C == 3) {
if (sentence->localWord("that") || sentence->localWord("blerontis")) {
addResponse(getDialogueId(201035));
applyFlag = true;
}
}
break;
case 78:
if (sentence->_field2C == 12) {
addResponse(getDialogueId(201034));
applyFlag = true;
stateFlag = false;
} else if (sentence->_field2C == 11) {
addResponse(getDialogueId(201040));
applyFlag = true;
} else if ((sentence->localWord("not") && sentence->localWord("remember"))
|| sentence->localWord("forgot")) {
addResponse(getDialogueId(201041));
applyFlag = true;
stateFlag = false;
} else if (sentence->localWord("why")) {
addResponse(getDialogueId(201042));
applyFlag = true;
stateFlag = false;
}
break;
case 79:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(201052));
CTrueTalkManager::triggerAction(14, 0);
applyFlag = true;
stateFlag = false;
} else if (sentence->_field2C == 12) {
addResponse(getDialogueId(202119));
addResponse(getDialogueId(200256));
applyFlag = true;
}
break;
case 80:
if ((!sentence->localWord("what") && sentence->localWord("how"))
|| sentence->localWord("about")
|| sentence->localWord("you")) {
if (sentence->_field2C != 3 && sentence->_field2C != 4 && sentence->_field2C != 7) {
addResponse(getDialogueId(201694));
applyFlag = true;
stateFlag = false;
}
} else {
addResponse(getDialogueId(201135));
applyFlag = true;
}
break;
case 81:
if ((!sentence->localWord("what") && !sentence->localWord("how"))
|| !sentence->localWord("about")
|| !sentence->localWord("you")) {
if (!sentence->localWord("and") || !sentence->localWord("yourself"))
break;
}
addResponse(getDialogueId(201135));
applyFlag = true;
break;
case 82:
if ((sentence->_field2C == 3 && sentence->localWord("mean"))
|| sentence->localWord("surf")
|| (sentence->localWord("what") && sentence->localWord("talk")
&& sentence->localWord("about"))) {
addResponse(getDialogueId(201694));
applyFlag = true;
stateFlag = false;
}
break;
case 83:
if (sentence->_field2C != 3 && sentence->_field2C != 4 && sentence->_field2C != 7) {
addResponse(getDialogueId(201083));
applyFlag = true;
}
break;
case 84:
if (sentence->_field2C == 12) {
addResponse(getDialogueId(202119));
switch (getValue(1)) {
case 1:
addResponse(getDialogueId(202024));
applyFlag = true;
break;
case 2:
addResponse(getDialogueId(201812));
applyFlag = true;
stateFlag = false;
break;
default:
break;
}
} else if (sentence->_field2C == 11) {
addResponse(getDialogueId(201060));
addResponse(getDialogueId(201079));
applyFlag = true;
stateFlag = false;
}
break;
case 85:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(201814));
applyFlag = true;
}
if (sentence->_field2C == 12) {
addResponse(getDialogueId(201813));
applyFlag = true;
}
break;
case 86:
if (sentence->_field2C == 11 || sentence->_field2C == 13) {
addResponse(getDialogueId(202109));
applyFlag = true;
}
if (sentence->_field2C == 12) {
addResponse(getDialogueId(202108));
applyFlag = true;
}
break;
case 87:
if (better(sentence, 201993, 200720)) {
applyFlag = true;
}
break;
case 88:
if (sentence->_field2C == 6 || sentence->contains("upside down")) {
addResponse(getDialogueId(202142));
applyFlag = true;
}
break;
case 89:
if (sentence->_field2C == 2) {
addResponse(getDialogueId(200739));
applyFlag = true;
stateFlag = false;
}
break;
case 90:
if (sentence->contains("like") && (sentence->contains("slug") || sentence->contains("snail"))) {
addResponse(getDialogueId(201029));
applyFlag = true;
stateFlag = false;
} else if (sentence->contains("slime") || sentence->localWord("what")) {
addResponse(getDialogueId(201220));
applyFlag = true;
stateFlag = false;
}
default:
break;
}
if (applyFlag)
applyResponse();
if (stateFlag) {
setState(0);
CTrueTalkManager::setFlags(23, 0);
}
return applyFlag ? 2 : 1;
}
bool BellbotScript::better(TTsentence *sentence, uint id1, uint id2) {
if (sentence->contains("good") || sentence->localWord("better")) {
addResponse(getDialogueId(id1));
} else if (sentence->localWord("bad")) {
addResponse(getDialogueId(id2));
} else {
return false;
}
return true;
}
} // End of namespace Titanic