// solider moves diagram - MotionCapture sources

// define default action sets

// Defines
//#include "cfgmoves/constants.hpp"
#define cpdriver		0
#define cpgunner		1
#define cpcommander		2
#define cpcargo			3

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/ActionsFunctions.hpp"
		#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="ATCrouch";
			//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"

			// ============================================================================
			//						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;};
			
			// BIS vehicle anim config
			#include "cfgmoves/StatesBISvehicles.hpp"
		};
	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,1,//PistolStand,CivilStand,5,
		CivilStand,PistolSafeStand,1,//PistolSafeStand,CivilStand,5,
		CivilStand,ATCrouch,1,//ATCrouch,CivilStand,5,
		CivilStand,ATSafeStand,1,//ATSafeStand,CivilStand,5,
		CivilStand,RifleStand,1,//RifleStand,CivilStand,5,
		CivilStand,RifleSafeStand,1,//RifleSafeStand,CivilStand,5,
		
		// Direct connection for neutral states
		CivilStand,CivilStandNeutral,2,CivilStandNeutral,CivilStand,2,
		CivilCrouch,CivilCrouchNeutral,2,CivilCrouchNeutral,CivilCrouch,2,
		CivilLying,CivilLyingNeutral,2,CivilLyingNeutral,CivilLying,2,
		PistolSafeStand,PistolSafeStandNeutral,2,PistolSafeStandNeutral,PistolSafeStand,2,
		PistolSafeCrouch,PistolSafeCrouchNeutral,2,PistolSafeCrouchNeutral,PistolSafeCrouch,2
		
		,
		// temporary direct connect till transitions are coded
		// AT Pistol
		ATPistolStand,ATPistolStandNeutral,2,ATPistolStandNeutral,ATPistolStand,2,
		ATPistolCrouch,ATPistolCrouchNeutral,2,ATPistolCrouchNeutral,ATPistolCrouch,2,
		ATPistolLying,ATPistolLyingNeutral,2,ATPistolLyingNeutral,ATPistolLying,2,
		
		// AT safe
		ATSafeStand,ATSafeStandNeutral,2,ATSafeStandNeutral,ATSafeStand,2,
		ATSafeCrouch,ATSafeCrouchNeutral,2,ATSafeCrouchNeutral,ATSafeCrouch,2,
		ATSafeLying,ATSafeLyingNeutral,2,ATSafeLyingNeutral,ATSafeLying,2,
		
		// Pistol
		PistolStand,PistolStandNeutral,2,PistolStandNeutral,PistolStand,2,
		PistolCrouch,PistolCrouchNeutral,2,PistolCrouchNeutral,PistolCrouch,2,
		PistolLying,PistolLyingNeutral,2,PistolLyingNeutral,PistolLying,2,
		
		// Rifle
		RifleStand,RifleStandNeutral,2,RifleStandNeutral,RifleStand,2,
		RifleCrouch,RifleCrouchNeutral,2,RifleCrouchNeutral,RifleCrouch,2,
		RifleLying,RifleLyingNeutral,2,RifleLyingNeutral,RifleLying,2,
		
		// RiflePistol
		RiflePistolStand,RiflePistolStandNeutral,2,RiflePistolStandNeutral,RiflePistolStand,2,
		RiflePistolCrouch,RiflePistolCrouchNeutral,2,RiflePistolCrouchNeutral,RiflePistolCrouch,2,
		RiflePistolLying,RiflePistolLyingNeutral,2,RiflePistolLyingNeutral,RiflePistolLying,2,
		
		// RifleSafe
		RifleSafeStand,RifleSafeStandNeutral,2,RifleSafeStandNeutral,RifleSafeStand,2,
		RifleSafeCrouch,RifleSafeCrouchNeutral,2,RifleSafeCrouchNeutral,RifleSafeCrouch,2

	};
	transitionsDisabled[]=
	{

	};
};

