hedgewars/uGearsHandlersMess.pas
changeset 12764 272fcd3833d2
parent 12746 e1395ba033e8
child 12789 28782e03b8f0
equal deleted inserted replaced
12763:ad67a3804981 12764:272fcd3833d2
  6406             // Let's make that duck swim!
  6406             // Let's make that duck swim!
  6407             // Does the duck come FROM the Sea edge? (left or right)
  6407             // Does the duck come FROM the Sea edge? (left or right)
  6408             if (((Gear^.Pos = 3) or (Gear^.Pos = 7)) and (cWindSpeed > _0)) or (((Gear^.Pos = 4) or (Gear^.Pos = 8)) and (cWindSpeed < _0)) then
  6408             if (((Gear^.Pos = 3) or (Gear^.Pos = 7)) and (cWindSpeed > _0)) or (((Gear^.Pos = 4) or (Gear^.Pos = 8)) and (cWindSpeed < _0)) then
  6409                 begin
  6409                 begin
  6410                 PlaySound(sndDuckWater);
  6410                 PlaySound(sndDuckWater);
  6411                 Gear^.Angle:= 0;
  6411                 Gear^.DirAngle:= 0;
  6412                 Gear^.Pos:= 1;
  6412                 Gear^.Pos:= 1;
  6413                 Gear^.dY:= _0;
  6413                 Gear^.dY:= _0;
  6414                 end;
  6414                 end;
  6415 
  6415 
  6416             // Duck comes either falling (usual case) or was rising from below
  6416             // Duck comes either falling (usual case) or was rising from below
  6482             begin
  6482             begin
  6483             // Turn duck when reaching edge the first time
  6483             // Turn duck when reaching edge the first time
  6484             if (Gear^.Pos <> 3) and (Gear^.Pos <> 7) then
  6484             if (Gear^.Pos <> 3) and (Gear^.Pos <> 7) then
  6485                 begin
  6485                 begin
  6486                 if Gear^.Tag = 1 then
  6486                 if Gear^.Tag = 1 then
  6487                     Gear^.Angle:= 90 
  6487                     Gear^.DirAngle:= 90
  6488                 else
  6488                 else
  6489                     Gear^.Angle:= 270;
  6489                     Gear^.DirAngle:= 270;
  6490                 end;
  6490                 end;
  6491 
  6491 
  6492             // Reaching the edge surface
  6492             // Reaching the edge surface
  6493             if (LeftX = hwRound(Gear^.X) - Gear^.Karma) and (Gear^.Pos <> 3) then
  6493             if (LeftX = hwRound(Gear^.X) - Gear^.Karma) and (Gear^.Pos <> 3) then
  6494                 // We are coming from the horizontal side
  6494                 // We are coming from the horizontal side
  6507         else if (RightX <= hwRound(Gear^.X) + Gear^.Karma) and ((cWindSpeed > _0) or ((Gear^.Pos = 0) or (Gear^.Pos = 8))) then
  6507         else if (RightX <= hwRound(Gear^.X) + Gear^.Karma) and ((cWindSpeed > _0) or ((Gear^.Pos = 0) or (Gear^.Pos = 8))) then
  6508             begin
  6508             begin
  6509             if (Gear^.Pos <> 4) and (Gear^.Pos <> 8) then
  6509             if (Gear^.Pos <> 4) and (Gear^.Pos <> 8) then
  6510                 begin
  6510                 begin
  6511                 if Gear^.Tag = 1 then
  6511                 if Gear^.Tag = 1 then
  6512                     Gear^.Angle:= 270 
  6512                     Gear^.DirAngle:= 270
  6513                 else
  6513                 else
  6514                     Gear^.Angle:= 90;
  6514                     Gear^.DirAngle:= 90;
  6515                 end;
  6515                 end;
  6516 
  6516 
  6517             if (RightX = hwRound(Gear^.X) + Gear^.Karma) and (Gear^.Pos <> 4) then
  6517             if (RightX = hwRound(Gear^.X) + Gear^.Karma) and (Gear^.Pos <> 4) then
  6518                 begin
  6518                 begin
  6519                 PlaySound(sndDuckWater);
  6519                 PlaySound(sndDuckWater);