class CfgPatches {
	class vurtual_m998_gmv {
		units[] = {
		"vurtual_gmv",
		"vurtual_gmv_m2",
		"vurtual_gmv_m134",
		"vurtual_gmv_gau19",
		"vurtual_ammo_gau19"
		};
		weapons[] = {};
		requiredVersion = 0.1;
		author = "vurtual";
		requiredAddons[] = {"vurtual_m998"};
	};
};
#include "sym/acre_pos.hpp"
class CBA_Extended_EventHandlers_base;
class cfgVehicles {
	#include "sym/cfgVehicles.hpp"
	
	class Reammobox_F;
	class vurtual_ammo_gau19: Reammobox_F {
		scope = 2;
		displayName = "Ammo Box (GAU-19)";
		scopeCurator = 2;
		model = "\vurtual_m998_gmv\vurtual_ammo_gau19.p3d";
		class VehicleTransport {
			class Cargo {
				parachuteClass              = "B_Parachute_02_F";
				parachuteHeightLimit        = 5;
				canBeTransported            = 1;
				//dimensions[]                = {"VTV_Base", "VTV_Corner"};
			};
		};
		maximumLoad = 0;
		class EventHandlers {
			class CBA_Extended_EventHandlers: CBA_Extended_EventHandlers_base {};
			init = "[_this select 0] call vurtual_m998_fnc_ammobox_gau";
		};
	};
	class vurtual_gmv: vurtual_hmmwv_base_ecv_a {
		VIVPassengers[] = {2,3,4,5};
		vurtual_base_spares[] = {};
		smokeLauncherAngle = 60;
		smokeLauncherGrenadeCount = 2;
		smokeLauncherOnTurret = 0;
		smokeLauncherVelocity = 14;
		vurtual_hmmwv_carry_litter = 1;
		vurtual_hmmwv_litter_slots[] = {
			{0,"attachto_litter",90}
		};
		vurtual_base_turnffv = 1;
		class AcreRacks: AcreRacks {
			class Rack_1: Rack_1 {
				ACRE_POS_GMV
			};
			class Rack_2: Rack_2 {
				ACRE_POS_GMV
			};
		};
		editorSubcategory = "EdSubCat_hmmwv_ecv_gmv";
		vurtual_base_explosion_hitpoints[] = {
			{"HitARockerL",3,"armor_akit_hide",0},
			{"HitARockerR",3,"armor_akit_hide",0},
			{"HitAUnderbody",30,"armor_akit_hide",0}, //36% total underbody
			{"HitGlass1",2,"",0},
			{"HitGlass2",2,"",0}, //4% front glass
			{"HitDoorL",8,"door_hide",0}, 
			{"HitDoorR",7,"door_hide",0}, //half door with no glass
			{"HitDoorL2",8,"door_hide",0}, 
			{"HitDoorR2",8,"door_hide",0}, 
			{"HitGlass3",2,"door_hide",0},
			{"HitGlass5",2,"door_hide",0},
			{"HitGlass6",2,"door_hide",0}, //3 doors at 10% each, one door at 7%
			{"HitARoof",10,"armor_roof_hide",0}, //10% total
			{"HitACargoL",3,"armor_cargo_hide",0}, //9% total
			{"HitACargoR",3,"armor_cargo_hide",0},
			{"HitATailgate",3,"armor_tailgate_hide",0}
		};
		vurtual_base_explosion_maxarmor = 100; //actually 96, easier than recalculating the explosionShielding factor
		explosionShielding = 0.5;
		fuelCapacity = 95+56.7;
		scope = 2;
		displayName = "M1113 GMV (Mk19)";
		vurtual_hmmwv_addweight = 0;
		model = "\vurtual_m998_gmv\vurtual_gmv.p3d";
		transportSoldier = 0;
		vurtual_hmmwv_windows[] = {{"window_left",0},{"window_right",1}};
		threat[] = {1, 0.3, 0.1};
		class AnimationSources: AnimationSources {
			class spare_hide: spare_hide {
				displayName = "";
				initPhase = 1;
			};
			class ReloadAnim{source="reload";weapon="vurtual_Mk19";};
			class ReloadMagazine{source="reloadmagazine";weapon="vurtual_Mk19";};
			class Revolving{source="revolving";weapon="vurtual_Mk19";};
			class ReloadAnim2{source="reload";weapon="vurtual_m240_veh";};
			class ReloadMagazine2{source="reloadmagazine";weapon="vurtual_m240_veh";};
			class Revolving2{source="revolving";weapon="vurtual_m240_veh";};
			class HitATailgate: HitARockerL { hitpoint = "HitATailgate"; };
			class gmv_hide_ammo {
				source = "user";
				initPhase = 0;
				animPeriod = 0.01;
				displayName = "Hide ammo boxes";
			};
			class gmv_hide_bags {
				source = "user";
				initPhase = 1;
				animPeriod = 0.01;
				displayName = "Hide bags";
			};
			class tailgate_rack_hide {
				source = "user";
				initPhase = 1;
				animPeriod = 0.01;
				displayName = "Remove Tailgate Rack";
			};
			class gmv_hide_weapon1 {
				source = "user";
				initPhase = 1;
				animPeriod = 0.01;
				displayName = "Hide Weapon 1";
			};
			class gmv_hide_weapon2 {
				source = "user";
				initPhase = 1;
				animPeriod = 0.01;
				displayName = "Hide Weapon 2";
			};
			class armor_cargo_hide: armor_cargo_hide {
				displayName = "Remove Cargo Armor";
				forceAnimatePhase = 0;
				forceAnimate[] = {"rails_base_hide",0};
				onPhaseChanged = "(_this select 0) animateSource ['armor_cargo_hide',(_this select 1),true]; if ((_this select 1)==1) then {(_this select 0) animateSource ['armor_tailgate_hide',(_this select 1),true];};";
				mass = -150;
			};
			class armor_tailgate_hide {
				source = "user";
				initPhase = 0;
				animPeriod = 0.1;
				displayName = "Remove Tailgate Armor";
				forceAnimatePhase = 0;
				forceAnimate[] = {"tailgate_hide",1,"armor_cargo_hide",0,"rails_base_hide",0};
				mass = -130;

			};
			class rails_base_hide {
				source = "user";
				initPhase = 0;
				animPeriod = 0.1;
				displayName = "Remove Rear Rails";
				forceAnimatePhase = 1;
				forceAnimate[] = {"armor_cargo_hide",1,"armor_tailgate_hide",1};
			};
			class m240_arm_swing {
				source = "door";
				initPhase = 0;
				animPeriod = 0.2;
			};
			class door_hide: door_hide {
				displayName = "Remove Doors";
			};
			class tailgate_hide: tailgate_hide {
				forceAnimatePhase = 0;
				initPhase = 1;
				forceAnimate[] = {"armor_tailgate_hide",1};
			};
			class armor_akit_hide: armor_akit_hide {
				displayName = "Remove Underbody Armor";
			};
			class armor_roof_hide: armor_roof_hide {
				displayName = "Remove Roof Armor";
			};
			class tailgate_fold: tailgate_fold {};
			class fordingkit_hide: fordingkit_hide {};
			class open_window: open_window {};
			class roof_hide: roof_hide {
				displayName = "Remove Roof";
			};
			class bedseat_fold: bedseat_fold {
				lockCargo[] = {3,4,5,6};
			};
			class GunnerShield_hide: GunnerShield_hide {
				displayName = "Remove Gunner Shield";
			};
		};
		class Hitpoints: Hitpoints {
			class HitATailgate: HitARockerL { armorComponent = "armor_roof"; name = "hit_armor_roof_p"; visual = "armor_roof"; };
		};
		class Turrets: Turrets {
			class MainTurret: MainTurret {};
			class SideTurret: MainTurret {
				class HitPoints {
					/*class HitSideGun {
						isTurret=1;
						isGun=1;
						armor = 0.6;
						material = -1;
						name = "HitSideGun_point";
						visual = "-";
						passThrough=1;
						ArmorComponent="HitSideGun";
					};*/
				};
				gunnerName = "Gunner (M240)";
				weapons[]={"vurtual_m240_veh","vurtual_SmokeLauncher_crows"};
				memoryPointGun="OtocHlaven_2";
				magazines[]={
					"vurtual_200rnd_762x51_box",
					"vurtual_200rnd_762x51_box",
					"vurtual_200rnd_762x51_box",
					"vurtual_200rnd_762x51_box",
					"vurtual_200rnd_762x51_box",
					"vurtual_200rnd_762x51_box",
					"vurtual_SmokeLauncherMag_crows"
				};
				soundServo[]={\ca\wheeled\Data\Sound\servo3, db-80, 1.1};
				gunnerInAction = "passenger_low01";
				gunnerRightHandAnimName = "";
				gunnerDoor = "door_right";
				gunnerLeftHandAnimName = "";
				selectionFireAnim = "muzzleflash2";
				gunnerAction = "passenger_inside_2";
				personTurretAction = "passenger_inside_2";
				animationSourceHatch = "m240_arm_swing";
				commanding = 1;
				primaryGunner = 0;
				minOutElev=-45;
				minOutTurn=-105;
				maxOutTurn=-30;
				primaryObserver = 1;
				discreteDistance[] = {200, 300, 400, 500, 600, 700, 800, 900, 1000, 1100, 1200, 1300, 1400, 1500, 1600, 1700, 1800};
				discreteDistanceInitIndex = 1;
				proxyType = "CPCargo";
				proxyIndex = 1;
				minElev = -18; maxElev = +20;
				minTurn=-183; maxTurn=20;
				gunBeg = "usti hlavne_2";
				gunEnd = "konec hlavne_2";
				body = "SideTurret";
				gun = "SideGun";
				memoryPointGunnerOptics= "gunnerview_2";
				animationSourceBody = "SideTurret";
				animationSourceGun = "SideGun";
				memoryPointsGetInGunner = "pos codriver";
				memoryPointsGetInGunnerDir = "pos codriver dir";
				LODOpticsIn = 1200;
				LODTurnedOut = 1200;
				LODTurnedIn= 1200;
				outGunnerMayFire=1;
				inGunnerMayFire=1;
				startEngine=0;
			};
			class CargoTurret_Passenger_L: CargoTurret_Passenger_L {};
			class CargoTurret_Passenger_R: CargoTurret_Passenger_R {};
			class CargoTurret_Tailgate_L_B: CargoTurret_Tailgate_L_B {
				gunnerCompartments = "Compartment1";
			};
			class CargoTurret_Tailgate_R_B: CargoTurret_Tailgate_R_B {
				gunnerCompartments = "Compartment1";
			};
			class CargoTurret_Tailgate_L: CargoTurret_Tailgate_L {
				gunnerCompartments = "Compartment1";
				proxyIndex = 6;
			};
			class CargoTurret_Tailgate_R: CargoTurret_Tailgate_R {
				gunnerCompartments = "Compartment1";
				proxyIndex = 7;
			};
		};
	};
	class vurtual_gmv_gau19: vurtual_gmv {
		scope = 2;
		threat[] = {1, 0.3, 0.5};
		displayName = "M1113 GMV (GAU-19)";
		model = "\vurtual_m998_gmv\vurtual_gmv_gau19.p3d";
		class Turrets: Turrets {
			class MainTurret: MainTurret {
				gunBeg = "muzzle";	// endpoint of the gun
				gunEnd = "chamber";	// chamber of the gun
				weapons[]={"vurtual_GAU19"};
				magazines[] = {"vurtual_900Rnd_127x99_belt","vurtual_900Rnd_127x99_belt","vurtual_900Rnd_127x99_belt"};
				gunnerName = "Gunner (GAU-19)";
				discreteDistance[] = {300};
				discreteDistanceInitIndex = 0;
			};
			class SideTurret: SideTurret {};
			class CargoTurret_Passenger_L: CargoTurret_Passenger_L {};
			class CargoTurret_Passenger_R: CargoTurret_Passenger_R {};
			class CargoTurret_Tailgate_L: CargoTurret_Tailgate_L {};
			class CargoTurret_Tailgate_R: CargoTurret_Tailgate_R {};
			class CargoTurret_Tailgate_L_B: CargoTurret_Tailgate_L_B {};
			class CargoTurret_Tailgate_R_B: CargoTurret_Tailgate_R_B {};
		};
		class AnimationSources: AnimationSources {
			class Gatling {
				source = "revolving";
				weapon = "vurtual_gau19";
			};
			class bedseat_fold: bedseat_fold {};
			class fordingkit_hide: fordingkit_hide {};
			class door_hide: door_hide {};
			class tailgate_hide: tailgate_hide {};
			class rails_base_hide: rails_base_hide {};
			class armor_tailgate_hide: armor_tailgate_hide {};
			class armor_cargo_hide: armor_cargo_hide {};
			class armor_roof_hide: armor_roof_hide {};
			class roof_hide: roof_hide {};
			class tailgate_fold: tailgate_fold {};
			class open_window: open_window {};

		};
	};
	class vurtual_gmv_m134: vurtual_gmv {
		scope = 2;
		threat[] = {1, 0.1, 0.3};
		displayName = "M1113 GMV (M134)";
		model = "\vurtual_m998_gmv\vurtual_gmv_m134.p3d";
		class AnimationSources: AnimationSources {
			class Gatling {
				source = "revolving";
				weapon = "vurtual_m134";
			};
			class bedseat_fold: bedseat_fold {};
			class fordingkit_hide: fordingkit_hide {};
			class door_hide: door_hide {};
			class tailgate_hide: tailgate_hide {};
			class rails_base_hide: rails_base_hide {};
			class armor_tailgate_hide: armor_tailgate_hide {};
			class armor_cargo_hide: armor_cargo_hide {};
			class armor_roof_hide: armor_roof_hide {};
			class roof_hide: roof_hide {};
			class tailgate_fold: tailgate_fold {};
			class open_window: open_window {};

		};
		class Turrets: Turrets {
			class MainTurret: MainTurret {
				gunBeg = "muzzle";	// endpoint of the gun
				gunEnd = "chamber";	// chamber of the gun
				weapons[]={"vurtual_M134"};
				magazines[] = {"vurtual_2000Rnd_762x51_belt"};
				gunnerName = "Gunner (M134)";
				discreteDistance[] = {300};
				discreteDistanceInitIndex = 0;
			};
			class SideTurret: SideTurret {};
			class CargoTurret_Passenger_L: CargoTurret_Passenger_L {};
			class CargoTurret_Passenger_R: CargoTurret_Passenger_R {};
			class CargoTurret_Tailgate_L: CargoTurret_Tailgate_L {};
			class CargoTurret_Tailgate_R: CargoTurret_Tailgate_R {};
			class CargoTurret_Tailgate_L_B: CargoTurret_Tailgate_L_B {};
			class CargoTurret_Tailgate_R_B: CargoTurret_Tailgate_R_B {};
		};
	};
	class vurtual_gmv_m2: vurtual_gmv {
		scope = 2;
		threat[] = {1, 0.1, 0.3};
		displayName = "M1113 GMV (M2)";
		model = "\vurtual_m998_gmv\vurtual_gmv_m2.p3d";
		class AnimationSources:AnimationSources {
			class ReloadAnim{source="reload";weapon="vurtual_M2";};
			class ReloadMagazine{source="reloadmagazine";weapon="vurtual_M2";};
			class Revolving{source="revolving";weapon="vurtual_M2";};
			class bedseat_fold: bedseat_fold {};
			class fordingkit_hide: fordingkit_hide {};
			class door_hide: door_hide {};
			class tailgate_hide: tailgate_hide {};
			class rails_base_hide: rails_base_hide {};
			class armor_tailgate_hide: armor_tailgate_hide {};
			class armor_cargo_hide: armor_cargo_hide {};
			class armor_roof_hide: armor_roof_hide {};
			class roof_hide: roof_hide {};
			class tailgate_fold: tailgate_fold {};
			class open_window: open_window {};

		};
		class Turrets: Turrets {
			class MainTurret: MainTurret {
				weapons[]={"vurtual_M2"};
				magazines[] = {
					"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow",
					"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow",
					"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow",
					"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow",
					"100Rnd_127x99_mag_Tracer_Yellow","100Rnd_127x99_mag_Tracer_Yellow",
					"100Rnd_127x99_mag_Tracer_Yellow"
					};
				gunnerName = "Gunner (M2)";
				discreteDistance[] = {100, 200, 300, 400, 500, 600, 700, 800, 900, 1000, 1200, 1500};
				discreteDistanceInitIndex = 2;
			};
			class SideTurret: SideTurret {};
			class CargoTurret_Passenger_L: CargoTurret_Passenger_L {};
			class CargoTurret_Passenger_R: CargoTurret_Passenger_R {};
			class CargoTurret_Tailgate_L: CargoTurret_Tailgate_L {};
			class CargoTurret_Tailgate_R: CargoTurret_Tailgate_R {};
			class CargoTurret_Tailgate_L_B: CargoTurret_Tailgate_L_B {};
			class CargoTurret_Tailgate_R_B: CargoTurret_Tailgate_R_B {};
		};
	};
};
