25 #include <boost/make_shared.hpp> 44 namespace DragonAge2 {
149 object->setVariable(name, ctx.
getParams()[2].getInt());
157 object->setVariable(name, ctx.
getParams()[2].getFloat());
165 object->setVariable(name, ctx.
getParams()[2].getString());
173 object->setVariable(name, ctx.
getParams()[2].getObject());
181 object->setVariable(name, ctx.
getParams()[2].getString());
189 object->setVariable(name, ctx.
getParams()[2].getEngineType());
197 object->setVariable(name, ctx.
getParams()[2].getEngineType());
205 object->setVariable(name, ctx.
getParams()[2].getEngineType());
213 object->setVariable(name, ctx.
getParams()[2].getEngineType());
221 object->setVariable(name, ctx.
getParams()[2].getEngineType());
229 object->setVariable(name, ctx.
getParams()[2].getEngineType());
272 object->setNonLocalizedName(ctx.
getParams()[1].getString());
297 object->getPosition(x, y, z);
302 #define SQR(x) ((x) * (x)) 308 if (!object1 || !object2)
353 size_t count = MAX<int32>(ctx.
getParams()[2].getInt(), 0);
363 const bool includeSelf = ctx.
getParams()[5].getInt() != 0;
365 result.push_back(boost::make_shared<Aurora::NWScript::Variable>(target));
375 std::list<Object *> objects;
376 while ((
object = search->next())) {
379 if (!daObject || (daObject == target))
387 if (type & objectType)
388 objects.push_back(daObject);
393 for (std::list<Object *>::iterator it = objects.begin(); it != objects.end() && count > 0; ++it, count--)
394 result.push_back(boost::make_shared<Aurora::NWScript::Variable>(*it));
413 size_t count = MAX<int32>(ctx.
getParams()[3].getInt(), 0);
423 const bool includeSelf = ctx.
getParams()[6].getInt() != 0;
425 result.push_back(boost::make_shared<Aurora::NWScript::Variable>(target));
435 std::list<Object *> objects;
436 while ((
object = search->next())) {
439 if (!daObject || (daObject == target))
447 if (type & objectType)
448 objects.push_back(daObject);
453 for (std::list<Object *>::iterator it = objects.begin(); it != objects.end() && count > 0; ++it, count--)
454 result.push_back(boost::make_shared<Aurora::NWScript::Variable>(*it));
472 const bool includeSelf = ctx.
getParams()[2].getInt() != 0;
473 if (includeSelf && (target->
getTag() == tag)) {
481 std::list<Object *> objects;
482 while ((
object = search->next())) {
485 if (!daObject || (daObject == target))
488 objects.push_back(daObject);
493 if (!objects.empty())
void getObjectType(Aurora::NWScript::FunctionContext &ctx)
void getLocalItemProperty(Aurora::NWScript::FunctionContext &ctx)
Campaigns & getCampaigns()
Return the campaigns context.
void getLocalPlayer(Aurora::NWScript::FunctionContext &ctx)
std::vector< boost::shared_ptr< Variable > > Array
void setLocalEvent(Aurora::NWScript::FunctionContext &ctx)
void getObjectByTag(Aurora::NWScript::FunctionContext &ctx)
A container of Dragon Age II objects.
void getLocalLocation(Aurora::NWScript::FunctionContext &ctx)
A class holding an UTF-8 string.
static Aurora::NWScript::Object * getParamObject(const Aurora::NWScript::FunctionContext &ctx, size_t n)
UString composeString(T value)
Convert any POD integer, float/double or bool type into a string.
void setLocalItemProperty(Aurora::NWScript::FunctionContext &ctx)
Context of an NWScript function.
A class able to sort objects by distance to a target object.
void getLocalInt(Aurora::NWScript::FunctionContext &ctx)
void getLocalResource(Aurora::NWScript::FunctionContext &ctx)
The context handling the gameplay in Dragon Age II.
void getLocalFloat(Aurora::NWScript::FunctionContext &ctx)
Utility templates and functions for working with strings and streams.
An object in a Dragon Age II area.
ObjectType getType() const
Return the exact type of the object.
A simple scoped smart pointer template.
const Common::UString & getTag() const
void setLocalFloat(Aurora::NWScript::FunctionContext &ctx)
Area * getCurrentArea() const
Return the area the PC is currently in.
void getNearestObject(Aurora::NWScript::FunctionContext &ctx)
void getLocalObject(Aurora::NWScript::FunctionContext &ctx)
EngineType * getEngineType() const
void UT_getNearestObjectByTag(Aurora::NWScript::FunctionContext &ctx)
Object * getObject() const
Utility templates and functions.
void setVector(float x, float y, float z)
ObjectSearch * findObjectsByTag(const Common::UString &tag) const
Return a search context to iterate over all objects with this tag.
ObjectSearch * findObjects() const
Return a search context to iterate over all objects.
bool empty() const
Is the string empty?
void getLocalEvent(Aurora::NWScript::FunctionContext &ctx)
void setLocalInt(Aurora::NWScript::FunctionContext &ctx)
A scoped plain pointer, allowing pointer-y access and normal deletion.
void setName(Aurora::NWScript::FunctionContext &ctx)
void getLocalCommand(Aurora::NWScript::FunctionContext &ctx)
void getResRef(Aurora::NWScript::FunctionContext &ctx)
void setLocalEffect(Aurora::NWScript::FunctionContext &ctx)
Campaign * getCurrentCampaign() const
Return the currently running campaign.
void getName(Aurora::NWScript::FunctionContext &ctx)
The context holding a Dragon Age II campaign.
void getDistanceBetween(Aurora::NWScript::FunctionContext &ctx)
"effect", "event", "location", "talent"...
The context managing and running the Dragon Age II campaigns.
static DragonAge2::Object * toObject(::Aurora::NWScript::Object *object)
const Array & getArray() const
Common::UString & getString()
virtual void getPosition(float &x, float &y, float &z) const
Return the object's position within its area.
void getTag(Aurora::NWScript::FunctionContext &ctx)
void setLocalObject(Aurora::NWScript::FunctionContext &ctx)
void getNearestObjectByTag(Aurora::NWScript::FunctionContext &ctx)
void setLocalPlayer(Aurora::NWScript::FunctionContext &ctx)
void getLocalEffect(Aurora::NWScript::FunctionContext &ctx)
void getPosition(Aurora::NWScript::FunctionContext &ctx)
void setLocalLocation(Aurora::NWScript::FunctionContext &ctx)
Basic Dragon Age II type definitions.
void setLocalResource(Aurora::NWScript::FunctionContext &ctx)
void getArea(Aurora::NWScript::FunctionContext &ctx)
void setLocalString(Aurora::NWScript::FunctionContext &ctx)
void clear()
Clear the string's contents.
Dragon Age II engine functions.
void getLocalString(Aurora::NWScript::FunctionContext &ctx)
void setLocalCommand(Aurora::NWScript::FunctionContext &ctx)
void isObjectValid(Aurora::NWScript::FunctionContext &ctx)