91 PlaySoundV(sndOops, gi^.Hedgehog^.Team^.voicepack) |
91 PlaySoundV(sndOops, gi^.Hedgehog^.Team^.voicepack) |
92 |
92 |
93 else |
93 else |
94 begin |
94 begin |
95 if (gi^.State and gstMoving) = 0 then |
95 if (gi^.State and gstMoving) = 0 then |
|
96 begin |
|
97 gi^.dX.isNegative:= X<gi^.X; |
96 gi^.State := gi^.State or gstLoser; |
98 gi^.State := gi^.State or gstLoser; |
|
99 end; |
97 |
100 |
98 if d > r div 2 then |
101 if d > r div 2 then |
99 PlaySoundV(sndNooo, gi^.Hedgehog^.Team^.voicepack) |
102 PlaySoundV(sndNooo, gi^.Hedgehog^.Team^.voicepack) |
100 else |
103 else |
101 PlaySoundV(sndUhOh, gi^.Hedgehog^.Team^.voicepack); |
104 PlaySoundV(sndUhOh, gi^.Hedgehog^.Team^.voicepack); |
193 tdX := Gear^.dX; |
196 tdX := Gear^.dX; |
194 tdY := Gear^.dY; |
197 tdY := Gear^.dY; |
195 |
198 |
196 |
199 |
197 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips) |
200 // might need some testing/adjustments - just to avoid projectiles to fly forever (accelerated by wind/skips) |
198 if (hwRound(Gear^.X) < LAND_WIDTH div -2) |
201 if (hwRound(Gear^.X) < min(LAND_WIDTH div -2, -2048)) |
199 or (hwRound(Gear^.X) > LAND_WIDTH * 3 div 2) then |
202 or (hwRound(Gear^.X) > max(LAND_WIDTH * 3 div 2, 6144)) then |
200 Gear^.State := Gear^.State or gstCollision; |
203 Gear^.State := Gear^.State or gstCollision; |
201 |
204 |
202 if Gear^.dY.isNegative then |
205 if Gear^.dY.isNegative then |
203 begin |
206 begin |
204 isFalling := true; |
207 isFalling := true; |
984 if (hwRound(Bullet^.X) and LAND_WIDTH_MASK <> 0) |
987 if (hwRound(Bullet^.X) and LAND_WIDTH_MASK <> 0) |
985 or (hwRound(Bullet^.Y) and LAND_HEIGHT_MASK <> 0) then |
988 or (hwRound(Bullet^.Y) and LAND_HEIGHT_MASK <> 0) then |
986 // only extend if not under water |
989 // only extend if not under water |
987 if hwRound(Bullet^.Y) < cWaterLine then |
990 if hwRound(Bullet^.Y) < cWaterLine then |
988 begin |
991 begin |
989 VGear^.dX := VGear^.dX + LAND_WIDTH * (VGear^.dX - VGear^.X); |
992 VGear^.dX := VGear^.dX + max(LAND_WIDTH,4096) * (VGear^.dX - VGear^.X); |
990 VGear^.dY := VGear^.dY + LAND_WIDTH * (VGear^.dY - VGear^.Y); |
993 VGear^.dY := VGear^.dY + max(LAND_WIDTH,4096) * (VGear^.dY - VGear^.Y); |
991 end; |
994 end; |
992 |
995 |
993 VGear^.Timer := 200; |
996 VGear^.Timer := 200; |
994 end; |
997 end; |
995 end; |
998 end; |
2168 end; |
2171 end; |
2169 |
2172 |
2170 if (GameTicks and $3F) = 0 then |
2173 if (GameTicks and $3F) = 0 then |
2171 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
2174 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
2172 |
2175 |
2173 if (hwRound(Gear^.X) > (LAND_WIDTH+2048)) or (hwRound(Gear^.X) < -2048) then |
2176 if (hwRound(Gear^.X) > (max(LAND_WIDTH,4096)+2048)) or (hwRound(Gear^.X) < -2048) then |
2174 begin |
2177 begin |
2175 // avoid to play forever (is this necessary?) |
2178 // avoid to play forever (is this necessary?) |
2176 StopSoundChan(Gear^.SoundChannel); |
2179 StopSoundChan(Gear^.SoundChannel); |
2177 DeleteGear(Gear) |
2180 DeleteGear(Gear) |
2178 end; |
2181 end; |
3967 else |
3970 else |
3968 loadNewPortalBall(Gear, true); |
3971 loadNewPortalBall(Gear, true); |
3969 end |
3972 end |
3970 |
3973 |
3971 else if (y > cWaterLine) |
3974 else if (y > cWaterLine) |
3972 or (y < -LAND_WIDTH) |
3975 or (y < -max(LAND_WIDTH,4096)) |
3973 or (x > 2*LAND_WIDTH) |
3976 or (x > 2*max(LAND_WIDTH,4096)) |
3974 or (x < -LAND_WIDTH) then |
3977 or (x < -max(LAND_WIDTH,4096)) then |
3975 loadNewPortalBall(Gear, true); |
3978 loadNewPortalBall(Gear, true); |
3976 end; |
3979 end; |
3977 |
3980 |
3978 procedure doStepMovingPortal(Gear: PGear); |
3981 procedure doStepMovingPortal(Gear: PGear); |
3979 begin |
3982 begin |
5244 |
5247 |
5245 //////////////////////////////////////////////////////////////////////////////// |
5248 //////////////////////////////////////////////////////////////////////////////// |
5246 procedure doStepKnife(Gear: PGear); |
5249 procedure doStepKnife(Gear: PGear); |
5247 var ox, oy: LongInt; |
5250 var ox, oy: LongInt; |
5248 la: hwFloat; |
5251 la: hwFloat; |
|
5252 a: real; |
5249 begin |
5253 begin |
5250 // Gear is shrunk so it can actually escape the hog without carving into the terrain |
5254 // Gear is shrunk so it can actually escape the hog without carving into the terrain |
5251 if (Gear^.Radius = 6) and (Gear^.CollisionMask = $FFFF) then Gear^.Radius:= 16; |
5255 if (Gear^.Radius = 6) and (Gear^.CollisionMask = $FFFF) then Gear^.Radius:= 16; |
|
5256 if Gear^.Damage > 100 then Gear^.CollisionMask:= 0 |
|
5257 else if Gear^.Damage > 30 then |
|
5258 if GetRandom(max(4,18-Gear^.Damage div 10)) < 3 then Gear^.CollisionMask:= 0; |
|
5259 Gear^.Damage:= 0; |
5252 if Gear^.Timer > 0 then dec(Gear^.Timer); |
5260 if Gear^.Timer > 0 then dec(Gear^.Timer); |
5253 if (Gear^.State and gstMoving <> 0) and (Gear^.State and gstCollision = 0) then |
5261 if (Gear^.State and gstMoving <> 0) and (Gear^.State and gstCollision = 0) then |
5254 begin |
5262 begin |
5255 DeleteCI(Gear); |
5263 DeleteCI(Gear); |
5256 // used for damage and impact calc. needs balancing I think |
5264 // used for damage and impact calc. needs balancing I think |
5257 Gear^.Health:= hwRound(hwSqr((hwAbs(Gear^.dY)+hwAbs(Gear^.dX))*_4)); |
5265 Gear^.Health:= hwRound(hwSqr((hwAbs(Gear^.dY)+hwAbs(Gear^.dX))*_4)); |
5258 doStepFallingGear(Gear); |
5266 doStepFallingGear(Gear); |
5259 AllInactive := false; |
5267 AllInactive := false; |
5260 CalcRotationDirAngle(Gear) |
5268 a:= Gear^.DirAngle; |
|
5269 CalcRotationDirAngle(Gear); |
|
5270 Gear^.DirAngle:= a+(Gear^.DirAngle-a)*2*hwSign(Gear^.dX) // double rotation |
5261 end |
5271 end |
5262 else if (Gear^.CollisionIndex = -1) and (Gear^.Timer = 0) then |
5272 else if (Gear^.CollisionIndex = -1) and (Gear^.Timer = 0) then |
5263 begin |
5273 begin |
5264 ox:= 0; oy:= 0; |
5274 ox:= 0; oy:= 0; |
5265 if TestCollisionYwithGear(Gear, -1) <> 0 then oy:= -1; |
5275 if TestCollisionYwithGear(Gear, -1) <> 0 then oy:= -1; |