22 #ifndef SHERLOCK_TALK_H 23 #define SHERLOCK_TALK_H 25 #include "common/scummsys.h" 26 #include "common/array.h" 27 #include "common/rect.h" 28 #include "common/stream.h" 29 #include "common/stack.h" 30 #include "sherlock/objects.h" 31 #include "sherlock/saveload.h" 35 #define SPEAKER_REMOVE 0x80 36 #define MAX_TALK_SEQUENCES 11 39 OP_SWITCH_SPEAKER = 0,
40 OP_RUN_CANIMATION = 1,
41 OP_ASSIGN_PORTRAIT_LOCATION = 2,
43 OP_REMOVE_PORTRAIT = 4,
45 OP_ADJUST_OBJ_SEQUENCE = 6,
46 OP_WALK_TO_COORDS = 7,
47 OP_PAUSE_WITHOUT_CONTROL = 8,
49 OP_SUMMON_WINDOW = 10,
52 OP_TOGGLE_OBJECT = 13,
53 OP_STEALTH_MODE_ACTIVE = 14,
55 OP_ELSE_STATEMENT = 16,
56 OP_END_IF_STATEMENT = 17,
57 OP_STEALTH_MODE_DEACTIVATE = 18,
58 OP_TURN_HOLMES_OFF = 19,
59 OP_TURN_HOLMES_ON = 20,
61 OP_PLAY_PROLOGUE = 22,
62 OP_ADD_ITEM_TO_INVENTORY = 23,
64 OP_CALL_TALK_FILE = 25,
66 OP_DISPLAY_INFO_LINE = 27,
67 OP_CLEAR_INFO_LINE = 28,
68 OP_WALK_TO_CANIMATION = 29,
69 OP_REMOVE_ITEM_FROM_INVENTORY = 30,
70 OP_ENABLE_END_KEY = 31,
71 OP_DISABLE_END_KEY = 32,
72 OP_END_TEXT_WINDOW = 33,
75 OP_SET_WALK_CONTROL = 35,
76 OP_SET_TALK_SEQUENCE = 36,
78 OP_WALK_HOLMES_AND_NPC_TO_CANIM = 38,
79 OP_SET_NPC_PATH_DEST = 39,
81 OP_SET_NPC_PATH_PAUSE = 41,
82 OP_NEED_PASSWORD = 42,
83 OP_SET_SCENE_ENTRY_FLAG = 43,
84 OP_WALK_NPC_TO_CANIM = 44,
85 OP_WALK_NPC_TO_COORDS = 45,
86 OP_WALK_HOLMES_AND_NPC_TO_COORDS = 46,
87 OP_SET_NPC_TALK_FILE = 47,
90 OP_NPC_DESC_ON_OFF = 50,
91 OP_NPC_PATH_PAUSE_TAKING_NOTES = 51,
92 OP_NPC_PATH_PAUSE_LOOKING_HOLMES = 52,
93 OP_ENABLE_TALK_INTERRUPTS = 53,
94 OP_DISABLE_TALK_INTERRUPTS = 54,
95 OP_SET_NPC_INFO_LINE = 55,
96 OP_SET_NPC_POSITION = 56,
97 OP_NPC_PATH_LABEL = 57,
98 OP_PATH_GOTO_LABEL = 58,
99 OP_PATH_IF_FLAG_GOTO_LABEL = 59,
100 OP_NPC_WALK_GRAPHICS = 60,
102 OP_NPC_VERB_CANIM = 62,
103 OP_NPC_VERB_SCRIPT = 63,
104 OP_RESTORE_PEOPLE_SEQUENCE = 64,
105 OP_NPC_VERB_TARGET = 65,
106 OP_TURN_SOUNDS_OFF = 66,
110 enum OpcodeReturn { RET_EXIT = -1, RET_SUCCESS = 0, RET_CONTINUE = 1 };
112 class SherlockEngine;
114 namespace Scalpel {
class ScalpelUserInterface; }
116 typedef OpcodeReturn(Talk::*OpcodeMethod)(
const byte *&str);
123 short _sequenceNumber;
161 bool &operator[](
int index) {
return _data[index]; }
170 void stripVoiceCommands();
173 OpcodeMethod *_opcodeTable;
181 int _scriptSaveIndex;
191 bool _endStr, _noTextYet;
193 const byte *_scriptStart, *_scriptEnd;
197 OpcodeReturn cmdAddItemToInventory(
const byte *&str);
198 OpcodeReturn cmdAdjustObjectSequence(
const byte *&str);
199 OpcodeReturn cmdBanishWindow(
const byte *&str);
200 OpcodeReturn cmdDisableEndKey(
const byte *&str);
201 OpcodeReturn cmdEnableEndKey(
const byte *&str);
202 OpcodeReturn cmdEndTextWindow(
const byte *&str);
203 OpcodeReturn cmdHolmesOff(
const byte *&str);
204 OpcodeReturn cmdHolmesOn(
const byte *&str);
205 OpcodeReturn cmdPause(
const byte *&str);
206 OpcodeReturn cmdPauseWithoutControl(
const byte *&str);
207 OpcodeReturn cmdRemoveItemFromInventory(
const byte *&str);
208 OpcodeReturn cmdRunCAnimation(
const byte *&str);
209 OpcodeReturn cmdSetFlag(
const byte *&str);
210 OpcodeReturn cmdSetObject(
const byte *&str);
211 OpcodeReturn cmdStealthModeActivate(
const byte *&str);
212 OpcodeReturn cmdStealthModeDeactivate(
const byte *&str);
213 OpcodeReturn cmdToggleObject(
const byte *&str);
214 OpcodeReturn cmdWalkToCAnimation(
const byte *&str);
219 bool isOpcode(byte checkCharacter);
230 virtual int waitForMore(
int delay);
235 virtual void talkInterface(
const byte *&str) = 0;
240 virtual void talkWait(
const byte *&str);
245 virtual void showTalk() = 0;
250 virtual void nothingToSay() = 0;
262 bool _openTalkWindow;
264 bool _moreTalkUp, _moreTalkDown;
266 const byte *_opcodes;
299 void initTalk(
int objNum);
316 void pushSequence(
int speaker);
321 virtual void pushSequenceEntry(
Object *obj) = 0;
326 virtual void clearSequences() = 0;
352 virtual int talkLine(
int lineNum,
int stateNum, byte color,
int lineY,
bool slamIt) {
return 0; }
358 virtual void pullSequence(
int slot = -1) = 0;
363 virtual bool isSequencesEmpty()
const = 0;
Definition: scalpel_user_interface.h:58
virtual void drawInterface()
Definition: talk.h:341
Definition: animation.h:29
Definition: serializer.h:79
virtual int talkLine(int lineNum, int stateNum, byte color, int lineY, bool slamIt)
Definition: talk.h:352
Definition: sherlock.h:76
Definition: objects.h:363
virtual void switchSpeaker()
Definition: talk.h:255
virtual bool displayTalk(bool slamIt)
Definition: talk.h:347
Statement & operator[](int idx)
Definition: talk.h:275