// ============================================================================
//						States / Rtm Functions
// ============================================================================ 
// Functions used to declare RTMs

		class DefaultBase:Default // this class is used to overwrite the default settings
			{
				preload=0;
				duty=-1;
				speed=10000000000.0;
				looped=0;
				soundEnabled=0;
			};
			
		class DyingBase:DefaultBase
		{
			actions="NoActions";
			looped=0;
			limitGunMovement=0;
			Aiming=AimingNo;
			legs=legsNo;
			head=headNo;
			disableWeapons=true;
			interpolationRestart=true;
			soundOverride="fallbody";
		};
			
		class DeadBase:DyingBase
		{
			actions="DeadActions";
			looped=1;
			onLandBeg=1;
			onLandEnd=1;
			soundEnabled=0;
			variantAfter[]={0,0,0};
			terminal=1;
			connectTo[]={"DeadState",10};
		};
		
	// ============================================================================
	//						Stance Constants
	// ============================================================================ 
		
	// function to declare all constants of an rtm file
		#define RTM_CONST_ALL(AimConst,State,Stance,CName,RtmName,AnimSpeed,SoundEdge1,SoundEdge2,SoundType,soundEnabled,StanceConstants,BaseClass) \
		class RTM_##State##Stance##CName##:##BaseClass## \
		{ \
			file=\ECA_Anims\##State##\##Stance##\##RtmName##.rtm; \
			speed=##AnimSpeed##; \
			soundEdge1=##SoundEdge1##; \
			soundEdge2=##SoundEdge2##; \
			soundOverride=##SoundType##; \
			soundEnabled=##soundEnabled##; \
			StanceConstants \
			AimConst\
		};

	// all stances
	// Dying start anims
		// static anim
		#define RTM_STATICALL(AimConst,State,Stance,Name,StanceConstants,BaseClass) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name,1e10,,,,0,StanceConstants,BaseClass)
		// Dying start anim
		#define RTM_DYINGSTART(AimConst,State,Stance,Name,StanceConstants) \
			RTM_STATICALL(AimConst,State,Stance,Name,StanceConstants,DyingBase)
		// Dying anims
		#define RTM_DYING(AimConst,State,Stance,Name,AnimSpeed,SoundEdge1,SoundEdge2,StanceConstants) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name,AnimSpeed,SoundEdge1,SoundEdge2,fallbody,1,StanceConstants,DyingBase)
		// Dead anims
		#define RTM_DEAD(AimConst,State,Stance,Name,StanceConstants) \
			RTM_STATICALL(AimConst,State,Stance,Name,StanceConstants,DeadBase)
		// static anims
		#define RTM_STATIC(AimConst,State,Stance,Name,StanceConstants) \
			RTM_STATICALL(AimConst,State,Stance,Name,StanceConstants,DefaultBase)
		// looped anims
		#define RTM_LOOP(AimConst,State,Stance,Name,AnimSpeed,StanceConstants) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name,AnimSpeed,,,,1,StanceConstants,DefaultBase)
		// dynamic anim (not looped)
		#define RTM_DYNAMIC(AimConst,State,Stance,Name,AnimSpeed,StanceConstants) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name,AnimSpeed,,,,0,StanceConstants,DefaultBase)
		// lying down anims (for example standto crouch)
		#define RTM_GETDOWN(AimConst,State,Stance,Name,AnimSpeed,SoundEdge1,SoundEdge2,StanceConstants) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name,AnimSpeed,SoundEdge1,SoundEdge2,laydown,1,StanceConstants,DefaultBase)
		// standing up anims (for example crouch to stand)
		#define RTM_GETUP(AimConst,State,Stance,Name,AnimSpeed,SoundEdge1,SoundEdge2,StanceConstants) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name,AnimSpeed,SoundEdge1,SoundEdge2,standup,1,StanceConstants,DefaultBase)
		// dynamic with sound (ex : run anims)
		#define RTM_DYNAMICSND(AimConst,State,Stance,Name,AnimSpeed,Sound,StanceConstants) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name,AnimSpeed,,,Sound,1,StanceConstants,DefaultBase)
		// dynamic with sound 2 (anim reuse at different speed ex : sprint anims)
		#define RTM_DYNAMICSND2(AimConst,State,Stance,Name,Name2,AnimSpeed,Sound,StanceConstants) \
			RTM_CONST_ALL(AimConst,State,Stance,Name,Name2,AnimSpeed,,,Sound,1,StanceConstants,DefaultBase)
			
		// Run anims
		#define RTM_RUN(AimConst,State,Stance,SpeedF,SpeedB,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunRF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunLF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunR,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunL,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunRB,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunLB,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunB,SpeedB,,StanceConstants)
		// Run aim anims
		#define RTM_RUNAIM(AimConst,State,Stance,SpeedF,SpeedB,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimRF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimLF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimR,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimL,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimRB,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimLB,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,RunAimB,SpeedB,,StanceConstants)
		// Walk anims
		#define RTM_WALK(AimConst,State,Stance,SpeedF,SpeedB,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkRF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkLF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkR,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkL,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkRB,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkLB,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,WalkB,SpeedB,,StanceConstants)
		// Crawl anims
		#define RTM_CRAWL(AimConst,State,Stance,SpeedFF,SpeedF,SpeedB,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlFastF,SpeedFF,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlF,SpeedF,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlRF,SpeedF,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlLF,SpeedF,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlR,SpeedB,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlL,SpeedB,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlRB,SpeedB,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlLB,SpeedB,crawl,StanceConstants) \
			RTM_DYNAMICSND(AimConst,State,Stance,CrawlB,SpeedB,crawl,StanceConstants)
		// Sprint Anims
		#define RTM_SPRINT(AimConst,State,Stance,SpeedF,SpeedB,StanceConstants) \
			RTM_DYNAMICSND2(AimConst,State,Stance,SprintF,RunF,SpeedF,,StanceConstants) \
			RTM_DYNAMICSND2(AimConst,State,Stance,SprintRF,RunRF,SpeedB,,StanceConstants) \
			RTM_DYNAMICSND2(AimConst,State,Stance,SprintLF,RunLF,SpeedB,,StanceConstants)
			
	// Stand
	#define StcConst1 \
		AimPrecision=1;
	#define RunFspeed -0.6
	#define RunBspeed -0.7
	#define RunAimFspeed -0.6
	#define RunAimBspeed -0.7
	#define WalkFspeed -0.8
	#define WalkBspeed -0.8
	#define SprintFspeed -0.4
	#define SprintBspeed -0.45
	
		#define RTM_STAND_DYINGSTART(AimConst,Stt,Name) \
			RTM_DYINGSTART(AimConst,Stt,Stand,Name,StcConst1)
		#define RTM_STAND_DYING(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_DYING(AimConst,Stt,Stand,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst1)
		#define RTM_STAND_DEAD(AimConst,Stt,Name) \
			RTM_DEAD(AimConst,Stt,Stand,Name,StcConst1)
		#define RTM_STAND_STATIC(AimConst,Stt,Name) \
			RTM_STATIC(AimConst,Stt,Stand,Name,StcConst1)
		#define RTM_STAND_LOOP(AimConst,Stt,Name,AnimSpeed) \
			RTM_LOOP(AimConst,Stt,Stand,Name,AnimSpeed,StcConst1)
		#define RTM_STAND_DYNAMIC(AimConst,Stt,Name,AnimSpeed) \
			RTM_DYNAMIC(AimConst,Stt,Stand,Name,AnimSpeed,StcConst1)
		#define RTM_STAND_GETDOWN(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_GETDOWN(AimConst,Stt,Stand,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst1)
		#define RTM_STAND_GETUP(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_GETUP(AimConst,Stt,Stand,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst1)
		#define RTM_STAND_RUN(AimConst,Stt) \
			RTM_RUN(AimConst,Stt,Stand,RunFspeed,RunBspeed,StcConst1) \
			RTM_SPRINT(AimConst,Stt,Stand,SprintFspeed,SprintBspeed,StcConst1)
		#define RTM_STAND_RUNFVAR(AimConst,Stt,NameRun,NameSprint) \
			RTM_DYNAMIC(AimConst,Stt,Stand,NameRun,RunFspeed,StcConst1) \
			RTM_DYNAMICSND2(AimConst,Stt,Stand,NameSprint,NameRun,SprintFspeed,,StcConst1)
		#define RTM_STAND_RUNAIM(AimConst,Stt) \
			RTM_RUNAIM(AimConst,Stt,Stand,RunAimFspeed,RunAimBspeed,StcConst1)
		#define RTM_STAND_WALK(AimConst,Stt) \
			RTM_WALK(AimConst,Stt,Stand,WalkFspeed,WalkBspeed,StcConst1)
		#define RTM_STAND_WALKFVAR(AimConst,Stt,Name) \
			RTM_DYNAMIC(AimConst,Stt,Stand,Name,WalkFspeed,StcConst1)

	// Crouch
	#define StcConst2 \
		visibleSize=0.6; \
		AimPrecision=0.5; \
		recoilSuffix=halffixed;
	#define RunFspeed -0.6
	#define RunBspeed -0.7
	#define RunAimFspeed -0.6
	#define RunAimBspeed -0.7
	#define WalkFspeed -0.8
	#define WalkBspeed -0.8
	#define SprintFspeed -0.4
	#define SprintBspeed -0.45
	
		#define RTM_CROUCH_DYINGSTART(AimConst,Stt,Name) \
			RTM_DYINGSTART(AimConst,Stt,Crouch,Name,StcConst2)
		#define RTM_CROUCH_DYING(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_DYING(AimConst,Stt,Crouch,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst2)
		#define RTM_CROUCH_DEAD(AimConst,Stt,Name) \
			RTM_DEAD(AimConst,Stt,Crouch,Name,StcConst2)
		#define RTM_CROUCH_STATIC(AimConst,Stt,Name) \
			RTM_STATIC(AimConst,Stt,Crouch,Name,StcConst2)
		#define RTM_CROUCH_LOOP(AimConst,Stt,Name,AnimSpeed) \
			RTM_LOOP(AimConst,Stt,Crouch,Name,AnimSpeed,StcConst2)
		#define RTM_CROUCH_DYNAMIC(AimConst,Stt,Name,AnimSpeed) \
			RTM_DYNAMIC(AimConst,Stt,Crouch,Name,AnimSpeed,StcConst2)
		#define RTM_CROUCH_GETDOWN(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_GETDOWN(AimConst,Stt,Crouch,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst2)
		#define RTM_CROUCH_GETUP(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_GETUP(AimConst,Stt,Crouch,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst2)
		#define RTM_CROUCH_RUN(AimConst,Stt) \
			RTM_RUN(AimConst,Stt,Crouch,RunFspeed,RunBspeed,StcConst2) \
			RTM_SPRINT(AimConst,Stt,Crouch,SprintFspeed,SprintBspeed,StcConst2)
		#define RTM_CROUCH_RUNFVAR(AimConst,Stt,NameRun,NameSprint) \
			RTM_DYNAMIC(AimConst,Stt,Crouch,NameRun,RunFspeed,StcConst2) \
			RTM_DYNAMICSND2(AimConst,Stt,Crouch,NameSprint,NameRun,SprintFspeed,,StcConst2)
		#define RTM_CROUCH_RUNAIM(AimConst,Stt) \
			RTM_RUNAIM(AimConst,Stt,Crouch,RunAimFspeed,RunAimBspeed,StcConst2)
		#define RTM_CROUCH_WALK(AimConst,Stt) \
			RTM_WALK(AimConst,Stt,Crouch,WalkFspeed,WalkBspeed,StcConst2)
		#define RTM_CROUCH_WALKFVAR(AimConst,Stt,Name) \
			RTM_DYNAMIC(AimConst,Stt,Crouch,Name,WalkFspeed,StcConst2)

	// Lying
	#define StcConst3 \
		visibleSize=0.25; \
		AimPrecision=0.3; \
		onLandBeg=1; \
		onLandEnd=1; \
		recoilSuffix=fixed;
	#define CrawlFFspeed -0.5
	#define CrawlFspeed -0.6
	#define CrawlBspeed -0.7

		#define RTM_LYING_DYINGSTART(AimConst,Stt,Name) \
			RTM_DYINGSTART(AimConst,Stt,Lying,Name,StcConst3)
		#define RTM_LYING_DYING(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_DYING(AimConst,Stt,Lying,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst3)
		#define RTM_LYING_DEAD(AimConst,Stt,Name) \
			RTM_DEAD(AimConst,Stt,Lying,Name,StcConst3)
		#define RTM_LYING_STATIC(AimConst,Stt,Name) \
			RTM_STATIC(AimConst,Stt,Lying,Name,StcConst3)
		#define RTM_LYING_LOOP(AimConst,Stt,Name,AnimSpeed) \
			RTM_LOOP(AimConst,Stt,Lying,Name,AnimSpeed,StcConst3)
		#define RTM_LYING_DYNAMIC(AimConst,Stt,Name,AnimSpeed) \
			RTM_DYNAMIC(AimConst,Stt,Lying,Name,AnimSpeed,StcConst3)
		#define RTM_LYING_GETDOWN(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_GETDOWN(AimConst,Stt,Lying,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst3)
		#define RTM_LYING_GETUP(AimConst,Stt,Name,AnimSpeed,SoundEdge1,SoundEdge2) \
			RTM_GETUP(AimConst,Stt,Lying,Name,AnimSpeed,SoundEdge1,SoundEdge2,StcConst3)
		#define RTM_LYING_CRAWL(AimConst,Stt) \
			RTM_CRAWL(AimConst,Stt,Lying,CrawlFFspeed,CrawlFspeed,CrawlBspeed,StcConst3)
