hedgewars/GSHandlers.inc
changeset 1753 2ccba26f1aa4
parent 1752 769986d39202
child 1760 55a1edd97911
equal deleted inserted replaced
1752:769986d39202 1753:2ccba26f1aa4
   388 	Gear^.doStep:= @doStepShotIdle;
   388 	Gear^.doStep:= @doStepShotIdle;
   389 	exit
   389 	exit
   390 	end;
   390 	end;
   391 dec(i)
   391 dec(i)
   392 until i = 0;
   392 until i = 0;
   393 if (Gear^.X < _0) or (Gear^.Y < _0) or (Gear^.X > _2048) or (Gear^.Y > _1024) then
   393 if (Gear^.X < _0) or (Gear^.Y < _0) or (Gear^.X > _4096) or (Gear^.Y > _2048) then // LAND_WIDTH / LAND_HEIGHT 
   394 	Gear^.doStep:= @doStepShotIdle
   394 	Gear^.doStep:= @doStepShotIdle
   395 end;
   395 end;
   396 
   396 
   397 ////////////////////////////////////////////////////////////////////////////////
   397 ////////////////////////////////////////////////////////////////////////////////
   398 procedure doStepDEagleShotWork(Gear: PGear);
   398 procedure doStepDEagleShotWork(Gear: PGear);
   407 repeat
   407 repeat
   408   Gear^.X:= Gear^.X + Gear^.dX;
   408   Gear^.X:= Gear^.X + Gear^.dX;
   409   Gear^.Y:= Gear^.Y + Gear^.dY;
   409   Gear^.Y:= Gear^.Y + Gear^.dY;
   410   x:= hwRound(Gear^.X);
   410   x:= hwRound(Gear^.X);
   411   y:= hwRound(Gear^.Y);
   411   y:= hwRound(Gear^.Y);
   412   if ((y and $FFFFFC00) = 0) and ((x and $FFFFF800) = 0)
   412   if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0)
   413      and (Land[y, x] <> 0) then inc(Gear^.Damage);
   413      and (Land[y, x] <> 0) then inc(Gear^.Damage);
   414   if Gear^.Damage > 5 then AmmoShove(Gear, 7, 20);
   414   if Gear^.Damage > 5 then AmmoShove(Gear, 7, 20);
   415   dec(i)
   415   dec(i)
   416 until (i = 0) or (Gear^.Damage > Gear^.Health);
   416 until (i = 0) or (Gear^.Damage > Gear^.Health);
   417 if Gear^.Damage > 0 then
   417 if Gear^.Damage > 0 then
   418    begin
   418    begin
   419    DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 82 - i, 1);
   419    DrawTunnel(oX, oY, Gear^.dX, Gear^.dY, 82 - i, 1);
   420    dec(Gear^.Health, Gear^.Damage);
   420    dec(Gear^.Health, Gear^.Damage);
   421    Gear^.Damage:= 0
   421    Gear^.Damage:= 0
   422    end;
   422    end;
   423 if (Gear^.Health <= 0) or (Gear^.X < _0) or (Gear^.Y < _0) or (Gear^.X > _2048) or (Gear^.Y > _1024) then
   423 if (Gear^.Health <= 0) or (Gear^.X < _0) or (Gear^.Y < _0) or (Gear^.X > _4096) or (Gear^.Y > _2048) then // LAND_WIDTH / LAND_HEIGHT
   424 	Gear^.doStep:= @doStepShotIdle
   424 	Gear^.doStep:= @doStepShotIdle
   425 end;
   425 end;
   426 
   426 
   427 procedure doStepDEagleShot(Gear: PGear);
   427 procedure doStepDEagleShot(Gear: PGear);
   428 begin
   428 begin
   710 	len:= Gear^.Elasticity - _0_3x70;
   710 	len:= Gear^.Elasticity - _0_3x70;
   711 	while len > _0_3 do
   711 	while len > _0_3 do
   712 			begin
   712 			begin
   713 			lx:= hwRound(Gear^.X + mdX * len);
   713 			lx:= hwRound(Gear^.X + mdX * len);
   714 			ly:= hwRound(Gear^.Y + mdY * len);
   714 			ly:= hwRound(Gear^.Y + mdY * len);
   715 			if ((ly and $FFFFFC00) = 0) and ((lx and $FFFFF800) = 0) and (Land[ly, lx] <> 0) then
   715 			if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and (Land[ly, lx] <> 0) then
   716 				begin
   716 				begin
   717 				with RopePoints.ar[RopePoints.Count] do
   717 				with RopePoints.ar[RopePoints.Count] do
   718 					begin
   718 					begin
   719 					X:= Gear^.X;
   719 					X:= Gear^.X;
   720 					Y:= Gear^.Y;
   720 					Y:= Gear^.Y;
  1299 	end;
  1299 	end;
  1300 
  1300 
  1301 if (GameTicks and $3F) = 0 then
  1301 if (GameTicks and $3F) = 0 then
  1302 	AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0);
  1302 	AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtSmokeTrace, 0, _0, _0, 0);
  1303 
  1303 
  1304 if (hwRound(Gear^.X) > 3072) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear)
  1304 if (hwRound(Gear^.X) > (LAND_WIDTH+1024)) or (hwRound(Gear^.X) < -1024) then DeleteGear(Gear)
  1305 end;
  1305 end;
  1306 
  1306 
  1307 procedure doStepAirAttack(Gear: PGear);
  1307 procedure doStepAirAttack(Gear: PGear);
  1308 begin
  1308 begin
  1309 AllInactive:= false;
  1309 AllInactive:= false;
  1775 Gear^.X:= Gear^.X + Gear^.dX;
  1775 Gear^.X:= Gear^.X + Gear^.dX;
  1776 Gear^.Y:= Gear^.Y + Gear^.dY;
  1776 Gear^.Y:= Gear^.Y + Gear^.dY;
  1777 x:= hwRound(Gear^.X);
  1777 x:= hwRound(Gear^.X);
  1778 y:= hwRound(Gear^.Y);
  1778 y:= hwRound(Gear^.Y);
  1779 
  1779 
  1780 if ((y and $FFFFFC00) = 0) and ((x and $FFFFF800) = 0) then
  1780 if ((y and LAND_HEIGHT_MASK) = 0) and ((x and LAND_WIDTH_MASK) = 0) then
  1781 	if (Land[y, x] <> 0) then
  1781 	if (Land[y, x] <> 0) then
  1782 		begin
  1782 		begin
  1783 		Gear^.dX.isNegative:= not Gear^.dX.isNegative;
  1783 		Gear^.dX.isNegative:= not Gear^.dX.isNegative;
  1784 		Gear^.dY.isNegative:= not Gear^.dY.isNegative;
  1784 		Gear^.dY.isNegative:= not Gear^.dY.isNegative;
  1785 		Gear^.dX:= Gear^.dX * _1_5;
  1785 		Gear^.dX:= Gear^.dX * _1_5;