ScummVM API documentation
Sherlock::Talk Class Referenceabstract
Inheritance diagram for Sherlock::Talk:
Sherlock::Scalpel::ScalpelTalk Sherlock::Tattoo::TattooTalk

Public Member Functions

Statementoperator[] (int idx)
 
virtual void talkTo (const Common::String &filename)
 
void doScript (const Common::String &script)
 
void initTalk (int objNum)
 
void freeTalkVars ()
 
virtual void loadTalkFile (const Common::String &filename)
 
void pushSequence (int speaker)
 
virtual void pushSequenceEntry (Object *obj)=0
 
virtual void clearSequences ()=0
 
void popStack ()
 
void synchronize (Serializer &s)
 
virtual void drawInterface ()
 
virtual bool displayTalk (bool slamIt)
 
virtual int talkLine (int lineNum, int stateNum, byte color, int lineY, bool slamIt)
 
virtual void pullSequence (int slot=-1)=0
 
virtual bool isSequencesEmpty () const =0
 

Static Public Member Functions

static Talkinit (SherlockEngine *vm)
 

Public Attributes

Common::Array< Statement_statements
 
bool _talkToAbort
 
int _talkCounter
 
int _talkTo
 
int _scriptMoreFlag
 
bool _openTalkWindow
 
Common::String _scriptName
 
bool _moreTalkUp
 
bool _moreTalkDown
 
int _converseNum
 
const byte * _opcodes
 
int _speaker
 

Protected Member Functions

 Talk (SherlockEngine *vm)
 
OpcodeReturn cmdAddItemToInventory (const byte *&str)
 
OpcodeReturn cmdAdjustObjectSequence (const byte *&str)
 
OpcodeReturn cmdBanishWindow (const byte *&str)
 
OpcodeReturn cmdDisableEndKey (const byte *&str)
 
OpcodeReturn cmdEnableEndKey (const byte *&str)
 
OpcodeReturn cmdEndTextWindow (const byte *&str)
 
OpcodeReturn cmdHolmesOff (const byte *&str)
 
OpcodeReturn cmdHolmesOn (const byte *&str)
 
OpcodeReturn cmdPause (const byte *&str)
 
OpcodeReturn cmdPauseWithoutControl (const byte *&str)
 
OpcodeReturn cmdRemoveItemFromInventory (const byte *&str)
 
OpcodeReturn cmdRunCAnimation (const byte *&str)
 
OpcodeReturn cmdSetFlag (const byte *&str)
 
OpcodeReturn cmdSetObject (const byte *&str)
 
OpcodeReturn cmdStealthModeActivate (const byte *&str)
 
OpcodeReturn cmdStealthModeDeactivate (const byte *&str)
 
OpcodeReturn cmdToggleObject (const byte *&str)
 
OpcodeReturn cmdWalkToCAnimation (const byte *&str)
 
bool isOpcode (byte checkCharacter)
 
void setTalkMap ()
 
virtual int waitForMore (int delay)
 
virtual void talkInterface (const byte *&str)=0
 
virtual void talkWait (const byte *&str)
 
virtual void showTalk ()=0
 
virtual void nothingToSay ()=0
 
virtual void switchSpeaker ()
 

Protected Attributes

SherlockEngine_vm
 
OpcodeMethod * _opcodeTable
 
Common::Stack< SequenceEntry_savedSequences
 
Common::Stack< ScriptStackEntry_scriptStack
 
Common::Array< TalkHistoryEntry_talkHistory
 
int _talkIndex
 
int _scriptSelect
 
int _talkStealth
 
int _talkToFlag
 
int _scriptSaveIndex
 
int _3doSpeechIndex
 
int _yp
 
int _charCount
 
int _line
 
int _wait
 
bool _pauseFlag
 
bool _endStr
 
bool _noTextYet
 
int _seqCount
 
const byte * _scriptStart
 
const byte * _scriptEnd
 

Member Function Documentation

◆ isOpcode()

bool Sherlock::Talk::isOpcode ( byte  checkCharacter)
protected

Checks if a character is an opcode

◆ setTalkMap()

void Sherlock::Talk::setTalkMap ( )
protected

Form a table of the display indexes for statements

◆ waitForMore()

virtual int Sherlock::Talk::waitForMore ( int  delay)
protectedvirtual

When the talk window has been displayed, waits a period of time proportional to the amount of text that's been displayed

Reimplemented in Sherlock::Scalpel::ScalpelTalk.

◆ talkInterface()

virtual void Sherlock::Talk::talkInterface ( const byte *&  str)
protectedpure virtual

Display the talk interface window

Implemented in Sherlock::Tattoo::TattooTalk, and Sherlock::Scalpel::ScalpelTalk.

◆ talkWait()

virtual void Sherlock::Talk::talkWait ( const byte *&  str)
protectedvirtual

Pause when displaying a talk dialog on-screen

Reimplemented in Sherlock::Scalpel::ScalpelTalk.

◆ showTalk()

virtual void Sherlock::Talk::showTalk ( )
protectedpure virtual

Show the talk display

Implemented in Sherlock::Tattoo::TattooTalk, and Sherlock::Scalpel::ScalpelTalk.

◆ nothingToSay()

virtual void Sherlock::Talk::nothingToSay ( )
protectedpure virtual

Called when a character being spoken to has no talk options to display

Implemented in Sherlock::Tattoo::TattooTalk, and Sherlock::Scalpel::ScalpelTalk.

◆ switchSpeaker()

virtual void Sherlock::Talk::switchSpeaker ( )
inlineprotectedvirtual

Called when the active speaker is switched

Reimplemented in Sherlock::Scalpel::ScalpelTalk.

◆ operator[]()

Statement& Sherlock::Talk::operator[] ( int  idx)
inline

Return a given talk statement

◆ talkTo()

virtual void Sherlock::Talk::talkTo ( const Common::String filename)
virtual

Called whenever a conversation or item script needs to be run. For standard conversations, it opens up a description window similar to how 'talk' does, but shows a 'reply' directly instead of waiting for a statement option.

Remarks
It seems that at some point, all item scripts were set up to use this as well. In their case, the conversation display is simply suppressed, and control is passed on to doScript to implement whatever action is required.

Reimplemented in Sherlock::Tattoo::TattooTalk, and Sherlock::Scalpel::ScalpelTalk.

◆ doScript()

void Sherlock::Talk::doScript ( const Common::String script)

Parses a reply for control codes and display text. The found text is printed within the text window, handles delays, animations, and animating portraits.

◆ initTalk()

void Sherlock::Talk::initTalk ( int  objNum)

Main method for handling conversations when a character to talk to has been selected. It will make Holmes walk to the person to talk to, draws the interface window for the conversation and passes on control to give the player a list of options to make a selection from

◆ freeTalkVars()

void Sherlock::Talk::freeTalkVars ( )

Clear loaded talk data

◆ loadTalkFile()

virtual void Sherlock::Talk::loadTalkFile ( const Common::String filename)
virtual

Opens the talk file 'talk.tlk' and searches the index for the specified conversation. If found, the data for that conversation is loaded

Reimplemented in Sherlock::Scalpel::ScalpelTalk.

◆ pushSequence()

void Sherlock::Talk::pushSequence ( int  speaker)

Push the sequence of a background object that's an NPC that needs to be saved onto the sequence stack.

◆ pushSequenceEntry()

virtual void Sherlock::Talk::pushSequenceEntry ( Object obj)
pure virtual

Push the details of a passed object onto the saved sequences stack

Implemented in Sherlock::Scalpel::ScalpelTalk, and Sherlock::Tattoo::TattooTalk.

◆ clearSequences()

virtual void Sherlock::Talk::clearSequences ( )
pure virtual

Clears the stack of pending object sequences associated with speakers in the scene

Implemented in Sherlock::Scalpel::ScalpelTalk, and Sherlock::Tattoo::TattooTalk.

◆ popStack()

void Sherlock::Talk::popStack ( )

Pops an entry off of the script stack

◆ synchronize()

void Sherlock::Talk::synchronize ( Serializer s)

Synchronize the data for a savegame

◆ drawInterface()

virtual void Sherlock::Talk::drawInterface ( )
inlinevirtual

Draws the interface for conversation display

Reimplemented in Sherlock::Scalpel::ScalpelTalk.

◆ displayTalk()

virtual bool Sherlock::Talk::displayTalk ( bool  slamIt)
inlinevirtual

Display a list of statements in a window at the bottom of the screen that the player can select from.

Reimplemented in Sherlock::Scalpel::ScalpelTalk.

◆ talkLine()

virtual int Sherlock::Talk::talkLine ( int  lineNum,
int  stateNum,
byte  color,
int  lineY,
bool  slamIt 
)
inlinevirtual

Prints a single conversation option in the interface window

Reimplemented in Sherlock::Scalpel::ScalpelTalk.

◆ pullSequence()

virtual void Sherlock::Talk::pullSequence ( int  slot = -1)
pure virtual

Pulls a background object sequence from the sequence stack and restore's the object's sequence

Implemented in Sherlock::Scalpel::ScalpelTalk, and Sherlock::Tattoo::TattooTalk.

◆ isSequencesEmpty()

virtual bool Sherlock::Talk::isSequencesEmpty ( ) const
pure virtual

Returns true if the script stack is empty

Implemented in Sherlock::Scalpel::ScalpelTalk, and Sherlock::Tattoo::TattooTalk.


The documentation for this class was generated from the following file: