hedgewars/uScript.pas
changeset 4235 6b1dfbd60a45
parent 4221 a1bf0f6b0d65
child 4236 fa2680cfff86
equal deleted inserted replaced
4234:60920aeb1606 4235:6b1dfbd60a45
    49     uWorld,
    49     uWorld,
    50     uAmmos,
    50     uAmmos,
    51     uSound,
    51     uSound,
    52     uTeams,
    52     uTeams,
    53     uKeys,
    53     uKeys,
    54     uChat;
    54     uChat,
       
    55     uStats;
    55 
    56 
    56 var luaState : Plua_State;
    57 var luaState : Plua_State;
    57     ScriptAmmoLoadout : shortstring;
    58     ScriptAmmoLoadout : shortstring;
    58     ScriptAmmoProbability : shortstring;
    59     ScriptAmmoProbability : shortstring;
    59     ScriptAmmoDelay : shortstring;
    60     ScriptAmmoDelay : shortstring;
   880     ScriptPrepareAmmoStore;
   881     ScriptPrepareAmmoStore;
   881     ScriptCall('onAmmoStoreInit');
   882     ScriptCall('onAmmoStoreInit');
   882     ScriptApplyAmmoStore
   883     ScriptApplyAmmoStore
   883     end;
   884     end;
   884 
   885 
   885 ScriptSetInteger('ClansCount', ClansCount)
   886 ScriptSetInteger('ClansCount', ClansCount);
       
   887 ScriptSetInteger('TeamsCount', TeamsCount)
   886 end;
   888 end;
   887 
   889 
   888 procedure ScriptLoad(name : shortstring);
   890 procedure ScriptLoad(name : shortstring);
   889 var ret : LongInt;
   891 var ret : LongInt;
   890 begin
   892 begin
   906 procedure SetGlobals;
   908 procedure SetGlobals;
   907 begin
   909 begin
   908 ScriptSetInteger('TurnTimeLeft', TurnTimeLeft);
   910 ScriptSetInteger('TurnTimeLeft', TurnTimeLeft);
   909 ScriptSetInteger('GameTime', GameTicks);
   911 ScriptSetInteger('GameTime', GameTicks);
   910 ScriptSetInteger('RealTime', RealTicks);
   912 ScriptSetInteger('RealTime', RealTicks);
       
   913 ScriptSetInteger('TotalRounds', TotalRounds);
   911 if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
   914 if (CurrentHedgehog <> nil) and (CurrentHedgehog^.Gear <> nil) then
   912     ScriptSetInteger('CurrentHedgehog', CurrentHedgehog^.Gear^.UID)
   915     ScriptSetInteger('CurrentHedgehog', CurrentHedgehog^.Gear^.UID)
   913 else
   916 else
   914     ScriptSetNil('CurrentHedgehog');
   917     ScriptSetNil('CurrentHedgehog');
   915 end;
   918 end;