123 procedure doStepBomb(Gear: PGear); |
123 procedure doStepBomb(Gear: PGear); |
124 var i: LongInt; |
124 var i: LongInt; |
125 dX, dY: hwFloat; |
125 dX, dY: hwFloat; |
126 begin |
126 begin |
127 AllInactive:= false; |
127 AllInactive:= false; |
|
128 |
128 doStepFallingGear(Gear); |
129 doStepFallingGear(Gear); |
|
130 |
129 dec(Gear^.Timer); |
131 dec(Gear^.Timer); |
130 if Gear^.Timer = 0 then |
132 if Gear^.Timer = 0 then |
131 begin |
133 begin |
132 case Gear^.Kind of |
134 case Gear^.Kind of |
133 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
135 gtAmmo_Bomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound); |
146 begin |
148 begin |
147 dX:= rndSign(GetRandom * _0_1); |
149 dX:= rndSign(GetRandom * _0_1); |
148 dY:= (GetRandom - _2) * _0_2; |
150 dY:= (GetRandom - _2) * _0_2; |
149 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMelonPiece, 0, dX, dY, 75)^.DirAngle:= i * 60; |
151 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMelonPiece, 0, dX, dY, 75)^.DirAngle:= i * 60; |
150 end |
152 end |
151 end |
153 end; |
|
154 gtHellishBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 90, EXPLAutoSound); |
152 end; |
155 end; |
153 DeleteGear(Gear); |
156 DeleteGear(Gear); |
154 exit |
157 exit |
155 end; |
158 end; |
|
159 |
156 CalcRotationDirAngle(Gear); |
160 CalcRotationDirAngle(Gear); |
|
161 |
|
162 if Gear^.Kind = gtHellishBomb then |
|
163 if (GameTicks and $3F) = 0 then |
|
164 if (Gear^.State and gstCollision) = 0 then |
|
165 AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtEvilTrace, 0, _0, _0, 0); |
|
166 |
157 if (Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then |
167 if (Gear^.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then |
158 if (hwAbs(Gear^.dX) > _0_1) or |
168 if (hwAbs(Gear^.dX) > _0_1) or |
159 (hwAbs(Gear^.dY) > _0_1) then |
169 (hwAbs(Gear^.dY) > _0_1) then |
160 PlaySound(sndGrenadeImpact, false) |
170 PlaySound(sndGrenadeImpact, false) |
161 end; |
171 end; |