25 #include "lure/luredefs.h" 26 #include "lure/memory.h" 27 #include "lure/res_struct.h" 28 #include "lure/hotspots.h" 29 #include "lure/palette.h" 31 #include "common/array.h" 32 #include "common/file.h" 33 #include "common/list.h" 34 #include "common/random.h" 38 enum TalkState {TALK_NONE, TALK_START, TALK_SELECT, TALK_RESPOND, TALK_RESPONSE_WAIT,
39 TALK_RESPOND_2, TALK_RESPOND_3};
41 #define MAX_TALK_SELECTIONS 4 42 typedef TalkEntryData *TalkSelections[MAX_TALK_SELECTIONS];
49 #define NUM_GIVE_TALK_IDS 6 63 uint16 *_hotspotScriptData;
72 Action _currentAction;
87 TalkSelections _talkSelections;
91 uint16 _talkingCharacter;
92 byte _cursor[CURSOR_WIDTH * CURSOR_HEIGHT];
103 RoomData *getRoom(uint16 roomNumber);
105 void insertPaletteSubset(
Palette &p);
106 byte *getCursor(uint8 cursorNum);
111 MemoryBlock *hotspotScriptData() {
return _script2Data; }
112 MemoryBlock *messagesData() {
return _messagesData; }
113 uint16 getHotspotScript(uint16 index);
114 HotspotList &activeHotspots() {
return _activeHotspots; }
117 Hotspot *getActiveHotspot(uint16 hotspotId);
123 uint16 getHotspotAction(uint16 actionsOffset, Action action);
128 MemoryBlock &getTalkDialogData() {
return *_talkDialogData; }
134 BarmanLists &barmanLists() {
return _barmanLists; }
135 StringList &stringList() {
return _stringList; }
136 uint16 getCharOffset(
int index) {
137 if (index >= numCharOffsets)
138 error(
"Invalid index %d passed to script engine support data offset list", index);
140 error(
"support data list index #1 was referenced - special handlng TODO");
141 return _charOffsets[index];
143 void copyCursorTo(
Surface *s, uint8 cursorNum, int16 x, int16 y);
145 uint16 numInventoryItems();
146 void setTalkData(uint16 offset);
147 TalkData *getTalkData() {
return _activeTalkData; }
148 void setTalkState(TalkState state) { _talkState = state; }
149 TalkState getTalkState() {
return _talkState; }
150 TalkSelections &getTalkSelections() {
return _talkSelections; }
152 void setTalkSelection(
int index) { _talkSelection = index; }
153 int getTalkSelection() {
return _talkSelection; }
154 void setTalkStartEntry(
int index) { _talkStartEntry = index; }
155 int getTalkStartEntry() {
return _talkStartEntry; }
156 uint16 getTalkingCharacter() {
return _talkingCharacter; }
157 void setTalkingCharacter(uint16 index);
158 uint16 getGiveTalkId(uint16 index) {
159 if (index >= _giveTalkIds.
size())
160 error(
"Invalid give talk id specified");
161 return _giveTalkIds[index];
163 void setCurrentAction(Action action) { _currentAction = action; }
164 Action getCurrentAction() {
return _currentAction; }
165 const char *getCurrentActionStr() {
166 if (_currentAction > EXAMINE)
167 error(
"Invalid current action %d", _currentAction);
168 return _stringList.getString(_currentAction);
170 Hotspot *activateHotspot(uint16 hotspotId);
171 Hotspot *addHotspot(uint16 hotspotId);
172 void addHotspot(
Hotspot *hotspot);
173 void deactivateHotspot(uint16 hotspotId,
bool isDestId =
false);
174 void deactivateHotspot(
Hotspot *hotspot);
Definition: hotspots.h:483
Definition: res_struct.h:851
Definition: res_struct.h:652
Definition: res_struct.h:607
Definition: res_struct.h:335
uint getRandomNumber(uint max)
Definition: res_struct.h:513
Definition: hotspots.h:180
Definition: res_struct.h:898
Definition: res_struct.h:700
Definition: res_struct.h:686
Definition: res_struct.h:358
Definition: res_struct.h:576
Definition: res_struct.h:372
Definition: res_struct.h:779
Definition: res_struct.h:349
Definition: res_struct.h:824
Definition: res_struct.h:582
size_type size() const
Definition: array.h:315
void NORETURN_PRE error(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: res_struct.h:742
Definition: res_struct.h:798
Definition: res_struct.h:719
Definition: res_struct.h:664
Definition: res_struct.h:313
Definition: res_struct.h:380