hedgewars/uVisualGears.pas
changeset 3704 ed2b9c7fb260
parent 3697 d5b30d6373fc
child 3706 a79784328c03
equal deleted inserted replaced
3702:6c90190908b6 3704:ed2b9c7fb260
   114             @doStepHealthTag,
   114             @doStepHealthTag,
   115             @doStepSmokeTrace,
   115             @doStepSmokeTrace,
   116             @doStepSmokeTrace,
   116             @doStepSmokeTrace,
   117             @doStepExplosion,
   117             @doStepExplosion,
   118             @doStepBigExplosion,
   118             @doStepBigExplosion,
   119             @doStepChunk
   119             @doStepChunk,
       
   120             @doStepNote
   120         );
   121         );
   121 
   122 
   122 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear;
   123 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType; State: LongWord = 0): PVisualGear;
   123 var gear: PVisualGear;
   124 var gear: PVisualGear;
   124     t: Longword;
   125     t: Longword;
   137     vgtSmallDamageTag,
   138     vgtSmallDamageTag,
   138     vgtSpeechBubble,
   139     vgtSpeechBubble,
   139     vgtHealthTag,
   140     vgtHealthTag,
   140     vgtExplosion,
   141     vgtExplosion,
   141     vgtSmokeTrace,
   142     vgtSmokeTrace,
   142     vgtEvilTrace]) then
   143     vgtEvilTrace,
       
   144     vgtNote]) then
   143     begin
   145     begin
   144       AddVisualGear:= nil;
   146       AddVisualGear:= nil;
   145       exit
   147       exit
   146     end;
   148     end;
   147 
   149 
   306                 sp:= 0.001 * (random(85) + 47);
   308                 sp:= 0.001 * (random(85) + 47);
   307                 dx:= AngleSin(t).QWordValue/4294967296 * sp;
   309                 dx:= AngleSin(t).QWordValue/4294967296 * sp;
   308                 dy:= AngleCos(t).QWordValue/4294967296 * sp;
   310                 dy:= AngleCos(t).QWordValue/4294967296 * sp;
   309                 if random(2) = 0 then dx := -dx;
   311                 if random(2) = 0 then dx := -dx;
   310                 (*if random(2) = 0 then*) dy := -2 * dy;
   312                 (*if random(2) = 0 then*) dy := -2 * dy;
       
   313                 end;
       
   314       vgtNote: begin
       
   315                 dx:= 0.005 * (random(15) + 10);
       
   316                 dy:= 0.001 * (random(40) + 20);
       
   317                 if random(2) = 0 then dx := -dx;
       
   318                 Frame:= random(4);
       
   319                 FrameTicks:= random(2000) + 1500;
   311                 end;
   320                 end;
   312         end;
   321         end;
   313 
   322 
   314 if State <> 0 then gear^.State:= State;
   323 if State <> 0 then gear^.State:= State;
   315 
   324 
   464                 vgtSmokeRing: begin
   473                 vgtSmokeRing: begin
   465                             Tint($FF, $FF, $FF, floor(Gear^.alpha * $FF));
   474                             Tint($FF, $FF, $FF, floor(Gear^.alpha * $FF));
   466                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
   475                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
   467                             end;
   476                             end;
   468                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   477                 vgtChunk: DrawRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
       
   478                  vgtNote: DrawRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   469             end;
   479             end;
   470         case Gear^.Kind of
   480         case Gear^.Kind of
   471             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   481             vgtSmallDamageTag: DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   472             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   482             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   473             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);
   483             vgtHealthTag: if Gear^.Tex <> nil then DrawCentered(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Tex);