hedgewars/uScript.pas
changeset 6529 40f9ef7d824d
parent 6523 666fccd5cb3a
child 6543 697e9b730189
equal deleted inserted replaced
6528:fb2918089225 6529:40f9ef7d824d
  1397     else if np = 4 then
  1397     else if np = 4 then
  1398         ScriptSetAmmo(TAmmoType(lua_tointeger(L, 1)), lua_tointeger(L, 2), lua_tointeger(L, 3), lua_tointeger(L, 4), 1)
  1398         ScriptSetAmmo(TAmmoType(lua_tointeger(L, 1)), lua_tointeger(L, 2), lua_tointeger(L, 3), lua_tointeger(L, 4), 1)
  1399     else
  1399     else
  1400         ScriptSetAmmo(TAmmoType(lua_tointeger(L, 1)), lua_tointeger(L, 2), lua_tointeger(L, 3), lua_tointeger(L, 4), lua_tointeger(L, 5));
  1400         ScriptSetAmmo(TAmmoType(lua_tointeger(L, 1)), lua_tointeger(L, 2), lua_tointeger(L, 3), lua_tointeger(L, 4), lua_tointeger(L, 5));
  1401     lc_setammo:= 0
  1401     lc_setammo:= 0
       
  1402 end;
       
  1403 
       
  1404 function lc_setammostore(L : Plua_State) : LongInt; Cdecl;
       
  1405 var np: LongInt;
       
  1406 begin
       
  1407     np:= lua_gettop(L);
       
  1408     if (np <> 4) then
       
  1409         LuaError('Lua: Wrong number of parameters passed to SetAmmoStore!')
       
  1410     else
       
  1411         begin
       
  1412         ScriptAmmoLoadout:= lua_tostring(L, 1);
       
  1413         ScriptAmmoProbability:= lua_tostring(L, 2);
       
  1414         ScriptAmmoDelay:= lua_tostring(L, 3);
       
  1415         ScriptAmmoReinforcement:= lua_tostring(L, 4);
       
  1416         end;
       
  1417     lc_setammostore:= 0
  1402 end;
  1418 end;
  1403 
  1419 
  1404 function lc_getrandom(L : Plua_State) : LongInt; Cdecl;
  1420 function lc_getrandom(L : Plua_State) : LongInt; Cdecl;
  1405 var m : LongInt;
  1421 var m : LongInt;
  1406 begin
  1422 begin
  2026 lua_register(luaState, 'ParseCommand', @lc_parsecommand);
  2042 lua_register(luaState, 'ParseCommand', @lc_parsecommand);
  2027 lua_register(luaState, 'ShowMission', @lc_showmission);
  2043 lua_register(luaState, 'ShowMission', @lc_showmission);
  2028 lua_register(luaState, 'HideMission', @lc_hidemission);
  2044 lua_register(luaState, 'HideMission', @lc_hidemission);
  2029 lua_register(luaState, 'AddCaption', @lc_addcaption);
  2045 lua_register(luaState, 'AddCaption', @lc_addcaption);
  2030 lua_register(luaState, 'SetAmmo', @lc_setammo);
  2046 lua_register(luaState, 'SetAmmo', @lc_setammo);
       
  2047 lua_register(luaState, 'SetAmmoStore', @lc_setammostore);
  2031 lua_register(luaState, 'PlaySound', @lc_playsound);
  2048 lua_register(luaState, 'PlaySound', @lc_playsound);
  2032 lua_register(luaState, 'AddTeam', @lc_addteam);
  2049 lua_register(luaState, 'AddTeam', @lc_addteam);
  2033 lua_register(luaState, 'AddHog', @lc_addhog);
  2050 lua_register(luaState, 'AddHog', @lc_addhog);
  2034 lua_register(luaState, 'AddAmmo', @lc_addammo);
  2051 lua_register(luaState, 'AddAmmo', @lc_addammo);
  2035 lua_register(luaState, 'GetAmmoCount', @lc_getammocount);
  2052 lua_register(luaState, 'GetAmmoCount', @lc_getammocount);