hedgewars/uCommandHandlers.pas
changeset 12997 f06660523198
parent 12990 8dd95c095882
child 12998 22e032ab1cb7
equal deleted inserted replaced
12996:2bafaeed5e2e 12997:f06660523198
    24 
    24 
    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, uConsole
    30     , uVisualGearsList, uGearsHedgehog
    30     , uVisualGearsList, uGearsHedgehog
    31      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
    31      {$IFDEF USE_VIDEO_RECORDING}, uVideoRec {$ENDIF};
    32 
    32 
    33 var prevGState: TGameState = gsConfirm;
    33 var prevGState: TGameState = gsConfirm;
    34     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);
   612     begin
   612     begin
   613     if UIDisplay <> uiNone then
   613     if UIDisplay <> uiNone then
   614          UIDisplay:= uiNone
   614          UIDisplay:= uiNone
   615     else UIDisplay:= uiAll
   615     else UIDisplay:= uiAll
   616     end
   616     end
   617 else if LocalMessage and gmPrecise = gmPrecise then
       
   618     begin
       
   619     if ((GameFlags and gfInvulnerable) = 0) then
       
   620         cTagsMask:= cTagsMasks[cTagsMask]
       
   621     else
       
   622         cTagsMask:= cTagsMasksNoHealth[cTagsMask]
       
   623     end
       
   624 else
   617 else
   625     begin
   618     begin
   626     if UIDisplay <> uiNoTeams then
   619     if UIDisplay <> uiNoTeams then
   627          UIDisplay:= uiNoTeams
   620          UIDisplay:= uiNoTeams
   628     else UIDisplay:= uiAll
   621     else UIDisplay:= uiAll
   629     end
   622     end
       
   623 end;
       
   624 
       
   625 procedure chRotateTags(var s: shortstring);
       
   626 begin
       
   627 s:= s; // avoid compiler hint
       
   628 if ((GameFlags and gfInvulnerable) = 0) then
       
   629     cTagsMask:= cTagsMasks[cTagsMask]
       
   630 else
       
   631     cTagsMask:= cTagsMasksNoHealth[cTagsMask]
   630 end;
   632 end;
   631 
   633 
   632 procedure chSpeedup_p(var s: shortstring);
   634 procedure chSpeedup_p(var s: shortstring);
   633 begin
   635 begin
   634 s:= s; // avoid compiler hint
   636 s:= s; // avoid compiler hint
   820     RegisterVariable('scriptparam', @chScriptParam, false);
   822     RegisterVariable('scriptparam', @chScriptParam, false);
   821     RegisterVariable('proto'   , @chCheckProto   , true );
   823     RegisterVariable('proto'   , @chCheckProto   , true );
   822     RegisterVariable('spectate', @chFastUntilLag   , false);
   824     RegisterVariable('spectate', @chFastUntilLag   , false);
   823     RegisterVariable('capture' , @chCapture      , true );
   825     RegisterVariable('capture' , @chCapture      , true );
   824     RegisterVariable('rotmask' , @chRotateMask   , true );
   826     RegisterVariable('rotmask' , @chRotateMask   , true );
       
   827     RegisterVariable('rottags' , @chRotateTags   , true );
   825     RegisterVariable('rdriven' , @chTeamLocal    , false);
   828     RegisterVariable('rdriven' , @chTeamLocal    , false);
   826     RegisterVariable('map'     , @chSetMap       , false);
   829     RegisterVariable('map'     , @chSetMap       , false);
   827     RegisterVariable('theme'   , @chSetTheme     , false);
   830     RegisterVariable('theme'   , @chSetTheme     , false);
   828     RegisterVariable('seed'    , @chSetSeed      , false);
   831     RegisterVariable('seed'    , @chSetSeed      , false);
   829     RegisterVariable('template_filter', @chTemplateFilter, false);
   832     RegisterVariable('template_filter', @chTemplateFilter, false);