hedgewars/GSHandlers.inc
changeset 2331 e4941a7986d6
parent 2329 1cfb7d184ee1
child 2339 f1bbcca1ae07
equal deleted inserted replaced
2330:ba46dcda3676 2331:e4941a7986d6
   571 	while i <= ei do
   571 	while i <= ei do
   572 		begin
   572 		begin
   573 		DrawExplosion(i, hwRound(Gear^.Y) + 3, 3);
   573 		DrawExplosion(i, hwRound(Gear^.Y) + 3, 3);
   574 		inc(i, 1)
   574 		inc(i, 1)
   575 		end;
   575 		end;
   576     if Land[hwRound(Gear^.Y + _1_9) , hwRound(Gear^.X + Gear^.dX + SignAs(_16,Gear^.dX))] <> COLOR_INDESTRUCTIBLE then
   576 
       
   577     if CheckLandValue(hwRound(Gear^.X + Gear^.dX + SignAs(_6,Gear^.dX)), hwRound(Gear^.Y + _1_9), COLOR_INDESTRUCTIBLE) then
   577         begin
   578         begin
   578         Gear^.X:= Gear^.X + Gear^.dX;
   579         Gear^.X:= Gear^.X + Gear^.dX;
   579         Gear^.Y:= Gear^.Y + _1_9;
   580         Gear^.Y:= Gear^.Y + _1_9;
   580         end;
   581         end;
   581 	SetAllHHToActive;
   582 	SetAllHHToActive;
   672 		begin
   673 		begin
   673 		HHGear^.State:= HHGear^.State and not gstAttacking;
   674 		HHGear^.State:= HHGear^.State and not gstAttacking;
   674 		prevX:= hwRound(HHGear^.X);
   675 		prevX:= hwRound(HHGear^.X);
   675 	
   676 	
   676 // why the call to HedgehogStep then a further increment of X?	
   677 // why the call to HedgehogStep then a further increment of X?	
   677 		if (prevX = hwRound(HHGear^.X)) and (Land[hwRound(HHGear^.Y) , hwRound(HHGear^.X + SignAs(_16, HHGear^.dX))] <> COLOR_INDESTRUCTIBLE) then HedgehogStep(HHGear);
   678         if (prevX = hwRound(HHGear^.X)) and 
       
   679            CheckLandValue(hwRound(HHGear^.X + SignAs(_6, HHGear^.dX)), hwRound(HHGear^.Y), COLOR_INDESTRUCTIBLE) then HedgehogStep(HHGear);
   678 		
   680 		
   679 		if (prevX = hwRound(HHGear^.X)) and (Land[hwRound(HHGear^.Y) , hwRound(HHGear^.X + SignAs(_16, HHGear^.dX))] <> COLOR_INDESTRUCTIBLE) then HHGear^.X:= HHGear^.X + SignAs(_1, HHGear^.dX);
   681         if (prevX = hwRound(HHGear^.X)) and 
       
   682            CheckLandValue(hwRound(HHGear^.X + SignAs(_6, HHGear^.dX)), hwRound(HHGear^.Y), COLOR_INDESTRUCTIBLE) then HHGear^.X:= HHGear^.X + SignAs(_1, HHGear^.dX);
   680 		HHGear^.State:= HHGear^.State or gstAttacking
   683 		HHGear^.State:= HHGear^.State or gstAttacking
   681 		end;
   684 		end;
   682 
   685 
   683 	inc(BTSteps);
   686 	inc(BTSteps);
   684 	if BTSteps = 7 then
   687 	if BTSteps = 7 then
   685 		begin
   688 		begin
   686 		BTSteps:= 0;
   689 		BTSteps:= 0;
   687         if Land[hwRound(HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC)) , hwRound(HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC) + SignAs(_16,Gear^.dX)
   690         if CheckLandValue(hwRound(HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC) + SignAs(_6,Gear^.dX)), hwRound(HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC)), COLOR_INDESTRUCTIBLE) then
   688 )] <> COLOR_INDESTRUCTIBLE then
       
   689             begin
   691             begin
   690 		Gear^.X:= HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC);
   692 		    Gear^.X:= HHGear^.X + Gear^.dX * (cHHRadius + cBlowTorchC);
   691 		Gear^.Y:= HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC);
   693 		    Gear^.Y:= HHGear^.Y + Gear^.dY * (cHHRadius + cBlowTorchC);
   692             end;
   694             end;
   693 		HHGear^.State:= HHGear^.State or gstNoDamage;
   695 		HHGear^.State:= HHGear^.State or gstNoDamage;
   694 		AmmoShove(Gear, 2, 15);
   696 		AmmoShove(Gear, 2, 15);
   695 		HHGear^.State:= HHGear^.State and not gstNoDamage
   697 		HHGear^.State:= HHGear^.State and not gstNoDamage
   696 		end;
   698 		end;
  1291 	DeleteGear(Gear);
  1293 	DeleteGear(Gear);
  1292 	AfterAttack;
  1294 	AfterAttack;
  1293 	exit
  1295 	exit
  1294 	end;
  1296 	end;
  1295 
  1297 
  1296 if Land[hwRound(HHGear^.Y + HHGear^.dY + SignAs(_16,Gear^.dX)
  1298 if CheckLandValue(hwRound(HHGear^.X), hwRound(HHGear^.Y + HHGear^.dY + SignAs(_6,Gear^.dY)), COLOR_INDESTRUCTIBLE) then 
  1297 ), hwRound(HHGear^.X)] <> COLOR_INDESTRUCTIBLE then HHGear^.Y:= HHGear^.Y + HHGear^.dY
  1299    HHGear^.Y:= HHGear^.Y + HHGear^.dY
  1298 end;
  1300 end;
  1299 
  1301 
  1300 procedure doStepFirePunch(Gear: PGear);
  1302 procedure doStepFirePunch(Gear: PGear);
  1301 var HHGear: PGear;
  1303 var HHGear: PGear;
  1302 begin
  1304 begin