hedgewars/uVisualGears.pas
changeset 4327 224efdd648e1
parent 4279 b697a26ed538
child 4357 a1fcfc341a52
equal deleted inserted replaced
4325:ca254d2a46ac 4327:224efdd648e1
   116             @doStepSmokeTrace,
   116             @doStepSmokeTrace,
   117             @doStepExplosion,
   117             @doStepExplosion,
   118             @doStepBigExplosion,
   118             @doStepBigExplosion,
   119             @doStepChunk,
   119             @doStepChunk,
   120             @doStepNote,
   120             @doStepNote,
   121             @doStepLineTrail
   121             @doStepLineTrail,
       
   122             @doStepBulletHit
   122         );
   123         );
   123 
   124 
   124 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear;
   125 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear;
   125 var gear: PVisualGear;
   126 var gear: PVisualGear;
   126     t: Longword;
   127     t: Longword;
   314                 dx:= 0.005 * (random(15) + 10);
   315                 dx:= 0.005 * (random(15) + 10);
   315                 dy:= -0.001 * (random(40) + 20);
   316                 dy:= -0.001 * (random(40) + 20);
   316                 if random(2) = 0 then dx := -dx;
   317                 if random(2) = 0 then dx := -dx;
   317                 Frame:= random(4);
   318                 Frame:= random(4);
   318                 FrameTicks:= random(2000) + 1500;
   319                 FrameTicks:= random(2000) + 1500;
       
   320                 end;
       
   321   vgtBulletHit: begin
       
   322                 dx:= 0;
       
   323                 dy:= 0;
       
   324                 FrameTicks:= 350;
       
   325                 Frame:= 7;
       
   326                 Angle := 0;
   319                 end;
   327                 end;
   320         end;
   328         end;
   321 
   329 
   322 if State <> 0 then gear^.State:= State;
   330 if State <> 0 then gear^.State:= State;
   323 
   331 
   477                             Tint($FF, $FF, $FF, floor(Gear^.alpha * $FF));
   485                             Tint($FF, $FF, $FF, floor(Gear^.alpha * $FF));
   478                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
   486                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
   479                             end;
   487                             end;
   480                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   488                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   481                  vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   489                  vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
       
   490                 vgtBulletHit: DrawRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle);
   482             end;
   491             end;
   483         case Gear^.Kind of
   492         case Gear^.Kind of
   484             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   493             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   485             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   494             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   486             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   495             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);