hedgewars/uGears.pas
changeset 74 42257fee61ae
parent 70 82d93eeecebe
child 75 d2b737858ff7
equal deleted inserted replaced
73:fe1c62875a19 74:42257fee61ae
    74 
    74 
    75 var CurAmmoGear: PGear = nil;
    75 var CurAmmoGear: PGear = nil;
    76     GearsList: PGear = nil;
    76     GearsList: PGear = nil;
    77 
    77 
    78 implementation
    78 implementation
    79 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uLand, uIO, uLandGraphics;
    79 uses uWorld, uMisc, uStore, uConsole, uSound, uTeams, uRandom, uCollisions, uLand, uIO, uLandGraphics, uAIMisc;
    80 var RopePoints: record
    80 var RopePoints: record
    81                 Count: Longword;
    81                 Count: Longword;
    82                 HookAngle: integer;
    82                 HookAngle: integer;
    83                 ar: array[0..300] of record
    83                 ar: array[0..300] of record
    84                                   X, Y: real;
    84                                   X, Y: real;
   314         stSpawn: begin
   314         stSpawn: begin
   315                  if not isInMultiShoot then SpawnBoxOfSmth;
   315                  if not isInMultiShoot then SpawnBoxOfSmth;
   316                  inc(step)
   316                  inc(step)
   317                  end;
   317                  end;
   318         stNTurn: begin
   318         stNTurn: begin
       
   319                  AwareOfExplosion(0, 0, 0);
   319                  if isInMultiShoot then isInMultiShoot:= false
   320                  if isInMultiShoot then isInMultiShoot:= false
   320                                    else ParseCommand('/nextturn');
   321                                    else ParseCommand('/nextturn');
   321                  step:= Low(step)
   322                  step:= Low(step)
   322                  end;
   323                  end;
   323         end;
   324         end;
   325 if TurnTimeLeft > 0 then
   326 if TurnTimeLeft > 0 then
   326    if CurrentTeam <> nil then
   327    if CurrentTeam <> nil then
   327       if CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].Gear <> nil then
   328       if CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].Gear <> nil then
   328          if ((CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].Gear.State and gstAttacking) = 0)
   329          if ((CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog].Gear.State and gstAttacking) = 0)
   329             and not isInMultiShoot then dec(TurnTimeLeft);
   330             and not isInMultiShoot then dec(TurnTimeLeft);
       
   331             
   330 inc(GameTicks);
   332 inc(GameTicks);
   331 {$IFDEF COUNTTICKS}
   333 {$IFDEF COUNTTICKS}
   332 asm
   334 asm
   333         push    eax
   335         push    eax
   334         push    edx
   336         push    edx
   516 end;
   518 end;
   517 
   519 
   518 procedure AddMiscGears;
   520 procedure AddMiscGears;
   519 var i: integer;
   521 var i: integer;
   520 begin
   522 begin
   521 for i:= 0 to cCloudsNumber do AddGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div cCloudsNumber), -128, gtCloud, random(4), (0.5-random)*0.01);
   523 for i:= 0 to cCloudsNumber do
       
   524     AddGear( - cScreenWidth + i * ((cScreenWidth * 2 + 2304) div cCloudsNumber), -140, gtCloud, random(4),
       
   525              (0.5-random)*0.02, ((i mod 2) * 2 - 1) * (0.005 + 0.015*random));
   522 AddGear(0, 0, gtActionTimer, gtsStartGame, 0, 0, 2000).Health:= 3;
   526 AddGear(0, 0, gtActionTimer, gtsStartGame, 0, 0, 2000).Health:= 3;
   523 if (GameFlags and gfForts) = 0 then
   527 if (GameFlags and gfForts) = 0 then
   524    for i:= 0 to 3 do
   528    for i:= 0 to 3 do
   525        FindPlace(AddGear(0, 0, gtMine, 0), false, 0, 2048);
   529        FindPlace(AddGear(0, 0, gtMine, 0), false, 0, 2048);
   526 end;
   530 end;