1231 if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9), lfIndestructible) then |
1231 if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9), lfIndestructible) then |
1232 begin |
1232 begin |
1233 Gear^.X := Gear^.X + Gear^.dX; |
1233 Gear^.X := Gear^.X + Gear^.dX; |
1234 Gear^.Y := Gear^.Y + _1_9; |
1234 Gear^.Y := Gear^.Y + _1_9; |
1235 end; |
1235 end; |
1236 SetAllHHToActive; |
1236 SetAllHHToActive(true); |
1237 end; |
1237 end; |
1238 if TestCollisionYwithGear(Gear, 1) <> 0 then |
1238 if TestCollisionYwithGear(Gear, 1) <> 0 then |
1239 begin |
1239 begin |
1240 Gear^.dY := _0; |
1240 Gear^.dY := _0; |
1241 SetLittle(HHGear^.dX); |
1241 SetLittle(HHGear^.dX); |
2336 PlaySound(sndDenied) |
2336 PlaySound(sndDenied) |
2337 end |
2337 end |
2338 else |
2338 else |
2339 begin |
2339 begin |
2340 DeleteCI(HHGear); |
2340 DeleteCI(HHGear); |
2341 SetAllHHToActive; |
2341 SetAllHHToActive(true); |
2342 Gear^.doStep := @doStepTeleportAnim; |
2342 Gear^.doStep := @doStepTeleportAnim; |
2343 |
2343 |
2344 // copy old HH position and direction to Gear (because we need them for drawing the vanishing hog) |
2344 // copy old HH position and direction to Gear (because we need them for drawing the vanishing hog) |
2345 Gear^.dX := HHGear^.dX; |
2345 Gear^.dX := HHGear^.dX; |
2346 // retrieve the cursor direction (it was previously copied to X so it doesn't get lost) |
2346 // retrieve the cursor direction (it was previously copied to X so it doesn't get lost) |
5205 landRect.w := min(2*iceRadius, LAND_WIDTH - landRect.x - 1); |
5205 landRect.w := min(2*iceRadius, LAND_WIDTH - landRect.x - 1); |
5206 landRect.h := min(2*iceRadius, LAND_HEIGHT - landRect.y - 1); |
5206 landRect.h := min(2*iceRadius, LAND_HEIGHT - landRect.y - 1); |
5207 UpdateLandTexture(landRect.x, landRect.w, landRect.y, landRect.h, true); |
5207 UpdateLandTexture(landRect.x, landRect.w, landRect.y, landRect.h, true); |
5208 |
5208 |
5209 // FillRoundInLandWithIce(Target.X, Target.Y, iceRadius); |
5209 // FillRoundInLandWithIce(Target.X, Target.Y, iceRadius); |
5210 SetAllHHToActive; |
5210 SetAllHHToActive(true); |
5211 Timer := iceWaitCollision; |
5211 Timer := iceWaitCollision; |
5212 end; |
5212 end; |
5213 |
5213 |
5214 if (Timer = iceCollideWithWater) and ((GameTicks - Power) > groundFreezingTime) then |
5214 if (Timer = iceCollideWithWater) and ((GameTicks - Power) > groundFreezingTime) then |
5215 begin |
5215 begin |
5216 DrawIceBreak(Target.X, cWaterLine - iceHeight, iceRadius, iceHeight); |
5216 DrawIceBreak(Target.X, cWaterLine - iceHeight, iceRadius, iceHeight); |
5217 SetAllHHToActive; |
5217 SetAllHHToActive(true); |
5218 Timer := iceWaitCollision; |
5218 Timer := iceWaitCollision; |
5219 end; |
5219 end; |
5220 |
5220 |
5221 // freeze nearby hogs |
5221 // freeze nearby hogs |
5222 hogs := GearsNear(int2hwFloat(Target.X), int2hwFloat(Target.Y), gtHedgehog, Gear^.Radius*2); |
5222 hogs := GearsNear(int2hwFloat(Target.X), int2hwFloat(Target.Y), gtHedgehog, Gear^.Radius*2); |