226 CalcRotationDirAngle(Gear); |
226 CalcRotationDirAngle(Gear); |
227 |
227 |
228 if (Gear^.State and gstCollision) <> 0 then begin |
228 if (Gear^.State and gstCollision) <> 0 then begin |
229 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 5, EXPLAutoSound); |
229 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 5, EXPLAutoSound); |
230 for i:= 0 to 40 do begin |
230 for i:= 0 to 40 do begin |
231 dX:= AngleCos(i * 16) * _0_5 * (GetRandom + _1); |
231 dX:= AngleCos(i * 2) * ((_0_08*(i mod 10))) * (GetRandom + _1); |
232 dY:= AngleSin(i * 16) * _0_5 * (GetRandom + _1); |
232 dY:= AngleSin(i * 8) * _0_5 * (GetRandom + _1); |
233 Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
233 Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
234 Fire^.State:= Fire^.State or gsttmpFlag; |
234 Fire^.State:= Fire^.State or gsttmpFlag; |
|
235 Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0); |
|
236 Fire^.State:= Fire^.State or gsttmpFlag; |
|
237 Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, -dX, dY, 0); |
|
238 Fire^.State:= Fire^.State or gsttmpFlag; |
|
239 Fire:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, -dX, -dY, 0); |
|
240 Fire^.State:= Fire^.State or gsttmpFlag; |
235 end; |
241 end; |
236 DeleteGear(Gear); |
242 DeleteGear(Gear); |
237 exit |
243 exit |
238 end; |
244 end; |
239 end; |
245 end; |
1213 PlaySound(sndWarp, false, nil); |
1219 PlaySound(sndWarp, false, nil); |
1214 |
1220 |
1215 if (Gear^.Tag = 0) and (Gear^.Timer < 1000) then |
1221 if (Gear^.Tag = 0) and (Gear^.Timer < 1000) then |
1216 inc(Gear^.Timer) |
1222 inc(Gear^.Timer) |
1217 else if Gear^.Tag = 1 then |
1223 else if Gear^.Tag = 1 then |
1218 if Gear^.Timer > 0 then |
1224 begin |
1219 dec(Gear^.Timer) |
1225 Gear^.Tag:= 2; |
1220 else |
1226 if (TrainingFlags and tfTimeTrial) <> 0 then |
1221 begin |
1227 begin |
1222 TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0); |
|
1223 FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH); |
|
1224 inc(TurnTimeLeft, TrainingTimeInc); |
1228 inc(TurnTimeLeft, TrainingTimeInc); |
1225 |
1229 |
1226 if TrainingTimeInc > TrainingTimeInM then |
1230 if TrainingTimeInc > TrainingTimeInM then |
1227 dec(TrainingTimeInc, TrainingTimeInD); |
1231 dec(TrainingTimeInc, TrainingTimeInD); |
1228 if TurnTimeLeft > TrainingTimeMax then |
1232 if TurnTimeLeft > TrainingTimeMax then |
1229 TurnTimeLeft:= TrainingTimeMax; |
1233 TurnTimeLeft:= TrainingTimeMax; |
1230 |
1234 end; |
|
1235 end |
|
1236 else if Gear^.Tag = 2 then |
|
1237 if Gear^.Timer > 0 then |
|
1238 dec(Gear^.Timer) |
|
1239 else |
|
1240 begin |
|
1241 if (TrainingFlags and tfTargetRespawn) <> 0 then |
|
1242 begin |
|
1243 TrainingTargetGear:= AddGear(0, 0, gtTarget, 0, _0, _0, 0); |
|
1244 FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH); |
|
1245 end; |
1231 DeleteGear(Gear); |
1246 DeleteGear(Gear); |
1232 exit; |
1247 exit; |
1233 end; |
1248 end; |
1234 |
1249 |
1235 doStepCase(Gear) |
1250 doStepCase(Gear) |
1289 |
1304 |
1290 if not TestCollisionYwithGear(Gear, 1) then |
1305 if not TestCollisionYwithGear(Gear, 1) then |
1291 begin |
1306 begin |
1292 if hwAbs(Gear^.dX) > _0_01 then |
1307 if hwAbs(Gear^.dX) > _0_01 then |
1293 Gear^.dX:= Gear^.dX * _0_995; |
1308 Gear^.dX:= Gear^.dX * _0_995; |
1294 |
1309 if (Gear^.State and gsttmpFlag) <> 0 then Gear^.dY:= Gear^.dY + _2*cGravity else |
1295 Gear^.dY:= Gear^.dY + cGravity; |
1310 Gear^.dY:= Gear^.dY + cGravity; |
1296 if hwAbs(Gear^.dY) > _0_2 then Gear^.dY:= Gear^.dY * _0_995; |
1311 if hwAbs(Gear^.dY) > _0_2 then Gear^.dY:= Gear^.dY * _0_995; |
1297 |
1312 |
|
1313 if (Gear^.State and gsttmpFlag) <> 0 then Gear^.X:= Gear^.X + Gear^.dX else |
1298 Gear^.X:= Gear^.X + Gear^.dX + cWindSpeed * 640; |
1314 Gear^.X:= Gear^.X + Gear^.dX + cWindSpeed * 640; |
1299 Gear^.Y:= Gear^.Y + Gear^.dY; |
1315 Gear^.Y:= Gear^.Y + Gear^.dY; |
1300 |
1316 |
1301 if (hwRound(Gear^.Y) > cWaterLine) then |
1317 if (hwRound(Gear^.Y) > cWaterLine) then |
1302 begin |
1318 begin |
2250 |
2266 |
2251 // pickup targets |
2267 // pickup targets |
2252 t:= CheckGearNear(Gear, gtTarget, 36, 36); |
2268 t:= CheckGearNear(Gear, gtTarget, 36, 36); |
2253 if t <> nil then |
2269 if t <> nil then |
2254 begin |
2270 begin |
2255 if t^.Tag = 1 then // collect it only once |
2271 if t^.Tag <> 0 then // collect it only once |
2256 exit; |
2272 exit; |
2257 PlaySound(sndShotgunReload, false, nil); |
2273 PlaySound(sndShotgunReload, false, nil); |
2258 t^.Tag:= 1; |
2274 t^.Tag:= 1; |
2259 TrainingTargetGear:= nil; // remove target cursor |
2275 TrainingTargetGear:= nil; // remove target cursor |
2260 exit; |
2276 exit; |
2261 end; |
2277 end; |
2262 |
2278 |
2263 if (TurnTimeLeft > 0) then |
2279 if (TurnTimeLeft > 0) then |
2264 dec(TurnTimeLeft) |
2280 dec(TurnTimeLeft) |
2265 else |
|
2266 begin |
|
2267 if ((TrainingFlags and tfTimeTrial) <>0) and (TimeTrialStopTime = 0) then TimeTrialStopTime:= RealTicks; |
|
2268 StopSound(sndRCPlane); |
|
2269 ResumeMusic; |
|
2270 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
|
2271 for i:= 0 to 32 do |
|
2272 begin |
|
2273 dX:= AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
|
2274 dY:= AngleSin(i * 64) * _0_5 * (GetRandom + _1); |
|
2275 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, dY, 0); |
|
2276 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, dX, -dY, 0); |
|
2277 end; |
|
2278 DeleteGear(Gear); |
|
2279 AfterAttack; |
|
2280 TurnTimeLeft:= 0; |
|
2281 CurAmmoGear:= nil; |
|
2282 HHGear^.Message:= 0; |
|
2283 ParseCommand('/taunt '#1, true); |
|
2284 exit; |
|
2285 end; |
|
2286 |
|
2287 end; |
2281 end; |
2288 |
2282 |
2289 CheckCollision(Gear); |
2283 CheckCollision(Gear); |
2290 |
2284 |
2291 if ((Gear^.State and gstCollision) <> 0) |
2285 if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) |
2292 or CheckGearDrowning(Gear) then |
2286 or CheckGearDrowning(Gear) then |
2293 begin |
2287 begin |
2294 if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStopTime = 0) then TimeTrialStopTime:= RealTicks; |
2288 if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and (TimeTrialStopTime = 0) then TimeTrialStopTime:= RealTicks; |
2295 StopSound(sndRCPlane); |
2289 StopSound(sndRCPlane); |
2296 StopSound(sndRideOfTheValkyries); |
2290 StopSound(sndRideOfTheValkyries); |
2297 ResumeMusic; |
2291 ResumeMusic; |
2298 |
2292 |
2299 if ((Gear^.State and gstCollision) <> 0) then |
2293 if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and (TurnTimeLeft = 0)) then |
2300 begin |
2294 begin |
2301 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
2295 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
2302 for i:= 0 to 32 do |
2296 for i:= 0 to 32 do |
2303 begin |
2297 begin |
2304 dX:= AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
2298 dX:= AngleCos(i * 64) * _0_5 * (GetRandom + _1); |