87 end; |
87 end; |
88 end; |
88 end; |
89 |
89 |
90 procedure DeleteGear(Gear: PGear); forward; |
90 procedure DeleteGear(Gear: PGear); forward; |
91 procedure doMakeExplosion(X, Y, Radius: integer; Mask: LongWord); forward; |
91 procedure doMakeExplosion(X, Y, Radius: integer; Mask: LongWord); forward; |
92 procedure AmmoShove(Ammo, Gear: PGear; Power: Longword); forward; |
92 procedure AmmoShove(Ammo: PGear; Power: integer); forward; |
93 function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: integer): PGear; forward; |
93 function CheckGearNear(Gear: PGear; Kind: TGearType; rX, rY: integer): PGear; forward; |
94 procedure SpawnBoxOfSmth; forward; |
94 procedure SpawnBoxOfSmth; forward; |
95 procedure AfterAttack; forward; |
95 procedure AfterAttack; forward; |
96 |
96 |
97 {$INCLUDE GSHandlers.inc} |
97 {$INCLUDE GSHandlers.inc} |
135 Result.CollIndex:= High(Longword); |
135 Result.CollIndex:= High(Longword); |
136 if CurrentTeam <> nil then |
136 if CurrentTeam <> nil then |
137 Result.Hedgehog:= @CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog]; |
137 Result.Hedgehog:= @CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog]; |
138 case Kind of |
138 case Kind of |
139 gtAmmo_Bomb: begin |
139 gtAmmo_Bomb: begin |
140 Result.HalfWidth:= 4; |
140 Result.Radius:= 4; |
141 Result.HalfHeight:= 4; |
|
142 Result.Elasticity:= 0.6; |
141 Result.Elasticity:= 0.6; |
143 Result.Friction:= 0.995; |
142 Result.Friction:= 0.995; |
144 Result.Timer:= Timer |
143 Result.Timer:= Timer |
145 end; |
144 end; |
146 gtHedgehog: begin |
145 gtHedgehog: begin |
147 Result.HalfWidth:= 6; |
146 Result.Radius:= cHHRadius; |
148 Result.HalfHeight:= cHHHalfHeight; |
|
149 Result.Elasticity:= 0.002; |
147 Result.Elasticity:= 0.002; |
150 Result.Friction:= 0.999; |
148 Result.Friction:= 0.999; |
151 end; |
149 end; |
152 gtAmmo_Grenade: begin |
150 gtAmmo_Grenade: begin |
153 Result.HalfWidth:= 4; |
151 Result.Radius:= 4; |
154 Result.HalfHeight:= 4; |
|
155 end; |
152 end; |
156 gtHealthTag: begin |
153 gtHealthTag: begin |
157 Result.Timer:= 1500; |
154 Result.Timer:= 1500; |
158 end; |
155 end; |
159 gtGrave: begin |
156 gtGrave: begin |
160 Result.HalfWidth:= 10; |
157 Result.Radius:= 10; |
161 Result.HalfHeight:= 10; |
|
162 Result.Elasticity:= 0.6; |
158 Result.Elasticity:= 0.6; |
163 end; |
159 end; |
164 gtUFO: begin |
160 gtUFO: begin |
165 Result.HalfWidth:= 5; |
161 Result.Radius:= 5; |
166 Result.HalfHeight:= 2; |
|
167 Result.Timer:= 500; |
162 Result.Timer:= 500; |
168 Result.Elasticity:= 0.9 |
163 Result.Elasticity:= 0.9 |
169 end; |
164 end; |
170 gtShotgunShot: begin |
165 gtShotgunShot: begin |
171 Result.Timer:= 900; |
166 Result.Timer:= 900; |
172 Result.HalfWidth:= 2; |
167 Result.Radius:= 2 |
173 Result.HalfHeight:= 2 |
|
174 end; |
168 end; |
175 gtActionTimer: begin |
169 gtActionTimer: begin |
176 Result.Timer:= Timer |
170 Result.Timer:= Timer |
177 end; |
171 end; |
178 gtPickHammer: begin |
172 gtPickHammer: begin |
179 Result.HalfWidth:= 10; |
173 Result.Radius:= 10; |
180 Result.HalfHeight:= 2; |
|
181 Result.Timer:= 4000 |
174 Result.Timer:= 4000 |
182 end; |
175 end; |
183 gtSmokeTrace: begin |
176 gtSmokeTrace: begin |
184 Result.X:= Result.X - 16; |
177 Result.X:= Result.X - 16; |
185 Result.Y:= Result.Y - 16; |
178 Result.Y:= Result.Y - 16; |
186 Result.State:= 8 |
179 Result.State:= 8 |
187 end; |
180 end; |
188 gtRope: begin |
181 gtRope: begin |
189 Result.HalfWidth:= 3; |
182 Result.Radius:= 3; |
190 Result.HalfHeight:= 3; |
|
191 Result.Friction:= 500; |
183 Result.Friction:= 500; |
192 RopePoints.Count:= 0; |
184 RopePoints.Count:= 0; |
193 end; |
185 end; |
194 gtExplosion: begin |
186 gtExplosion: begin |
195 Result.X:= Result.X - 25; |
187 Result.X:= Result.X - 25; |
196 Result.Y:= Result.Y - 25; |
188 Result.Y:= Result.Y - 25; |
197 end; |
189 end; |
198 gtMine: begin |
190 gtMine: begin |
199 Result.HalfWidth:= 3; |
191 Result.Radius:= 3; |
200 Result.HalfHeight:= 3; |
|
201 Result.Elasticity:= 0.55; |
192 Result.Elasticity:= 0.55; |
202 Result.Friction:= 0.995; |
193 Result.Friction:= 0.995; |
203 Result.Timer:= 3000; |
194 Result.Timer:= 3000; |
204 end; |
195 end; |
205 gtCase: begin |
196 gtCase: begin |
206 Result.HalfWidth:= 14; |
197 Result.Radius:= 14; |
207 Result.HalfHeight:= 14; |
|
208 Result.Elasticity:= 0.6 |
198 Result.Elasticity:= 0.6 |
209 end; |
199 end; |
210 gtDEagleShot: begin |
200 gtDEagleShot: begin |
211 Result.HalfWidth:= 1; |
201 Result.Radius:= 1; |
212 Result.HalfHeight:= 1; |
202 Result.Radius:= 1; |
213 Result.Health:= 50 |
203 Result.Health:= 50 |
214 end; |
204 end; |
215 gtDynamite: begin |
205 gtDynamite: begin |
216 Result.HalfWidth:= 3; |
206 Result.Radius:= 3; |
217 Result.HalfHeight:= 3; |
|
218 Result.Elasticity:= 0.03; |
207 Result.Elasticity:= 0.03; |
219 Result.Friction:= 0.03; |
208 Result.Friction:= 0.03; |
220 Result.Timer:= 5000; |
209 Result.Timer:= 5000; |
221 end; |
210 end; |
222 end; |
211 end; |
229 end; |
218 end; |
230 |
219 |
231 procedure DeleteGear(Gear: PGear); |
220 procedure DeleteGear(Gear: PGear); |
232 var team: PTeam; |
221 var team: PTeam; |
233 begin |
222 begin |
234 if Gear.CollIndex < High(Longword) then DeleteCR(Gear); |
223 if Gear.CollIndex < High(Longword) then DeleteCI(Gear); |
235 if Gear.Kind = gtHedgehog then |
224 if Gear.Kind = gtHedgehog then |
236 if CurAmmoGear <> nil then |
225 if CurAmmoGear <> nil then |
237 begin |
226 begin |
238 {$IFDEF DEBUGFILE}AddFileLog('DeleteGear: Sending gm_Destroy, hh handle = '+inttostr(integer(Gear)));{$ENDIF} |
227 {$IFDEF DEBUGFILE}AddFileLog('DeleteGear: Sending gm_Destroy, hh handle = '+inttostr(integer(Gear)));{$ENDIF} |
239 Gear.Message:= gm_Destroy; |
228 Gear.Message:= gm_Destroy; |