TITANIC: Added BellbotScript scriptChanged

This commit is contained in:
Paul Gilbert 2016-07-30 23:52:09 -04:00
parent 45fb6a2d32
commit 377f926a6b
17 changed files with 88 additions and 23 deletions

View File

@ -756,7 +756,7 @@ done:
return 2;
}
ScriptChangedResult BarbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
ScriptChangedResult BarbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
switch (id) {
case 1:
case 100:

View File

@ -70,7 +70,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
uint val, uint tagId, uint remainder);

View File

@ -344,9 +344,75 @@ int BellbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
return 2;
}
ScriptChangedResult BellbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
warning("TODO");
return SCR_1;
ScriptChangedResult BellbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
if (!roomScript)
return SCR_2;
switch (id) {
case 104:
addResponse(getDialogueId(200617));
applyResponse();
break;
case 105:
addResponse(getDialogueId(200732));
applyResponse();
break;
case 106:
addResponse(getDialogueId(200733));
applyResponse();
break;
case 107:
addResponse(getDialogueId(200731));
applyResponse();
break;
case 157:
_field2DC = 1;
break;
case 158:
CTrueTalkManager::setFlags(26, 1);
break;
case 3:
if (_field2DC) {
if (randomResponse0(roomScript, id))
return SCR_2;
} else {
addResponse(getDialogueId(201693));
applyResponse();
}
_field2DC = 0;
CTrueTalkManager::_v9 = 0;
// Deliberate fall-through
default:
if (roomScript->_scriptId == 115 && id == 103) {
switch (getValue(4)) {
case 0:
addResponse(getDialogueId(200014));
applyResponse();
break;
case 1:
case 2:
addResponse(getDialogueId(200011));
applyResponse();
break;
case 3:
addResponse(getDialogueId(200007));
applyResponse();
break;
default:
break;
}
}
break;
}
return SCR_2;
}
int BellbotScript::handleQuote(TTroomScript *roomScript, TTsentence *sentence,
@ -1623,7 +1689,6 @@ int BellbotScript::checkCommonSentences(TTroomScript *roomScript, TTsentence *se
return 1;
uint val1 = getValue(1);
uint newId = 0;
for (uint idx = 0; idx < _phrases.size(); ++idx) {
TTcommonPhrase &cp = _phrases[idx];

View File

@ -98,7 +98,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
uint val, uint tagId, uint remainder);

View File

@ -64,7 +64,7 @@ int DeskbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
return 0;
}
ScriptChangedResult DeskbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
ScriptChangedResult DeskbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
warning("TODO");
return SCR_1;
}

View File

@ -74,7 +74,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
uint val, uint tagId, uint remainder);

View File

@ -132,7 +132,7 @@ int DoorbotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
return 0;
}
ScriptChangedResult DoorbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
ScriptChangedResult DoorbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
warning("TODO");
return SCR_1;
}

View File

@ -68,7 +68,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
uint val, uint tagId, uint remainder);

View File

@ -95,7 +95,7 @@ int LiftbotScript::proc9() const {
return 0;
}
ScriptChangedResult LiftbotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
ScriptChangedResult LiftbotScript::scriptChanged(TTroomScript *roomScript, uint id) {
warning("TODO");
return SCR_1;
}

View File

@ -65,7 +65,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
uint val, uint tagId, uint remainder);

View File

@ -70,7 +70,7 @@ int MaitreDScript::process(TTroomScript *roomScript, TTsentence *sentence) {
return 0;
}
ScriptChangedResult MaitreDScript::scriptChanged(TTscriptBase *roomScript, uint id) {
ScriptChangedResult MaitreDScript::scriptChanged(TTroomScript *roomScript, uint id) {
warning("TODO");
return SCR_1;
}

View File

@ -73,7 +73,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
virtual int handleQuote(TTroomScript *roomScript, TTsentence *sentence,
uint val, uint tagId, uint remainder);

View File

@ -63,7 +63,7 @@ int ParrotScript::process(TTroomScript *roomScript, TTsentence *sentence) {
return 2;
}
ScriptChangedResult ParrotScript::scriptChanged(TTscriptBase *roomScript, uint id) {
ScriptChangedResult ParrotScript::scriptChanged(TTroomScript *roomScript, uint id) {
if (id >= 280000 && id <= 280276) {
if (id == 280258) {
if (CTrueTalkManager::_currentNPC) {

View File

@ -50,7 +50,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
/**
* Process a sentence fragment entry

View File

@ -79,7 +79,7 @@ int SuccUBusScript::process(TTroomScript *roomScript, TTsentence *sentence) {
return 0;
}
ScriptChangedResult SuccUBusScript::scriptChanged(TTscriptBase *roomScript, uint id) {
ScriptChangedResult SuccUBusScript::scriptChanged(TTroomScript *roomScript, uint id) {
warning("TODO");
return SCR_1;
}

View File

@ -52,7 +52,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id);
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id);
/**
* Handles updating NPC state based on specified dialogue Ids and dial positions

View File

@ -72,7 +72,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) = 0;
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) = 0;
virtual int proc11() const = 0;
virtual int proc12() const = 0;
@ -237,7 +237,7 @@ public:
/**
* Called when the script/id changes
*/
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) {
virtual ScriptChangedResult scriptChanged(TTroomScript *roomScript, uint id) {
return SCR_2;
}
@ -335,8 +335,8 @@ public:
/**
* Called with the script and id changes
*/
ScriptChangedResult notifyScript(TTscriptBase *npcScript, int id) {
return scriptChanged(npcScript, id);
ScriptChangedResult notifyScript(TTroomScript *roomScript, int id) {
return scriptChanged(roomScript, id);
}
};