hedgewars/uScript.pas
branch0.9.22
changeset 12366 744e51920a04
parent 11251 66796cd627d8
equal deleted inserted replaced
11630:11f6a4c316a1 12366:744e51920a04
  2524 function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
  2524 function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
  2525 begin
  2525 begin
  2526     if CheckLuaParamCount(L, 4, 'DeclareAchievement', 'achievementId, teamname, location, value') then
  2526     if CheckLuaParamCount(L, 4, 'DeclareAchievement', 'achievementId, teamname, location, value') then
  2527         declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tostring(L, 3), lua_tointeger(L, 4));
  2527         declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tostring(L, 3), lua_tointeger(L, 4));
  2528     lc_declareachievement:= 0
  2528     lc_declareachievement:= 0
       
  2529 end;
       
  2530 
       
  2531 function lc_startghostpoints(L : Plua_State) : LongInt; Cdecl;
       
  2532 begin
       
  2533     if CheckLuaParamCount(L, 1, 'StartGhostPoints', 'count') then
       
  2534         startGhostPoints(lua_tointeger(L, 1));
       
  2535     lc_startghostpoints:= 0
       
  2536 end;
       
  2537 
       
  2538 function lc_dumppoint(L : Plua_State) : LongInt; Cdecl;
       
  2539 begin
       
  2540     if CheckLuaParamCount(L, 2, 'DumpPoint', 'x, y') then
       
  2541         dumpPoint(lua_tointeger(L, 1), lua_tointeger(L, 2));
       
  2542     lc_dumppoint:= 0
  2529 end;
  2543 end;
  2530 
  2544 
  2531 
  2545 
  2532 procedure ScriptFlushPoints();
  2546 procedure ScriptFlushPoints();
  2533 begin
  2547 begin
  3343 lua_register(luaState, _P'FlushPoints', @lc_flushPoints);
  3357 lua_register(luaState, _P'FlushPoints', @lc_flushPoints);
  3344 
  3358 
  3345 lua_register(luaState, _P'SetGearAIHints', @lc_setgearaihints);
  3359 lua_register(luaState, _P'SetGearAIHints', @lc_setgearaihints);
  3346 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
  3360 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload);
  3347 lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement);
  3361 lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement);
       
  3362 lua_register(luaState, _P'StartGhostPoints', @lc_startghostpoints);
       
  3363 lua_register(luaState, _P'DumpPoint', @lc_dumppoint);
  3348 
  3364 
  3349 ScriptSetInteger('TEST_SUCCESSFUL'   , HaltTestSuccess);
  3365 ScriptSetInteger('TEST_SUCCESSFUL'   , HaltTestSuccess);
  3350 ScriptSetInteger('TEST_FAILED'       , HaltTestFailed);
  3366 ScriptSetInteger('TEST_FAILED'       , HaltTestFailed);
  3351 lua_register(luaState, _P'EndLuaTest', @lc_endluatest);
  3367 lua_register(luaState, _P'EndLuaTest', @lc_endluatest);
  3352 
  3368