hedgewars/uGears.pas
changeset 1854 6e05013899b2
parent 1849 2a989e5abda6
child 1861 98de5dc5fda7
equal deleted inserted replaced
1853:5618915f9ea4 1854:6e05013899b2
   596 	end;
   596 	end;
   597 
   597 
   598 inc(GameTicks)
   598 inc(GameTicks)
   599 end;
   599 end;
   600 
   600 
   601 (* Purpose, to reset all transient attributes toggled by a utility.  Right now that is just Low Gravity and Extra Damage and Invulnerability.
   601 //Purpose, to reset all transient attributes toggled by a utility.
   602 Other possibilities include: Laser Sight... more?
   602 //If any of these are set as permanent toggles in the frontend, that needs to be checked and skipped here.
   603 *)
       
   604 procedure ResetUtilities;
   603 procedure ResetUtilities;
   605 begin
   604 begin
   606     cGravity:= cMaxWindSpeed;
   605     cGravity:= cMaxWindSpeed;
   607     cDamageModifier:= _1;
   606     cDamageModifier:= _1;
       
   607     cLaserSighting:= false;
   608     if (CurrentHedgehog^.Gear <> nil) then
   608     if (CurrentHedgehog^.Gear <> nil) then
   609         CurrentHedgehog^.Gear^.Invulnerable:= false;
   609         CurrentHedgehog^.Gear^.Invulnerable:= false;
   610 end;
   610 end;
   611 
   611 
   612 procedure SetAllToActive;
   612 procedure SetAllToActive;
   634 end;
   634 end;
   635 
   635 
   636 procedure DrawHH(Gear: PGear);
   636 procedure DrawHH(Gear: PGear);
   637 var t: LongInt;
   637 var t: LongInt;
   638 	amt: TAmmoType;
   638 	amt: TAmmoType;
   639 	hx, hy, m: LongInt;
   639 	hx, hy, cx, cy, tx, ty, m: LongInt;
   640 	aAngle, dAngle: real;
   640 	lx, ly, dx, dy, aAngle, dAngle: real;
   641 	defaultPos, HatVisible: boolean;
   641 	defaultPos, HatVisible: boolean;
   642 begin
   642 begin
   643 if (Gear^.State and gstHHDeath) <> 0 then
   643 if (Gear^.State and gstHHDeath) <> 0 then
   644 	begin
   644 	begin
   645 	DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos);
   645 	DrawSprite(sprHHDeath, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 26 + WorldDy, Gear^.Pos);
   653 	begin
   653 	begin
   654 	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   654 	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   655 			hwSign(Gear^.dX),
   655 			hwSign(Gear^.dX),
   656 			1,
   656 			1,
   657 			7,
   657 			7,
   658 			0);
   658 			0, Gear^.Invulnerable);
   659 	defaultPos:= false
   659 	defaultPos:= false
   660 	end else
   660 	end else
   661 
   661 
   662 if (Gear^.State and gstWinner) <> 0 then
   662 if (Gear^.State and gstWinner) <> 0 then
   663 	begin
   663 	begin
   664 	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   664 	DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   665 			hwSign(Gear^.dX),
   665 			hwSign(Gear^.dX),
   666 			2,
   666 			2,
   667 			0,
   667 			0,
   668 			0);
   668 			0, Gear^.Invulnerable);
   669 	defaultPos:= false
   669 	defaultPos:= false
   670 	end else
   670 	end else
   671 
   671 
   672 if (Gear^.State and gstHHDriven) <> 0 then
   672 if (Gear^.State and gstHHDriven) <> 0 then
   673 	begin
   673 	begin
   703 					end;
   703 					end;
   704 				DrawHedgehog(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,
   704 				DrawHedgehog(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy,
   705 						m,
   705 						m,
   706 						1,
   706 						1,
   707 						0,
   707 						0,
   708 						DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
   708 						DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle, Gear^.Invulnerable);
   709 				defaultPos:= false
   709 				defaultPos:= false
   710 				end;
   710 				end;
   711 			gtBlowTorch: begin
   711 			gtBlowTorch: begin
   712 				DrawRotated(sprBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
   712 				DrawRotated(sprBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
   713 				DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   713 				DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   714 						hwSign(Gear^.dX),
   714 						hwSign(Gear^.dX),
   715 						3,
   715 						3,
   716 						PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   716 						PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   717 						0);
   717 						0, Gear^.Invulnerable);
   718 				defaultPos:= false
   718 				defaultPos:= false
   719 				end;
   719 				end;
   720 			gtShover: DrawRotated(sprHandBaseball, hx, hy, hwSign(Gear^.dX), aangle + 180);
   720 			gtShover: DrawRotated(sprHandBaseball, hx, hy, hwSign(Gear^.dX), aangle + 180);
   721 			gtFirePunch: begin
   721 			gtFirePunch: begin
   722 				DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   722 				DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   723 						hwSign(Gear^.dX),
   723 						hwSign(Gear^.dX),
   724 						1,
   724 						1,
   725 						4,
   725 						4,
   726 						0);
   726 						0, Gear^.Invulnerable);
   727 				defaultPos:= false
   727 				defaultPos:= false
   728 				end;
   728 				end;
   729 			gtPickHammer,
   729 			gtPickHammer,
   730 			gtTeleport: defaultPos:= false;
   730 			gtTeleport: defaultPos:= false;
   731 			gtWhip: begin
   731 			gtWhip: begin
   741 				if CurAmmoGear^.Pos = 0 then
   741 				if CurAmmoGear^.Pos = 0 then
   742 					DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   742 					DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   743 							hwSign(Gear^.dX),
   743 							hwSign(Gear^.dX),
   744 							1,
   744 							1,
   745 							6,
   745 							6,
   746 							0)
   746 							0, Gear^.Invulnerable)
   747 				else
   747 				else
   748 					DrawRotatedF(sprKamikaze,
   748 					DrawRotatedF(sprKamikaze,
   749 							hwRound(Gear^.X) + WorldDx,
   749 							hwRound(Gear^.X) + WorldDx,
   750 							hwRound(Gear^.Y) + WorldDy,
   750 							hwRound(Gear^.Y) + WorldDy,
   751 							CurAmmoGear^.Pos - 1,
   751 							CurAmmoGear^.Pos - 1,
   758 				if CurAmmoGear^.Pos >= 6 then
   758 				if CurAmmoGear^.Pos >= 6 then
   759 					DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   759 					DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   760 							hwSign(Gear^.dX),
   760 							hwSign(Gear^.dX),
   761 							2,
   761 							2,
   762 							2,
   762 							2,
   763 							0)
   763 							0, Gear^.Invulnerable)
   764 				else
   764 				else
   765 					begin
   765 					begin
   766 					DrawRotatedF(sprDress,
   766 					DrawRotatedF(sprDress,
   767 							hwRound(Gear^.X) + WorldDx,
   767 							hwRound(Gear^.X) + WorldDx,
   768 							hwRound(Gear^.Y) + WorldDy,
   768 							hwRound(Gear^.Y) + WorldDy,
   781 			gtShover: begin
   781 			gtShover: begin
   782 				DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   782 				DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   783 						hwSign(Gear^.dX),
   783 						hwSign(Gear^.dX),
   784 						0,
   784 						0,
   785 						4,
   785 						4,
   786 						0);
   786 						0, Gear^.Invulnerable);
   787 				defaultPos:= false
   787 				defaultPos:= false
   788 			end
   788 			end
   789 		end
   789 		end
   790 	end else
   790 	end else
   791 
   791 
   794 	if ((Gear^.State and gstHHHJump) <> 0) then
   794 	if ((Gear^.State and gstHHHJump) <> 0) then
   795 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   795 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   796 			- hwSign(Gear^.dX),
   796 			- hwSign(Gear^.dX),
   797 			1,
   797 			1,
   798 			1,
   798 			1,
   799 			0)
   799 			0, Gear^.Invulnerable)
   800 		else
   800 		else
   801 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   801 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   802 			hwSign(Gear^.dX),
   802 			hwSign(Gear^.dX),
   803 			1,
   803 			1,
   804 			1,
   804 			1,
   805 			0);
   805 			0, Gear^.Invulnerable);
   806 	defaultPos:= false
   806 	defaultPos:= false
   807 	end else
   807 	end else
   808 
   808 
   809 	if (Gear^.Message and (gm_Left or gm_Right) <> 0) then
   809 	if (Gear^.Message and (gm_Left or gm_Right) <> 0) then
   810 		begin
   810 		begin
   811 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   811 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   812 			hwSign(Gear^.dX),
   812 			hwSign(Gear^.dX),
   813 			0,
   813 			0,
   814 			PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   814 			PHedgehog(Gear^.Hedgehog)^.visStepPos div 2,
   815 			0);
   815 			0, Gear^.Invulnerable);
   816 		defaultPos:= false;
   816 		defaultPos:= false;
   817 		HatVisible:= true
   817 		HatVisible:= true
   818 		end
   818 		end
   819 	else
   819 	else
   820 
   820 
   852 			amMineStrike: DrawRotated(sprHandAirAttack, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) + WorldDy, hwSign(Gear^.dX), 0);
   852 			amMineStrike: DrawRotated(sprHandAirAttack, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) + WorldDy, hwSign(Gear^.dX), 0);
   853 			amPickHammer: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   853 			amPickHammer: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   854 						hwSign(Gear^.dX),
   854 						hwSign(Gear^.dX),
   855 						1,
   855 						1,
   856 						2,
   856 						2,
   857 						0);
   857 						0, Gear^.Invulnerable);
   858 			amBlowTorch: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   858 			amBlowTorch: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   859 						hwSign(Gear^.dX),
   859 						hwSign(Gear^.dX),
   860 						1,
   860 						1,
   861 						3,
   861 						3,
   862 						0);
   862 						0, Gear^.Invulnerable);
   863 			amTeleport: DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, 0, hwSign(Gear^.dX), 0);
   863 			amTeleport: DrawRotatedF(sprTeleport, hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy, 0, hwSign(Gear^.dX), 0);
   864 			amKamikaze: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   864 			amKamikaze: DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   865 						hwSign(Gear^.dX),
   865 						hwSign(Gear^.dX),
   866 						1,
   866 						1,
   867 						5,
   867 						5,
   868 						0);
   868 						0, Gear^.Invulnerable);
   869 			amWhip: DrawRotatedF(sprWhip,
   869 			amWhip: DrawRotatedF(sprWhip,
   870 						hwRound(Gear^.X) + 1 + WorldDx,
   870 						hwRound(Gear^.X) + 1 + WorldDx,
   871 						hwRound(Gear^.Y) - 3 + WorldDy,
   871 						hwRound(Gear^.Y) - 3 + WorldDy,
   872 						0,
   872 						0,
   873 						hwSign(Gear^.dX),
   873 						hwSign(Gear^.dX),
   875 		else
   875 		else
   876 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   876 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   877 				hwSign(Gear^.dX),
   877 				hwSign(Gear^.dX),
   878 				0,
   878 				0,
   879 				4,
   879 				4,
   880 				0);
   880 				0, Gear^.Invulnerable);
   881 			
   881 			
   882 			HatVisible:= true;
   882 			HatVisible:= true;
   883 			with PHedgehog(Gear^.Hedgehog)^ do
   883 			with PHedgehog(Gear^.Hedgehog)^ do
   884 				if (HatTex <> nil)
   884 				if (HatTex <> nil)
   885 				and (HatVisibility > 0) then
   885 				and (HatVisibility > 0)
       
   886                 and (not Gear^.Invulnerable) then
   886 					DrawTextureF(HatTex,
   887 					DrawTextureF(HatTex,
   887 						HatVisibility,
   888 						HatVisibility,
   888 						hwRound(Gear^.X) + 1 + WorldDx,
   889 						hwRound(Gear^.X) + 1 + WorldDx,
   889 						hwRound(Gear^.Y) - 8 + WorldDy,
   890 						hwRound(Gear^.Y) - 8 + WorldDy,
   890 						0,
   891 						0,
   907 		begin
   908 		begin
   908 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   909 		DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   909 			hwSign(Gear^.dX),
   910 			hwSign(Gear^.dX),
   910 			2,
   911 			2,
   911 			1,
   912 			1,
   912 			Gear^.DirAngle);
   913 			Gear^.DirAngle, Gear^.Invulnerable);
   913 		defaultPos:= false
   914 		defaultPos:= false
   914 		end else
   915 		end else
   915 
   916 
   916 	if ((Gear^.State and gstHHJumping) <> 0) then
   917 	if ((Gear^.State and gstHHJumping) <> 0) then
   917 		begin
   918 		begin
   918 		if ((Gear^.State and gstHHHJump) <> 0) then
   919 		if ((Gear^.State and gstHHHJump) <> 0) then
   919 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   920 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   920 				- hwSign(Gear^.dX),
   921 				- hwSign(Gear^.dX),
   921 				1,
   922 				1,
   922 				1,
   923 				1,
   923 				0)
   924 				0, Gear^.Invulnerable)
   924 			else
   925 			else
   925 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   926 			DrawHedgehog(hwRound(Gear^.X) + 1 + WorldDx, hwRound(Gear^.Y) - 3 + WorldDy,
   926 				hwSign(Gear^.dX),
   927 				hwSign(Gear^.dX),
   927 				1,
   928 				1,
   928 				1,
   929 				1,
   929 				0);
   930 				0, Gear^.Invulnerable);
   930 			defaultPos:= false
   931 			defaultPos:= false
   931 		end;
   932 		end;
   932 	end;
   933 	end;
   933 
   934 
   934 with PHedgehog(Gear^.Hedgehog)^ do
   935 with PHedgehog(Gear^.Hedgehog)^ do
   950 		else
   951 		else
   951 	else
   952 	else
   952 		if HatVisibility > 0.0 then
   953 		if HatVisibility > 0.0 then
   953 			HatVisibility:= HatVisibility - 0.2;
   954 			HatVisibility:= HatVisibility - 0.2;
   954 	
   955 	
   955 	if (HatTex <> nil)
   956 	if (HatTex <> nil) and (not Gear^.Invulnerable)
   956 	and (HatVisibility > 0) then
   957 	and (HatVisibility > 0) then
   957 		if DefaultPos then
   958 		if DefaultPos then
   958 			DrawTextureF(HatTex,
   959 			DrawTextureF(HatTex,
   959 				HatVisibility,
   960 				HatVisibility,
   960 				hwRound(Gear^.X) + 1 + WorldDx,
   961 				hwRound(Gear^.X) + 1 + WorldDx,
  1005 			if (Gear^.State and gstHHThinking) <> 0 then
  1006 			if (Gear^.State and gstHHThinking) <> 0 then
  1006 				DrawSprite(sprQuestion, hwRound(Gear^.X) - 10 + WorldDx, hwRound(Gear^.Y) - cHHRadius - 34 + WorldDy, 0)
  1007 				DrawSprite(sprQuestion, hwRound(Gear^.X) - 10 + WorldDx, hwRound(Gear^.Y) - cHHRadius - 34 + WorldDy, 0)
  1007 				else
  1008 				else
  1008 				if ShowCrosshair and ((Gear^.State and (gstAttacked or gstAnimation)) = 0) then
  1009 				if ShowCrosshair and ((Gear^.State and (gstAttacked or gstAnimation)) = 0) then
  1009 					begin
  1010 					begin
       
  1011 (* These calculations are a little complex for a few reasons:
       
  1012    1: I need to draw the laser from weapon origin to nearest land
       
  1013    2: I need to start the beam outside the hedgie for attractiveness. 
       
  1014       I can't do the calc from there, or it accumulates more error visible in a deagle shot.
       
  1015    3: I need to extend the beam beyond land. 
       
  1016    This routine perhaps should be pushed into uStore or somesuch instead of continuuing the increase in size of this function.
       
  1017    Additionally, using crosshairs, amusingly, makes the laser imprecise to about   0.05% of a deagle shot.  This means that if you are firing across an entire 4096px map your laser will be a few pixels off of the the deagle shot.  This is still a lot more accurate than real laser sights - feel free to change if it bothers you.
       
  1018 *)
       
  1019 					if cLaserSighting then
       
  1020 						begin
       
  1021 						lx:= hwRound(Gear^.X);
       
  1022 						ly:= hwRound(Gear^.Y);
       
  1023 						dx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * pi / cMaxAngle);
       
  1024 						dy:= - Cos(Gear^.Angle * pi / cMaxAngle);
       
  1025 						lx:= lx + dx * 16;
       
  1026 						ly:= ly + dy * 16;
       
  1027 
       
  1028 						dx:= dx * 4;
       
  1029 						dy:= dy * 4;
       
  1030 
       
  1031 						tx:= round(lx);
       
  1032 						ty:= round(ly);
       
  1033 						hx:= tx;
       
  1034 						hy:= ty;
       
  1035 						while ((ty and LAND_HEIGHT_MASK) = 0) and
       
  1036 							((tx and LAND_WIDTH_MASK) = 0) and
       
  1037 							(Land[ty, tx] = 0) do
       
  1038 							begin
       
  1039 							lx:= lx + dx;
       
  1040 							ly:= ly + dy;
       
  1041 							tx:= round(lx);
       
  1042 							ty:= round(ly)
       
  1043 							end;
       
  1044 						// reached edge of land. assume infinite beam. Extend it way out past camera
       
  1045 						if ((ty and LAND_HEIGHT_MASK) <> 0) or ((tx and LAND_WIDTH_MASK) <> 0) then
       
  1046 							begin
       
  1047 							lx:= lx + dx * (LAND_WIDTH div 4);
       
  1048 							ly:= ly + dy * (LAND_WIDTH div 4)
       
  1049 							end;
       
  1050 						
       
  1051 						//if (abs(lx-tx)>8) or (abs(ly-ty)>8) then
       
  1052 							begin
       
  1053 							glDisable(GL_TEXTURE_2D);
       
  1054 							glEnable(GL_LINE_SMOOTH);
       
  1055 							glBegin(GL_LINES);
       
  1056 							glColor4ub($FF, $00, $00, $C0);
       
  1057 							glVertex2i(hx + WorldDx, hy + WorldDy);
       
  1058 							glVertex2i(tx + WorldDx, ty + WorldDy);
       
  1059 							glEnd();
       
  1060 							glColor4f(1, 1, 1, 1);
       
  1061 							glEnable(GL_TEXTURE_2D);
       
  1062 							glDisable(GL_LINE_SMOOTH);
       
  1063 							end;
       
  1064 						end;
       
  1065 					// draw crossahair
  1010 					if ((Gear^.State and gstHHHJump) <> 0) then m:= -1 else m:= 1;
  1066 					if ((Gear^.State and gstHHHJump) <> 0) then m:= -1 else m:= 1;
       
  1067 					cx:= Round(hwRound(Gear^.X) + hwSign(Gear^.dX) * m * Sin(Gear^.Angle*pi/cMaxAngle) * 80);
       
  1068 					cy:= Round(hwRound(Gear^.Y) - Cos(Gear^.Angle*pi/cMaxAngle) * 80);
  1011 					DrawRotatedTex(Team^.CrosshairTex,
  1069 					DrawRotatedTex(Team^.CrosshairTex,
  1012 							12, 12,
  1070 							12, 12, cx+WorldDx, cy+WorldDy, 0,
  1013 							Round(hwRound(Gear^.X) + hwSign(Gear^.dX) * m * Sin(Gear^.Angle*pi/cMaxAngle) * 80) + WorldDx,
  1071 							hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle);
  1014 							Round(hwRound(Gear^.Y) - Cos(Gear^.Angle*pi/cMaxAngle) * 80) + WorldDy, 0,
       
  1015 							hwSign(Gear^.dX) * (Gear^.Angle * 180.0) / cMaxAngle)
       
  1016 					end
  1072 					end
  1017 			end
  1073 			end
  1018 	end
  1074 	end
  1019 end;
  1075 end;
  1020 
  1076 
  1240 				gtFlame: begin
  1296 				gtFlame: begin
  1241 						//{$IFDEF DEBUGFILE}AddFileLog('Damage: ' + inttostr(dmg));{$ENDIF}
  1297 						//{$IFDEF DEBUGFILE}AddFileLog('Damage: ' + inttostr(dmg));{$ENDIF}
  1242 						if (Mask and EXPLNoDamage) = 0 then
  1298 						if (Mask and EXPLNoDamage) = 0 then
  1243 							begin
  1299 							begin
  1244                             if not Gear^.Invulnerable then
  1300                             if not Gear^.Invulnerable then
  1245 							   inc(Gear^.Damage, dmg);
  1301                                 begin
  1246 							if Gear^.Kind = gtHedgehog then
  1302 							    inc(Gear^.Damage, dmg);
  1247 								AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), dmg, PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.Color)
  1303 							    if Gear^.Kind = gtHedgehog then
       
  1304 								    AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), dmg, PHedgehog(Gear^.Hedgehog)^.Team^.Clan^.Color);
       
  1305                                 end;
  1248 							end;
  1306 							end;
  1249 						if ((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog) then
  1307 						if ((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog) then
  1250 							begin
  1308 							begin
  1251 							DeleteCI(Gear);
  1309 							DeleteCI(Gear);
  1252 							Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - int2hwFloat(X));
  1310 							Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - int2hwFloat(X));
  1284 	case t^.Kind of
  1342 	case t^.Kind of
  1285 		gtHedgehog,
  1343 		gtHedgehog,
  1286 			gtMine,
  1344 			gtMine,
  1287 			gtCase,
  1345 			gtCase,
  1288 			gtTarget: begin
  1346 			gtTarget: begin
  1289                     if (not Gear^.Invulnerable) then
  1347                     if (not t^.Invulnerable) then
       
  1348                         begin
  1290 					    inc(t^.Damage, dmg);
  1349 					    inc(t^.Damage, dmg);
  1291 
  1350 					    if t^.Kind = gtHedgehog then
  1292 					if t^.Kind = gtHedgehog then
  1351 						    AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), dmg, PHedgehog(t^.Hedgehog)^.Team^.Clan^.Color);
  1293 						AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), dmg, PHedgehog(t^.Hedgehog)^.Team^.Clan^.Color);
  1352                         end;
  1294 
  1353 
  1295 					DeleteCI(t);
  1354 					DeleteCI(t);
  1296 					t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX);
  1355 					t^.dX:= t^.dX + Gear^.dX * dmg * _0_01 + SignAs(cHHKick, Gear^.dX);
  1297 					t^.dY:= t^.dY + Gear^.dY * dmg * _0_01;
  1356 					t^.dY:= t^.dY + Gear^.dY * dmg * _0_01;
  1298 					t^.State:= t^.State or gstMoving;
  1357 					t^.State:= t^.State or gstMoving;
  1324 			gtHedgehog,
  1383 			gtHedgehog,
  1325 			gtMine,
  1384 			gtMine,
  1326 			gtTarget,
  1385 			gtTarget,
  1327 			gtCase: begin
  1386 			gtCase: begin
  1328 					if (Ammo^.Kind = gtDrill) then begin Ammo^.Timer:= 0; exit; end;
  1387 					if (Ammo^.Kind = gtDrill) then begin Ammo^.Timer:= 0; exit; end;
  1329 					inc(t^.ar[i]^.Damage, Damage);
  1388                     if (not t^.ar[i]^.Invulnerable) then
  1330 
  1389                         begin
  1331 					if (t^.ar[i]^.Kind = gtHedgehog) and (Damage > 0) then
  1390 					    inc(t^.ar[i]^.Damage, Damage);
  1332 						AddDamageTag(hwRound(t^.ar[i]^.X), hwRound(t^.ar[i]^.Y), Damage, PHedgehog(t^.ar[i]^.Hedgehog)^.Team^.Clan^.Color);
  1391 
       
  1392                         if (t^.ar[i]^.Kind = gtHedgehog) and (Damage > 0) then
       
  1393                             AddDamageTag(hwRound(t^.ar[i]^.X), hwRound(t^.ar[i]^.Y), Damage, PHedgehog(t^.ar[i]^.Hedgehog)^.Team^.Clan^.Color);
       
  1394                         end;
  1333 
  1395 
  1334 					DeleteCI(t^.ar[i]);
  1396 					DeleteCI(t^.ar[i]);
  1335 					t^.ar[i]^.dX:= Ammo^.dX * Power * _0_01;
  1397 					t^.ar[i]^.dX:= Ammo^.dX * Power * _0_01;
  1336 					t^.ar[i]^.dY:= Ammo^.dY * Power * _0_01;
  1398 					t^.ar[i]^.dY:= Ammo^.dY * Power * _0_01;
  1337 					t^.ar[i]^.Active:= true;
  1399 					t^.ar[i]^.Active:= true;