xoreos  0.0.5
functions.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_JADE_SCRIPT_FUNCTIONS_H
26 #define ENGINES_JADE_SCRIPT_FUNCTIONS_H
27 
29 
30 namespace Aurora {
31  class TwoDAFile;
32  namespace NWScript {
33  class FunctionContext;
34  class Object;
35  }
36 }
37 
38 namespace Engines {
39 
40 namespace Jade {
41 
42 class Game;
43 class Area;
44 class Object;
45 
46 class Functions {
47 public:
48  Functions(Game &game);
49  ~Functions();
50 
51 private:
53 
54  struct FunctionPointer {
56  const char *name;
58  };
59 
64  };
65 
69  };
70 
74 
75 
77 
78  void registerFunctions();
79 
80  // .--- Utility methods
81  void jumpTo(Jade::Object *object, Area *area, float x, float y, float z);
82 
83  static int32 getRandom(int min, int max, int32 n = 1);
84 
85  static Common::UString formatFloat(float f, int width = 18, int decimals = 9);
86 
88 
90  // '---
91 
92  // --- Engine functions ---
93 
95 
96  // .--- Math, functions_math.cpp
99 
103 
107 
111 
113 
123 
126 
130  // '---
131 
132  // .--- Strings, functions_string.cpp
134 
136 
142 
146 
148 
151 
153 
156 
159 
163 
165 
167  // '---
168 
169  // .--- Game functions, functions_game.cpp
174 
179  // '---
180 
181  // .--- Module functions, functions_module.cpp
183 
185 
188  // '---
189 
190  // .--- General object functions, functions_object.cpp
193 
195 
197 
203 
209 
211 
213 
216 
218 
220 
224 
226 
229 
232 
234  // '---
235 
236  // .--- Creatures, functions_creature.cpp
238  // '---
239 
240  // .--- Actions, functions_action.cpp
243 
245 
247 
250 
253 
255 
260  // '---
261 
262  // .--- Events, functions_event.cpp
264 
266 
269  // '---
270 
271  // .--- 2DA Reads, functions_2da.cpp
274 
278 
282  // '---
283 };
284 
285 } // End of namespace Jade
286 
287 } // End of namespace Engines
288 
289 #endif // ENGINES_JADE_SCRIPT_FUNCTIONS_H
void get2DAEntryFloatByString(Aurora::NWScript::FunctionContext &ctx)
Class to hold the two-dimensional array of a 2DA file.
Definition: 2dafile.h:124
void signalEvent(Aurora::NWScript::FunctionContext &ctx)
void vectorMagnitude(Aurora::NWScript::FunctionContext &ctx)
void getStringUpperCase(Aurora::NWScript::FunctionContext &ctx)
void getEnteringObject(Aurora::NWScript::FunctionContext &ctx)
void actionSpeakStringByStrRef(Aurora::NWScript::FunctionContext &ctx)
void getObjectType(Aurora::NWScript::FunctionContext &ctx)
void getNextPC(Aurora::NWScript::FunctionContext &ctx)
void getPlayer(Aurora::NWScript::FunctionContext &ctx)
void getExitingObject(Aurora::NWScript::FunctionContext &ctx)
void setLocalObject(Aurora::NWScript::FunctionContext &ctx)
void eventUserDefined(Aurora::NWScript::FunctionContext &ctx)
void getAutoBalance(Aurora::NWScript::FunctionContext &ctx)
void actionCloseDoor(Aurora::NWScript::FunctionContext &ctx)
void d20(Aurora::NWScript::FunctionContext &ctx)
void d12(Aurora::NWScript::FunctionContext &ctx)
void writeTimestampedLogEntry(Aurora::NWScript::FunctionContext &ctx)
void jumpToObject(Aurora::NWScript::FunctionContext &ctx)
void get2DAEntryIntByString(Aurora::NWScript::FunctionContext &ctx)
A class holding an UTF-8 string.
Definition: ustring.h:48
void acos(Aurora::NWScript::FunctionContext &ctx)
void assignCommand(Aurora::NWScript::FunctionContext &ctx)
void getStringLowerCase(Aurora::NWScript::FunctionContext &ctx)
void jumpTo(Jade::Object *object, Area *area, float x, float y, float z)
Definition: functions.cpp:129
void getNearestObject(Aurora::NWScript::FunctionContext &ctx)
void intToHexString(Aurora::NWScript::FunctionContext &ctx)
void sendMessageToPC(Aurora::NWScript::FunctionContext &ctx)
void d8(Aurora::NWScript::FunctionContext &ctx)
void getGlobalBool(Aurora::NWScript::FunctionContext &ctx)
void intToString(Aurora::NWScript::FunctionContext &ctx)
void insertString(Aurora::NWScript::FunctionContext &ctx)
void d10(Aurora::NWScript::FunctionContext &ctx)
void getSubString(Aurora::NWScript::FunctionContext &ctx)
const Aurora::NWScript::Variable * defaults[11]
Definition: functions.h:68
static Common::UString formatFloat(float f, int width=18, int decimals=9)
Definition: functions.cpp:114
void random(Aurora::NWScript::FunctionContext &ctx)
void fabs(Aurora::NWScript::FunctionContext &ctx)
void setLocalBool(Aurora::NWScript::FunctionContext &ctx)
const Aurora::TwoDAFile & findTable(int32 nr)
void executeScript(Aurora::NWScript::FunctionContext &ctx)
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
Definition: functions.cpp:118
void d6(Aurora::NWScript::FunctionContext &ctx)
void getLocalFloat(Aurora::NWScript::FunctionContext &ctx)
void setLocalString(Aurora::NWScript::FunctionContext &ctx)
void findSubString(Aurora::NWScript::FunctionContext &ctx)
void getLocalString(Aurora::NWScript::FunctionContext &ctx)
void getLocalInt(Aurora::NWScript::FunctionContext &ctx)
void log(Aurora::NWScript::FunctionContext &ctx)
void setGlobalInt(Aurora::NWScript::FunctionContext &ctx)
void actionStartConversation(Aurora::NWScript::FunctionContext &ctx)
void getGlobalString(Aurora::NWScript::FunctionContext &ctx)
void(Functions::* funcPtr)(Aurora::NWScript::FunctionContext &ctx)
Definition: functions.h:52
void d4(Aurora::NWScript::FunctionContext &ctx)
void getObjectByTag(Aurora::NWScript::FunctionContext &ctx)
void getStringLength(Aurora::NWScript::FunctionContext &ctx)
void setUserDefinedEventNumber(Aurora::NWScript::FunctionContext &ctx)
void stringToInt(Aurora::NWScript::FunctionContext &ctx)
void getIsPC(Aurora::NWScript::FunctionContext &ctx)
void atan(Aurora::NWScript::FunctionContext &ctx)
void setCustomToken(Aurora::NWScript::FunctionContext &ctx)
void getGlobalFloat(Aurora::NWScript::FunctionContext &ctx)
void getPositionFromLocation(Aurora::NWScript::FunctionContext &ctx)
void d3(Aurora::NWScript::FunctionContext &ctx)
void getTag(Aurora::NWScript::FunctionContext &ctx)
void location(Aurora::NWScript::FunctionContext &ctx)
void getArea(Aurora::NWScript::FunctionContext &ctx)
void get2DAEntryStringByString(Aurora::NWScript::FunctionContext &ctx)
An area in Jade Empire, holding all objects and rooms within, as well as general area properties like...
Definition: area.h:57
void delayCommand(Aurora::NWScript::FunctionContext &ctx)
void getDistanceToObject(Aurora::NWScript::FunctionContext &ctx)
void get2DAEntryString(Aurora::NWScript::FunctionContext &ctx)
void get2DANumColumn(Aurora::NWScript::FunctionContext &ctx)
void d100(Aurora::NWScript::FunctionContext &ctx)
Aurora::NWScript::Type parameters[12]
Definition: functions.h:63
void getIsObjectValid(Aurora::NWScript::FunctionContext &ctx)
void actionJumpToLocation(Aurora::NWScript::FunctionContext &ctx)
void setLocalFloat(Aurora::NWScript::FunctionContext &ctx)
void printFloat(Aurora::NWScript::FunctionContext &ctx)
void setGlobalString(Aurora::NWScript::FunctionContext &ctx)
void stringToFloat(Aurora::NWScript::FunctionContext &ctx)
void vector(Aurora::NWScript::FunctionContext &ctx)
void setGlobalBool(Aurora::NWScript::FunctionContext &ctx)
void printVector(Aurora::NWScript::FunctionContext &ctx)
void intToFloat(Aurora::NWScript::FunctionContext &ctx)
static int32 getRandom(int min, int max, int32 n=1)
Definition: functions.cpp:102
static const FunctionPointer kFunctionPointers[]
The table defining the name and function pointer of each engine function.
Definition: functions.h:71
void setLocalInt(Aurora::NWScript::FunctionContext &ctx)
static const FunctionDefaults kFunctionDefaults[]
The table defining the default values for the parameters of each engine function. ...
Definition: functions.h:73
void sqrt(Aurora::NWScript::FunctionContext &ctx)
void getPosition(Aurora::NWScript::FunctionContext &ctx)
void getLocalBool(Aurora::NWScript::FunctionContext &ctx)
An object within a Jade area.
Definition: object.h:53
void printInteger(Aurora::NWScript::FunctionContext &ctx)
void get2DAEntryFloat(Aurora::NWScript::FunctionContext &ctx)
void floatToInt(Aurora::NWScript::FunctionContext &ctx)
void asin(Aurora::NWScript::FunctionContext &ctx)
void printString(Aurora::NWScript::FunctionContext &ctx)
void pow(Aurora::NWScript::FunctionContext &ctx)
void actionJumpToObject(Aurora::NWScript::FunctionContext &ctx)
void getStringByStrRef(Aurora::NWScript::FunctionContext &ctx)
void printObject(Aurora::NWScript::FunctionContext &ctx)
void sin(Aurora::NWScript::FunctionContext &ctx)
void actionDoCommand(Aurora::NWScript::FunctionContext &ctx)
void objectToString(Aurora::NWScript::FunctionContext &ctx)
uint32_t uint32
Definition: types.h:204
void getWaypointByTag(Aurora::NWScript::FunctionContext &ctx)
void actionMoveToObject(Aurora::NWScript::FunctionContext &ctx)
void getGlobalInt(Aurora::NWScript::FunctionContext &ctx)
void getLocalObject(Aurora::NWScript::FunctionContext &ctx)
void get2DAEntryInt(Aurora::NWScript::FunctionContext &ctx)
void actionOpenDoor(Aurora::NWScript::FunctionContext &ctx)
void jumpToLocation(Aurora::NWScript::FunctionContext &ctx)
void getPriorActivation(Aurora::NWScript::FunctionContext &ctx)
void getStringLeft(Aurora::NWScript::FunctionContext &ctx)
void getObjectConversationResref(Aurora::NWScript::FunctionContext &ctx)
void vectorNormalize(Aurora::NWScript::FunctionContext &ctx)
void get2DANumRows(Aurora::NWScript::FunctionContext &ctx)
void getStringRight(Aurora::NWScript::FunctionContext &ctx)
void actionMoveToLocation(Aurora::NWScript::FunctionContext &ctx)
void getLocation(Aurora::NWScript::FunctionContext &ctx)
void d2(Aurora::NWScript::FunctionContext &ctx)
void actionPlayAnimation(Aurora::NWScript::FunctionContext &ctx)
void setObjectNoCollide(Aurora::NWScript::FunctionContext &ctx)
void cos(Aurora::NWScript::FunctionContext &ctx)
void unimplementedFunction(Aurora::NWScript::FunctionContext &ctx)
Definition: functions.cpp:97
NWScript types.
void floatToString(Aurora::NWScript::FunctionContext &ctx)
void setGlobalFloat(Aurora::NWScript::FunctionContext &ctx)
void playAnimation(Aurora::NWScript::FunctionContext &ctx)
void abs(Aurora::NWScript::FunctionContext &ctx)
static const FunctionSignature kFunctionSignatures[]
The table defining the signature (return type and type of parameters) of each engine function...
Definition: functions.h:72
void getUserDefinedEventNumber(Aurora::NWScript::FunctionContext &ctx)
int32_t int32
Definition: types.h:203
void tan(Aurora::NWScript::FunctionContext &ctx)