hedgewars/uScript.pas
changeset 7996 66e8ac9c2274
parent 7889 57b117d441b9
child 8012 2a61631a4505
equal deleted inserted replaced
7994:706218709157 7996:66e8ac9c2274
  1781                     );
  1781                     );
  1782         lua_pushboolean(L, rtn);
  1782         lua_pushboolean(L, rtn);
  1783         end;
  1783         end;
  1784     lc_testrectforobstacle:= 1
  1784     lc_testrectforobstacle:= 1
  1785 end;
  1785 end;
       
  1786 
       
  1787 
       
  1788 function lc_setaihintsongear(L : Plua_State) : LongInt; Cdecl;
       
  1789 var gear: PGear;
       
  1790 begin
       
  1791     if lua_gettop(L) <> 2 then
       
  1792         LuaError('Lua: Wrong number of parameters passed to SetAIHintOnGear!')
       
  1793     else
       
  1794         begin
       
  1795         gear:= GearByUID(lua_tointeger(L, 1));
       
  1796         if gear <> nil then
       
  1797             gear^.aihints:= lua_tointeger(L, 2);
       
  1798         end;
       
  1799     lc_setaihintsongear:= 0
       
  1800 end;
       
  1801 
  1786 ///////////////////
  1802 ///////////////////
  1787 
  1803 
  1788 procedure ScriptPrintStack;
  1804 procedure ScriptPrintStack;
  1789 var n, i : LongInt;
  1805 var n, i : LongInt;
  1790 begin
  1806 begin
  2284 ScriptSetInteger('gstWait'           ,$00020000);
  2300 ScriptSetInteger('gstWait'           ,$00020000);
  2285 ScriptSetInteger('gstNotKickable'    ,$00040000);
  2301 ScriptSetInteger('gstNotKickable'    ,$00040000);
  2286 ScriptSetInteger('gstLoser'          ,$00080000);
  2302 ScriptSetInteger('gstLoser'          ,$00080000);
  2287 ScriptSetInteger('gstHHGone'         ,$00100000);
  2303 ScriptSetInteger('gstHHGone'         ,$00100000);
  2288 ScriptSetInteger('gstInvisible'      ,$00200000);
  2304 ScriptSetInteger('gstInvisible'      ,$00200000);
       
  2305 
       
  2306 ScriptSetInteger('aihUsualProcessing' ,$00000000);
       
  2307 ScriptSetInteger('aihDoesntMatter'    ,$00000001);
  2289 
  2308 
  2290 // register functions
  2309 // register functions
  2291 lua_register(luaState, _P'HideHog', @lc_hidehog);
  2310 lua_register(luaState, _P'HideHog', @lc_hidehog);
  2292 lua_register(luaState, _P'RestoreHog', @lc_restorehog);
  2311 lua_register(luaState, _P'RestoreHog', @lc_restorehog);
  2293 lua_register(luaState, _P'SaveCampaignVar', @lc_savecampaignvar);
  2312 lua_register(luaState, _P'SaveCampaignVar', @lc_savecampaignvar);
  2378 lua_register(luaState, _P'SetHogHat', @lc_sethoghat);
  2397 lua_register(luaState, _P'SetHogHat', @lc_sethoghat);
  2379 lua_register(luaState, _P'PlaceGirder', @lc_placegirder);
  2398 lua_register(luaState, _P'PlaceGirder', @lc_placegirder);
  2380 lua_register(luaState, _P'GetCurAmmoType', @lc_getcurammotype);
  2399 lua_register(luaState, _P'GetCurAmmoType', @lc_getcurammotype);
  2381 lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle);
  2400 lua_register(luaState, _P'TestRectForObstacle', @lc_testrectforobstacle);
  2382 
  2401 
       
  2402 lua_register(luaState, _P'SetGearAIHints', @lc_setaihintsongear);
       
  2403 
  2383 
  2404 
  2384 ScriptClearStack; // just to be sure stack is empty
  2405 ScriptClearStack; // just to be sure stack is empty
  2385 ScriptLoaded:= false;
  2406 ScriptLoaded:= false;
  2386 end;
  2407 end;
  2387 
  2408