hedgewars/uVisualGears.pas
changeset 5490 18c6049b5ae3
parent 5357 ec36f3d53f3c
child 5491 3a82724de759
equal deleted inserted replaced
5489:f7ec6e5ad054 5490:18c6049b5ae3
   243                 FrameTicks:= cExplFrameTicks * 2;
   243                 FrameTicks:= cExplFrameTicks * 2;
   244                 end;
   244                 end;
   245     vgtHealth: begin
   245     vgtHealth: begin
   246                 dx:= 0.001 * random(45);
   246                 dx:= 0.001 * random(45);
   247                 dy:= 0.001 * (random(20) + 25);
   247                 dy:= 0.001 * (random(20) + 25);
       
   248                 Tint:= $00FF00FF; // default to green
   248                 if random(2) = 0 then dx := -dx;
   249                 if random(2) = 0 then dx := -dx;
   249                 Frame:= 0;
   250                 Frame:= 0;
   250                 FrameTicks:= random(750) + 1250;
   251                 FrameTicks:= random(750) + 1250;
   251                 end;
   252                 end;
   252   vgtDust: begin
   253   vgtDust: begin
   480                              else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then
   481                              else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then
   481                                  DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   482                                  DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   482                              end;
   483                              end;
   483             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   484             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   484             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   485             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   485             vgtHealth: begin
   486             vgtHealth: DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0);
   486                        tinted:= true;
       
   487                        case Gear^.Frame div 10 of
       
   488                            0:Tint(0, $FF, 0, round(Gear^.FrameTicks * $FF / 1000));
       
   489                            1:Tint($FF, 0, 0, round(Gear^.FrameTicks * $FF / 1000));
       
   490                        end;
       
   491                        DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0);
       
   492                        end;
       
   493         end;
   487         end;
   494         if (cReducedQuality and rqAntiBoom) = 0 then
   488         if (cReducedQuality and rqAntiBoom) = 0 then
   495             case Gear^.Kind of
   489             case Gear^.Kind of
   496                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   490                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   497             end;
   491             end;