hedgewars/uGears.pas
changeset 295 8834f3cb620e
parent 294 92a7ccd67bb9
child 300 be94799f33d2
equal deleted inserted replaced
294:92a7ccd67bb9 295:8834f3cb620e
    65 var CurAmmoGear: PGear = nil;
    65 var CurAmmoGear: PGear = nil;
    66     GearsList: PGear = nil;
    66     GearsList: PGear = nil;
    67 
    67 
    68 implementation
    68 implementation
    69 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions,
    69 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions,
    70      uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI;
    70      uLand, uIO, uLandGraphics, uAIMisc, uLocale, uAI, uAmmos;
    71 var RopePoints: record
    71 var RopePoints: record
    72                 Count: Longword;
    72                 Count: Longword;
    73                 HookAngle: integer;
    73                 HookAngle: integer;
    74                 ar: array[0..300] of record
    74                 ar: array[0..300] of record
    75                                   X, Y: Double;
    75                                   X, Y: Double;
   777       end;
   777       end;
   778 end;
   778 end;
   779 
   779 
   780 procedure SpawnBoxOfSmth;
   780 procedure SpawnBoxOfSmth;
   781 begin
   781 begin
   782 if (CountGears(gtCase) > 2) or (getrandom(3) <> 0) then exit;
   782 if (CountGears(gtCase) >= 5) or (getrandom(cCaseFactor) <> 0) then exit;
   783 FollowGear:= AddGear(0, 0, gtCase, 0);
   783 FollowGear:= AddGear(0, 0, gtCase, 0);
   784 FollowGear.Health:= 25;
   784 case getrandom(2) of
   785 FollowGear.Pos:= posCaseHealth;
   785      0: begin
       
   786         FollowGear.Health:= 25;
       
   787         FollowGear.Pos:= posCaseHealth
       
   788         end;
       
   789      1: begin
       
   790         FollowGear.Pos:= posCaseAmmo;
       
   791         FollowGear.State:= Longword(amMineStrike)
       
   792         end;
       
   793      end;
   786 FindPlace(FollowGear, true, 0, 2048)
   794 FindPlace(FollowGear, true, 0, 2048)
   787 end;
   795 end;
   788 
   796 
   789 procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: integer);
   797 procedure FindPlace(Gear: PGear; withFall: boolean; Left, Right: integer);
   790 
   798