26 #ifndef SAGA2_SCRIPT_H 27 #define SAGA2_SCRIPT_H 29 #include "saga2/objects.h" 30 #include "saga2/calendar.h" 34 typedef int16 ThreadID;
41 kScriptResultNoScript = 0,
47 kScriptResultFinished,
59 ObjectID invokedObject = Nothing;
63 ObjectID enactor = Nothing,
64 directObject = Nothing,
65 indirectObject = Nothing;
73 int16 responseType = -1;
91 kActionResultFailure = 0,
113 kBuiltinTypeObject = -1,
114 kBuiltinTypeTAG = -2,
115 kBuiltinAbstract = -3,
116 kBuiltinTypeMission = -4
124 void initSAGADataSeg();
130 inline void cleanupSAGADataSeg() {}
139 void initSAGAThreads();
145 void cleanupSAGAThreads();
148 void deleteThread(
Thread *p);
150 void newThread(
Thread *p, ThreadID
id);
152 void newThread(
Thread *p);
155 ThreadID getThreadID(
Thread *thread);
158 Thread *getThreadAddress(ThreadID
id);
166 scriptResult runMethod(
167 uint16 scriptClassID,
175 friend char *STRING(
int strNum);
177 friend scriptResult runScript(uint16 exportEntryNum,
scriptCallFrame &args);
179 friend void wakeUpThread(ThreadID, int16);
191 kTFWaiting = (1 << 0),
192 kTFFinished = (1 << 1),
193 kTFAborted = (1 << 2),
194 kTFExtended = (1 << 3),
195 kTFExpectResult = (1 << 4),
196 kTFSynchronous = (1 << 5),
200 kTFAsleep = (kTFWaiting | kTFFinished | kTFAborted)
255 void *archive(
void *buf);
260 static void dispatch();
266 void waitForEvent(WaitTypes wt,
ActiveItem *param) {
267 _flags |= kTFWaiting;
274 void clearExtended();
278 uint8 *strAddress(
int strNum);
282 const int maxTimeSlice = 16,
289 typedef int16 C_Call(int16 *);
309 extern Thread *thisThread;
326 scriptResult runObjectMethod(
329 scriptResult runTagMethod(
334 int16 deadActorProto,
336 int16 EXP_spellEffect_CreateFireWisp,
337 EXP_spellEffect_CreateWindWisp,
338 EXP_spellEffect_CreateWraith,
339 EXP_spellEffect_TeleportToShrine,
340 EXP_spellEffect_Rejoin,
341 EXP_spellEffect_Timequake,
342 EXP_spellEffect_CreateFood;
Definition: savefile.h:54
Definition: idtypes.h:124
Definition: memstream.h:194
Definition: tcoords.h:127
Definition: calendar.h:86