6242 (*ox:= 0; oy:= 0; |
6242 (*ox:= 0; oy:= 0; |
6243 if TestCollisionYwithGear(Gear, -1) <> 0 then oy:= -1; |
6243 if TestCollisionYwithGear(Gear, -1) <> 0 then oy:= -1; |
6244 if TestCollisionXwithGear(Gear, 1) <> 0 then ox:= 1; |
6244 if TestCollisionXwithGear(Gear, 1) <> 0 then ox:= 1; |
6245 if TestCollisionXwithGear(Gear, -1) <> 0 then ox:= -1; |
6245 if TestCollisionXwithGear(Gear, -1) <> 0 then ox:= -1; |
6246 if TestCollisionYwithGear(Gear, 1) <> 0 then oy:= 1; |
6246 if TestCollisionYwithGear(Gear, 1) <> 0 then oy:= 1; |
6247 if Gear^.Health > 0 then |
|
6248 PlaySound(sndRopeAttach); |
|
6249 |
6247 |
6250 la:= _10000; |
6248 la:= _10000; |
6251 if (ox <> 0) or (oy <> 0) then |
6249 if (ox <> 0) or (oy <> 0) then |
6252 la:= CalcSlopeNearGear(Gear, ox, oy); |
6250 la:= CalcSlopeNearGear(Gear, ox, oy); |
6253 if la = _10000 then |
6251 if la = _10000 then |
6254 begin |
6252 begin |
6255 // debug for when we couldn't get an angle |
6253 // debug for when we couldn't get an angle |
6256 //AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite); |
6254 //AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeWhite); |
6257 *) |
6255 *) |
|
6256 if Gear^.Health > 0 then |
|
6257 PlaySound(Gear^.ImpactSound); |
|
6258 |
6258 Gear^.DirAngle:= DxDy2Angle(Gear^.dX, Gear^.dY) + (random(30)-15); |
6259 Gear^.DirAngle:= DxDy2Angle(Gear^.dX, Gear^.dY) + (random(30)-15); |
6259 if (Gear^.dX.isNegative and Gear^.dY.isNegative) or |
6260 if (Gear^.dX.isNegative and Gear^.dY.isNegative) or |
6260 ((not Gear^.dX.isNegative) and (not Gear^.dY.isNegative)) then Gear^.DirAngle:= Gear^.DirAngle-90; |
6261 ((not Gear^.dX.isNegative) and (not Gear^.dY.isNegative)) then Gear^.DirAngle:= Gear^.DirAngle-90; |
6261 // end |
6262 // end |
6262 // else Gear^.DirAngle:= hwFloat2Float(la)*90; // sheepluva's comment claims 45deg = 0.5 - yet orientation doesn't seem consistent? |
6263 // else Gear^.DirAngle:= hwFloat2Float(la)*90; // sheepluva's comment claims 45deg = 0.5 - yet orientation doesn't seem consistent? |