1970 PlaySound(sndWarp); |
1970 PlaySound(sndWarp); |
1971 |
1971 |
1972 if (Gear^.Tag = 0) and (Gear^.Timer < 1000) then |
1972 if (Gear^.Tag = 0) and (Gear^.Timer < 1000) then |
1973 inc(Gear^.Timer) |
1973 inc(Gear^.Timer) |
1974 else if Gear^.Tag = 1 then |
1974 else if Gear^.Tag = 1 then |
1975 begin |
1975 Gear^.Tag := 2 |
1976 Gear^.Tag := 2; |
|
1977 if (TrainingFlags and tfTimeTrial) <> 0 then |
|
1978 begin |
|
1979 inc(TurnTimeLeft, TrainingTimeInc); |
|
1980 |
|
1981 if TrainingTimeInc > TrainingTimeInM then |
|
1982 dec(TrainingTimeInc, TrainingTimeInD); |
|
1983 if TurnTimeLeft > TrainingTimeMax then |
|
1984 TurnTimeLeft := TrainingTimeMax; |
|
1985 end; |
|
1986 end |
|
1987 else if Gear^.Tag = 2 then |
1976 else if Gear^.Tag = 2 then |
1988 if Gear^.Timer > 0 then |
1977 if Gear^.Timer > 0 then |
1989 dec(Gear^.Timer) |
1978 dec(Gear^.Timer) |
1990 else |
1979 else |
1991 begin |
1980 begin |
1992 if (TrainingFlags and tfTargetRespawn) <> 0 then |
|
1993 begin |
|
1994 TrainingTargetGear := AddGear(0, 0, gtTarget, 0, _0, _0, 0); |
|
1995 FindPlace(TrainingTargetGear, false, 0, LAND_WIDTH); |
|
1996 end; |
|
1997 DeleteGear(Gear); |
1981 DeleteGear(Gear); |
1998 exit; |
1982 exit; |
1999 end; |
1983 end; |
2000 |
1984 |
2001 doStepCase(Gear) |
1985 doStepCase(Gear) |
3152 end; |
3131 end; |
3153 |
3132 |
3154 Gear^.X := Gear^.X + Gear^.dX; |
3133 Gear^.X := Gear^.X + Gear^.dX; |
3155 Gear^.Y := Gear^.Y + Gear^.dY; |
3134 Gear^.Y := Gear^.Y + Gear^.dY; |
3156 |
3135 |
3157 if (TrainingFlags and tfRCPlane) = 0 then |
3136 if (GameTicks and $FF) = 0 then |
3158 begin |
3137 if Gear^.Timer < 3500 then |
3159 if (GameTicks and $FF) = 0 then |
3138 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEvilTrace) |
3160 if Gear^.Timer < 3500 then |
|
3161 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtEvilTrace) |
|
3162 else |
|
3163 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
|
3164 |
|
3165 if ((HHGear^.Message and gmAttack) <> 0) and (Gear^.Health <> 0) then |
|
3166 begin |
|
3167 HHGear^.Message := HHGear^.Message and not gmAttack; |
|
3168 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * |
|
3169 _0_5, 0); |
|
3170 dec(Gear^.Health) |
|
3171 end; |
|
3172 |
|
3173 if ((HHGear^.Message and gmLJump) <> 0) |
|
3174 and ((Gear^.State and gsttmpFlag) = 0) then |
|
3175 begin |
|
3176 Gear^.State := Gear^.State or gsttmpFlag; |
|
3177 PauseMusic; |
|
3178 playSound(sndRideOfTheValkyries); |
|
3179 end; |
|
3180 |
|
3181 // pickup bonuses |
|
3182 t := CheckGearNear(Gear, gtCase, 36, 36); |
|
3183 if t <> nil then |
|
3184 PickUp(HHGear, t); |
|
3185 end |
|
3186 else |
3139 else |
3187 begin |
3140 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
3188 if (GameTicks and $FF) = 0 then |
3141 |
3189 AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace); |
3142 if ((HHGear^.Message and gmAttack) <> 0) and (Gear^.Health <> 0) then |
3190 |
3143 begin |
3191 // pickup targets |
3144 HHGear^.Message := HHGear^.Message and not gmAttack; |
3192 t := CheckGearNear(Gear, gtTarget, 36, 36); |
3145 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, Gear^.dX * _0_5, Gear^.dY * |
3193 if t <> nil then |
3146 _0_5, 0); |
3194 begin |
3147 dec(Gear^.Health) |
3195 if t^.Tag <> 0 then // collect it only once |
3148 end; |
3196 exit; |
3149 |
3197 PlaySound(sndShotgunReload); |
3150 if ((HHGear^.Message and gmLJump) <> 0) |
3198 t^.Tag := 1; |
3151 and ((Gear^.State and gsttmpFlag) = 0) then |
3199 TrainingTargetGear := nil; |
3152 begin |
3200 // remove target cursor |
3153 Gear^.State := Gear^.State or gsttmpFlag; |
3201 exit; |
3154 PauseMusic; |
3202 end; |
3155 playSound(sndRideOfTheValkyries); |
3203 |
3156 end; |
3204 if (TurnTimeLeft > 0) then |
3157 |
3205 dec(TurnTimeLeft) |
3158 // pickup bonuses |
3206 end; |
3159 t := CheckGearNear(Gear, gtCase, 36, 36); |
|
3160 if t <> nil then |
|
3161 PickUp(HHGear, t); |
3207 |
3162 |
3208 CheckCollision(Gear); |
3163 CheckCollision(Gear); |
3209 |
3164 |
3210 if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and ( |
3165 if ((Gear^.State and gstCollision) <> 0) or CheckGearDrowning(Gear) then |
3211 TurnTimeLeft = 0)) |
3166 begin |
3212 or CheckGearDrowning(Gear) then |
|
3213 begin |
|
3214 if ((TrainingFlags and tfRCPlane) <> 0) and ((TrainingFlags and tfTimeTrial) <> 0 ) and ( |
|
3215 TimeTrialStopTime = 0) then TimeTrialStopTime := RealTicks; |
|
3216 StopSound(Gear^.SoundChannel); |
3167 StopSound(Gear^.SoundChannel); |
3217 StopSound(sndRideOfTheValkyries); |
3168 StopSound(sndRideOfTheValkyries); |
3218 ResumeMusic; |
3169 ResumeMusic; |
3219 |
3170 |
3220 if ((Gear^.State and gstCollision) <> 0) or (((TrainingFlags and tfRCPlane) <> 0) and ( |
3171 if ((Gear^.State and gstCollision) <> 0) then |
3221 TurnTimeLeft = 0)) then |
|
3222 begin |
3172 begin |
3223 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
3173 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, EXPLAutoSound); |
3224 for i:= 0 to 32 do |
3174 for i:= 0 to 32 do |
3225 begin |
3175 begin |
3226 dX := AngleCos(i * 64) * _0_5 * (GetRandom + _1); |
3176 dX := AngleCos(i * 64) * _0_5 * (GetRandom + _1); |