ScummVM API documentation
scripts.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef ACCESS_SCRIPTS_H
23#define ACCESS_SCRIPTS_H
24
25#include "common/scummsys.h"
26#include "common/memstream.h"
27#include "access/data.h"
28
29namespace Access {
30
31class AccessEngine;
32class Scripts;
33
34#define SCRIPT_START_BYTE 0xE0
35#define INIT_ROOM_SCRIPT 1000
36#define ROOM_SCRIPT 2000
37
38typedef void(Scripts::*ScriptMethodPtr)();
39
40class Scripts : public Manager {
41 friend class Debugger;
42
43private:
44 int _specialFunction;
45 int _scriptCommand;
46
47 void clearWatch();
48 void printWatch();
49
50protected:
51 Resource *_resource;
53 //ScriptMethodPtr _opcodes[100];
55
56 // Game variables only ever used from inside scripts
57 Common::Point _charsOrg, _texsOrg;
58 int _choice;
59 int32 _choiceStart;
60
61 virtual bool executeSpecial(int commandIndex, int param1, int param2) = 0;
62 virtual void executeCommand(int commandIndex);
63
64 void charLoop();
65
66 void cmdObject();
67 void cmdEndObject();
68 void cmdJumpLook();
69 void cmdJumpOpen();
70 void cmdJumpHelp();
71 void cmdJumpGet();
72 void cmdJumpMove();
73 void cmdJumpUse();
74 void cmdJumpTalk();
75 void cmdNull();
76 void cmdPrint_v1();
77 void cmdPrint_v2();
78 void cmdAnim();
79 void cmdSetFlag();
80 void cmdCheckFlag();
81
85 void cmdGoto();
86
87 void cmdAddScore();
88 void cmdSetInventory();
89 void cmdCheckInventory();
90 void cmdSetPlayerCoords();
91 void cmdNewRoom();
92 void cmdConverse();
93 void cmdCheckFrame();
94 void cmdCheckAnim();
95 void cmdSnd();
96 void cmdRetNeg();
97 void cmdBD();
98 void cmdCheckLoc();
99 void cmdSetAnim();
100 void cmdDispInv_v1();
101 void cmdSetAbout();
102 void cmdSetTimer();
103 void cmdCheckTimer();
104 void cmdJumpGoto();
105 void cmdSetTravel();
106 void cmdSetVideo_v1();
107 void cmdPlayVideo();
108 void cmdPlotImage();
109 void cmdSetDisplay();
110 void cmdSetBuffer();
111 void cmdSetScroll();
112 void cmdSaveRect();
113 void cmdVideoEnded();
114 void cmdSetBufVid();
115 void cmdPlayBufVid();
116 void cmdRemoveLast();
117 void cmdDoTravel();
118 void cmdCheckAbout();
119 void cmdSpecial();
120 void cmdSetCycle();
121 void cmdCycle();
122 void cmdCharSpeak();
123 void cmdTexSpeak();
124 void cmdTexChoice();
125 void cmdWait();
126 void cmdSetConPos();
127 void cmdCheckVFrame();
128 void cmdJumpChoice();
129 void cmdReturnChoice();
130 void cmdClearBlock();
131 void cmdLoadSound();
132 void cmdSetVideoSound();
133 void cmdPlayVideoSound();
134 void cmdPrintWatch();
135 void cmdDispAbout();
136
137 void cmdPushLocation_v1();
138 void cmdCheckTravel();
139 void cmdBlock();
140 void cmdPlayerOff();
141 void cmdPlayerOn();
142 void cmdDead();
143 void cmdFadeOut();
144 void cmdEndVideo();
145 void cmdHelp_v1();
146
147public:
148 int _sequence;
149 bool _endFlag;
150 int _returnCode;
151
152 int _continuenceType; // Only used in Noctropolis
153 bool _continuenceFlag; // Only set in Noctropolis (always false otherwise). See also room->_conFlag which is used in earlier games.
154
155public:
157
158 virtual ~Scripts();
159
160 void setScript(Resource *data, bool restartFlag = false);
161
162 void freeScriptData();
163
164 virtual void searchForSequence();
165
166 int executeScript();
167
168 void doCmdPrint_v1(const Common::String &msg);
169
170
175
176 // Script commands that need to be public
177 void cmdFreeSound();
178 void cmdRetPos();
179 void converse1(int val);
180
181protected:
182 virtual void setOpcodes();
183
184 void findNull();
185};
186
187} // End of namespace Access
188
189#endif /* ACCESS_SCRIPTS_H */
Definition: access.h:141
Definition: debugger.h:34
Definition: data.h:37
Definition: files.h:55
Definition: scripts.h:40
void printString(const Common::String &msg, Common::Point pt=Common::Point(-1, -1))
Definition: array.h:52
Definition: stream.h:745
Definition: str.h:59
Definition: access.h:62
Definition: rect.h:144