hedgewars/uVisualGears.pas
changeset 2974 f3fa665f0874
parent 2972 82828fd23dea
child 2982 4213c6a8aceb
equal deleted inserted replaced
2973:b51a0f57cd43 2974:f3fa665f0874
   262             Gear^.FrameTicks:= cExplFrameTicks
   262             Gear^.FrameTicks:= cExplFrameTicks
   263             end
   263             end
   264         else dec(Gear^.FrameTicks, Steps)
   264         else dec(Gear^.FrameTicks, Steps)
   265 end;
   265 end;
   266 
   266 
       
   267 procedure doStepSplash(Gear: PVisualGear; Steps: Longword);
       
   268 begin
       
   269   if Gear^.FrameTicks <= Steps then
       
   270       DeleteVisualGear(Gear)
       
   271   else
       
   272       dec(Gear^.FrameTicks, Steps);
       
   273 end;
       
   274 
   267 ////////////////////////////////////////////////////////////////////////////////
   275 ////////////////////////////////////////////////////////////////////////////////
   268 const cSorterWorkTime = 640;
   276 const cSorterWorkTime = 640;
   269 var thexchar: array[0..cMaxTeams] of
   277 var thexchar: array[0..cMaxTeams] of
   270             record
   278             record
   271             dy, ny, dw: LongInt;
   279             dy, ny, dw: LongInt;
   399             @doStepAmmo,
   407             @doStepAmmo,
   400             @doStepSmoke,
   408             @doStepSmoke,
   401             @doStepSmoke,
   409             @doStepSmoke,
   402             @doStepHealth,
   410             @doStepHealth,
   403             @doStepShell,
   411             @doStepShell,
   404             @doStepDust
   412             @doStepDust,
       
   413             @doStepSplash
   405         );
   414         );
   406 
   415 
   407 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear;
   416 function  AddVisualGear(X, Y: LongInt; Kind: TVisualGearType): PVisualGear;
   408 var gear: PVisualGear;
   417 var gear: PVisualGear;
   409     t: Longword;
   418     t: Longword;
   517                 dx:= _0_005 * (random(15) + 10);
   526                 dx:= _0_005 * (random(15) + 10);
   518                 dx.isNegative:= random(2) = 0;
   527                 dx.isNegative:= random(2) = 0;
   519                 dy:= _0_001 * (random(40) + 20);
   528                 dy:= _0_001 * (random(40) + 20);
   520                 Frame:= 7 - random(2);
   529                 Frame:= 7 - random(2);
   521                 FrameTicks:= random(20) + 15;
   530                 FrameTicks:= random(20) + 15;
       
   531                 end;
       
   532   vgtSplash: begin
       
   533                 dx:= _0;
       
   534                 dx.isNegative:= false;
       
   535                 dy:= _0;
       
   536                 FrameTicks:= 740;
       
   537                 Frame:= 19;
   522                 end;
   538                 end;
   523         end;
   539         end;
   524 
   540 
   525 if VisualGearsList <> nil then
   541 if VisualGearsList <> nil then
   526     begin
   542     begin
   612                                 glColor4f(1, 1, 1, Gear^.FrameTicks / 250);
   628                                 glColor4f(1, 1, 1, Gear^.FrameTicks / 250);
   613                             DrawRotatedF(sprShell, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   629                             DrawRotatedF(sprShell, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   614                             if Gear^.FrameTicks < 250 then
   630                             if Gear^.FrameTicks < 250 then
   615                                 glColor4f(1, 1, 1, 1);
   631                                 glColor4f(1, 1, 1, 1);
   616                             end;
   632                             end;
       
   633                 vgtSplash: DrawSprite(sprSplash, hwRound(Gear^.X) + WorldDx - 64, hwRound(Gear^.Y) + WorldDy - 72, 19 - (Gear^.FrameTicks div 37));
   617             end;
   634             end;
   618         case Gear^.Kind of
   635         case Gear^.Kind of
   619             vgtSmallDamageTag: DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
   636             vgtSmallDamageTag: DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
   620             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
   637             vgtSpeechBubble: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
   621         end;
   638         end;