hedgewars/uGears.pas
changeset 14406 b48c270328a5
parent 14405 dce60c706f01
child 14407 7dbc3e5f8129
equal deleted inserted replaced
14405:dce60c706f01 14406:b48c270328a5
   400         else
   400         else
   401             inc(step);
   401             inc(step);
   402         end;
   402         end;
   403     stSuddenDeath:
   403     stSuddenDeath:
   404         begin
   404         begin
   405         if (cWaterRise <> 0) or (cHealthDecrease <> 0) then
   405         if ((cWaterRise <> 0) or (cHealthDecrease <> 0)) and (not (isInMultiShoot or bBetweenTurns)) then
   406             begin
   406             begin
   407             if (TotalRoundsPre = cSuddenDTurns) and (not SuddenDeath) and (not isInMultiShoot) then
   407             // Start Sudden Death
       
   408             if (TotalRoundsPre = cSuddenDTurns) and (not SuddenDeath) then
   408                 begin
   409                 begin
   409                 StartSuddenDeath();
   410                 StartSuddenDeath();
   410                 delay:= delaySDStart;
   411                 delay:= delaySDStart;
       
   412                 inc(step);
   411                 end
   413                 end
   412             else if (TotalRoundsPre < cSuddenDTurns) and (not isInMultiShoot) then
   414             // Show Sudden Death warning message
       
   415             else if (TotalRoundsPre < cSuddenDTurns) and ((LastSuddenDWarn = -2) or (LastSuddenDWarn <> TotalRoundsPre)) then
   413                 begin
   416                 begin
   414                 i:= cSuddenDTurns - TotalRoundsPre;
   417                 i:= cSuddenDTurns - TotalRoundsPre;
   415                 s:= ansistring(inttostr(i));
   418                 s:= ansistring(inttostr(i));
   416                 if i = 1 then
   419                 // X rounds before SD. X = 1, 2, 5, 10, 15, 20, 25, 50, 100, ...
       
   420                 if (i > 0) and ((i <= 2) or ((i mod 50 = 0) or ((i <= 25) and (i mod 5 = 0)))) then
   417                     begin
   421                     begin
   418                     AddCaption(trmsg[sidRoundSD], capcolDefault, capgrpGameState);
   422                     if i = 1 then
       
   423                         AddCaption(trmsg[sidRoundSD], capcolDefault, capgrpGameState)
       
   424                     else
       
   425                         AddCaption(FormatA(trmsg[sidRoundsSD], s), capcolDefault, capgrpGameState);
   419                     delay:= delaySDWarning;
   426                     delay:= delaySDWarning;
       
   427                     inc(step);
       
   428                     LastSuddenDWarn:= TotalRoundsPre;
   420                     end
   429                     end
   421                 else if (i = 2) or ((i > 0) and ((i mod 50 = 0) or ((i <= 25) and (i mod 5 = 0)))) then
   430                 else
   422                     begin
   431                     inc(step, 2);
   423                     AddCaption(FormatA(trmsg[sidRoundsSD], s), capcolDefault, capgrpGameState);
   432                 end
   424                     delay:= delaySDWarning;
   433             else
   425                     end
   434                 inc(step, 2);
   426                 end;
       
   427             inc(step);
       
   428             end
   435             end
   429         else
   436         else
   430             inc(step, 2);
   437             inc(step, 2);
   431         end;
   438         end;
   432     stDelay3:
   439     stDelay3: