equal
deleted
inserted
replaced
1605 end; |
1605 end; |
1606 end; |
1606 end; |
1607 |
1607 |
1608 procedure doStepDEagleShot(Gear: PGear); |
1608 procedure doStepDEagleShot(Gear: PGear); |
1609 begin |
1609 begin |
1610 Gear^.Data:= nil; |
1610 |
1611 // remember who fired this |
1611 if Gear^.Data = nil then |
1612 if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then |
1612 // remember who fired this |
1613 Gear^.Data:= Pointer(Gear^.Hedgehog^.Gear); |
1613 if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then |
|
1614 Gear^.Data:= Pointer(Gear^.Hedgehog^.Gear); |
1614 |
1615 |
1615 PlaySound(sndGun); |
1616 PlaySound(sndGun); |
1616 ClearHitOrder(); |
1617 ClearHitOrder(); |
1617 // add 2 initial steps to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths, and also just plain old weird angles |
1618 // add 2 initial steps to avoid problem with ammoshove related to calculation of radius + 1 radius as gear widths, and also just plain old weird angles |
1618 Gear^.X := Gear^.X + Gear^.dX * 2; |
1619 Gear^.X := Gear^.X + Gear^.dX * 2; |
7170 Gear^.FlightTime := 0; |
7171 Gear^.FlightTime := 0; |
7171 Gear^.doStep := @doStepBulletWork |
7172 Gear^.doStep := @doStepBulletWork |
7172 end; |
7173 end; |
7173 |
7174 |
7174 //////////////////////////////////////////////////////////////////////////////// |
7175 //////////////////////////////////////////////////////////////////////////////// |
|
7176 |
7175 procedure doStepSentry(Gear: PGear); |
7177 procedure doStepSentry(Gear: PGear); |
7176 begin |
7178 var HHGear, bullet: PGear; |
|
7179 distX, distY, invDistance: HwFloat; |
|
7180 begin |
|
7181 HHGear:= nil; |
|
7182 |
7177 if CheckGearDrowning(Gear) then |
7183 if CheckGearDrowning(Gear) then |
7178 exit; |
7184 exit; |
7179 |
7185 |
7180 if (TestCollisionYKick(Gear, 1) = 0) then |
7186 if (TestCollisionYKick(Gear, 1) = 0) then |
7181 begin |
7187 begin |
7210 begin |
7216 begin |
7211 MakeHedgehogsStep(Gear); |
7217 MakeHedgehogsStep(Gear); |
7212 if TestCollisionX(Gear, 1) <> 0 then |
7218 if TestCollisionX(Gear, 1) <> 0 then |
7213 Gear^.Timer := 0 |
7219 Gear^.Timer := 0 |
7214 end; |
7220 end; |
|
7221 |
|
7222 if ((GameTicks and $FF) = 0) |
|
7223 and (CurrentHedgehog <> nil) |
|
7224 and (CurrentHedgehog^.Gear <> nil) |
|
7225 and ((CurrentHedgehog^.Gear^.State and (gstMoving or gstHHDriven)) = (gstMoving or gstHHDriven)) then |
|
7226 begin |
|
7227 HHGear := CurrentHedgehog^.Gear; |
|
7228 distX := HHGear^.X - Gear^.X; |
|
7229 distY := HHGear^.Y - Gear^.Y; |
|
7230 if (distX.isNegative = Gear^.dX.isNegative) |
|
7231 and (distX.Round > 32) |
|
7232 and (distX.Round < 1000) |
|
7233 and (hwAbs(distY) < hwAbs(distX)) then |
|
7234 begin |
|
7235 invDistance := _1 / Distance(distX, distY); |
|
7236 |
|
7237 distX := distX * invDistance; |
|
7238 distY := distY * invDistance; |
|
7239 |
|
7240 bullet := AddGear( |
|
7241 hwRound(Gear^.X), hwRound(Gear^.Y), |
|
7242 gtDEagleShot, 0, |
|
7243 distX, |
|
7244 distY, |
|
7245 0); |
|
7246 |
|
7247 bullet^.PortalCounter := 1; |
|
7248 bullet^.Elasticity := Gear^.X; |
|
7249 bullet^.Friction := Gear^.Y; |
|
7250 bullet^.Data := Pointer(Gear); |
|
7251 inc(Gear^.WDTimer); |
|
7252 |
|
7253 CreateShellForGear(Gear, Gear^.WDTimer and 1); |
|
7254 end |
|
7255 end |
7215 end; |
7256 end; |
7216 |
7257 |
7217 end. |
7258 end. |