equal
deleted
inserted
replaced
63 |
63 |
64 var skipFlag: boolean; |
64 var skipFlag: boolean; |
65 |
65 |
66 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); forward; |
66 procedure AmmoShove(Ammo: PGear; Damage, Power: LongInt); forward; |
67 //procedure AmmoFlameWork(Ammo: PGear); forward; |
67 //procedure AmmoFlameWork(Ammo: PGear); forward; |
68 function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): TPGearArray; forward; |
68 function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): PGearArrayS; forward; |
69 procedure SpawnBoxOfSmth; forward; |
69 procedure SpawnBoxOfSmth; forward; |
70 procedure ShotgunShot(Gear: PGear); forward; |
70 procedure ShotgunShot(Gear: PGear); forward; |
71 procedure doStepCase(Gear: PGear); forward; |
71 procedure doStepCase(Gear: PGear); forward; |
72 |
72 |
73 |
73 |
869 dec(Count) |
869 dec(Count) |
870 end |
870 end |
871 end |
871 end |
872 end; |
872 end; |
873 |
873 |
874 function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): TPGearArray; |
874 var GearsNearArray : TPGearArray; |
|
875 function GearsNear(X, Y: hwFloat; Kind: TGearType; r: LongInt): PGearArrayS; |
875 var |
876 var |
876 t: PGear; |
877 t: PGear; |
877 l: Longword; |
878 s: Longword; |
878 begin |
879 begin |
879 r:= r*r; |
880 r:= r*r; |
880 GearsNear := nil; |
881 s:= 0; |
|
882 SetLength(GearsNearArray, s); |
881 t := GearsList; |
883 t := GearsList; |
882 while t <> nil do |
884 while t <> nil do |
883 begin |
885 begin |
884 if (t^.Kind = Kind) |
886 if (t^.Kind = Kind) |
885 and ((X - t^.X)*(X - t^.X) + (Y - t^.Y)*(Y-t^.Y) < int2hwFloat(r)) then |
887 and ((X - t^.X)*(X - t^.X) + (Y - t^.Y)*(Y-t^.Y) < int2hwFloat(r)) then |
886 begin |
888 begin |
887 l:= Length(GearsNear); |
889 inc(s); |
888 SetLength(GearsNear, l + 1); |
890 SetLength(GearsNearArray, s); |
889 GearsNear[l] := t; |
891 GearsNearArray[s - 1] := t; |
890 end; |
892 end; |
891 t := t^.NextGear; |
893 t := t^.NextGear; |
892 end; |
894 end; |
|
895 |
|
896 GearsNear.size:= s; |
|
897 GearsNear.ar:= @GearsNearArray |
893 end; |
898 end; |
894 |
899 |
895 {procedure AmmoFlameWork(Ammo: PGear); |
900 {procedure AmmoFlameWork(Ammo: PGear); |
896 var t: PGear; |
901 var t: PGear; |
897 begin |
902 begin |