;
{curve "gun_std"}
; changing to real speed
;(define "speed"   
;	{speed (* 0.17 %s)}  
;)
(define "speed"   
	{speed (* 1 %s)}  
)

(define "damage"                                                                                 
	{projectileDamageTable {20 %a} {50 %b} {70 %c} {90 %d} {110 %e} {120 (* 0.8 %e)} {130 (* 0.6 %e)} {170 (* 0.4 %e)} {200 0}}
)



(define "damage_30mm"                                                                                 
	{projectileDamageTable {70 %a} {200 %b} {300 %c} {400 %d} {500 %e}}
)



(define "damage3"                                                                                                         
	{projectileDamageTable {20 %a} {40 %b} {60 %c} {80 %d} {100 %e} {125 (* 0.7 %e)} {150 (* 0.5 %e)} {170 (* 0.3 %e)} {200 0}}
)

(mod not "mp"
	(define "damage"    
		{projectileDamageTable {10 %a} {110 (* 0.75 %b)} {130 (* 0.55 %b)} {150 (* 0.4 %b)}}
	)

	(define "damage3"    
		{projectileDamageTable {10 %a} {50 %b} {90 (* 0.9 %c)} {110 (* 0.75 %c)} {130 (* 0.6 %c)} {150 (* 0.4 %c)} {170 (* 0.3 %c)}}
	)
)

(define "accuracy"   
	{spreading 
		{radiusTable {0 0} {20 (* 0.6 %r1)} {50 %r1} {110 (* 0.9 %r2)} {130 (* 1.5 %r2)} {150 (* 1.8 %r2)}}
	}
	{parameters "fg"
		{spreading
			{radiusTable {0 0} {20 (* 0.6 %r1)} {50 (* 1.2 %r1)} {110 (* 1.5 %r2)} {130 (* 2 %r2)} {170 (* 2.5 %r2)}}
		}
	}	
)

(mod not "mp"
	(define "accuracy"   
		{spreading 
			{radiusTable {0 0} {20 (* 0.6 %r1)} {50 (* 0.8 %r1)} {110 (* 0.8 %r2)} {130 (* 1.5 %r2)} {150 (* 1.8 %r2)}}
		}
		{parameters "fg"
			{spreading
				{radiusTable {0 0} {20 (* 0.4 %r1)} {50 (* 0.9 %r1)} {110 %r2} {130 (* 2 %r2)} {170 (* 2.5 %r2)}}
			}
		}	
	)
)

(define "accuracy_2" 
	{spreading 
		{radiusTable {0 0} {50 %r1} {110 (* 0.65 %r2)} {120 (* 0.6 %r3)} {170 (* 0.6 %r4)}}
	}		
	{parameters "fg"
		{spreading
			{radiusTable {0 0} {50 %r1} {110 %r2} {120 %r3} {170 %r4}}
		}
	}
)

(define "accuracy_3"  
	{spreading 
		{radiusTable {0 0} {70 %r1} {110 %r2} {150 %r3} {270 %r4}}
		(mod not "mp"
			{radiusTable {0 0} {70 %r1} {110 %r2} {150 %r3} {220 %r4}}
		)	
	}
)

(define "accuracy_t29" 
	("accuracy" r1(0.45) r2(1.45))
)
(define "accuracy_nashorn" 
	("accuracy" r1(0.45) r2(1.55))
)	
(define "accuracy_panther" 
	("accuracy" r1(0.5) r2(1.65))
)
(define "accuracy_is2" 
	("accuracy" r1(0.5) r2(1.65))
)		
(define "accuracy_pz4" 
	("accuracy" r1(0.5) r2(1.8))
)	
(define "accuracy_sherman" 
	("accuracy" r1(0.2) r2(0.8))
)
(define "accuracy_bt7a"
	("accuracy" r1(1.8) r2(2.8))
)
(define "accuracy_zenite"
	("accuracy" r1(1) r2(2))
)
(define "accuracy_kv2" 
	("accuracy_2" r1(0.85) r2(4.5) r3(6) r4(8))
)
(define "accuracy_isu152" 
	("accuracy_2" r1(0.8) r2(2.5) r3(4) r4(8))
)
(define "accuracy_su122" 
	("accuracy_2" r1(1) r2(3.5) r3(5.5) r4(7.5))
)

(define "accuracy_howitzer" 
	("accuracy_3" r1(2) r2(5) r3(13) r4(15))
)

(mod not "mp"
	(define "accuracy_nashorn" 
		("accuracy" r1(1.75) r2(5))
	)	
	(define "accuracy_panther" 
		("accuracy" r1(2) r2(6))
	)		
	(define "accuracy_pz4" 
		("accuracy" r1(2) r2(7.5))
	)	
	(define "accuracy_sherman" 
		("accuracy" r1(1.75) r2(7.5))
	)
	(define "accuracy_bt7a"
		("accuracy" r1(2) r2(9))
	)
)

(define "14-20caliber"
	{projectileDamageThreshold 1.2}
)
(define "37-57caliber"
	{projectileDamageThreshold 1.1}
)
(define "75-76caliber"
	{projectileDamageThreshold 1.15}
)
(define "85-93caliber"
	{projectileDamageThreshold 1.15}
)
(define "100-128caliber"
	{projectileDamageThreshold 1.15}
)
(define "howitzer_caliber"
	{projectileDamageThreshold 1.15}
)
(mod not "mp"
	(define "14-20caliber"
		{projectileDamageThreshold 1.15}
	)
	(define "37-57caliber"
		{projectileDamageThreshold 1.3}
	)
	(define "75-76caliber"
		{projectileDamageThreshold 1.3}
	)
	(define "85-93caliber"
		{projectileDamageThreshold 1.3}
	)
	(define "100-128caliber"
		{projectileDamageThreshold 1.4}
	)
	(define "howitzer_caliber"
		{projectileDamageThreshold 1.6}
	)
)


(define "range_bmp2_30mm"
	{spreading                   
		{SpreadPower	1}
		(mod not "mp"   	
			{SpreadXYRatio	1.4}
		)
;		{SpreadYadjust	0.2} 
	}	
	{SpreadTolerance 0.4}
	
	{range 500 500}

	{ZeroingAccuracy 0.8 0.6}
	{parameters "fg"
		{spreading
			{SpreadXYRatio	2.6}
			{SpreadPower	1}
			{SpreadYadjust	0.08}
			(mod not "mp"
				{SpreadXYRatio	1.6}
				{SpreadPower	0.8}
				{SpreadYadjust	0.1}

			)
		}
	}	
    {RelaxationTime 0.4}
	{gravity 1.5}
)




























(define "range_45-57"
	{spreading                   
		{SpreadPower	1}
		(mod not "mp"   	
			{SpreadXYRatio	1.4}
		)
;		{SpreadYadjust	0.2} 
	}	
	{SpreadTolerance 0.4}
	
	{range 70 110}
	(mod not "mp"
		{range 60 70}
	)
	{ZeroingAccuracy 0.8 0.6}
	{parameters "fg"
		{spreading
			{SpreadXYRatio	2.6}
			{SpreadPower	1}
			{SpreadYadjust	0.08}
			(mod not "mp"
				{SpreadXYRatio	1.6}
				{SpreadPower	0.8}
				{SpreadYadjust	0.1}

			)
		}
	}	
    {RelaxationTime 0.4}
	{gravity 1.5}
)

(define "range_zenite"
	("accuracy_zenite")
	{spreading 1
		{SpreadXYRatio	1.8}
		{SpreadPower	1.5}
		{BurstAccuracy 100 90 85 80 72}
	}
	{SpreadTolerance 0.6}
	
	{range 70 100}	
	(mod not "mp"
		{range 60 70}
	)
	
    {RelaxationTime 0.2}
	{gravity 1.5}
)

(define "range_75-90"
	{curve "gun_medium"}
	{spreading			
		{SpreadXYRatio	0.65}
		(mod not "mp"   	
			{SpreadXYRatio	1.3}
		)
		{SpreadPower	1.2}
;		{SpreadYadjust	0.2}
	}
	
	{SpreadTolerance 0.4}
				
	{range 90 130}
	(mod not "mp"
		{range 70 90}	
	)
	
	{ZeroingAccuracy 0.8 0.6}
	{parameters "fg"
		{spreading
			{SpreadXYRatio	2.2}
			{SpreadPower	1.1}
			{SpreadYadjust	0.07}
			(mod not "mp"
				{SpreadXYRatio	2.4}
				{SpreadPower	1}
				{SpreadYadjust	0.1}
			)
		}
	}
    {RelaxationTime 0.4}
	{gravity 1.4}
)
 
(define "range_100+"
	{curve "gun_heavy"}
	{spreading			
		{SpreadXYRatio	0.65}  
		{SpreadPower	1}
		(mod not "mp"   	
			{SpreadXYRatio	1.3}
			{SpreadPower	1.3}
		)

	}
	{SpreadTolerance 0.4}

	{range 130 140}
	(mod not "mp"
		{range 90 110}	
	)
		
	{ZeroingAccuracy 0.8 0.6}
	{parameters "fg"
		{spreading
			{SpreadXYRatio	2.7}
			{SpreadPower	1}
			{SpreadYadjust	0.05}
		}
	}	
    	{RelaxationTime 0.4}
	{gravity 1.4}
)

(define "range_130+"
	{curve "gun_heavy"}
	{spreading			
		{SpreadXYRatio	0.65}  
		{SpreadPower	1}
		(mod not "mp"   	
			{SpreadXYRatio	1.3}
			{SpreadPower	1.3}
		)

	}
	{SpreadTolerance 0.4}

	{range 130 150}
	(mod not "mp"
		{range 90 110}	
	)
		
	{ZeroingAccuracy 0.8 0.6}
	{parameters "fg"
		{spreading
			{SpreadXYRatio	2.7}
			{SpreadPower	1}
			{SpreadYadjust	0.05}
		}
	}	
    	{RelaxationTime 0.4}
	{gravity 1.4}
)

(define "range_light_howitzer"
	{curve "gun_medium"}
	{spreading			
		{SpreadXYRatio	0.7}
		{SpreadPower	1}
;		{SpreadYadjust	0.2}
	}
	
	{SpreadTolerance 0.7}			
	{range 130 150}
	
	{ZeroingAccuracy 0.85 0.7}
	{parameters "fg"	
		{range 130 170}
		{spreading
			{SpreadXYRatio	2}
			{SpreadPower	1.2}
		}
	}
    	{RelaxationTime 0.4}
	{gravity 3}
)

(define "range_grazing_howitzer"
	{curve "gun_medium"}
	{spreading			
		{SpreadXYRatio	0.7}
		{SpreadPower	1}
;		{SpreadYadjust	0.2}
	}
	
	{SpreadTolerance 0.7}			
	{range 130 150}
	
	{ZeroingAccuracy 0.85 0.7}
	{parameters "fg"	
		{range 130 170}
		{spreading
			{SpreadXYRatio	1.3}
			{SpreadPower	1.2}
;			{SpreadYadjust	0.1}
		}
	}
    	{RelaxationTime 0.4}
	{gravity 3}
)

(define "heavy_howitzer"
	{spreading	
		{SpreadPower	1}
		{SpreadYadjust	0.3}
	}
	("accuracy_howitzer")
	("howitzer_caliber")
	{bullet_view "howitzer_shell"
		{tail "shell_tail" "root"}
	}
	{ZeroingAccuracy 0.8 0.6}
	{DisableRicochet}
	{aimtype adaptive}
	{traceFreq 0}
	{gravity 1.3}   
	{range 250 250}
	(mod not "mp"
		{range 150 170}	
	)
    {RelaxationTime 2}
	
	{speed 70}
	{gravity 4}
)

(define "overmatch_100mm"
	(mod "mp"
		{OvermatchDamping
			{0	1}
			{30	1}
				{55	1}
			{60	1}
			{60	4}		
			{90	6}		
		}
	)
)