hedgewars/uScript.pas
changeset 15131 a77b0e339929
parent 15079 424e3b132dd3
child 15177 a22013a817e4
equal deleted inserted replaced
15130:13e7d4eccb67 15131:a77b0e339929
  2927             if (delay > 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.CurAmmoType = TAmmoType(at)) then
  2927             if (delay > 0) and (CurrentHedgehog <> nil) and (CurrentHedgehog^.CurAmmoType = TAmmoType(at)) then
  2928                 ParseCommand('setweap ' + char(0), true, true);
  2928                 ParseCommand('setweap ' + char(0), true, true);
  2929             end;
  2929             end;
  2930         end;
  2930         end;
  2931     lc_setammodelay:= 0
  2931     lc_setammodelay:= 0
       
  2932 end;
       
  2933 
       
  2934 function lc_setammoslot(L : Plua_State) : LongInt; Cdecl;
       
  2935 var at, slot: LongInt;
       
  2936 begin
       
  2937     if CheckLuaParamCount(L, 2, 'SetAmmoSlot', 'ammoType, slot') then
       
  2938         begin
       
  2939         at:= Trunc(lua_tonumber(L, 1));
       
  2940         slot:= Trunc(lua_tonumber(L, 2));
       
  2941         Ammoz[TAmmoType(at)].Slot:= slot - 1;
       
  2942         AmmoMenuInvalidated:= true;
       
  2943         end;
       
  2944     lc_setammoslot:= 0;
  2932 end;
  2945 end;
  2933 
  2946 
  2934 function lc_getrandom(L : Plua_State) : LongInt; Cdecl;
  2947 function lc_getrandom(L : Plua_State) : LongInt; Cdecl;
  2935 var m : LongInt;
  2948 var m : LongInt;
  2936 begin
  2949 begin
  4470 lua_register(luaState, _P'SetAmmoDescriptionAppendix', @lc_setammodescriptionappendix);
  4483 lua_register(luaState, _P'SetAmmoDescriptionAppendix', @lc_setammodescriptionappendix);
  4471 lua_register(luaState, _P'AddCaption', @lc_addcaption);
  4484 lua_register(luaState, _P'AddCaption', @lc_addcaption);
  4472 lua_register(luaState, _P'SetAmmo', @lc_setammo);
  4485 lua_register(luaState, _P'SetAmmo', @lc_setammo);
  4473 lua_register(luaState, _P'GetAmmo', @lc_getammo);
  4486 lua_register(luaState, _P'GetAmmo', @lc_getammo);
  4474 lua_register(luaState, _P'SetAmmoDelay', @lc_setammodelay);
  4487 lua_register(luaState, _P'SetAmmoDelay', @lc_setammodelay);
       
  4488 lua_register(luaState, _P'SetAmmoSlot', @lc_setammoslot);
  4475 lua_register(luaState, _P'PlaySound', @lc_playsound);
  4489 lua_register(luaState, _P'PlaySound', @lc_playsound);
  4476 lua_register(luaState, _P'PlayMusicSound', @lc_playmusicsound);
  4490 lua_register(luaState, _P'PlayMusicSound', @lc_playmusicsound);
  4477 lua_register(luaState, _P'StopMusicSound', @lc_stopmusicsound);
  4491 lua_register(luaState, _P'StopMusicSound', @lc_stopmusicsound);
  4478 lua_register(luaState, _P'SetSoundMask', @lc_setsoundmask);
  4492 lua_register(luaState, _P'SetSoundMask', @lc_setsoundmask);
  4479 lua_register(luaState, _P'GetTeamName', @lc_getteamname);
  4493 lua_register(luaState, _P'GetTeamName', @lc_getteamname);