124 if Gear.X > cScreenWidth + 2048 then Gear.X:= -cScreenWidth - 256 |
124 if Gear.X > cScreenWidth + 2048 then Gear.X:= -cScreenWidth - 256 |
125 end; |
125 end; |
126 |
126 |
127 //////////////////////////////////////////////////////////////////////////////// |
127 //////////////////////////////////////////////////////////////////////////////// |
128 procedure doStepBomb(Gear: PGear); |
128 procedure doStepBomb(Gear: PGear); |
|
129 var i: integer; |
129 begin |
130 begin |
130 AllInactive:= false; |
131 AllInactive:= false; |
131 doStepFallingGear(Gear); |
132 doStepFallingGear(Gear); |
132 dec(Gear.Timer); |
133 dec(Gear.Timer); |
133 if Gear.Timer = 0 then |
134 if Gear.Timer = 0 then |
134 begin |
135 begin |
135 doMakeExplosion(round(Gear.X), round(Gear.Y), 50, EXPLAutoSound); |
136 case Gear.Kind of |
|
137 gtAmmo_Bomb: doMakeExplosion(round(Gear.X), round(Gear.Y), 50, EXPLAutoSound); |
|
138 gtClusterBomb: begin |
|
139 doMakeExplosion(round(Gear.X), round(Gear.Y), 30, EXPLAutoSound); |
|
140 for i:= 0 to 4 do |
|
141 AddGear(round(Gear.X), round(Gear.Y), gtCluster, 0, (getrandom - 0.5)*0.2, (getrandom - 2) * 0.2); |
|
142 end |
|
143 end; |
136 DeleteGear(Gear); |
144 DeleteGear(Gear); |
137 exit |
145 exit |
138 end; |
146 end; |
139 CalcRotationDirAngle(Gear); |
147 CalcRotationDirAngle(Gear); |
140 if (Gear.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then PlaySound(sndGrenadeImpact) |
148 if (Gear.State and (gstCollision or gstMoving)) = (gstCollision or gstMoving) then PlaySound(sndGrenadeImpact) |
|
149 end; |
|
150 |
|
151 procedure doStepCluster(Gear: PGear); |
|
152 begin |
|
153 AllInactive:= false; |
|
154 doStepFallingGear(Gear); |
|
155 if (Gear.State and gstCollision) <> 0 then |
|
156 begin |
|
157 doMakeExplosion(round(Gear.X), round(Gear.Y), 20, EXPLAutoSound); |
|
158 DeleteGear(Gear); |
|
159 exit |
|
160 end; |
|
161 if (GameTicks and $1F) = 0 then |
|
162 AddGear(round(Gear.X), round(Gear.Y), gtSmokeTrace, 0) |
141 end; |
163 end; |
142 |
164 |
143 //////////////////////////////////////////////////////////////////////////////// |
165 //////////////////////////////////////////////////////////////////////////////// |
144 procedure doStepGrenade(Gear: PGear); |
166 procedure doStepGrenade(Gear: PGear); |
145 begin |
167 begin |