mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-06 09:48:39 +00:00
TITANIC: Beginnings of TTinput class
This commit is contained in:
parent
eb94894688
commit
e5e0e22c56
@ -462,6 +462,7 @@ MODULE_OBJS := \
|
||||
true_talk/true_talk_manager.o \
|
||||
true_talk/tt_action.o \
|
||||
true_talk/tt_adj.o \
|
||||
true_talk/tt_input.o \
|
||||
true_talk/tt_major_word.o \
|
||||
true_talk/tt_npc_script.o \
|
||||
true_talk/tt_parser.o \
|
||||
|
@ -432,7 +432,7 @@ void CPetConversations::stopNPCTimer() {
|
||||
_petControl->stopPetTimer(1);
|
||||
}
|
||||
|
||||
TTNpcScript *CPetConversations::getNPCScript(const CString &name) const {
|
||||
TTnpcScript *CPetConversations::getNPCScript(const CString &name) const {
|
||||
if (name.empty() || !_petControl)
|
||||
return nullptr;
|
||||
CGameManager *gameManager = _petControl->getGameManager();
|
||||
@ -517,13 +517,13 @@ void CPetConversations::copyColors(uint tableNum, uint colors[5]) {
|
||||
}
|
||||
|
||||
void CPetConversations::updateDial(uint dialNum, const CString &npcName) {
|
||||
TTNpcScript *script = getNPCScript(npcName);
|
||||
TTnpcScript *script = getNPCScript(npcName);
|
||||
uint newLevel = getDialLevel(dialNum, script);
|
||||
npcDialChange(dialNum, _npcLevels[dialNum], newLevel);
|
||||
_npcLevels[dialNum] = newLevel;
|
||||
}
|
||||
|
||||
uint CPetConversations::getDialLevel(uint dialNum, TTNpcScript *script, int v) {
|
||||
uint CPetConversations::getDialLevel(uint dialNum, TTnpcScript *script, int v) {
|
||||
bool flag = v != 0;
|
||||
|
||||
if (!script)
|
||||
@ -559,7 +559,7 @@ void CPetConversations::npcDialChange(uint dialNum, int oldLevel, int newLevel)
|
||||
}
|
||||
|
||||
void CPetConversations::resetDials(const CString &name) {
|
||||
TTNpcScript *script = getNPCScript(name);
|
||||
TTnpcScript *script = getNPCScript(name);
|
||||
|
||||
for (int idx = 0; idx < TOTAL_DIALS; ++idx) {
|
||||
uint oldLevel = _npcLevels[idx];
|
||||
|
@ -112,7 +112,7 @@ private:
|
||||
/**
|
||||
* Get the TrueTalk script associated with a given NPC
|
||||
*/
|
||||
TTNpcScript *getNPCScript(const CString &name) const;
|
||||
TTnpcScript *getNPCScript(const CString &name) const;
|
||||
|
||||
/**
|
||||
* Handle a keypress
|
||||
@ -142,7 +142,7 @@ private:
|
||||
/**
|
||||
* Get a dial level
|
||||
*/
|
||||
uint getDialLevel(uint dialNum, TTNpcScript *script, int v = 1);
|
||||
uint getDialLevel(uint dialNum, TTnpcScript *script, int v = 1);
|
||||
|
||||
/**
|
||||
* Called when the dial for an NPC is being changed
|
||||
|
@ -119,7 +119,7 @@ public:
|
||||
CMainGameWindow *_window;
|
||||
Common::RandomSource _randomSource;
|
||||
CScriptHandler *_scriptHandler;
|
||||
TTScriptBase *_script;
|
||||
TTscriptBase *_script;
|
||||
CExeResources _exeResources;
|
||||
CMovieList _activeMovies;
|
||||
CString _itemNames[TOTAL_ITEMS];
|
||||
|
@ -27,11 +27,11 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class BarbotScript : public TTNpcScript {
|
||||
class BarbotScript : public TTnpcScript {
|
||||
public:
|
||||
BarbotScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
|
||||
virtual int proc6() const;
|
||||
virtual void proc7(int v1, int v2);
|
||||
|
@ -28,7 +28,7 @@ namespace Titanic {
|
||||
|
||||
BellbotScript::BellbotScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0),
|
||||
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);
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class BellbotScript : public TTNpcScript {
|
||||
class BellbotScript : public TTnpcScript {
|
||||
private:
|
||||
int _array[150];
|
||||
int _field2D0;
|
||||
|
@ -28,7 +28,7 @@ namespace Titanic {
|
||||
|
||||
DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
|
||||
TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
|
||||
CTrueTalkManager::setFlags(18, 0);
|
||||
CTrueTalkManager::setFlags(19, 0);
|
||||
CTrueTalkManager::setFlags(20, 0);
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class DeskbotScript : public TTNpcScript {
|
||||
class DeskbotScript : public TTnpcScript {
|
||||
public:
|
||||
DeskbotScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2);
|
||||
|
@ -27,13 +27,13 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class DoorbotScript : public TTNpcScript {
|
||||
class DoorbotScript : public TTnpcScript {
|
||||
private:
|
||||
int _array[148];
|
||||
public:
|
||||
DoorbotScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
|
||||
virtual int proc6() const;
|
||||
virtual void proc7(int v1, int v2);
|
||||
|
@ -27,11 +27,11 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class LiftbotScript : public TTNpcScript {
|
||||
class LiftbotScript : public TTnpcScript {
|
||||
public:
|
||||
LiftbotScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
|
||||
virtual int proc6() const;
|
||||
virtual void proc7(int v1, int v2);
|
||||
|
@ -28,7 +28,7 @@ namespace Titanic {
|
||||
|
||||
MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
|
||||
TTnpcScript(val1, charClass, v2, charName, v3, val2, -1, -1, -1, 0) {
|
||||
CTrueTalkManager::setFlags(9, 1);
|
||||
CTrueTalkManager::setFlags(10, 0);
|
||||
CTrueTalkManager::setFlags(11, 0);
|
||||
|
@ -27,7 +27,7 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class MaitreDScript : public TTNpcScript {
|
||||
class MaitreDScript : public TTnpcScript {
|
||||
public:
|
||||
MaitreDScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2);
|
||||
|
@ -27,11 +27,11 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class ParrotScript : public TTNpcScript {
|
||||
class ParrotScript : public TTnpcScript {
|
||||
public:
|
||||
ParrotScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) {}
|
||||
|
||||
virtual int proc6() const;
|
||||
virtual void proc7(int v1, int v2);
|
||||
|
@ -21,6 +21,7 @@
|
||||
*/
|
||||
|
||||
#include "titanic/true_talk/script_handler.h"
|
||||
#include "titanic/true_talk/tt_input.h"
|
||||
#include "titanic/titanic.h"
|
||||
|
||||
namespace Titanic {
|
||||
@ -41,7 +42,7 @@ CScriptHandler::~CScriptHandler() {
|
||||
delete _vocab;
|
||||
}
|
||||
|
||||
ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
|
||||
ScriptChangedResult CScriptHandler::scriptChanged(TTroomScript *roomScript, TTnpcScript *npcScript, uint dialogueId) {
|
||||
if (!npcScript || !roomScript) {
|
||||
++_inputCtr;
|
||||
return SCR_5;
|
||||
@ -57,12 +58,19 @@ ScriptChangedResult CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNp
|
||||
error("TODO: CScriptHandler::scriptChanged");
|
||||
}
|
||||
|
||||
void CScriptHandler::processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
|
||||
int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScript,
|
||||
const TTstring &line) {
|
||||
if (!roomScript || !line.isValid())
|
||||
return;
|
||||
return SS_5;
|
||||
|
||||
TTinput *input = new TTinput(_inputCtr++, line, this, roomScript, npcScript);
|
||||
_parser.processInput(input);
|
||||
|
||||
warning("TODO: CScriptHandler::processInput");
|
||||
|
||||
// TODO
|
||||
delete input;
|
||||
return SS_VALID;
|
||||
}
|
||||
|
||||
SimpleFile *CScriptHandler::openResource(const CString &name) {
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
class CScriptHandler {
|
||||
private:
|
||||
CTitleEngine *_owner;
|
||||
TTScriptBase *_script;
|
||||
TTscriptBase *_script;
|
||||
TTvocab *_vocab;
|
||||
CExeResources &_resources;
|
||||
int _field10;
|
||||
@ -69,9 +69,10 @@ public:
|
||||
/**
|
||||
* Set the character and room
|
||||
*/
|
||||
ScriptChangedResult scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId);
|
||||
ScriptChangedResult scriptChanged(TTroomScript *roomScript,
|
||||
TTnpcScript *npcScript, uint dialogueId);
|
||||
|
||||
void processInput(TTRoomScript *roomScript, TTNpcScript *npcScript,
|
||||
int processInput(TTroomScript *roomScript, TTnpcScript *npcScript,
|
||||
const TTstring &line);
|
||||
|
||||
/**
|
||||
|
@ -27,13 +27,13 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class SuccUBusScript : public TTNpcScript {
|
||||
class SuccUBusScript : public TTnpcScript {
|
||||
private:
|
||||
int _field2D0;
|
||||
public:
|
||||
SuccUBusScript(int val1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
|
||||
TTNpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
|
||||
TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
|
||||
_field2D0(0) {}
|
||||
|
||||
virtual int proc6() const;
|
||||
|
@ -42,10 +42,10 @@ public:
|
||||
class CTitleEngine {
|
||||
public:
|
||||
CScriptHandler *_scriptHandler;
|
||||
TTScriptBase *_script;
|
||||
TTscriptBase *_script;
|
||||
public:
|
||||
CTitleEngine();
|
||||
~CTitleEngine();
|
||||
virtual ~CTitleEngine();
|
||||
|
||||
/**
|
||||
* Setup the engine
|
||||
@ -75,7 +75,7 @@ public:
|
||||
Common::Array<byte> _data;
|
||||
public:
|
||||
STtitleEngine();
|
||||
~STtitleEngine();
|
||||
virtual ~STtitleEngine();
|
||||
|
||||
void reset();
|
||||
|
||||
|
@ -179,13 +179,13 @@ void CTrueTalkManager::setFlags(int index, int val) {
|
||||
}
|
||||
|
||||
void CTrueTalkManager::loadNPC(SimpleFile *file, int charId) {
|
||||
TTNpcScript *script = _scripts.getNpcScript(charId);
|
||||
TTnpcScript *script = _scripts.getNpcScript(charId);
|
||||
if (script)
|
||||
script->load(file);
|
||||
}
|
||||
|
||||
void CTrueTalkManager::saveNPC(SimpleFile *file, int charId) const {
|
||||
TTNpcScript *script = _scripts.getNpcScript(charId);
|
||||
TTnpcScript *script = _scripts.getNpcScript(charId);
|
||||
if (script) {
|
||||
script->save(file);
|
||||
file->writeNumber(MKTAG_BE('U', 'R', 'A', 'H'));
|
||||
@ -218,8 +218,8 @@ void CTrueTalkManager::update2() {
|
||||
}
|
||||
|
||||
void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
|
||||
TTNpcScript *npcScript = getNpcScript(npc);
|
||||
TTRoomScript *roomScript = getRoomScript();
|
||||
TTnpcScript *npcScript = getNpcScript(npc);
|
||||
TTroomScript *roomScript = getRoomScript();
|
||||
|
||||
_titleEngine.reset();
|
||||
uint charId = npcScript->charId();
|
||||
@ -232,7 +232,7 @@ void CTrueTalkManager::start(CTrueTalkNPC *npc, uint id, CViewItem *view) {
|
||||
setDialogue(npc, roomScript, view);
|
||||
}
|
||||
|
||||
TTNpcScript *CTrueTalkManager::getTalker(const CString &name) const {
|
||||
TTnpcScript *CTrueTalkManager::getTalker(const CString &name) const {
|
||||
if (name.contains("Doorbot"))
|
||||
return _scripts.getNpcScript(104);
|
||||
else if (name.contains("DeskBot"))
|
||||
@ -255,9 +255,9 @@ TTNpcScript *CTrueTalkManager::getTalker(const CString &name) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TTNpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
|
||||
TTnpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
|
||||
CString npcName = npc->getName();
|
||||
TTNpcScript *script = getTalker(npcName);
|
||||
TTnpcScript *script = getTalker(npcName);
|
||||
|
||||
if (!script) {
|
||||
// Fall back on the default NPC script
|
||||
@ -267,9 +267,9 @@ TTNpcScript *CTrueTalkManager::getNpcScript(CTrueTalkNPC *npc) const {
|
||||
return script;
|
||||
}
|
||||
|
||||
TTRoomScript *CTrueTalkManager::getRoomScript() const {
|
||||
TTroomScript *CTrueTalkManager::getRoomScript() const {
|
||||
CRoomItem *room = _gameManager->getRoom();
|
||||
TTRoomScript *script = nullptr;
|
||||
TTroomScript *script = nullptr;
|
||||
if (room) {
|
||||
int scriptId = room->getScriptId();
|
||||
if (scriptId)
|
||||
@ -303,8 +303,8 @@ void CTrueTalkManager::loadAssets(CTrueTalkNPC *npc, int charId) {
|
||||
}
|
||||
|
||||
void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CViewItem *view) {
|
||||
TTNpcScript *npcScript = getNpcScript(npc);
|
||||
TTRoomScript *roomScript = getRoomScript();
|
||||
TTnpcScript *npcScript = getNpcScript(npc);
|
||||
TTroomScript *roomScript = getRoomScript();
|
||||
_titleEngine.reset();
|
||||
|
||||
if (npcScript && roomScript) {
|
||||
@ -320,7 +320,7 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView
|
||||
_currentNPC = nullptr;
|
||||
}
|
||||
|
||||
void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTRoomScript *roomScript, CViewItem *view) {
|
||||
void CTrueTalkManager::setDialogue(CTrueTalkNPC *npc, TTroomScript *roomScript, CViewItem *view) {
|
||||
// Get the dialog text
|
||||
CString dialogueStr = readDialogueString();
|
||||
if (dialogueStr.empty())
|
||||
@ -422,7 +422,7 @@ void CTrueTalkManager::triggerNPC(CTrueTalkNPC *npc) {
|
||||
}
|
||||
}
|
||||
|
||||
void CTrueTalkManager::setTalker(TTTalker *talker, TTRoomScript *roomScript, CViewItem *view, bool isParrot) {
|
||||
void CTrueTalkManager::setTalker(TTTalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot) {
|
||||
warning("TODO: CTrueTalkManager::setTalker");
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ class CTrueTalkManager {
|
||||
private:
|
||||
CGameManager *_gameManager;
|
||||
STtitleEngine _titleEngine;
|
||||
TTScripts _scripts;
|
||||
TTscripts _scripts;
|
||||
int _currentCharId;
|
||||
CDialogueFile *_dialogueFile;
|
||||
int _dialogueId;
|
||||
@ -72,19 +72,19 @@ private:
|
||||
/**
|
||||
* Gets the script associated with an NPC game object
|
||||
*/
|
||||
TTNpcScript *getNpcScript(CTrueTalkNPC *npc) const;
|
||||
TTnpcScript *getNpcScript(CTrueTalkNPC *npc) const;
|
||||
|
||||
/**
|
||||
* Gets the script associated with the current room
|
||||
*/
|
||||
TTRoomScript *getRoomScript() const;
|
||||
TTroomScript *getRoomScript() const;
|
||||
|
||||
/**
|
||||
* Loads assets for the current character, if it's changed
|
||||
*/
|
||||
void loadAssets(CTrueTalkNPC *npc, int charId);
|
||||
|
||||
void setDialogue(CTrueTalkNPC *npc, TTRoomScript *roomScript, CViewItem *view);
|
||||
void setDialogue(CTrueTalkNPC *npc, TTroomScript *roomScript, CViewItem *view);
|
||||
|
||||
/**
|
||||
* Read in text from the dialogue file
|
||||
@ -101,7 +101,7 @@ private:
|
||||
*/
|
||||
void triggerNPC(CTrueTalkNPC *npc);
|
||||
|
||||
void setTalker(TTTalker *talker, TTRoomScript *roomScript, CViewItem *view, bool isParrot);
|
||||
void setTalker(TTTalker *talker, TTroomScript *roomScript, CViewItem *view, bool isParrot);
|
||||
public:
|
||||
static int _v1;
|
||||
static int _v2;
|
||||
@ -169,7 +169,7 @@ public:
|
||||
/**
|
||||
* Returns the scripts for the manager
|
||||
*/
|
||||
TTScripts &getScripts() { return _scripts; }
|
||||
TTscripts &getScripts() { return _scripts; }
|
||||
|
||||
/**
|
||||
* Remove any completed talkers
|
||||
@ -186,7 +186,7 @@ public:
|
||||
/**
|
||||
* Return a TrueTalk talker/script
|
||||
*/
|
||||
TTNpcScript *getTalker(const CString &name) const;
|
||||
TTnpcScript *getTalker(const CString &name) const;
|
||||
|
||||
/**
|
||||
* Process player's input
|
||||
|
43
engines/titanic/true_talk/tt_input.cpp
Normal file
43
engines/titanic/true_talk/tt_input.cpp
Normal file
@ -0,0 +1,43 @@
|
||||
/* 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 "titanic/true_talk/tt_input.h"
|
||||
#include "titanic/true_talk/script_handler.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
TTinputSubBase::TTinputSubBase() : _field0(0), _field4(0), _field8(0),
|
||||
_fieldC(0), _field10(0), _field14(0), _field18(0), _field1C(0),
|
||||
_field20(0), _field24(0) {
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
TTinput::TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
|
||||
TTroomScript *roomScript, TTnpcScript *npcScript) :
|
||||
_owner(owner), _field2C(1), _inputCtr(inputCtr), _field34(0),
|
||||
_field38(0), _line(line), _field4C(0), _roomScript(roomScript),
|
||||
_npcScript(npcScript), _field58(0), _field5C(0) {
|
||||
_status = _line.isValid() && _string2.isValid() ? SS_11: SS_VALID;
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
77
engines/titanic/true_talk/tt_input.h
Normal file
77
engines/titanic/true_talk/tt_input.h
Normal file
@ -0,0 +1,77 @@
|
||||
/* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TITANIC_TT_INPUT_H
|
||||
#define TITANIC_TT_INPUT_H
|
||||
|
||||
#include "titanic/true_talk/tt_npc_script.h"
|
||||
#include "titanic/true_talk/tt_room_script.h"
|
||||
#include "titanic/true_talk/tt_string.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CScriptHandler;
|
||||
|
||||
class TTinputSubBase {
|
||||
public:
|
||||
int _field0;
|
||||
int _field4;
|
||||
int _field8;
|
||||
int _fieldC;
|
||||
int _field10;
|
||||
int _field14;
|
||||
int _field18;
|
||||
int _field1C;
|
||||
int _field20;
|
||||
int _field24;
|
||||
public:
|
||||
TTinputSubBase();
|
||||
};
|
||||
|
||||
class TTinputSub : public TTinputSubBase {
|
||||
public:
|
||||
};
|
||||
|
||||
class TTinput {
|
||||
private:
|
||||
CScriptHandler *_owner;
|
||||
TTinputSub _sub;
|
||||
int _field2C;
|
||||
int _inputCtr;
|
||||
int _field34;
|
||||
int _field38;
|
||||
TTstring _line;
|
||||
TTstring _string2;
|
||||
int _field4C;
|
||||
TTroomScript *_roomScript;
|
||||
TTnpcScript *_npcScript;
|
||||
int _field58;
|
||||
int _field5C;
|
||||
int _status;
|
||||
public:
|
||||
TTinput(int inputCtr, const TTstring &line, CScriptHandler *owner,
|
||||
TTroomScript *roomScript, TTnpcScript *npcScript);
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
||||
#endif /* TITANIC_TT_INPUT_H */
|
@ -26,17 +26,17 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
TTNpcScriptBase::TTNpcScriptBase(int charId, const char *charClass, int v2,
|
||||
TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
|
||||
TTScriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
|
||||
TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7),
|
||||
_charId(charId), _field54(0), _val2(val2) {
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
TTNpcScript::TTNpcScript(int charId, const char *charClass, int v2,
|
||||
TTnpcScript::TTnpcScript(int charId, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) :
|
||||
TTNpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
|
||||
TTnpcScriptBase(charId, charClass, v2, charName, v3, val2, v4, v5, v6, v7),
|
||||
_subPtr(nullptr), _field60(0), _field64(0), _field68(0),
|
||||
_field6C(0), _field70(0), _field74(0), _field78(0),
|
||||
_field7C(0), _field80(0) {
|
||||
@ -51,95 +51,95 @@ TTNpcScript::TTNpcScript(int charId, const char *charClass, int v2,
|
||||
resetFlags();
|
||||
}
|
||||
|
||||
void TTNpcScript::resetFlags() {
|
||||
void TTnpcScript::resetFlags() {
|
||||
Common::fill(&_array[26], &_array[146], 0);
|
||||
}
|
||||
|
||||
void TTNpcScript::randomizeFlags() {
|
||||
void TTnpcScript::randomizeFlags() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTNpcScript::proc4(int v) {
|
||||
void TTnpcScript::proc4(int v) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
int TTNpcScript::proc6() const {
|
||||
int TTnpcScript::proc6() const {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void TTNpcScript::proc7(int v1, int v2) {
|
||||
void TTnpcScript::proc7(int v1, int v2) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
int TTNpcScript::proc8() const {
|
||||
int TTnpcScript::proc8() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc9() const {
|
||||
int TTnpcScript::proc9() const {
|
||||
return 2;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc11() const {
|
||||
int TTnpcScript::proc11() const {
|
||||
return 2;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc12() const {
|
||||
int TTnpcScript::proc12() const {
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool TTNpcScript::proc13() const {
|
||||
bool TTnpcScript::proc13() const {
|
||||
warning("TODO");
|
||||
return true;
|
||||
}
|
||||
|
||||
void TTNpcScript::proc14(int v) {
|
||||
void TTnpcScript::proc14(int v) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
int TTNpcScript::proc15() const {
|
||||
int TTnpcScript::proc15() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool TTNpcScript::proc16() const {
|
||||
bool TTnpcScript::proc16() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TTNpcScript::proc17() const {
|
||||
bool TTnpcScript::proc17() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TTNpcScript::proc18() const {
|
||||
bool TTnpcScript::proc18() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
void TTNpcScript::proc19(int v) {
|
||||
void TTnpcScript::proc19(int v) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTNpcScript::proc20(int v) {
|
||||
void TTnpcScript::proc20(int v) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
int TTNpcScript::proc21(int v) {
|
||||
int TTnpcScript::proc21(int v) {
|
||||
return v;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc22() const {
|
||||
int TTnpcScript::proc22() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc23() const {
|
||||
int TTnpcScript::proc23() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc25() const {
|
||||
int TTnpcScript::proc25() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TTNpcScript::proc26() {
|
||||
void TTnpcScript::proc26() {
|
||||
}
|
||||
|
||||
void TTNpcScript::save(SimpleFile *file) {
|
||||
void TTnpcScript::save(SimpleFile *file) {
|
||||
file->writeNumber(charId());
|
||||
saveBody(file);
|
||||
|
||||
@ -154,7 +154,7 @@ void TTNpcScript::save(SimpleFile *file) {
|
||||
file->writeNumber(_array[idx]);
|
||||
}
|
||||
|
||||
void TTNpcScript::load(SimpleFile *file) {
|
||||
void TTnpcScript::load(SimpleFile *file) {
|
||||
loadBody(file);
|
||||
|
||||
int count = file->readNumber();
|
||||
@ -174,7 +174,7 @@ void TTNpcScript::load(SimpleFile *file) {
|
||||
}
|
||||
}
|
||||
|
||||
void TTNpcScript::saveBody(SimpleFile *file) {
|
||||
void TTnpcScript::saveBody(SimpleFile *file) {
|
||||
int v = proc31();
|
||||
file->writeNumber(v);
|
||||
|
||||
@ -183,7 +183,7 @@ void TTNpcScript::saveBody(SimpleFile *file) {
|
||||
}
|
||||
}
|
||||
|
||||
void TTNpcScript::loadBody(SimpleFile *file) {
|
||||
void TTnpcScript::loadBody(SimpleFile *file) {
|
||||
int count = file->readNumber();
|
||||
preLoad();
|
||||
|
||||
@ -196,38 +196,38 @@ void TTNpcScript::loadBody(SimpleFile *file) {
|
||||
}
|
||||
}
|
||||
|
||||
int TTNpcScript::proc31() {
|
||||
int TTnpcScript::proc31() {
|
||||
warning("TODO");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TTNpcScript::proc32() {
|
||||
void TTnpcScript::proc32() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTNpcScript::proc33(int v1, int v2) {
|
||||
void TTnpcScript::proc33(int v1, int v2) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
int TTNpcScript::proc34() {
|
||||
int TTnpcScript::proc34() {
|
||||
warning("TODO");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TTNpcScript::getDialLevel(uint dialNum, bool flag) {
|
||||
int TTnpcScript::getDialLevel(uint dialNum, bool flag) {
|
||||
warning("TODO");
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc36() const {
|
||||
int TTnpcScript::proc36() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TTNpcScript::proc37() const {
|
||||
int TTnpcScript::proc37() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TTNpcScript::preLoad() {
|
||||
void TTnpcScript::preLoad() {
|
||||
if (_subPtr) {
|
||||
error("TODO");
|
||||
}
|
||||
|
@ -29,14 +29,14 @@
|
||||
namespace Titanic {
|
||||
|
||||
|
||||
class TTNpcScriptBase : public TTScriptBase {
|
||||
class TTnpcScriptBase : public TTscriptBase {
|
||||
protected:
|
||||
int _field54;
|
||||
int _val2;
|
||||
public:
|
||||
int _charId;
|
||||
public:
|
||||
TTNpcScriptBase(int charId, const char *charClass, int v2,
|
||||
TTnpcScriptBase(int charId, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4,
|
||||
int v5, int v6, int v7);
|
||||
|
||||
@ -48,7 +48,7 @@ public:
|
||||
/**
|
||||
* Called when the script/id changes
|
||||
*/
|
||||
virtual ScriptChangedResult scriptChanged(TTScriptBase *roomScript, uint id) = 0;
|
||||
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) = 0;
|
||||
|
||||
virtual int proc11() const = 0;
|
||||
virtual int proc12() const = 0;
|
||||
@ -56,7 +56,7 @@ public:
|
||||
int charId() const { return _charId; }
|
||||
};
|
||||
|
||||
class TTNpcScript : public TTNpcScriptBase {
|
||||
class TTnpcScript : public TTnpcScriptBase {
|
||||
protected:
|
||||
byte *_subPtr;
|
||||
int _field60;
|
||||
@ -74,7 +74,7 @@ protected:
|
||||
|
||||
void randomizeFlags();
|
||||
public:
|
||||
TTNpcScript(int charId, const char *charClass, int v2,
|
||||
TTnpcScript(int charId, const char *charClass, int v2,
|
||||
const char *charName, int v3, int val2, int v4,
|
||||
int v5, int v6, int v7);
|
||||
|
||||
@ -87,7 +87,7 @@ public:
|
||||
/**
|
||||
* Called when the script/id changes
|
||||
*/
|
||||
virtual ScriptChangedResult scriptChanged(TTScriptBase *roomScript, uint id) {
|
||||
virtual ScriptChangedResult scriptChanged(TTscriptBase *roomScript, uint id) {
|
||||
return SCR_2;
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ public:
|
||||
/**
|
||||
* Called with the script and id changes
|
||||
*/
|
||||
ScriptChangedResult notifyScript(TTScriptBase *npcScript, int id) {
|
||||
ScriptChangedResult notifyScript(TTscriptBase *npcScript, int id) {
|
||||
return scriptChanged(npcScript, id);
|
||||
}
|
||||
};
|
||||
|
@ -22,7 +22,12 @@
|
||||
|
||||
#include "titanic/true_talk/tt_parser.h"
|
||||
#include "titanic/true_talk/script_handler.h"
|
||||
#include "titanic/true_talk/tt_input.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
void TTparser::processInput(TTinput *input) {
|
||||
warning("TODO: TTparser::processInput");
|
||||
}
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -23,6 +23,8 @@
|
||||
#ifndef TITANIC_TT_PARSER_H
|
||||
#define TITANIC_TT_PARSER_H
|
||||
|
||||
#include "titanic/true_talk/tt_input.h"
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class CScriptHandler;
|
||||
@ -39,6 +41,11 @@ public:
|
||||
public:
|
||||
TTparser(CScriptHandler *owner) : _owner(owner), _field4(0), _field8(0),
|
||||
_fieldC(0), _field10(0), _field14(0), _field18(0) {}
|
||||
|
||||
/**
|
||||
* Gets passed a newly created input wrapper during conversation text processing
|
||||
*/
|
||||
void processInput(TTinput *input);
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -25,42 +25,42 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
TTRoomScriptBase::TTRoomScriptBase(int scriptId,
|
||||
TTroomScriptBase::TTroomScriptBase(int scriptId,
|
||||
const char *charClass, const char *charName,
|
||||
int v3, int v4, int v5, int v6, int v2, int v7) : _scriptId(scriptId),
|
||||
TTScriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) {
|
||||
TTscriptBase(3, charClass, v2, charName, v3, v4, v5, v6, v7) {
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
TTRoomScript::TTRoomScript(int scriptId) :
|
||||
TTRoomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
|
||||
TTroomScript::TTroomScript(int scriptId) :
|
||||
TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) {
|
||||
}
|
||||
|
||||
void TTRoomScript::proc6() {
|
||||
void TTroomScript::proc6() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTRoomScript::proc7() {
|
||||
void TTroomScript::proc7() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTRoomScript::proc8() {
|
||||
void TTroomScript::proc8() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTRoomScript::proc9() {
|
||||
void TTroomScript::proc9() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
ScriptChangedResult TTRoomScript::scriptChanged(TTScriptBase *npcScript, int id) {
|
||||
ScriptChangedResult TTroomScript::scriptChanged(TTscriptBase *npcScript, int id) {
|
||||
if (id == 1)
|
||||
_field54 = 1;
|
||||
|
||||
return SCR_1;
|
||||
}
|
||||
|
||||
void TTRoomScript::proc11() {
|
||||
void TTroomScript::proc11() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
|
@ -27,11 +27,11 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class TTRoomScriptBase : public TTScriptBase {
|
||||
class TTroomScriptBase : public TTscriptBase {
|
||||
public:
|
||||
int _scriptId;
|
||||
public:
|
||||
TTRoomScriptBase(int scriptId, const char *charClass, const char *charName,
|
||||
TTroomScriptBase(int scriptId, const char *charClass, const char *charName,
|
||||
int v3, int v4, int v5, int v6, int v2, int v7);
|
||||
|
||||
virtual void proc6() = 0;
|
||||
@ -42,17 +42,17 @@ public:
|
||||
/**
|
||||
* Called when the script changes
|
||||
*/
|
||||
virtual ScriptChangedResult scriptChanged(TTScriptBase *npcScript, int id) = 0;
|
||||
virtual ScriptChangedResult scriptChanged(TTscriptBase *npcScript, int id) = 0;
|
||||
|
||||
virtual void proc11() = 0;
|
||||
};
|
||||
|
||||
|
||||
class TTRoomScript : public TTRoomScriptBase {
|
||||
class TTroomScript : public TTroomScriptBase {
|
||||
private:
|
||||
int _field54;
|
||||
public:
|
||||
TTRoomScript(int scriptId);
|
||||
TTroomScript(int scriptId);
|
||||
|
||||
virtual void proc6();
|
||||
virtual void proc7();
|
||||
@ -62,14 +62,14 @@ public:
|
||||
/**
|
||||
* Called when the script changes
|
||||
*/
|
||||
virtual ScriptChangedResult scriptChanged(TTScriptBase *npcScript, int id);
|
||||
virtual ScriptChangedResult scriptChanged(TTscriptBase *npcScript, int id);
|
||||
|
||||
virtual void proc11();
|
||||
|
||||
/**
|
||||
* Called with the new script and id
|
||||
*/
|
||||
ScriptChangedResult notifyScript(TTScriptBase *npcScript, int id) {
|
||||
ScriptChangedResult notifyScript(TTscriptBase *npcScript, int id) {
|
||||
return scriptChanged(npcScript, id);
|
||||
}
|
||||
};
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
TTScriptBase::TTScriptBase(int v1, const char *charClass, int v2,
|
||||
TTscriptBase::TTscriptBase(int v1, const char *charClass, int v2,
|
||||
const char *charName, int v3, int v4, int v5, int v6, int v7) :
|
||||
_charName(charName), _charClass(charClass),
|
||||
_field4(0), _field8(0), _fieldC(0),
|
||||
@ -50,13 +50,13 @@ TTScriptBase::TTScriptBase(int v1, const char *charClass, int v2,
|
||||
reset();
|
||||
}
|
||||
|
||||
bool TTScriptBase::areNamesValid() {
|
||||
bool TTscriptBase::areNamesValid() {
|
||||
bool result = !_charName.isValid() && !_charClass.isValid();
|
||||
_status = result ? 0 : 11;
|
||||
return result;
|
||||
}
|
||||
|
||||
void TTScriptBase::reset() {
|
||||
void TTscriptBase::reset() {
|
||||
_field4 = 0;
|
||||
_field8 = 4;
|
||||
_fieldC = 0;
|
||||
@ -73,19 +73,23 @@ void TTScriptBase::reset() {
|
||||
_field48 = 0;
|
||||
}
|
||||
|
||||
void TTScriptBase::proc2(int v) {
|
||||
void TTscriptBase::processInput(TTinput *input) {
|
||||
warning("TODO: TTscriptBase::processInput");
|
||||
}
|
||||
|
||||
void TTscriptBase::proc2(int v) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTScriptBase::proc3(int v) {
|
||||
void TTscriptBase::proc3(int v) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTScriptBase::proc4(int v) {
|
||||
void TTscriptBase::proc4(int v) {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
void TTScriptBase::proc5() {
|
||||
void TTscriptBase::proc5() {
|
||||
warning("TODO");
|
||||
}
|
||||
|
||||
|
@ -31,7 +31,9 @@ enum ScriptChangedResult {
|
||||
SCR_1 = 1, SCR_2 = 2, SCR_3 = 3, SCR_4 = 4, SCR_5 = 5
|
||||
};
|
||||
|
||||
class TTScriptBase {
|
||||
class TTinput;
|
||||
|
||||
class TTscriptBase {
|
||||
private:
|
||||
void reset();
|
||||
protected:
|
||||
@ -52,13 +54,18 @@ protected:
|
||||
int _field48;
|
||||
int _status;
|
||||
public:
|
||||
TTScriptBase(int v1, const char *charClass, int v2, const char *charName,
|
||||
TTscriptBase(int v1, const char *charClass, int v2, const char *charName,
|
||||
int v3, int v4, int v5, int v6, int v7);
|
||||
|
||||
bool areNamesValid();
|
||||
|
||||
int getStatus() const { return _status; }
|
||||
|
||||
/**
|
||||
* Gets passed a newly created input wrapper during conversation text processing
|
||||
*/
|
||||
void processInput(TTinput *input);
|
||||
|
||||
virtual void proc2(int v);
|
||||
|
||||
virtual void proc3(int v);
|
||||
|
@ -33,9 +33,9 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
TTNpcScript *TTNpcScriptList::findById(int charId) const {
|
||||
for (TTNpcScriptList::const_iterator i = begin(); i != end(); ++i) {
|
||||
const TTNpcScriptListItem *item = *i;
|
||||
TTnpcScript *TTnpcScriptList::findById(int charId) const {
|
||||
for (TTnpcScriptList::const_iterator i = begin(); i != end(); ++i) {
|
||||
const TTnpcScriptListItem *item = *i;
|
||||
if (item->_npcScript->_charId == charId)
|
||||
return item->_npcScript;
|
||||
}
|
||||
@ -45,9 +45,9 @@ TTNpcScript *TTNpcScriptList::findById(int charId) const {
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
TTRoomScript *TTRoomScriptList::findById(int scriptId) const {
|
||||
for (TTRoomScriptList::const_iterator i = begin(); i != end(); ++i) {
|
||||
const TTRoomScriptListItem *item = *i;
|
||||
TTroomScript *TTroomScriptList::findById(int scriptId) const {
|
||||
for (TTroomScriptList::const_iterator i = begin(); i != end(); ++i) {
|
||||
const TTroomScriptListItem *item = *i;
|
||||
if (item->_item->_scriptId == scriptId)
|
||||
return item->_item;
|
||||
}
|
||||
@ -57,11 +57,11 @@ TTRoomScript *TTRoomScriptList::findById(int scriptId) const {
|
||||
|
||||
/*------------------------------------------------------------------------*/
|
||||
|
||||
TTScripts::TTScripts(CTitleEngine *titleEngine) :
|
||||
TTscripts::TTscripts(CTitleEngine *titleEngine) :
|
||||
_titleEngine(titleEngine), _field24(0), _field28(0) {
|
||||
// Load room scripts
|
||||
for (int scriptNum = 100; scriptNum < 133; ++scriptNum)
|
||||
addScript(new TTRoomScript(scriptNum));
|
||||
addScript(new TTroomScript(scriptNum));
|
||||
|
||||
// Load npc scripts
|
||||
addScript(new DoorbotScript(104, "Doorbot", 0, "Fentible", 11, 1, -1, -1, -1, 0), 100);
|
||||
@ -74,25 +74,25 @@ TTScripts::TTScripts(CTitleEngine *titleEngine) :
|
||||
addScript(new SuccUBusScript(111, "Succubus", 0, "Shorbert", 9, 1, -1, -1, -1, 0), 110);
|
||||
}
|
||||
|
||||
void TTScripts::addScript(TTNpcScript *script, int scriptId) {
|
||||
void TTscripts::addScript(TTnpcScript *script, int scriptId) {
|
||||
script->proc13();
|
||||
|
||||
// Find the room script this is associated with
|
||||
TTRoomScript *roomScript = getRoomScript(scriptId);
|
||||
TTroomScript *roomScript = getRoomScript(scriptId);
|
||||
assert(roomScript);
|
||||
|
||||
_npcScripts.push_back(new TTNpcScriptListItem(script, roomScript));
|
||||
_npcScripts.push_back(new TTnpcScriptListItem(script, roomScript));
|
||||
}
|
||||
|
||||
void TTScripts::addScript(TTRoomScript *script) {
|
||||
_roomScripts.push_back(new TTRoomScriptListItem(script));
|
||||
void TTscripts::addScript(TTroomScript *script) {
|
||||
_roomScripts.push_back(new TTroomScriptListItem(script));
|
||||
}
|
||||
|
||||
TTRoomScript *TTScripts::getRoomScript(int scriptId) const {
|
||||
TTroomScript *TTscripts::getRoomScript(int scriptId) const {
|
||||
return _roomScripts.findById(scriptId);
|
||||
}
|
||||
|
||||
TTNpcScript *TTScripts::getNpcScript(int charId) const {
|
||||
TTnpcScript *TTscripts::getNpcScript(int charId) const {
|
||||
return _npcScripts.findById(charId);
|
||||
}
|
||||
|
||||
|
@ -31,33 +31,33 @@ namespace Titanic {
|
||||
|
||||
class CTitleEngine;
|
||||
|
||||
class TTNpcScriptListItem : public ListItem {
|
||||
class TTnpcScriptListItem : public ListItem {
|
||||
public:
|
||||
TTNpcScript *_npcScript;
|
||||
TTRoomScript *_roomScript;
|
||||
TTnpcScript *_npcScript;
|
||||
TTroomScript *_roomScript;
|
||||
public:
|
||||
TTNpcScriptListItem() : _npcScript(nullptr), _roomScript(nullptr) {}
|
||||
TTNpcScriptListItem(TTNpcScript *script, TTRoomScript *roomScript) :
|
||||
TTnpcScriptListItem() : _npcScript(nullptr), _roomScript(nullptr) {}
|
||||
TTnpcScriptListItem(TTnpcScript *script, TTroomScript *roomScript) :
|
||||
_npcScript(script), _roomScript(roomScript) {}
|
||||
virtual ~TTNpcScriptListItem() { delete _npcScript; }
|
||||
virtual ~TTnpcScriptListItem() { delete _npcScript; }
|
||||
};
|
||||
|
||||
PTR_LIST_ITEM(TTRoomScript);
|
||||
PTR_LIST_ITEM(TTroomScript);
|
||||
|
||||
class TTNpcScriptList : public List<TTNpcScriptListItem> {
|
||||
class TTnpcScriptList : public List<TTnpcScriptListItem> {
|
||||
public:
|
||||
TTNpcScript *findById(int charId) const;
|
||||
TTnpcScript *findById(int charId) const;
|
||||
};
|
||||
|
||||
class TTRoomScriptList : public List<TTRoomScriptListItem> {
|
||||
class TTroomScriptList : public List<TTroomScriptListItem> {
|
||||
public:
|
||||
TTRoomScript *findById(int scriptId) const;
|
||||
TTroomScript *findById(int scriptId) const;
|
||||
};
|
||||
|
||||
class TTScripts {
|
||||
class TTscripts {
|
||||
private:
|
||||
TTNpcScriptList _npcScripts;
|
||||
TTRoomScriptList _roomScripts;
|
||||
TTnpcScriptList _npcScripts;
|
||||
TTroomScriptList _roomScripts;
|
||||
CTitleEngine *_titleEngine;
|
||||
int _field24;
|
||||
int _field28;
|
||||
@ -65,24 +65,24 @@ private:
|
||||
/**
|
||||
* Add a named script to the named scripts list
|
||||
*/
|
||||
void addScript(TTNpcScript *script, int charId);
|
||||
void addScript(TTnpcScript *script, int charId);
|
||||
|
||||
/**
|
||||
* Add an unnamed script to the unnamed scripts list
|
||||
*/
|
||||
void addScript(TTRoomScript *script);
|
||||
void addScript(TTroomScript *script);
|
||||
public:
|
||||
TTScripts(CTitleEngine *titleEngine);
|
||||
TTscripts(CTitleEngine *titleEngine);
|
||||
|
||||
/**
|
||||
* Return a pointer to the specified room script
|
||||
*/
|
||||
TTRoomScript *getRoomScript(int scriptId) const;
|
||||
TTroomScript *getRoomScript(int scriptId) const;
|
||||
|
||||
/**
|
||||
* Return a pointer to the specified character script
|
||||
*/
|
||||
TTNpcScript *getNpcScript(int charId) const;
|
||||
TTnpcScript *getNpcScript(int charId) const;
|
||||
};
|
||||
|
||||
} // End of namespace Titanic
|
||||
|
@ -38,7 +38,7 @@ struct TTstringData {
|
||||
TTstringData(const CString &str) : _string(str), _referenceCount(1) {}
|
||||
};
|
||||
|
||||
enum TTstringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_13 = 13 };
|
||||
enum TTstringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 };
|
||||
|
||||
class TTstring {
|
||||
private:
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
TTTitleScript::TTTitleScript() : TTScriptBase(1, "", 0, "", 0, -1, -1, -1, 0),
|
||||
TTTitleScript::TTTitleScript() : TTscriptBase(1, "", 0, "", 0, -1, -1, -1, 0),
|
||||
_field50(0), _field5C(-1), _field60(0) {
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
||||
|
||||
namespace Titanic {
|
||||
|
||||
class TTTitleScript : public TTScriptBase {
|
||||
class TTTitleScript : public TTscriptBase {
|
||||
private:
|
||||
int _field50;
|
||||
TTstring _string1;
|
||||
|
Loading…
Reference in New Issue
Block a user