hedgewars/uScript.pas
changeset 11574 294ce0fa65d0
parent 11566 254333210cc8
child 11622 aed348042a77
equal deleted inserted replaced
11573:e9ee87b28e17 11574:294ce0fa65d0
  2522 function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
  2522 function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
  2523 begin
  2523 begin
  2524     if CheckLuaParamCount(L, 4, 'DeclareAchievement', 'achievementId, teamname, location, value') then
  2524     if CheckLuaParamCount(L, 4, 'DeclareAchievement', 'achievementId, teamname, location, value') then
  2525         declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tostring(L, 3), lua_tointeger(L, 4));
  2525         declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tostring(L, 3), lua_tointeger(L, 4));
  2526     lc_declareachievement:= 0
  2526     lc_declareachievement:= 0
       
  2527 end;
       
  2528 
       
  2529 function lc_startghostpoints(L : Plua_State) : LongInt; Cdecl;
       
  2530 begin
       
  2531     if CheckLuaParamCount(L, 1, 'StartGhostPoints', 'count') then
       
  2532         startGhostPoints(lua_tointeger(L, 1));
       
  2533     lc_startghostpoints:= 0
       
  2534 end;
       
  2535 
       
  2536 function lc_dumppoint(L : Plua_State) : LongInt; Cdecl;
       
  2537 begin
       
  2538     if CheckLuaParamCount(L, 2, 'DumpPoint', 'x, y') then
       
  2539         dumpPoint(lua_tointeger(L, 1), lua_tointeger(L, 2));
       
  2540     lc_dumppoint:= 0
  2527 end;
  2541 end;
  2528 
  2542 
  2529 
  2543 
  2530 procedure ScriptFlushPoints();
  2544 procedure ScriptFlushPoints();
  2531 begin
  2545 begin
  3340 lua_register(luaState, _P'FlushPoints', @lc_flushPoints);
  3354 lua_register(luaState, _P'FlushPoints', @lc_flushPoints);
  3341 
  3355 
  3342 lua_register(luaState, _P'SetGearAIHints', @lc_setgearaihints);
  3356 lua_register(luaState, _P'SetGearAIHints', @lc_setgearaihints);
  3343 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
  3357 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
  3344 lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement);
  3358 lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement);
       
  3359 lua_register(luaState, _P'StartGhostPoints', @lc_startghostpoints);
       
  3360 lua_register(luaState, _P'DumpPoint', @lc_dumppoint);
  3345 
  3361 
  3346 ScriptSetInteger('TEST_SUCCESSFUL'   , HaltTestSuccess);
  3362 ScriptSetInteger('TEST_SUCCESSFUL'   , HaltTestSuccess);
  3347 ScriptSetInteger('TEST_FAILED'       , HaltTestFailed);
  3363 ScriptSetInteger('TEST_FAILED'       , HaltTestFailed);
  3348 lua_register(luaState, _P'EndLuaTest', @lc_endluatest);
  3364 lua_register(luaState, _P'EndLuaTest', @lc_endluatest);
  3349 
  3365