hedgewars/uCommandHandlers.pas
branchqmlfrontend
changeset 10886 99273b7afbff
parent 10862 4575977d3ce0
child 11024 b02e38762bbb
equal deleted inserted replaced
10823:1ff3dd3705b1 10886:99273b7afbff
    25 procedure initModule;
    25 procedure initModule;
    26 procedure freeModule;
    26 procedure freeModule;
    27 
    27 
    28 implementation
    28 implementation
    29 uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uWorld, uRandom, uCaptions
    29 uses uCommands, uTypes, uVariables, uIO, uDebug, uConsts, uScript, uUtils, SDLh, uWorld, uRandom, uCaptions
       
    30     , uVisualGearsList
    30      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
    31      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
    31 
    32 
    32 var prevGState: TGameState = gsConfirm;
    33 var prevGState: TGameState = gsConfirm;
    33     cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 15, 6, 4, 5, 0, 0, 0, 0, 0, 14, 12, 13);
    34     cTagsMasks : array[0..15] of byte = (7, 0, 0, 0, 15, 6, 4, 5, 0, 0, 0, 0, 0, 14, 12, 13);
    34     cTagsMasksNoHealth: array[0..15] of byte = (3, 2, 11, 1, 0, 0, 0, 0, 0, 10, 0, 9, 0, 0, 0, 0);
    35     cTagsMasksNoHealth: array[0..15] of byte = (3, 2, 11, 1, 0, 0, 0, 0, 0, 10, 0, 9, 0, 0, 0, 0);
   746 procedure chLandMines(var s: shortstring);
   747 procedure chLandMines(var s: shortstring);
   747 begin
   748 begin
   748 cLandMines:= StrToInt(s)
   749 cLandMines:= StrToInt(s)
   749 end;
   750 end;
   750 
   751 
       
   752 procedure chAirMines(var s: shortstring);
       
   753 begin
       
   754 cAirMines:= StrToInt(s)
       
   755 end;
       
   756 
   751 procedure chExplosives(var s: shortstring);
   757 procedure chExplosives(var s: shortstring);
   752 begin
   758 begin
   753 cExplosives:= StrToInt(s)
   759 cExplosives:= StrToInt(s)
   754 end;
   760 end;
   755 
   761 
   769 cMinesTime:= StrToInt(s)
   775 cMinesTime:= StrToInt(s)
   770 end;
   776 end;
   771 
   777 
   772 procedure chFastUntilLag(var s: shortstring);
   778 procedure chFastUntilLag(var s: shortstring);
   773 begin
   779 begin
   774 fastUntilLag:= StrToInt(s) <> 0
   780     fastUntilLag:= StrToInt(s) <> 0;
       
   781 
       
   782     if not fastUntilLag then
       
   783     begin
       
   784         // update health bars and the wind indicator
       
   785         AddVisualGear(0, 0, vgtTeamHealthSorter);
       
   786         AddVisualGear(0, 0, vgtSmoothWindBar)
       
   787     end
   775 end;
   788 end;
   776 
   789 
   777 procedure chCampVar(var s:shortstring);
   790 procedure chCampVar(var s:shortstring);
   778 begin
   791 begin
   779   CampaignVariable := s;
   792   CampaignVariable := s;
   835     RegisterVariable('damagepct',@chDamagePercent , false);
   848     RegisterVariable('damagepct',@chDamagePercent , false);
   836     RegisterVariable('ropepct' , @chRopePercent   , false);
   849     RegisterVariable('ropepct' , @chRopePercent   , false);
   837     RegisterVariable('getawaytime' , @chGetAwayTime , false);
   850     RegisterVariable('getawaytime' , @chGetAwayTime , false);
   838     RegisterVariable('minedudpct',@chMineDudPercent, false);
   851     RegisterVariable('minedudpct',@chMineDudPercent, false);
   839     RegisterVariable('minesnum', @chLandMines     , false);
   852     RegisterVariable('minesnum', @chLandMines     , false);
       
   853     RegisterVariable('airmines', @chAirMines      , false);
   840     RegisterVariable('explosives',@chExplosives    , false);
   854     RegisterVariable('explosives',@chExplosives    , false);
   841     RegisterVariable('gmflags' , @chGameFlags      , false);
   855     RegisterVariable('gmflags' , @chGameFlags      , false);
   842     RegisterVariable('turntime', @chHedgehogTurnTime, false);
   856     RegisterVariable('turntime', @chHedgehogTurnTime, false);
   843     RegisterVariable('minestime',@chMinesTime     , false);
   857     RegisterVariable('minestime',@chMinesTime     , false);
   844     RegisterVariable('quit'    , @chQuit         , true );
   858     RegisterVariable('quit'    , @chQuit         , true );