hedgewars/uVisualGears.pas
changeset 3080 b7fa8ad60e3b
parent 3062 62eb6095497b
child 3083 8da8f2515221
equal deleted inserted replaced
3079:8deb4e8f5172 3080:b7fa8ad60e3b
   126         end;
   126         end;
   127     end;
   127     end;
   128 
   128 
   129 end;
   129 end;
   130 
   130 
       
   131 procedure doStepBeeTrace(Gear: PVisualGear; Steps: Longword);
       
   132 begin
       
   133 if Gear^.FrameTicks > Steps then
       
   134     dec(Gear^.FrameTicks, Steps)
       
   135 else
       
   136     DeleteVisualGear(Gear);
       
   137 end;
       
   138 
   131 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
   139 procedure doStepCloud(Gear: PVisualGear; Steps: Longword);
   132 var i: Longword;
   140 var i: Longword;
   133 begin
   141 begin
   134 Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps;
   142 Gear^.X:= Gear^.X + (cWindSpeed * 200 + Gear^.dX) * Steps;
   135 
   143 
   455             @doStepHealth,
   463             @doStepHealth,
   456             @doStepShell,
   464             @doStepShell,
   457             @doStepDust,
   465             @doStepDust,
   458             @doStepSplash,
   466             @doStepSplash,
   459             @doStepDroplet,
   467             @doStepDroplet,
   460             @doStepSmokeRing
   468             @doStepSmokeRing,
       
   469             @doStepBeeTrace
   461         );
   470         );
   462 
   471 
   463 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear;
   472 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear;
   464 var gear: PVisualGear;
   473 var gear: PVisualGear;
   465     t: Longword;
   474     t: Longword;
   591                 dx.isNegative:= random(2) = 0;
   600                 dx.isNegative:= random(2) = 0;
   592                 dy:= _0_001 * (random(80) + 120);
   601                 dy:= _0_001 * (random(80) + 120);
   593                 dy.isNegative:= true;
   602                 dy.isNegative:= true;
   594                 FrameTicks:= 250 + random(1751);
   603                 FrameTicks:= 250 + random(1751);
   595                 Frame:= random(3)
   604                 Frame:= random(3)
       
   605                 end;
       
   606    vgtBeeTrace: begin
       
   607                 FrameTicks:= 1000;
       
   608                 Frame:= random(16);
   596                 end;
   609                 end;
   597     vgtSmokeRing: begin
   610     vgtSmokeRing: begin
   598                 dx:= _0;
   611                 dx:= _0;
   599                 dx.isNegative:= false;
   612                 dx.isNegative:= false;
   600                 dy:= _0;
   613                 dy:= _0;
   725                             if Gear^.FrameTicks < 250 then
   738                             if Gear^.FrameTicks < 250 then
   726                                 glColor4f(1, 1, 1, 1);
   739                                 glColor4f(1, 1, 1, 1);
   727                             end;
   740                             end;
   728                 vgtSplash: DrawSprite(sprSplash, hwRound(Gear^.X) + WorldDx - 64, hwRound(Gear^.Y) + WorldDy - 72, 19 - (Gear^.FrameTicks div 37));
   741                 vgtSplash: DrawSprite(sprSplash, hwRound(Gear^.X) + WorldDx - 64, hwRound(Gear^.Y) + WorldDy - 72, 19 - (Gear^.FrameTicks div 37));
   729                 vgtDroplet: DrawSprite(sprDroplet, hwRound(Gear^.X) + WorldDx - 8, hwRound(Gear^.Y) + WorldDy - 8, Gear^.Frame);
   742                 vgtDroplet: DrawSprite(sprDroplet, hwRound(Gear^.X) + WorldDx - 8, hwRound(Gear^.Y) + WorldDy - 8, Gear^.Frame);
       
   743                vgtBeeTrace: begin
       
   744                             if Gear^.FrameTicks < 250 then
       
   745                                 glColor4f(1, 1, 1, Gear^.FrameTicks / 500)
       
   746                             else
       
   747                                 glColor4f(1, 1, 1, 0.5);
       
   748                             DrawRotatedF(sprBeeTrace, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, 1, (RealTicks shr 4) mod cMaxAngle);
       
   749                             glColor4f(1, 1, 1, 1);
       
   750                             end;
   730                 vgtSmokeRing: begin
   751                 vgtSmokeRing: begin
   731                             glColor4f(1, 1, 1, Gear^.alpha);
   752                             glColor4f(1, 1, 1, Gear^.alpha);
   732                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
   753                             DrawRotatedTextureF(SpritesData[sprSmokeRing].Texture, Gear^.scale, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 200, 200, Gear^.Angle);
   733                             glColor4f(1, 1, 1, 1);
   754                             glColor4f(1, 1, 1, 1);
   734                             end;
   755                             end;