hedgewars/GSHandlers.inc
changeset 5494 5f55e9202122
parent 5480 37bafa5a7016
child 5507 1040c0946ef8
equal deleted inserted replaced
5492:a0455a050ca8 5494:5f55e9202122
   255 procedure doStepDrowningGear(Gear: PGear);
   255 procedure doStepDrowningGear(Gear: PGear);
   256 begin
   256 begin
   257     AllInactive := false;
   257     AllInactive := false;
   258     Gear^.Y := Gear^.Y + cDrownSpeed;
   258     Gear^.Y := Gear^.Y + cDrownSpeed;
   259     Gear^.X := Gear^.X + Gear^.dX * cDrownSpeed;
   259     Gear^.X := Gear^.X + Gear^.dX * cDrownSpeed;
   260     if (not SuddenDeathDmg and (cWaterOpacity > $FE)) or (SuddenDeathDmg and (cSDWaterOpacity > $FE)) or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then
       
   261         DeleteGear(Gear);
       
   262     // Create some bubbles (0.5% might be better but causes too few bubbles sometimes)
   260     // Create some bubbles (0.5% might be better but causes too few bubbles sometimes)
   263     if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cSDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then
   261     if ((not SuddenDeathDmg and (cWaterOpacity < $FF)) or (SuddenDeathDmg and (cSDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then
   264         if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then
   262         if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then
   265             AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius,
   263             AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble)
   266             vgtBubble)
       
   267     else if Random(12) = 0 then
   264     else if Random(12) = 0 then
   268              AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius,
   265              AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble);
   269              vgtBubble)
   266     if (not SuddenDeathDmg and (cWaterOpacity > $FE)) or (SuddenDeathDmg and (cSDWaterOpacity > $FE)) or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then
       
   267         DeleteGear(Gear);
   270 end;
   268 end;
   271 
   269 
   272 ////////////////////////////////////////////////////////////////////////////////
   270 ////////////////////////////////////////////////////////////////////////////////
   273 procedure doStepFallingGear(Gear: PGear);
   271 procedure doStepFallingGear(Gear: PGear);
   274 var 
   272 var