hedgewars/uScript.pas
changeset 11846 6bf91006d630
parent 11844 a784866c91ad
child 11847 38e7206a5df4
equal deleted inserted replaced
11845:25d36d8935cc 11846:6bf91006d630
  2536 function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
  2536 function lc_declareachievement(L : Plua_State) : LongInt; Cdecl;
  2537 begin
  2537 begin
  2538     if CheckLuaParamCount(L, 4, 'DeclareAchievement', 'achievementId, teamname, location, value') then
  2538     if CheckLuaParamCount(L, 4, 'DeclareAchievement', 'achievementId, teamname, location, value') then
  2539         declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tostring(L, 3), lua_tointeger(L, 4));
  2539         declareAchievement(lua_tostring(L, 1), lua_tostring(L, 2), lua_tostring(L, 3), lua_tointeger(L, 4));
  2540     lc_declareachievement:= 0
  2540     lc_declareachievement:= 0
       
  2541 end;
       
  2542 
       
  2543 function lc_getammoname(L : Plua_state) : LongInt; Cdecl;
       
  2544 var at: LongInt;
       
  2545 const call = 'GetAmmoName';
       
  2546       params = 'ammoType';
       
  2547 begin
       
  2548     if CheckLuaParamCount(L, 1, call, params) then
       
  2549         begin
       
  2550         at:= LuaToAmmoTypeOrd(L, 1, call, params);                                                                                                   
       
  2551         if at >= 0 then   
       
  2552             lua_pushstring(L, Str2PChar(trammo[Ammoz[TAmmoType(at)].NameId]));
       
  2553         end
       
  2554     else
       
  2555         lua_pushnil(L);
       
  2556     lc_getammoname:= 1;
  2541 end;
  2557 end;
  2542 
  2558 
  2543 function lc_startghostpoints(L : Plua_State) : LongInt; Cdecl;
  2559 function lc_startghostpoints(L : Plua_State) : LongInt; Cdecl;
  2544 begin
  2560 begin
  2545     if CheckLuaParamCount(L, 1, 'StartGhostPoints', 'count') then
  2561     if CheckLuaParamCount(L, 1, 'StartGhostPoints', 'count') then
  3361 lua_register(luaState, _P'SetWaterLine', @lc_setwaterline);
  3377 lua_register(luaState, _P'SetWaterLine', @lc_setwaterline);
  3362 lua_register(luaState, _P'SetNextWeapon', @lc_setnextweapon);
  3378 lua_register(luaState, _P'SetNextWeapon', @lc_setnextweapon);
  3363 lua_register(luaState, _P'SetWeapon', @lc_setweapon);
  3379 lua_register(luaState, _P'SetWeapon', @lc_setweapon);
  3364 lua_register(luaState, _P'SetCinematicMode', @lc_setcinematicmode);
  3380 lua_register(luaState, _P'SetCinematicMode', @lc_setcinematicmode);
  3365 lua_register(luaState, _P'SetMaxBuildDistance', @lc_setmaxbuilddistance);
  3381 lua_register(luaState, _P'SetMaxBuildDistance', @lc_setmaxbuilddistance);
       
  3382 lua_register(luaState, _P'GetAmmoName', @lc_getammoname);
  3366 // drawn map functions
  3383 // drawn map functions
  3367 lua_register(luaState, _P'AddPoint', @lc_addPoint);
  3384 lua_register(luaState, _P'AddPoint', @lc_addPoint);
  3368 lua_register(luaState, _P'FlushPoints', @lc_flushPoints);
  3385 lua_register(luaState, _P'FlushPoints', @lc_flushPoints);
  3369 
  3386 
  3370 lua_register(luaState, _P'SetGearAIHints', @lc_setgearaihints);
  3387 lua_register(luaState, _P'SetGearAIHints', @lc_setgearaihints);