static QScriptValue js_centreView(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(2); ARG_NUMBER(0); ARG_NUMBER(1); return QScriptValue(); }
static QScriptValue js_safeDest(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(3); ARG_NUMBER(0); ARG_NUMBER(1); ARG_NUMBER(2); return QScriptValue(true); }
static QScriptValue js_setAssemblyPoint(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(3); ARG_STRUCT(0); ARG_NUMBER(1); ARG_NUMBER(2); return QScriptValue(true); }
static QScriptValue js_droidCanReach(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(3); ARG_DROID(0); ARG_NUMBER(1); ARG_NUMBER(2); return QScriptValue(true); }
static QScriptValue js_addStructure(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(4); ARG_NUMBER(0); ARG_PLAYER(1); ARG_NUMBER(2); ARG_NUMBER(3); return QScriptValue(true); }
static QScriptValue js_orderDroidLoc(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(4); ARG_DROID(0); ARG_ORDER(1); ARG_NUMBER(2); ARG_NUMBER(3); return QScriptValue(true); }
static QScriptValue js_distBetweenTwoPoints(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(4); ARG_NUMBER(0); ARG_NUMBER(1); ARG_NUMBER(2); ARG_NUMBER(3); return QScriptValue(10); }
static QScriptValue js_setScrollParams(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(4); ARG_NUMBER(0); ARG_NUMBER(1); ARG_NUMBER(2); ARG_NUMBER(3); return QScriptValue(); }
static QScriptValue js_setNoGoArea(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(5); ARG_NUMBER(0); ARG_NUMBER(1); ARG_NUMBER(2); ARG_NUMBER(3); ARG_PLAYER(4); return QScriptValue(true); }
static QScriptValue js_groupAddArea(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(5); ARG_NUMBER(0); ARG_NUMBER(1); ARG_NUMBER(2); ARG_NUMBER(3); ARG_NUMBER(4); return QScriptValue(); }
static QScriptValue js_playSound(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_VAR(1, 4); ARG_STRING(0); if (context->argumentCount() != 1) { SCRIPT_ASSERT(context, context->argumentCount() == 4, "Arguments must be either 1 or 4"); ARG_NUMBER(1); ARG_NUMBER(2); ARG_NUMBER(3); } return QScriptValue(); }
static QScriptValue js_setDroidExperience(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(2); ARG_DROID(0); ARG_NUMBER(1); return QScriptValue(); }
static QScriptValue js_groupAddDroid(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(2); ARG_NUMBER(0); ARG_DROID(1); return QScriptValue(); }
static QScriptValue js_setPower(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_VAR(1, 2); ARG_NUMBER(0); if (context->argumentCount() > 1) { ARG_PLAYER(1); } return QScriptValue(); }
static QScriptValue js_enumGroup(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(1); ARG_NUMBER(0); QScriptValue result = engine->newArray(3); for (int i = 0; i < 3; i++) { result.setProperty(i, convDroid(engine)); } return result; }
static QScriptValue js_setStructureLimits(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_VAR(2, 3); ARG_STRING(0); ARG_NUMBER(1); if (context->argumentCount() > 2) { ARG_PLAYER(2); } return QScriptValue(); }
/// Special scripting function that registers a object-specific timer event. Note: Functions must be passed /// quoted, otherwise they will be inlined! static QScriptValue js_queue(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_VAR(1, 3); ARG_STRING(0); if (context->argumentCount() > 1) ARG_NUMBER(1); if (context->argumentCount() == 3) ARG_OBJ(2); QString funcName = context->argument(0).toString(); // TODO - check that a function by that name exists // TODO - object argument int player = engine->globalObject().property("me").toInt32(); timerNode node(engine, funcName, player); timers.push_back(node); return QScriptValue(); }
static at *test_event_sub(int arg_number, at **arg_array, int remove) { /* Validate parameters */ at *handler = NIL; if (arg_number == 0) handler = current_window_handler(); else if (arg_number == 1) handler = APOINTER(1); else ARG_NUMBER(-1); /* Perform */ call_spoll(); at *r = handler ? event_get(handler, remove) : event_peek(); return r; }
static QScriptValue js_enumDroid(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_VAR(0, 3); switch (context->argumentCount()) { default: case 3: ARG_PLAYER(2); // fall-through case 2: ARG_NUMBER(1); // fall-through case 1: ARG_PLAYER(0); break; } QScriptValue result = engine->newArray(3); for (int i = 0; i < 3; i++) { result.setProperty(i, convDroid(engine)); } return result; }
static at * Nacces(int arg_number, at **arg_array, int champ) { flt val = Fzero; int numero; ALL_ARGS_EVAL; if (arg_number <1 || arg_number >=3) ARG_NUMBER(-1); numero = AINTEGER(1); if (numero<0 || numero>=neurnombre) error(NIL,"illegal neuron number",NEW_NUMBER(numero)); switch(arg_number) { case 1: val=get_Nfield(numero,champ); break; case 2: val = AFLT(2); set_Nfield(numero,champ,val); break; } return NEW_NUMBER(Ftofp(val)); }
static QScriptValue js_groupSize(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(1); ARG_NUMBER(0); return QScriptValue(3); }
static QScriptValue js_setMissionTime(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(1); ARG_NUMBER(0); return QScriptValue(); }
static QScriptValue js_setReinforcementTime(QScriptContext *context, QScriptEngine *) { ARG_COUNT_EXACT(1); ARG_NUMBER(0); return QScriptValue(); }
static QScriptValue js_objFromId(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(1); ARG_NUMBER(0); return QScriptValue(convDroid(engine)); }
static QScriptValue js_removeReticuleButton(QScriptContext *context, QScriptEngine *engine) { ARG_COUNT_EXACT(1); ARG_NUMBER(0); return QScriptValue(); }