equal
deleted
inserted
replaced
21 |
21 |
22 interface |
22 interface |
23 uses uFloat, uTypes, SDLh; |
23 uses uFloat, uTypes, SDLh; |
24 |
24 |
25 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; |
25 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; |
|
26 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer, newUid: LongWord): PGear; |
26 procedure DeleteGear(Gear: PGear); |
27 procedure DeleteGear(Gear: PGear); |
27 procedure InsertGearToList(Gear: PGear); |
28 procedure InsertGearToList(Gear: PGear); |
28 procedure RemoveGearFromList(Gear: PGear); |
29 procedure RemoveGearFromList(Gear: PGear); |
29 |
30 |
30 var curHandledGear: PGear; |
31 var curHandledGear: PGear; |
162 Gear^.PrevGear:= nil |
163 Gear^.PrevGear:= nil |
163 end; |
164 end; |
164 |
165 |
165 |
166 |
166 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; |
167 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear; |
|
168 begin |
|
169 AddGear:= AddGear(X, Y, Kind, State, dX, dY, Timer, 0); |
|
170 end; |
|
171 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer, newUid: LongWord): PGear; |
167 var gear: PGear; |
172 var gear: PGear; |
168 //c: byte; |
173 //c: byte; |
169 cakeData: PCakeData; |
174 cakeData: PCakeData; |
170 begin |
175 begin |
171 inc(GCounter); |
176 if newUid = 0 then |
|
177 inc(GCounter); |
172 |
178 |
173 AddFileLog('AddGear: #' + inttostr(GCounter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); |
179 AddFileLog('AddGear: #' + inttostr(GCounter) + ' (' + inttostr(x) + ',' + inttostr(y) + '), d(' + floattostr(dX) + ',' + floattostr(dY) + ') type = ' + EnumToStr(Kind)); |
174 |
180 |
175 |
181 |
176 New(gear); |
182 New(gear); |
184 gear^.dX:= dX; |
190 gear^.dX:= dX; |
185 gear^.dY:= dY; |
191 gear^.dY:= dY; |
186 gear^.doStep:= doStepHandlers[Kind]; |
192 gear^.doStep:= doStepHandlers[Kind]; |
187 gear^.CollisionIndex:= -1; |
193 gear^.CollisionIndex:= -1; |
188 gear^.Timer:= Timer; |
194 gear^.Timer:= Timer; |
189 gear^.uid:= GCounter; |
195 if newUid = 0 then |
|
196 gear^.uid:= GCounter |
|
197 else gear^.uid:= newUid; |
190 gear^.SoundChannel:= -1; |
198 gear^.SoundChannel:= -1; |
191 gear^.ImpactSound:= sndNone; |
199 gear^.ImpactSound:= sndNone; |
192 gear^.Density:= _1; |
200 gear^.Density:= _1; |
193 // Define ammo association, if any. |
201 // Define ammo association, if any. |
194 gear^.AmmoType:= GearKindAmmoTypeMap[Kind]; |
202 gear^.AmmoType:= GearKindAmmoTypeMap[Kind]; |
464 if gear^.Timer = 0 then gear^.Timer:= 3000; |
472 if gear^.Timer = 0 then gear^.Timer:= 3000; |
465 gear^.Radius:= 15; |
473 gear^.Radius:= 15; |
466 gear^.Tag:= Y |
474 gear^.Tag:= Y |
467 end; |
475 end; |
468 gtAirAttack: begin |
476 gtAirAttack: begin |
|
477 gear^.Health:= 6; |
|
478 gear^.Damage:= 30; |
469 gear^.Z:= cHHZ+2; |
479 gear^.Z:= cHHZ+2; |
470 gear^.Tint:= gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF |
480 gear^.Tint:= gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF |
471 end; |
481 end; |
472 gtAirBomb: begin |
482 gtAirBomb: begin |
473 gear^.AdvBounce:= 1; |
483 gear^.AdvBounce:= 1; |