hedgewars/uScript.pas
changeset 4496 ba5da3388110
parent 4484 b7a098f2649a
child 4498 8c9595e39539
equal deleted inserted replaced
4495:1eea498d12e0 4496:ba5da3388110
   452             lua_pushinteger(L, gear^.Hedgehog^.BotLevel)
   452             lua_pushinteger(L, gear^.Hedgehog^.BotLevel)
   453         else
   453         else
   454             lua_pushnil(L);
   454             lua_pushnil(L);
   455     end;
   455     end;
   456     lc_gethoglevel := 1;
   456     lc_gethoglevel := 1;
       
   457 end;
       
   458 
       
   459 function lc_sethoglevel(L : Plua_State) : LongInt; Cdecl;
       
   460 var gear : PGear;
       
   461 begin
       
   462     if lua_gettop(L) <> 2 then
       
   463         LuaError('Lua: Wrong number of parameters passed to SetHogLevel!')
       
   464     else
       
   465         begin
       
   466         gear:= GearByUID(lua_tointeger(L, 1));
       
   467         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) then
       
   468             gear^.Hedgehog^.BotLevel:= lua_tointeger(L, 2);
       
   469         end;
       
   470     lc_sethoglevel:= 0
   457 end;
   471 end;
   458 
   472 
   459 function lc_gethogclan(L : Plua_State) : LongInt; Cdecl;
   473 function lc_gethogclan(L : Plua_State) : LongInt; Cdecl;
   460 var gear : PGear;
   474 var gear : PGear;
   461 begin
   475 begin
  1383 lua_register(luaState, 'SetEffect', @lc_seteffect);
  1397 lua_register(luaState, 'SetEffect', @lc_seteffect);
  1384 lua_register(luaState, 'GetHogClan', @lc_gethogclan);
  1398 lua_register(luaState, 'GetHogClan', @lc_gethogclan);
  1385 lua_register(luaState, 'GetHogTeamName', @lc_gethogteamname);
  1399 lua_register(luaState, 'GetHogTeamName', @lc_gethogteamname);
  1386 lua_register(luaState, 'GetHogName', @lc_gethogname);
  1400 lua_register(luaState, 'GetHogName', @lc_gethogname);
  1387 lua_register(luaState, 'GetHogLevel', @lc_gethoglevel);
  1401 lua_register(luaState, 'GetHogLevel', @lc_gethoglevel);
       
  1402 lua_register(luaState, 'SetHogLevel', @lc_sethoglevel);
  1388 lua_register(luaState, 'GetX', @lc_getx);
  1403 lua_register(luaState, 'GetX', @lc_getx);
  1389 lua_register(luaState, 'GetY', @lc_gety);
  1404 lua_register(luaState, 'GetY', @lc_gety);
  1390 lua_register(luaState, 'CopyPV', @lc_copypv);
  1405 lua_register(luaState, 'CopyPV', @lc_copypv);
  1391 lua_register(luaState, 'CopyPV2', @lc_copypv2);
  1406 lua_register(luaState, 'CopyPV2', @lc_copypv2);
  1392 lua_register(luaState, 'FollowGear', @lc_followgear);
  1407 lua_register(luaState, 'FollowGear', @lc_followgear);