hedgewars/uGears.pas
changeset 1295 27bec661581c
parent 1294 50198e5c7f02
child 1298 18fdc25fe65d
equal deleted inserted replaced
1294:50198e5c7f02 1295:27bec661581c
   286                 Result^.Timer:= 5000;
   286                 Result^.Timer:= 5000;
   287                 end;
   287                 end;
   288      gtCluster: Result^.Radius:= 2;
   288      gtCluster: Result^.Radius:= 2;
   289       gtShover: Result^.Radius:= 20;
   289       gtShover: Result^.Radius:= 20;
   290        gtFlame: begin
   290        gtFlame: begin
   291                 Result^.Angle:= Counter mod 64;
   291                 Result^.Tag:= Counter mod 64;
   292                 Result^.Radius:= 1;
   292                 Result^.Radius:= 1;
   293                 Result^.Health:= 2;
   293                 Result^.Health:= 2;
   294                 Result^.dY:= (getrandom - _0_8) * _0_03;
   294                 Result^.dY:= (getrandom - _0_8) * _0_03;
   295                 Result^.dX:= (getrandom - _0_5) * _0_4
   295                 Result^.dX:= (getrandom - _0_5) * _0_4
   296                 end;
   296                 end;
  1352 procedure AmmoFlameWork(Ammo: PGear);
  1352 procedure AmmoFlameWork(Ammo: PGear);
  1353 var t: PGear;
  1353 var t: PGear;
  1354 begin
  1354 begin
  1355 t:= GearsList;
  1355 t:= GearsList;
  1356 while t <> nil do
  1356 while t <> nil do
  1357       begin
  1357 	begin
  1358       if (t^.Kind = gtHedgehog) and (t^.Y < Ammo^.Y) then
  1358 	if (t^.Kind = gtHedgehog) and (t^.Y < Ammo^.Y) then
  1359          if not (hwSqr(Ammo^.X - t^.X) + hwSqr(Ammo^.Y - t^.Y - int2hwFloat(cHHRadius)) * 2 > _2) then
  1359 		if not (hwSqr(Ammo^.X - t^.X) + hwSqr(Ammo^.Y - t^.Y - int2hwFloat(cHHRadius)) * 2 > _2) then
  1360             begin
  1360 			begin
  1361             inc(t^.Damage, 5);
  1361 			inc(t^.Damage, 5);
  1362             t^.dX:= t^.dX + (t^.X - Ammo^.X) * _0_02;
  1362 			t^.dX:= t^.dX + (t^.X - Ammo^.X) * _0_02;
  1363             t^.dY:= - _0_25;
  1363 			t^.dY:= - _0_25;
  1364             t^.Active:= true;
  1364 			t^.Active:= true;
  1365             DeleteCI(t);
  1365 			DeleteCI(t);
  1366             FollowGear:= t
  1366 			FollowGear:= t
  1367             end;
  1367 			end;
  1368       t:= t^.NextGear
  1368 	t:= t^.NextGear
  1369       end;
  1369 	end;
  1370 end;
  1370 end;
  1371 
  1371 
  1372 function CheckGearsNear(mX, mY: LongInt; Kind: TGearsType; rX, rY: LongInt): PGear;
  1372 function CheckGearsNear(mX, mY: LongInt; Kind: TGearsType; rX, rY: LongInt): PGear;
  1373 var t: PGear;
  1373 var t: PGear;
  1374 begin
  1374 begin
  1404     i: TAmmoType;
  1404     i: TAmmoType;
  1405 begin
  1405 begin
  1406 if (cCaseFactor = 0) or
  1406 if (cCaseFactor = 0) or
  1407    (CountGears(gtCase) >= 5) or
  1407    (CountGears(gtCase) >= 5) or
  1408    (getrandom(cCaseFactor) <> 0) then exit;
  1408    (getrandom(cCaseFactor) <> 0) then exit;
       
  1409 
  1409 FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1410 FollowGear:= AddGear(0, 0, gtCase, 0, _0, _0, 0);
  1410 case getrandom(2) of
  1411 case getrandom(2) of
  1411      0: begin
  1412      0: begin
  1412         FollowGear^.Health:= 25;
  1413         FollowGear^.Health:= 25;
  1413         FollowGear^.Pos:= posCaseHealth
  1414         FollowGear^.Pos:= posCaseHealth