hedgewars/uVisualGears.pas
changeset 5563 fc73b6e941f7
parent 5562 8056d82b4d23
child 5564 4f42009237df
equal deleted inserted replaced
5562:8056d82b4d23 5563:fc73b6e941f7
    88             @doStepBubble,
    88             @doStepBubble,
    89             @doStepSteam,
    89             @doStepSteam,
    90             @doStepAmmo,
    90             @doStepAmmo,
    91             @doStepSmoke,
    91             @doStepSmoke,
    92             @doStepSmoke,
    92             @doStepSmoke,
    93             @doStepHealth,
       
    94             @doStepShell,
    93             @doStepShell,
    95             @doStepDust,
    94             @doStepDust,
    96             @doStepSplash,
    95             @doStepSplash,
    97             @doStepDroplet,
    96             @doStepDroplet,
    98             @doStepSmokeRing,
    97             @doStepSmokeRing,
   234                 dy:= 0.0002 * (random(45) + 10);
   233                 dy:= 0.0002 * (random(45) + 10);
   235                 if random(2) = 0 then dx := -dx;
   234                 if random(2) = 0 then dx := -dx;
   236                 Frame:= 7 - random(2);
   235                 Frame:= 7 - random(2);
   237                 FrameTicks:= cExplFrameTicks * 2;
   236                 FrameTicks:= cExplFrameTicks * 2;
   238                 end;
   237                 end;
   239     vgtHealth: begin
       
   240                 dx:= 0.001 * random(45);
       
   241                 dy:= 0.001 * (random(20) + 25);
       
   242                 Tint:= $00FF00FF; // default to green
       
   243                 if random(2) = 0 then dx := -dx;
       
   244                 Frame:= 0;
       
   245                 FrameTicks:= random(750) + 1250;
       
   246                 end;
       
   247   vgtDust: begin
   238   vgtDust: begin
   248                 dx:= 0.005 * (random(15) + 10);
   239                 dx:= 0.005 * (random(15) + 10);
   249                 dy:= 0.001 * (random(40) + 20);
   240                 dy:= 0.001 * (random(40) + 20);
   250                 if random(2) = 0 then dx := -dx;
   241                 if random(2) = 0 then dx := -dx;
   251                 Frame:= 7 - random(2);
   242                 Frame:= 7 - random(2);
   330                 dy:= 0.001 * (random(200));
   321                 dy:= 0.001 * (random(200));
   331                 if random(2) = 0 then dx := -dx;
   322                 if random(2) = 0 then dx := -dx;
   332                 if random(2) = 0 then dy := -dy;
   323                 if random(2) = 0 then dy := -dy;
   333                 Frame:= 0;
   324                 Frame:= 0;
   334                 FrameTicks:= random(750) + 1000;
   325                 FrameTicks:= random(750) + 1000;
   335                 Sprite:= sprSnowDust;
   326                 State:= ord(sprSnowDust);
   336                 end;
   327                 end;
   337         end;
   328         end;
   338 
   329 
   339 if State <> 0 then gear^.State:= State;
   330 if State <> 0 then gear^.State:= State;
   340 
   331 
   485                              else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then
   476                              else if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog^.Team = CurrentTeam)) or (Gear^.State = 2)) then
   486                                  DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   477                                  DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   487                              end;
   478                              end;
   488             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   479             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   489             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   480             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   490             vgtHealth: DrawSprite(sprHealth, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, 0);
   481             vgtStraightShot: DrawRotatedF(TSprite(Gear^.State), round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   491             vgtStraightShot: DrawRotatedF(Gear^.Sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
       
   492         end;
   482         end;
   493         if (cReducedQuality and rqAntiBoom) = 0 then
   483         if (cReducedQuality and rqAntiBoom) = 0 then
   494             case Gear^.Kind of
   484             case Gear^.Kind of
   495                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   485                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   496             end;
   486             end;