
(include "\set\small_firearms_accuracy.inc")

(define "penetration"
	{projectileDamageTable 	{20 %0} {100 %1} {155 %2} {250 %3} {400 %4}}
)

(define "armor health"
	{minimumDamageModifier (* 1.0 %damage)}
)

(define "semi_rifle"
	{tag "auto_eject semi_auto"}
	{range 160 160}
	{spreading 
		{BurstAccuracy 100 70 58 48 40 34 29 25 22 19 17 15 14 13 12 11 10 9 8}
	}
	{burst
		{short 1 0}		; burst shots on long distance, rand (+-)shots
		{long 2 1}			; burst shots on short distance, rand (+-)shots
		{rangeKoef 0.3}	; rangeKoef * aimRange = max long burst distance
	}
	{Automatic}
	("accuracy_rifle_auto")
	{LockFireDistanceTime 0.5}
	("human health" damage(75))
	("fire rate" rpm(150))
	;("zeroing_boost")
	{FiringTimeout 3.00 1}
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	{curve "autorifle"}
	("recoil_rifle_semi")
	("ap_7_62_slope_multiplier")
	{AccuracyByMotionK 1.0}
)

(define "auto_rifle" ;full size rifle calibers with full auto capability; AVT40, BAR
	{tag "autorifle_sup auto_eject rifle_shell"}
	{range 160 160}
	{spreading
		{BurstAccuracy 100 70 58 48 40 34 29 25 22 19 17 15 14 13 12 11 10 9 8}
	}
	{burst
		{short 1 0.5}		; burst shots on long distance, rand (+-)shots
		{long 3 1}			; burst shots on short distance, rand (+-)shots
		{rangeKoef 0.3}		; rangeKoef * aimRange = max long burst distance
	}

	{Automatic}
	("accuracy_rifle_auto")
	{LockFireDistanceTime 0.5}
	("human health" damage(75))
	{SyncedProjectiles 0}		;// not for automatic weapons
	{FiringTimeout 3 0.5}
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	{curve "autorifle"}
	("recoil_rifle_semi")
	("ap_7_62_slope_multiplier")
	{AccuracyByMotionK 1.0}
)

(define "battle_rifle" ;full size rifle calibers with full auto capability; FG42
	{tag "autorifle_sup auto_eject rifle_shell"}
	{range 160 160}
	{spreading
		{BurstAccuracy 100 70 58 48 40 34 29 25 22 19 17 15 14 13 12 11 10 9 8}
	}
	{burst
		{short 3 1}		; burst shots on long distance, rand (+-)shots
		{long 3 1}			; burst shots on short distance, rand (+-)shots
		{rangeKoef 0.33}		; rangeKoef * aimRange = max long burst distance
	}

	{Automatic}
	("accuracy_battle_rifle")
	{LockFireDistanceTime 0.5}
	("human health" damage(75))
	{SyncedProjectiles 0}		;// not for automatic weapons
	{FiringTimeout 2.0 0.5}
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	{curve "autorifle"}
	("recoil_rifle_semi")
	("ap_7_62_slope_multiplier")
	{AccuracyByMotionK 1.0}
)

(define "battle_rifle_fg42" ;full size rifle calibers with full auto capability; FG42
	{tag "autorifle_sup auto_eject rifle_shell"}
	{range 120 120}
	{spreading
		{BurstAccuracy 100 70 58 48 40 34 29 25 22 19 17 15 14 13 12 11 10 9 8}
	}
	{burst
		{short 1.5 0.5}		; burst shots on long distance, rand (+-)shots
		{long 4 1}			; burst shots on short distance, rand (+-)shots
		{rangeKoef 0.3}		; rangeKoef * aimRange = max long burst distance
	}

	{Automatic}
	("accuracy_rifle_auto")
	{LockFireDistanceTime 0.5}
	("human health" damage(75))
	{SyncedProjectiles 0}		;// not for automatic weapons
	{FiringTimeout 2.5 0.5}
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	{curve "autorifle"}
	("recoil_fg42")
	("ap_7_62_slope_multiplier")
	{AccuracyByMotionK 1.0}
)

(define "assault_rifle" ;small size rifle calibers with full auto capability; stg44
	{tag "autorifle_sup auto_eject"}
	{range 120 120}
	{spreading
		{BurstAccuracy 100 80 66 54 45 38 33 28 24 21 19 17 15 14 13 12 11 10}
	}

	{Automatic}
	("accuracy_assault_rifle")
	{LockFireDistanceTime 0.5}
	("human health" damage(51))
	{SyncedProjectiles 0}		;// not for automatic weapons
	{FiringTimeout 2.25 0.25}
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	{burst
		{short 1.5 0.5}		; burst shots on long distance, rand (+-)shots
		{long 5 2}			; burst shots on short distance, rand (+-)shots
		{rangeKoef 0.3}	; rangeKoef * aimRange = max long burst distance
	}
	{curve "assaultrifle"}
	("recoil_stg")
	("ap_7_62_slope_multiplier")
	{AccuracyByMotionK 0.98}
)

(define "carbine_rifle" ;small size rifle calibers; m1 carbine
	{tag "autorifle_sup auto_eject"}
	{range 100 100}
	{spreading
		{BurstAccuracy 100 80 66 54 45 38 33 28 24 21 19 17 15 14 13 12 11 10}
	}

	{Automatic}
	("accuracy_assault_rifle")
	{LockFireDistanceTime 0.5}
	("human health" damage(35))
	{SyncedProjectiles 0}		;// not for automatic weapons
	{FiringTimeout 1.5 0.5}
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	{burst
		{short 1}			; burst shots on long distance, rand (+-)shots
		{long 1}		; burst shots on short distance, rand (+-)shots
		{rangeKoef 1}		; rangeKoef * aimRange = max long burst distance
	}

	{curve "assaultrifle"}
	("recoil_stg")
	("ap_7_62_slope_multiplier")
	{AccuracyByMotionK 0.98}
)
(define "marksman"
	{ZeroingAccuracy 0.9 0.85 0.8 0.75 0.7 0.65 0.6}
)

(define "k98_rate"
	{FiringTimeout 3.5 0.5}		;// 3.5 0.5
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	("fire rate" rpm(40))			  
)

(define "finnish_rate"
	{FiringTimeout 3.5 0.5}		;// 3.5 0.5
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	("fire rate" rpm(32))
	("accuracy_rifle_sniper")

)

(define "swedish_rate"
	{FiringTimeout 3.5 0.5}		;// 3.5 0.5
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}
	("fire rate" rpm(43))
	("accuracy_rifle_sniper")
	("human health" damage(70))
)

(define "mosin_rate"
	{FiringTimeout 3.5 0.5}		;// 4 0.5
	("fire rate" rpm(30))
	{FiringTimeoutDistanceFactor
		{0.2 0.8}
		{0.4 1.2}
		{0.6 1.6}
		{0.8 2.2}
	}				  
)

(define "enfield_no1_rate"
	{FiringTimeout 2.7 0.2}
	{FiringTimeoutDistanceFactor
		{0.2 0.5}	;24m, 1.55s
		{0.4 0.8}	;48m, 2.48s
		{0.6 0.9}	;72m, 2.79s
		{0.8 1.0}	;96m, 3.1s
	}
	("human health" damage(76))
	("fire rate" rpm(50))
	("reload time" seconds(10))
)

(define "enfield_no4_rate"
	{FiringTimeout 2.5 0.2}
	{FiringTimeoutDistanceFactor
		{0.2 0.5}	;24m, 1.45s
		{0.4 0.8}	;48m, 2.32s
		{0.6 0.9}	;72m, 2.61s
		{0.8 1.0}	;96m, 2.9s
	}
	("human health" damage(76))
	("fire rate" rpm(60))
	("reload time" seconds(10))
)

(define "bolt_action"
	{range 160 160}
	{Automatic}
	{tag "bolt_action rifle_shell"}
	("human health" damage(80))
	("fire rate" rpm(30)) 
	{states
		{reload		"reload"}
		{unload		"unload"}
		{fire		"fire"	}
		{aim 		"aim"	}
		{can_aim	"can-aim-bolt"}
	}
	("recoil_rifle_bolt")
	("ap_7_62_slope_multiplier")
	{burst
		{short 0 0.1}	; burst shots on long distance, rand (+-)shots
		{long 2 0.1}	; burst shots on short distance, rand (+-)shots
		{rangeKoef 0.2}	; rangeKoef * aimRange = max long burst distance
	}
	{AccuracyByMotionK 1.0}
)

(define "zeroing_boost"
	{ZeroingAccuracy 0.95 0.9 0.85 0.825 0.8 0.775 0.75 0.725 0.7}
)

(define "scopeview"
	{thirdpersonparams inherit "human default"
		{level 1
			{distanceset 		0		}
			{distance			35		}	; activation distance
			{delta 				20		}
			{linkBone			"head"	}

			{zoom}
			{vision_modes_active}
			{vignette_recoil 2.75 1.1}		; speed, scale
			{vignette_fade_speed 5}			; factoring the speed at which the vignette fades in/out
			{drop_zoom_on_reload}
			{blur_strength 10}
			{mouse_speed_factor 0.6}
			{ManualAccuracyZoom}

			{camera "human_zoom4"}	; magnification x4
			{scope_vignette "/texture/common/environment/lens_effects/%scope"}
			{blur_mask "/texture/common/environment/lens_effects/zoom_vignette_scope_01_mask"}
			{bump_spec_mask "/texture/common/environment/lens_effects/%scope"}
			{refraction_mask "/texture/common/environment/lens_effects/zoom_vignette_scope_01_bp"}
			{lens_dirt_mask "/texture/common/environment/lens_effects/dirty_lens_scope_01"}
			{vignette_gloss 10}
			{offset 35 2.25 0.75}
			{hide_weapon 1}
			{with_owner
				{viewoff "skin"}
			}
			{with_weapon
				{viewon "foresight3"}
			}
			{hide_crosshair}
			{weapon_sway_active}
			{aimer_type "sniper"}
		}
	}
)
