28 #include <boost/bind.hpp> 72 assert((fSig.
id ==
id) && (fDef.
id ==
id));
93 FunctionMan.registerFunction(fPtr.
name,
id, boost::bind(f,
this, _1), signature, defaults);
109 r += std::rand() % (max - min + 1) + min;
131 if (!object->
getArea() || !area) {
132 warning(
"Functions::jumpTo(): No area?!? (%d, %d)", object->
getArea() != 0, area != 0);
139 if (object->
getArea() != area) {
143 warning(
"TODO: Functions::jumpTo(): Moving from \"%s\" to \"%s\"", areaFrom.
c_str(), areaTo.
c_str());
149 if (areaFrom == pcArea) {
153 object->unloadModel();
155 }
else if (areaTo == pcArea) {
164 object->setArea(area);
168 object->setPosition(x, y, z);
void movedPC()
Notify the module that the PC was moved.
An object within a Jade Empire area.
The global graphics manager.
std::vector< class Variable > Parameters
Area * getArea() const
Return the area this object is currently in.
Module & getModule()
Return the module context.
A class holding an UTF-8 string.
void jumpTo(Jade::Object *object, Area *area, float x, float y, float z)
const Common::UString & getResRef()
Return the area's resref (resource ID).
Common::UString formatType(Type type)
Construct a string describing this variable type.
Jade Empire engine functions.
const Aurora::NWScript::Variable * defaults[11]
static Common::UString formatFloat(float f, int width=18, int decimals=9)
Object * getCaller() const
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
The context handling the gameplay in Jade Empire.
#define ARRAYSIZE(x)
Macro which determines the number of entries in a fixed size array.
void(Functions::* funcPtr)(Aurora::NWScript::FunctionContext &ctx)
The NWScript function manager.
Creature * getPC()
Return the currently playing PC.
A container of Jade Empire objects.
const char * c_str() const
Return the (utf8 encoded) string data.
static Jade::Object * toObject(::Aurora::NWScript::Object *object)
static UString format(const char *s,...) GCC_PRINTF(1
Print formatted data into an UString object, similar to sprintf().
Basic Jade Empire type definitions.
Utility templates and functions.
An area in Jade Empire, holding all objects and rooms within, as well as general area properties like...
Aurora::NWScript::Type parameters[12]
std::vector< Type > Signature
const Common::UString & getName() const
static int32 getRandom(int min, int max, int32 n=1)
static const FunctionPointer kFunctionPointers[]
The table defining the name and function pointer of each engine function.
void warning(const char *s,...)
static const FunctionDefaults kFunctionDefaults[]
The table defining the default values for the parameters of each engine function. ...
An object within a Jade area.
Tables defining the engine functions in Jade Empire.
Common::UString formatParams(const FunctionContext &ctx)
Construct a string describing parameters of this function.
Aurora::NWScript::Type returnType
void unimplementedFunction(Aurora::NWScript::FunctionContext &ctx)
ObjectType getType() const
Return the exact type of the object.
NWScript utility functions.
#define GfxMan
Shortcut for accessing the graphics manager.
static const FunctionSignature kFunctionSignatures[]
The table defining the signature (return type and type of parameters) of each engine function...
A creature in a Jade Empire area.