// solider moves diagram - MotionCapture sources

// define default action sets

enum ManAction
{
	#define ACTION(x) ManAct##x,
	#include "cfgmoves/manActions.hpp"
	#undef ACTION
	ManActN // count of enum values
};

enum ManPos
{
	ManPosDead,			// 0
	ManPosWeapon, 		// 1 special weapon - AT
	ManPosBinocLying,	// 2
	ManPosLyingNoWeapon,// 3
	ManPosLying,		// 4
	ManPosHandGunLying,	// 5
	ManPosCrouch,		// 6
	ManPosHandGunCrouch,// 7
	ManPosCombat,		// 8
	ManPosHandGunStand,	// 9
	ManPosStand, 		// 10 moves with weapon on the back
	ManPosNoWeapon, 	// 11 civilian moves
	ManPosBinoc, 		// 12 binocular position
	ManPosBinocStand 	// 13 binocular position (weapon on back)
};

#define RunDuty -0.5
#define WalkDuty -0.7
#define RestDuty -1
#define CrawlDuty -0.0
#define SprintDuty 0.6

#define SPEED_STATIC 1e10


#include "cfgmoves/manVehActions.hpp"

class CfgManActions
{
	access = ReadOnlyVerified;

	#define ACTION(x) x="";
	#include "cfgmoves/manActions.hpp"
	#undef ACTION
};

#define BipodRestrict 0.35
class CfgMovesMC
{
	access = ReadAndCreate;
	vehicleActions=CfgVehicleActions;
	class Actions
	{
		#include "cfgmoves/Actions.hpp"
		// *******************************************************************************************************
		// 									BIS compability actions
		// *******************************************************************************************************
		class WeaponActions:ATCrouchActions{access=3;};
		class CombatActions:RifleStandActions{access=3;};
		class CrouchActions:RifleCrouchActions{access=3;};	
		class LyingActions:RifleLyingActions{access=3;};


		//class StandActions:RifleSafeStandActions{access=3;};
		class StandActions: NoActions
		{
			access=3;
		
			stop="CivilStand";
			default = "CivilStand";

			weaponOn="ATSafeStand";
			//weaponOff="Stand";

			binocOn="CivilBinocStand"
			//binocOff="Stand"

			handGunOn="PistolStand";

			//strokeFist = "StandStrokeFist";
			//strokeGun = "";

			lying="RifleLying";
			combat="RifleStand";
			crouch="RifleCrouch";
			stand="RifleSafeStand";
			civil="CivilStand";
			civilLying="CivilLying";
			//fireNotPossible="Combat";

			throwGrenade="StandThrowGrenadeStart";


			turnSpeed = 4;
			limitFast = 2.5;

			die="StandDead";

			upDegree=ManPosStand;
		};
		class CivilActions:CivilStandActions{access=3;};
		class HandGunCrouchActions:PistolCrouchActions{access=3;};
		class HandGunLyingActions:PistolLyingActions{access=3;};
		class HandGunStandActions:PistolStandActions{access=3;};
	};
	class BlendAnims
	{
		// different ways to blend animations (head, arms, legs...)
		AimingDefault[]=
		{
			hlava,1,krk,1,
			zbran,1,roura,1,
			lrameno,1,prameno,1,
			lbiceps,1,lloket,1,lruka,1,
			pbiceps,1,ploket,1,pruka,1,
			hrudnik,0.9,zebra,0.5,bricho,0.2
		};
		AimingPistol[]=
		{
			hlava,1,krk,1,
			//zbran,1,roura,1,
			//lrameno,1,
			prameno,1,
			//lbiceps,1,lloket,1,lruka,1,
			pbiceps,1,ploket,1,pruka,1,
			hrudnik,0.9,zebra,0.5,bricho,0.2
		};
		AimingBipod[]=
		{
			hlava,BipodRestrict,krk,BipodRestrict,
			zbran,BipodRestrict, roura,BipodRestrict,
			lrameno,BipodRestrict,prameno,BipodRestrict,
			lbiceps,BipodRestrict,lloket,BipodRestrict,lruka,BipodRestrict,
			pbiceps,BipodRestrict,ploket,BipodRestrict,pruka,BipodRestrict
		//	hrudnik,0.9,zebra,0.5,bricho,0.2
		};
		legsDefault[]=
		{
			lprsty,1,pprsty,1,
			lchodidlo,1,pchodidlo,1,
			lholen,0.95,pholen,0.95,
			lstehno,0.9,pstehno,0.9,
			lzadek,0.5,pzadek,0.5
		};
		headDefault[]=
		{
			hlava,1,krk,0.5
			//lrameno,0.1,prameno,0.1,
			//hrudnik,0.2
		};
		AimingLying[]=
		{
			hlava,1,krk,0.9,
			lrameno,0.5,prameno,0.5,
			hrudnik,0.8,zebra,0.5
		};
		AimingNo[]={};
		legsNo[]={};
		headNo[]={};
	};

	class Default // default state
	{
		access = ReadOnlyVerified;

		actions = "RifleSafeStandActions"; // was StandActions
		file=""; // default - no file
		looped=true;
		speed=0.5;
		disableWeapons=false;
		enableOptics=true; // note: this is tested only when disableWeapons is false
		disableWeaponsLong=false;
		showWeaponAim=true;
		enableMissile = false;
		enableBinocular = false;
		showItemInHand = false;
		showItemInRightHand = false;
		showHandGun = false;
		onLandBeg=false;
		onLandEnd=false;
		onLadder=false;
		duty=-0.5;

		visibleSize = 1;
		AimPrecision = 1; // default is 1
		recoilSuffix = "";

		relSpeedMin=1.0;
		relSpeedMax=1.0;
		soundEnabled=true;
		soundOverride=""; // default - no override
		soundEdge1=0.5;soundEdge2=1; // in what relative positions sound should start
		terminal = false; // all movement stops here
		limitGunMovement=1;
		variantsPlayer[]={}; // variants for player
		variantsAI[]={""}; // variants for AI - default is to use players variants
		equivalentTo=""; // whioch move is this variant of
		connectAs=""; // connection same as some other state
		variantAfter[]={5,10,20}; // min, mid, max: time after which variant should be run

		connectFrom[]={}; // after which state may be this one played
		connectTo[]={}; // which state may be played after this one
		interpolateWith[]={}; // which states may we interpolate with
		interpolateTo[]={}; // which states may we interpolate with
		interpolateFrom[]={}; // which states may we interpolate with

		Aiming = AimingDefault;
		legs = legsDefault;
		head = headDefault;

		interpolationSpeed=6; // inverse of interpolation time
		interpolationRestart=false;

		// only some animations need to be resident 
		preload = false;
	};

	class DefaultDie: Default
	{
		limitGunMovement=0;
		Aiming=AimingNo;
		legs=legsNo; // all animation copies slope
		head=headNo;
		disableWeapons=true;
		interpolationRestart=true;
		soundOverride="fallbody";
		soundEdge1=0.45;soundEdge2=0.45;
	};
	class States
		{
			#include "cfgmoves/States.hpp"
			// #include "cfgmoves/StatesFx.hpp" complete FX connections, actions and baseclass first
			// ============================================================================
			//						BIS compatibility states
			// ============================================================================ 

			class Combat:RifleStand{access=3;};
			class Crouch:RifleCrouch{access=3;};	
			class Lying:RifleLying{access=3;};
			class Stand:RifleSafeStand{access=3;};
			//class Civil:CivilStand{access=3;};
			class Weapon:ATCrouch{access=3;};
			class HandGunCrouch:PistolCrouch{access=3;};
			class HandGunLying:PistolLying{access=3;};
			class HandGunStand:PistolStand{access=3;};

		};
	class Interpolations
	{

		cargoEquiv[]=
		{
			2,
			M113Gunner,M113Driver,M113DriverOut,
			M60Gunner,M60Driver,M60DriverOut,M60Commander,M60CommanderOut,
			M1A1Gunner,M1A1Driver,M1A1DriverOut,M1A1Commander,
			Cargo
		};
		cargoVars[]={0.1,Cargo,CargoVer1,CargoVer2,CargoVer3,CargoVer4,CargoVer5};
		sitDownVars[]={1.0,EffectStandSitDown,EffectStandSitDownVer2,EffectStandSitDownVer1};
	};

	transitionsInterpolated[]=
	{

	};
	transitionsSimple[]=
	{
		// from, to, cost
		
		// these direct connections are here so the soldier can start in the right state at the start of the mission.
		CivilStand, PistolStand, 2, PistolStand, CivilStand, 2,
		CivilStand, PistolSafeStand, 2, PistolSafeStand, CivilStand, 2,
		CivilCrouch, ATCrouch, 2, //ATStand, CivilStand, 2,
		CivilStand, ATSafeStand, 2, //ATSafeStand, CivilStand, 2,
		CivilStand, RifleStand, 2, RifleStand, CivilStand, 2,
		CivilStand, RifleSafeStand, 2, RifleSafeStand, CivilStand, 2,
		
		// Direct connection for neutral states
		CivilStand, CivilNeutralStand, 2, CivilNeutralStand, CivilStand, 2,
		CivilCrouch, CivilNeutralCrouch, 2, CivilNeutralCrouch, CivilCrouch, 2,
		CivilLying, CivilNeutralLying, 2, CivilNeutralLying, CivilLying, 2,
		PistolSafeStand, PistolSafeNeutralStand, 2, PistolSafeNeutralStand, PistolSafeStand, 2,
		PistolSafeCrouch, PistolSafeNeutralCrouch, 2, PistolSafeNeutralCrouch, PistolSafeCrouch, 2
	};
	transitionsDisabled[]=
	{

	};
};

