305 or (SuddenDeathDmg and (SDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then |
305 or (SuddenDeathDmg and (SDWaterOpacity < $FF))) and ((GameTicks and $1F) = 0) then |
306 if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then |
306 if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then |
307 AddVisualGear(bubbleX, bubbleY, vgtBubble) |
307 AddVisualGear(bubbleX, bubbleY, vgtBubble) |
308 else if Random(12) = 0 then |
308 else if Random(12) = 0 then |
309 AddVisualGear(bubbleX, bubbleY, vgtBubble); |
309 AddVisualGear(bubbleX, bubbleY, vgtBubble); |
|
310 // Insta-delete gear and skip drowning animation if water is 100% opaque |
310 if (not SuddenDeathDmg and (WaterOpacity > $FE)) |
311 if (not SuddenDeathDmg and (WaterOpacity > $FE)) |
311 or (SuddenDeathDmg and (SDWaterOpacity > $FE)) |
312 or (SuddenDeathDmg and (SDWaterOpacity > $FE)) then |
312 or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then |
313 begin |
|
314 // Teleport gear to a suitable position for the damage tag in the water |
|
315 if (WorldEdge = weSea) and (hwRound(Gear^.X) - Gear^.Radius < leftX) then |
|
316 begin |
|
317 if (hwRound(Gear^.X) - Gear^.Radius > leftX - 90) then |
|
318 Gear^.X := Gear^.X - _90 |
|
319 end |
|
320 else if (WorldEdge = weSea) and (hwRound(Gear^.X) + Gear^.Radius > rightX) then |
|
321 begin |
|
322 if (hwRound(Gear^.X) - Gear^.Radius < rightX + 90) then |
|
323 Gear^.X := Gear^.X + _90 |
|
324 end |
|
325 else |
|
326 Gear^.Y := int2hwFloat(Gear^.Radius + cWaterLine + cVisibleWater); |
|
327 DeleteGear(Gear); |
|
328 exit; |
|
329 end; |
|
330 // Delete normally if gear is outside of visible range |
|
331 if (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then |
313 DeleteGear(Gear); |
332 DeleteGear(Gear); |
314 end; |
333 end; |
315 |
334 |
316 //////////////////////////////////////////////////////////////////////////////// |
335 //////////////////////////////////////////////////////////////////////////////// |
317 procedure doStepFallingGear(Gear: PGear); |
336 procedure doStepFallingGear(Gear: PGear); |