hedgewars/uGearsHandlersMess.pas
changeset 15242 5c91c5191085
parent 15240 66dcb7728e01
child 15248 c70de34686ac
equal deleted inserted replaced
15241:afda6c9711cf 15242:5c91c5191085
  3079 
  3079 
  3080 ////////////////////////////////////////////////////////////////////////////////
  3080 ////////////////////////////////////////////////////////////////////////////////
  3081 procedure doStepAirAttackWork(Gear: PGear);
  3081 procedure doStepAirAttackWork(Gear: PGear);
  3082 var uw, nuw: boolean;
  3082 var uw, nuw: boolean;
  3083     tmpFloat: hwFloat;
  3083     tmpFloat: hwFloat;
       
  3084     i: LongInt;
  3084 begin
  3085 begin
  3085     AllInactive := false;
  3086     AllInactive := false;
  3086     if (WorldEdge = weWrap) then
  3087     if (WorldEdge = weWrap) then
  3087         if (WorldWrap(Gear)) then
  3088         if (WorldWrap(Gear)) then
  3088             inc(Gear^.Power);
  3089             inc(Gear^.Power);
  3120         end;
  3121         end;
  3121 
  3122 
  3122     // Particles
  3123     // Particles
  3123     if (GameTicks and $3F) = 0 then
  3124     if (GameTicks and $3F) = 0 then
  3124         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  3125         if CheckCoordInWater(hwRound(Gear^.X), hwRound(Gear^.Y)) then
  3125             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
  3126             begin
       
  3127             // air plane bubbles
       
  3128             for i:=1 to 3 do
       
  3129                 AddVisualGear(hwRound(Gear^.X) - 8 + Random(16), hwRound(Gear^.Y) - 8 + Random(16), vgtBubble);
       
  3130             // pilot's snorkel bubbles
       
  3131             if random(2) = 0 then
       
  3132                 AddVisualGear(hwRound(Gear^.X) + 10, hwRound(Gear^.Y) - 50, vgtBubble);
       
  3133             end
  3126         else
  3134         else
       
  3135             // smoke
  3127             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
  3136             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
  3128 
  3137 
  3129     // Get rid of gear and cleanup
  3138     // Get rid of gear and cleanup
  3130     if ((WorldEdge = weWrap) and (Gear^.FlightTime >= 4000)) or
  3139     if ((WorldEdge = weWrap) and (Gear^.FlightTime >= 4000)) or
  3131         ((WorldEdge <> weWrap) and (((hwRound(Gear^.X) - Gear^.Radius > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) + Gear^.Radius < -2048) or ((Gear^.Message and gmDestroy) > 0)))) then
  3140         ((WorldEdge <> weWrap) and (((hwRound(Gear^.X) - Gear^.Radius > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) + Gear^.Radius < -2048) or ((Gear^.Message and gmDestroy) > 0)))) then