#ifndef WAG2_CLIENTDATA_GAME_H
#define WAG2_CLIENTDATA_GAME_H

//--------------------------------------------------------------------------------

#include "../../Shared/MOS/Classes/GameWorld/WAnimGraph2Instance/WAG2_ClientData.h"
#include "../../Shared/MOS/Classes/GameWorld/WAnimGraph2Instance/WAG2I.h"
#include "../../Shared/MOS/Classes/GameWorld/WObjects/WObj_Damage.h"

#include "WRPG/WRPGDef.h"
//#include "../../Shared/MOS/Classes/GameWorld/WObjects/WObj_AutoVar.h"

enum
{
	AG2_TOKEN_MAIN = 0,
	AG2_TOKEN_EFFECT = 2,
	AG2_TOKEN_UNEQUIP = 3,
};

enum
{
	AG2_IMPULSETYPE_BEHAVIOR = 0,
	AG2_IMPULSETYPE_RESPONSE = 1,
	AG2_IMPULSETYPE_CONTROLMODE = 2,
	AG2_IMPULSETYPE_WEAPONTYPE = 3,
	AG2_IMPULSETYPE_ACTIONCUTSCENE = 4,
	AG2_IMPULSETYPE_ITEMACTION = 5,
	AG2_IMPULSETYPE_DIALOG = 6,
	AG2_IMPULSETYPE_LADDERMOVE = 7,
	AG2_IMPULSETYPE_HURT = 8,
	AG2_IMPULSETYPE_SIDESTEP = 9,
	AG2_IMPULSETYPE_BUMP = 10,
	AG2_IMPULSETYPE_JUMP = 11,
	AG2_IMPULSETYPE_DIALOGMOOD = 12,
	AG2_IMPULSETYPE_DIALOGGESTURE = 13,
	AG2_IMPULSETYPE_GAMEPLAY = 14,
	AG2_IMPULSETYPE_BEHAVIORCONTROL = 15,
	AG2_IMPULSETYPE_MOVEVAR = 16,
	AG2_IMPULSETYPE_GUNPLAY = 17,
	AG2_IMPULSETYPE_FACIAL = 18,
	AG2_IMPULSETYPE_GLANCE = 19,
	AG2_IMPULSETYPE_SHORTGESTURE = 20,
	AG2_IMPULSETYPE_SHOOTGESTURE = 21,
	AG2_IMPULSETYPE_DIALOGTYPE = 22,
	AG2_IMPULSETYPE_LEDGE = 23,
	AG2_IMPULSETYPE_WALKSTAIR = 24,
};

enum
{
	AG2_WANTEDBEHAVIORFLAG_MASKTYPE	= 0x8000,

	AG2_STATEFLAG_AIIDLE				= 0x01000000,

	AG2_STATEFLAG_BEHAVIORACTIVE		= 0x00000001,

	AG2_STATEFLAG_USETURNCORRECTION		= 0x00000002,
	AG2_STATEFLAG_APPLYTURNCORRECTION	= 0x00000004,
	AG2_STATEFLAG_APPLYFIGHTCORRECTION	= 0x00000008,

	AG2_STATEFLAG_NOCHARCOLL			= 0x00000010,
	AG2_STATEFLAG_NOITEMRENDERSECONDARY	= 0x00000020,
	AG2_STATEFLAG_CANDISABLEREFRESH		= 0x00000040,
	AG2_STATEFLAG_HURTACTIVE			= 0x00000080,
	AG2_STATEFLAG_EFFECTOKENACTIVE		= 0x00000100,
	AG2_STATEFLAG_BLOCKACTIVE			= 0x00000200,
	AG2_STATEFLAG_EQUIPPING				= 0x00000400,
	AG2_STATEFLAG_NOLOOK				= 0x00000800,
	AG2_STATEFLAG_JUMPACTIVE			= 0x00001000,
	AG2_STATEFLAG_RELOADING				= 0x00002000,
	// When not in controlmode animation
	AG2_STATEFLAG_NOBLENDOUT			= 0x00004000,
	AG2_STATEFLAG_MOVADVADJUST			= 0x00008000,
	// We want special handling of this animation
	AG2_STATEFLAG_BEHAVIORENTER			= 0x00010000,
	AG2_STATEFLAG_BEHAVIOREXIT			= 0x00020000,
	AG2_STATEFLAG_LADDERSTEPADJUST		= 0x00040000,
	AG2_STATEFLAG_NOCOLLISION			= 0x00080000,
	AG2_STATEFLAG_DISABLEBREAKOUT		= 0x00100000,
	AG2_STATEFLAG_BEHAVIOR_IKLOOK		= 0x00200000,
	AG2_STATEFLAG_EXPANDVISBOX			= 0x00400000,
	AG2_STATEFLAG_MOVEEFFECTACTIVE		= 0x00800000,
	AG2_STATEFLAG_LAYERADJUSTFOROFFSET	= 0x01000000,
	AG2_STATEFLAG_NOGRAVITY				= 0x02000000,
	AG2_STATEFLAG_TAGUSEANIMCAMERA		= 0x04000000,
	AG2_STATEFLAG_AIMELEE_CANATTACK		= 0x08000000,
	AG2_STATEFLAG_VELOCITYOVERRIDE		= 0x10000000,
	AG2_STATEFLAG_DONTTOUCHCONTROLMODE	= 0x20000000,
	AG2_STATEFLAG_NOPHYSFLAG			= 0x40000000,
	AG2_STATEFLAG_NOITEMRENDER			= 0x80000000,

	AG2_STATEFLAG_SKIPFORCEKEEP			= 0x00004000,

	AG2_STATEFLAG_EXCLUSIVEATTACK		= 0x01000000,

	AG2_STATEFLAGHI_FORCECROUCH			= 0x00000001,
	AG2_STATEFLAGHI_NOCOLLISION			= 0x00000002,
	AG2_STATEFLAGHI_SYNCANIM			= 0x00000004,
	AG2_STATEFLAGHI_JUMPSTART			= 0x00000008,
	AG2_STATEFLAGHI_ANIMPHYSOVERRIDE	= 0x00000010,
	AG2_STATEFLAGHI_ADJUSTSTATETIMESCALE	= 0x00000020,
	AG2_STATEFLAGHI_EXACTDESTPOSITION	= 0x00000040,
	AG2_STATEFLAGHI_EXACTSTARTPOSITION	= 0x00000080,
	AG2_STATEFLAGHI_DISABLESETDEST		= 0x00000100,
	AG2_STATEFLAGHI_NOPREVEXACTMOVE		= 0x00000200,
	AG2_STATEFLAGHI_ONLYBLENDEXACTMOVE	= 0x00000400,
	AG2_STATEFLAGHI_BEHAVIORDISABLED	= 0x00000800,

	AG2_STATEFLAGHI_NOWALKSTOP			= 0x00100000,

	// So vocap can know we're safe..
	AG2_STATEFLAGHI_VOCAP_IDLE			= 0x00001000,
	AG2_STATEFLAGHI_VOCAP_WALK			= 0x00002000,
	AG2_STATEFLAGHI_VOCAP_RUN			= 0x00004000,
	AG2_STATEFLAGHI_VOCAP_CROUCHED		= 0x00008000,
	AG2_STATEFLAGHI_VOCAP_ONLYFACE		= 0x00010000,
	AG2_STATEFLAGHI_VOCAP_ONLYUPPERBODY	= 0x00020000,
	
	AG2_STATEFLAGHI_IKSYSTEM_IGNOREFEET	 = 0x00040000,
	AG2_STATEFLAGHI_IKSYSTEM_IGNOREHANDS = 0x00080000,

	AG2_STATEFLAGHI_SHOULDNOTMOVE				= 0x00100000,
	AG2_STATEFLAGHI_DISABLEREFRESH				= 0x00200000,
	AG2_STATEFLAGHI_IKSYSTEM_ENABLELEFTHANDIK	= 0x00400000,
	AG2_STATEFLAGHI_BERAGDOLL			= 0x00800000,
	AG2_STATEFLAGHI_EXITRAGDOLL			= 0x01000000,
	AG2_STATEFLAGHI_BEHAVIORISMH		= 0x02000000,
	AG2_STATEFLAGHI_NOWALLCLIMB			= 0x04000000,
	AG2_STATEFLAGHI_FORCEREFRESH		= 0x08000000,
	AG2_STATEFLAGHI_ADAPTIVETIMESCALE	= 0x10000000,
	AG2_STATEFLAGHI_IKSYSTEM_FORCEFRONTFEET	= 0x20000000,
	AG2_STATEFLAGHI_IKSYSTEM_FORCEBACKFEET	= 0x40000000,
	AG2_STATEFLAGHI_RANDOMIZE_ENTER			= 0x80000000,
	


	// Vocap flags
	AG2_VOCAP_FLAG_IDLE					= 0x00000001,
	AG2_VOCAP_FLAG_WALK					= 0x00000002,
	AG2_VOCAP_FLAG_RUN					= 0x00000004,
	AG2_VOCAP_FLAG_CROUCHED				= 0x00000008,
	AG2_VOCAP_FLAG_ONLYFACE				= 0x00000010,
	AG2_VOCAP_FLAG_ONLYUPPERBODY		= 0x00000020,
	AG2_VOCAP_FLAG_BEHAVIOR				= 0x00000040,
	AG2_VOCAP_FLAG_MASKBEHAVIORTYPE		= 0xffff0000,
	AG2_VOCAP_FLAG_BEHAVIORTYPESHIFT	= 16,
};

#define M_AG2_VOCAP_TEST_BEHAVIOR(s) ((s & AG2_STATEFLAG_BEHAVIORACTIVE) << 6)
#define M_AG2_VOCAP_TEST_IDLE(s) ((s & AG2_STATEFLAGHI_VOCAP_IDLE) >> 12)
#define M_AG2_VOCAP_TEST_WALK(s) ((s & AG2_STATEFLAGHI_VOCAP_WALK) >> 12)
#define M_AG2_VOCAP_TEST_RUN(s) ((s & AG2_STATEFLAGHI_VOCAP_RUN) >> 12)
#define M_AG2_VOCAP_TEST_CROUCHED(s) ((s & AG2_STATEFLAGHI_VOCAP_CROUCHED) >> 12)
#define M_AG2_VOCAP_TEST_ONLYFACE(s) ((s & AG2_STATEFLAGHI_VOCAP_ONLYFACE) >> 12)
#define M_AG2_VOCAP_TEST_ONLYUPPERBODY(s) ((s & AG2_STATEFLAGHI_VOCAP_ONLYUPPERBODY) >> 12)


enum
{
	AG2_STANCETYPE_IDLE = 0,
	AG2_STANCETYPE_HOSTILE = 1,
	AG2_STANCETYPE_COMBAT = 2,
	AG2_STANCETYPE_WARY = 3,
	AG2_STANCETYPE_PANIC = 4,

	AG2_NUMSTANCES,
};

enum
{
	//
	AG2_IMPULSEVALUE_BEHAVIOR_EXIT = 6000,
	AG2_IMPULSEVALUE_BEHAVIOR_EXITMH = 6001,
	AG2_IMPULSEVALUE_BEHAVIORCONTROL_RAGDOLLEXIT = 6666,
	AG2_IMPULSEVALUE_BEHAVIOR_DARKNESS_RESPONSE_KNIFE = 7102,
	// Idle
	AG2_IMPULSEVALUE_WEAPONTYPE_UNARMED = 0,
	AG2_IMPULSEVALUE_WEAPONTYPE_MELEE = 1,
	AG2_IMPULSEVALUE_WEAPONTYPE_GUN = 3,
	AG2_IMPULSEVALUE_WEAPONTYPE_RIFLE = 6,
	AG2_IMPULSEVALUE_GROUPTYPE_GUN = 1,
	AG2_IMPULSEVALUE_GROUPTYPE_ASSAULT = 2,
	AG2_IMPULSEVALUE_GROUPTYPE_SHOTGUN = 3,
	AG2_IMPULSEVALUE_GROUPTYPE_ANCIENT = 4,

	AG2_IMPULSEVALUE_WEAPONTYPE_UNARMEDCROUCH = 7,
	AG2_IMPULSEVALUE_WEAPONTYPE_GUNCROUCH = 10,
	AG2_IMPULSEVALUE_WEAPONTYPE_RIFLECROUCH = 13,

	// For idle/hostile/combat/wary/panic, just find appropriate type
	AG2_IMPULSEVALUE_NUMWEAPONTYPES = 7,

	// Offset between stance levels
	AG2_IMPULSEVALUE_STANCETYPEOFFSET = 2 * AG2_IMPULSEVALUE_NUMWEAPONTYPES,

	AG2_IMPULSEVALUE_STANCEOFFSET_IDLE = AG2_IMPULSEVALUE_STANCETYPEOFFSET * AG2_STANCETYPE_IDLE,
	AG2_IMPULSEVALUE_STANCEOFFSET_HOSTILE = AG2_IMPULSEVALUE_STANCETYPEOFFSET * AG2_STANCETYPE_HOSTILE,
	AG2_IMPULSEVALUE_STANCEOFFSET_COMBAT = AG2_IMPULSEVALUE_STANCETYPEOFFSET * AG2_STANCETYPE_COMBAT,
	AG2_IMPULSEVALUE_STANCEOFFSET_WARY = AG2_IMPULSEVALUE_STANCETYPEOFFSET * AG2_STANCETYPE_WARY,
	AG2_IMPULSEVALUE_STANCEOFFSET_PANIC = AG2_IMPULSEVALUE_STANCETYPEOFFSET * AG2_STANCETYPE_PANIC,	

///////////////
	AG2_IMPULSEVALUE_CONTROLMODE_LADDER = 1,

	AG2_IMPULSEVALUE_RESPONSE_HURT			= 1,
	AG2_IMPULSEVALUE_RESPONSE_DEAD			= 2,
	AG2_IMPULSEVALUE_RESPONSE_WALKSTART		= 3,
	AG2_IMPULSEVALUE_RESPONSE_WALKSTOP		= 4,


	AG2_IMPULSEVALUE_RESPONSE_ANGELUS_LIFTOFF = 50,
	AG2_IMPULSEVALUE_RESPONSE_ANGELUS_LAND = 51,

	AG2_IMPULSEVALUE_RESPONSE_GRABBEDITEM = 100,

	AG2_IMPULSEVALUE_ITEMACTION_PRIMARYATTACK		= 0,
	AG2_IMPULSEVALUE_ITEMACTION_SECONDARYATTACK		= 1,
	AG2_IMPULSEVALUE_ITEMACTION_RELOAD				= 2,
	AG2_IMPULSEVALUE_ITEMACTION_UNEQUIP				= 3,
	AG2_IMPULSEVALUE_ITEMACTION_EQUIP				= 4,
	AG2_IMPULSEVALUE_ITEMACTION_RELEASEPRIMARY		= 5,
	AG2_IMPULSEVALUE_ITEMACTION_RELEASESECONDARY	= 6,
	AG2_IMPULSEVALUE_ITEMACTION_RELOADSECONDARY		= 7,
	AG2_IMPULSEVALUE_ITEMACTION_REEQUIPPRIMARY		= 8,
	AG2_IMPULSEVALUE_ITEMACTION_REEQUIPSECONDARY	= 9,
	AG2_IMPULSEVALUE_ITEMACTION_MELEEPRIMARY		= 10,
	AG2_IMPULSEVALUE_ITEMACTION_MELEESECONDARY		= 11,

	AG2_IMPULSEVALUE_ITEMACTION_RESET				= 5000,

	AG2_IMPULSEVALUE_DIALOG_INIT = 0,

	AG2_IMPULSEVALUE_SIDESTEP_LEFT = 1,
	AG2_IMPULSEVALUE_SIDESTEP_RIGHT = 2,
	
	AG2_IMPULSEVALUE_BUMP_FRONT = 1,
	AG2_IMPULSEVALUE_BUMP_BACK = 2,
	AG2_IMPULSEVALUE_BUMP_LEFT = 3,
	AG2_IMPULSEVALUE_BUMP_RIGHT = 4,

	AG2_IMPULSEVALUE_GUNPLAY_RIGHT = 0,
	AG2_IMPULSEVALUE_GUNPLAY_LEFT = 1,

	AG2_IMPULSEVALUE_FACIAL_CHANGETYPE = 10,
	AG2_IMPULSEVALUE_FACIAL_TERMINATE = 11,
	AG2_IMPULSEVALUE_FACIAL_START = 12,

	AG2_IMPULSEVALUE_FACIAL_GROUP_HUNTER = 0,
	AG2_IMPULSEVALUE_FACIAL_GROUP_BUTCHER = 1,
	AG2_IMPULSEVALUE_FACIAL_GROUP_JENNY = 2,
	AG2_IMPULSEVALUE_FACIAL_GROUP_SARAH = 3,
	AG2_IMPULSEVALUE_FACIAL_GROUP_CIVMALE3 = 4,


	// Laddermoves
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBUP = 0,
	AG2_IMPULSEVALUE_LADDERMOVE_SLIDEDOWN = 1,
	AG2_IMPULSEVALUE_LADDERMOVE_SLIDESTART = 2,
	AG2_IMPULSEVALUE_LADDERMOVE_SLIDESTOP = 3,
	AG2_IMPULSEVALUE_LADDERMOVE_SLIDESTOPEND = 4,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBONDOWN = 5,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBONUP = 6,
	AG2_IMPULSEVALUE_LADDERMOVE_IDLE = 7,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPL4PLUS = 8,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPL0L0 = 9,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPL4MINUS = 10,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPL8MINUS = 11,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPL12MINUS = 12,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPR4PLUS = 13,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPR0 = 14,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPR4MINUS = 15,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPR8MINUS = 16,
	AG2_IMPULSEVALUE_LADDERMOVE_CLIMBOFFUPR12MINUS = 17,

	AG2_IMPULSEVALUE_JUMP_UP = 0,
	AG2_IMPULSEVALUE_JUMP_FWD = 1,
	AG2_IMPULSEVALUE_JUMP_LAND = 2,
	AG2_IMPULSEVALUE_JUMP_LANDDEST = 3,

	AG2_IMPULSEVALUE_BEHAVIOR_GENERAL_LEFT = 0,		// Left, black hole pulls towards characters left
	AG2_IMPULSEVALUE_BEHAVIOR_GENERAL_RIGHT = 1,	// Right, black hole pulls towards characters right
	AG2_IMPULSEVALUE_BEHAVIOR_GENERAL_TOP = 2,		// Forward, black hole pulls character forward
	AG2_IMPULSEVALUE_BEHAVIOR_GENERAL_BOTTOM = 3,	// Back, black hole pulls character backwards

	AG2_IMPULSEVALUE_GAMEPLAY_DARKLING_SPAWNPUSHJUMPUP = 1,
	AG2_IMPULSEVALUE_GAMEPLAY_TURRET_LOW = 5007,
	AG2_IMPULSEVALUE_GAMEPLAY_TURRET_STANDING = 5008,

	AG2_IMPULSEVALUE_MOVEVAR_IDLE		= 0,
	AG2_IMPULSEVALUE_MOVEVAR_WALKFWD	= 1,
	AG2_IMPULSEVALUE_MOVEVAR_RUNFWD		= 2,

	AG2_IMPULSEVALUE_CREEPINGDARK_RESPONSE_ATTACK_CROUCH	= 2000,
	AG2_IMPULSEVALUE_CREEPINGDARK_RESPONSE_ATTACK_HIGH	= 2001,
	AG2_IMPULSEVALUE_CREEPINGDARK_USE	= 5002,
	AG2_IMPULSEVALUE_GAMEPLAY_MELEERESPONSE	= 5030,


	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR1	= 0,
	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR2	= 1,
	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR3	= 2,
	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR4	= 3,
	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR5	= 4,
	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR6	= 5,
	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR7	= 6,
	AG2_IMPULSEVALUE_SHOOTGESTURE_VAR8	= 7,


	AG2_IMPULSEVALUE_WALKSTAIR_STOP		= 0,
	AG2_IMPULSEVALUE_WALKSTAIR_WALKUP	= 1,
	AG2_IMPULSEVALUE_WALKSTAIR_WALKDOWN	= 2,
};

enum
{
	PROPERTY_FLOAT_STATETIME = 0,
	PROPERTY_FLOAT_ANIMLOOPCOUNT = 2,
	PROPERTY_FLOAT_ANIMLOOPCOUNTOFFSET = 3,
	PROPERTY_FLOAT_LOOPEDANIMTIME = 4,
	PROPERTY_FLOAT_RAND1 = 5,
	PROPERTY_FLOAT_RAND255 = 6,
	PROPERTY_FLOAT_STATETIMEOFFSET = 7,
	PROPERTY_FLOAT_ANIMMOVELENGTH = 8,

	
	PROPERTY_FLOAT_ONHITFORCE = 11,
	PROPERTY_FLOAT_ONHITDAMAGE = 12,
	
	PROPERTY_FLOAT_MOVERADIUSCONTROL = 13,
	PROPERTY_FLOAT_MOVEANGLECONTROL = 14,
	PROPERTY_FLOAT_MOVEANGLESCONTROL = 15,
	PROPERTY_FLOAT_MOVEANGLEUNITCONTROL = 16,
	PROPERTY_FLOAT_MOVEANGLEUNITSCONTROL = 17,

	PROPERTY_FLOAT_MOVEVELOCITY = 18,
	PROPERTY_FLOAT_MOVEVELOCITYVERTICAL = 19,

	PROPERTY_FLOAT_MOVEANGLE = 20,
	PROPERTY_FLOAT_MOVEANGLES = 21,
	PROPERTY_FLOAT_MOVEANGLEUNIT = 22,
	PROPERTY_FLOAT_MOVEANGLEUNITS = 23,
	
	PROPERTY_FLOAT_MOVEHCONTROL = 24,
	PROPERTY_FLOAT_MOVEVCONTROL = 25,

	PROPERTY_FLOAT_VIGILANCE = 26,

	PROPERTY_FLOAT_LEFTTRIGGER = 27,
	PROPERTY_FLOAT_RIGHTTRIGGER = 28,

	PROPERTY_FLOAT_HEALTH = 29,

	PROPERTY_FLOAT_ANGLEDIFF = 30,
	PROPERTY_FLOAT_ANGLEDIFFS = 31,


	PROPERTY_FLOAT_WALLCOLLISION = 32,

	PROPERTY_FLOAT_RELATIVEHEALTH = 33,
	PROPERTY_FLOAT_TURRETHORIZONTAL = 34,
	PROPERTY_FLOAT_TURRETVERTICAL = 35,

	AG2_MAXPROPERTYFLOAT_DARKNESS,
};

enum
{
	PROPERTY_INT_AGPARAM = 9,
	PROPERTY_INT_HANDLEDRESPONSE = 10,
	PROPERTY_INT_ONHITBODYPART = 11,
	PROPERTY_INT_ONHITDAMAGETYPE = 12,
	PROPERTY_FLOAT_ONHITDIRECTION = 13,
	PROPERTY_INT_WEAPONCLASS = 14,
	PROPERTY_INT_BUTTONPRESS = 15,
	PROPERTY_INT_BUTTONPRESSED = 16,
	PROPERTY_INT_LEDGETYPE = 17,
	PROPERTY_INT_CONTROLMODE = 18,
	PROPERTY_INT_JOYPAD = 19,

	PROPERTY_INT_FACIAL_GROUP = 20,
	PROPERTY_INT_FACIAL_TYPE = 21,
	PROPERTY_INT_ONLYANIMTYPE = 22,
	PROPERTY_INT_LOCALPLAYER = 23,
	PROPERTY_INT_VOCAPINFO = 24,
	PROPERTY_INT_ANIMGRIPTYPERIGHT = 25,
	PROPERTY_INT_ANIMGRIPTYPELEFT = 26,
	PROPERTY_INT_ACTIONCUTSCENETYPE = 27,
	PROPERTY_INT_ACSLEVERSTATE = 28,
	PROPERTY_INT_WANTEDBEHAVIOR = 29,

	//PROPERTY_INT_LADDERENDPOINT = 30,
	PROPERTY_INT_RAND255 = 30,
	PROPERTY_INT_LADDERSTEPOFFTYPE = 31,

	PROPERTY_INT_DIALOGGESTURE = 32,
	PROPERTY_INT_DIALOGBLENDTYPE = 33,
	PROPERTY_INT_DIALOGMOOD = 34,
	PROPERTY_INT_DIALOGFACIAL = 35,
	PROPERTY_INT_DIALOGFACIALGESTURE1 = 36,
	PROPERTY_INT_DIALOGFACIALGESTURE2 = 37,

	PROPERTY_INT_ITEMANIMTYPE = 38,

	PROPERTY_INT_IDLETURNTIMER = 39,

	// Which weapon to switch to
	PROPERTY_INT_WEAPONIDENTIFIER = 40,

	PROPERTY_INT_BEHAVIOR_ENTEREXITTYPE = 41,
	PROPERTY_INT_BEHAVIOR_GENERAL = 42,
	PROPERTY_INT_BEHAVIOR_LOOPMODE = 43,

	PROPERTY_INT_STANCE = 44,

	PROPERTY_INT_HURT_IMPACTDIRECTION = 45,
	PROPERTY_INT_HURT_IMPACTLOCATION = 46,
	PROPERTY_INT_HURT_STAGGERDIRECTION = 47,
	PROPERTY_INT_HURT_RANGE = 48,

	PROPERTY_INT_WALKSTOPTYPE = 49,

	PROPERTY_INT_EQUIPPEDITEMCLASS = 50,

	PROPERTY_INT_STANCESTANDING = 51,

	PROPERTY_INT_MOVEVARIATION = 52,

	PROPERTY_INT_EQUIPPEDITEMTYPE = 53,

	PROPERTY_INT_WEAPONIDENTIFIERDUALWIELD = 54,
	PROPERTY_INT_WALKSTARTTYPE = 55,
	PROPERTY_INT_GUNPLAY = 56,

	__EMPTY_1 = 57,
	__EMPTY_2 = 58,
	__EMPTY_3 = 59,

	PROPERTY_INT_RAGDOLLAGONYTYPE = 60,
	PROPERTY_INT_VOCAPINFO2 = 61,

	AG2_MAXPROPERTYINT_DARKNESS,
};

enum
{
	// Hurt stuff
	AG2_IMPULSEVALUE_HURTTYPE_SHORT = 1,
	AG2_IMPULSEVALUE_HURTTYPE_LONG = 2,
	AG2_IMPULSEVALUE_HURTTYPE_EXTREME = 3,
	AG2_IMPULSEVALUE_HURTTYPE_DEAD = 4,

	AG2_IMPACTDIRECTION_NONE = 0,
	AG2_IMPACTDIRECTION_FRONT = 1,
	AG2_IMPACTDIRECTION_BACK = 2,
	AG2_IMPACTDIRECTION_LEFT = 3,
	AG2_IMPACTDIRECTION_RIGHT = 4,

	AG2_IMPACTLOCATION_NONE = 0,
	AG2_IMPACTLOCATION_HIGH = 1,
	AG2_IMPACTLOCATION_MID = 2,
	AG2_IMPACTLOCATION_LOW = 3,

	AG2_STAGGERDIRECTION_FORWARD = 0,
	AG2_STAGGERDIRECTION_BACK = 1,
	AG2_STAGGERDIRECTION_LEFT = 2,
	AG2_STAGGERDIRECTION_RIGHT = 3,
	

	AG2_STAGGER_RANGE_NONE = 0,
	AG2_STAGGER_RANGE_ONPLACE = 1,
	AG2_STAGGER_RANGE_SHORT = 2,
	AG2_STAGGER_RANGE_LONG = 3,


	// Behavior stuff  (fast == direct??)
	AG2_BEHAVIOR_ENTEREXIT_NORMAL = 0,
	AG2_BEHAVIOR_ENTEREXIT_FAST = 1,
	AG2_BEHAVIOR_ENTEREXIT_DIRECT = 2,

	AG2_BEHAVIOR_LOOPMODE_ONCE = 0,
	AG2_BEHAVIOR_LOOPMODE_CONTINUOUS = 1,


	AG2_WALKSTARTDIRECTION_FWD = 0,
	AG2_WALKSTARTDIRECTION_LEFT45 = 1,
	AG2_WALKSTARTDIRECTION_LEFT90 = 2,
	AG2_WALKSTARTDIRECTION_RIGHT45 = 3,
	AG2_WALKSTARTDIRECTION_RIGHT90 = 4,
	AG2_WALKSTARTDIRECTION_LEFT180 = 5,
	AG2_WALKSTARTDIRECTION_RIGHT180 = 6,


	AG2_JUMPSTARTDIRECTION_FWD = 0,
	AG2_JUMPSTARTDIRECTION_LEFT45 = 1,
	AG2_JUMPSTARTDIRECTION_LEFT90 = 2,
	AG2_JUMPSTARTDIRECTION_RIGHT45 = 3,
	AG2_JUMPSTARTDIRECTION_RIGHT90 = 4,
	AG2_JUMPSTARTDIRECTION_LEFT180 = 5,
	AG2_JUMPSTARTDIRECTION_RIGHT180 = 6,
	AG2_JUMPSTARTDIRECTION_UP = 7,



	// Stopmode
	AG2_WALKSTOP_NORMAL = 0,
	AG2_WALKSTOP_EMERGENCY = 1,
};

// AG Event types (should perhaps be general and not game specific..?)
enum
{
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FIRE = 0,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_RELOAD = 1,
	AG2_ANIMEVENT_GAMEPLAY_WEAPONATTACH = 2,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FIRESECONDARY = 3,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_KILLYOURSELF = 4,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FAKEPRIMARY = 5,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FAKESECONDARY = 6,
	AG2_ANIMEVENT_GAMEPLAY_BLOODATROTTRACK = 7,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FAKEPRIMARYNOSOUND = 8,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FAKESECONDARYNOSOUND = 9,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FORCEDROPPRIMARY = 10,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FORCEDROPSECONDARY = 11,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FORCEMAKEOBJECTPRIMARY = 12,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_FORCEMAKEOBJECTSECONDARY = 13,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_BERAGDOLL = 14,
	AG2_ANIMEVENT_GAMEPLAY_WEAPON_MELEE = 15,

	AG2_ANIMEVENT_EFFECTTYPE_WEAPON = 0,
	AG2_ANIMEVENT_EFFECTTYPE_NEWWEAPONEFFECT = 2,
	AG2_ANIMEVENT_EFFECTTYPE_DISABLEANIMCAM = 5,
};
	

enum
{
	PROPERTY_BOOL_ISSLEEPING = 0,
	PROPERTY_BOOL_ISSERVER = 1,
	PROPERTY_BOOL_ISCROUCHING = 2,
	PROPERTY_BOOL_ISDEAD = 3,
	PROPERTY_BOOL_ISINAIR = 4,
	PROPERTY_BOOL_CANACTIVATEITEM = 5,
	PROPERTY_BOOL_CANBLOCK = 6,
	PROPERTY_BOOL_CANENDACS = 7,
	PROPERTY_BOOL_CANSWITCHWEAPON = 8,
	PROPERTY_BOOL_CANPLAYEQUIP = 9,
	PROPERTY_BOOL_DISABLETURNCORRECTION = 10,
	PROPERTY_BOOL_EFFECTPLAYING = 11,
	PROPERTY_BOOL_WEAPONSELECTQUEUED = 12,
	PROPERTY_BOOL_ALWAYSTRUE = 13,
	PROPERTY_BOOL_PERFECTPLACEMENT = 14,
	PROPERTY_BOOL_DISABLEREFRESH = 15,
	PROPERTY_BOOL_WEAPONSELECTQUEUEDDUALWIELD = 16,
	PROPERTY_BOOL_WALKSTOPENABLED = 17,
	PROPERTY_BOOL_ISPLAYER = 18,
	PROPERTY_BOOL_GUNPLAYDISABLED = 19,

	AG2_MAXPROPERTYBOOL_DARKNESS,
};

enum
{
	AG2_CONSTANT_ANIMMOVESCALE		= 0,
	AG2_CONSTANT_ANIMROTSCALE		= 1,
	AG2_CONSTANT_STOPLENGTH			= 2,

	AG2_CONSTANT_ANIMPHYSMOVETYPE	= 4,
	AG2_CONSTANT_MAXBODYOFFSET		= 5,
	AG2_CONSTANT_TURNSCALE			= 7,
	AG2_CONSTANT_AIMINGTYPE			= 9,
	AG2_CONSTANT_TURNTHRESHOLD		= 10,
	AG2_CONSTANT_CANCOUNTER			= 11,
	AG2_CONSTANT_CURRENTATTACK		= 12,
	AG2_CONSTANT_MAXLOOKANGLEZ		= 13,
	AG2_CONSTANT_MAXLOOKANGLEY		= 14,
	AG2_CONSTANT_MAXTURNANGLE		= 15,
	AG2_CONSTANT_STANCE_UNUSED		= 16,
	AG2_CONSTANT_BEHAVIORDISTANCE	= 17,
	AG2_CONSTANT_ADJUSTMENTOFFSET	= 18,
	AG2_CONSTANT_ADJUSTMENTCUTOFF	= 19,
	AG2_CONSTANT_CLOTHANIMSCALE		= 20,
	AG2_CONSTANT_CLOTHSIMFREQ		= 21,

	AG2_CONSTANT_OFFSETX			= 22,
	AG2_CONSTANT_OFFSETY			= 23,
	AG2_CONSTANT_OFFSETZ			= 24,
	AG2_CONSTANT_OTHERBEHAVIOR		= 25,
	AG2_CONSTANT_REVERSEDIR			= 26,
};

enum
{
	AG2_DEFAULTIDLETURNTHRESHOLD = 90,

	AG2_BEHAVIOR_SIGNAL_ENDOFBEHAVIOR			= 1,
	AG2_BEHAVIOR_SIGNAL_STARTOFBEHAVIOR			= 2,

	RPG_ITEMTYPE_FIST = 0,
	RPG_ITEMTYPE_GUN = 1,
	RPG_ITEMTYPE_ANCIENTWEAPONS = 7,

	AG2_ITEMSLOT_NONE			= -1,
	AG2_ITEMSLOT_WEAPONS		= 0,
	AG2_ITEMSLOT_ITEMS			= 1,
	AG2_ITEMSLOT_DUALWIELD		= 2,

	AG2_ITEMACTIVATION_NORMAL	= 0,
	AG2_ITEMACTIVATION_FAIL		= 1,
	AG2_ITEMACTIVATION_RELOAD	= 2,
};

enum
{
	SELECTION_NONE = 0,
	SELECTION_CHAR,
	SELECTION_PICKUP,
	SELECTION_ACTIONCUTSCENE,
	SELECTION_LADDER,
	SELECTION_LEDGE,
	SELECTION_HANGRAIL,
	SELECTION_DEADCHAR,
	SELECTION_ACTIONCUTSCENELOCKED,
	SELECTION_STEALTHTARGET,
	SELECTION_USABLEOBJECT,
	SELECTION_DARKLINGSPAWN,
	SELECTION_GRABBABLE_OBJECT,

	SELECTION_MASK_TYPE = 0x1f,
	SELECTION_MASK_TYPEINVALID = 0x3f,

	SELECTION_FLAG_INVALID = 0x20,
	SELECTION_FLAG_PROXY = 0x40, // Can't use 0x80 until converted SelectionType to uint8
};

enum
{
	ANIMPHYSMOVETYPE_NONE		= 0,
	ANIMPHYSMOVETYPE_FORWARD	= 1,
	ANIMPHYSMOVETYPE_BACKWARD	= 2,
	ANIMPHYSMOVETYPE_LEFT		= 3,
	ANIMPHYSMOVETYPE_RIGHT		= 4,
	ANIMPHYSMOVETYPE_RESET		= 5,

	ANIMPHYSMOVETYPECONSTANTID	= 4,

	EXPLORE_ACTIVE_UNDEFINED	= 0,
	EXPLORE_ACTIVE_FWD			= 1,
	EXPLORE_ACTIVE_LEFT45		= 2,
	EXPLORE_ACTIVE_LEFT90		= 3,
	EXPLORE_ACTIVE_LEFT135		= 4,
	EXPLORE_ACTIVE_LEFT180		= 5,

	EXPLORE_ACTIVE_RIGHT45		= 6,
	EXPLORE_ACTIVE_RIGHT90		= 7,
	EXPLORE_ACTIVE_RIGHT135		= 8,
	EXPLORE_ACTIVE_RIGHT180		= 9,

	BUTTONPRESS_PRIMARY			= 1 << 0,
	BUTTONPRESS_SECONDARY		= 1 << 1,
	BUTTONPRESS_JUMP			= 1 << 2,
	BUTTONPRESS_A				= 1 << 3,
	BUTTONPRESS_B				= 1 << 4,
	BUTTONPRESS_X				= 1 << 5,
	BUTTONPRESS_Y				= 1 << 6,
	BUTTONPRESS_SHIFT			= 1,
	//OSV....
	DIGIPAD_UP					= 1 << 0,
	DIGIPAD_DOWN				= 1 << 1,
	DIGIPAD_LEFT				= 1 << 2,
	DIGIPAD_RIGHT				= 1 << 3,
	DIGIPAD_SHIFT				= 8,
};

// Actioncutscene types
enum
{
	AG2_ACSACTIONTYPE_CROUCH					= 1,
	AG2_ACSACTIONTYPE_DISABLEPHYSICS			= 2,
	AG2_ACSACTIONTYPE_ENABLEPHYSICS				= 3,
	AG2_ACSACTIONTYPE_SETTHIRDPERSON			= 4,
	AG2_ACSACTIONTYPE_SETFIRSTPERSON			= 5,
	AG2_ACSACTIONTYPE_SUCCESSSETSTARTPOSITION	= 6,
	AG2_ACSACTIONTYPE_SUCCESSSETENDPOSITION		= 7,

	AG2_ACSACTIONTYPE_STARTANIMATION			= 8,
	AG2_ACSACTIONTYPE_ENDANIMATION				= 9,
	AG2_ACSACTIONTYPE_DOTRIGGER					= 10,

	AG2_ACSACTIONTYPE_PICKUPITEM				= 11,

	AG2_ACSACTIONTYPE_SETLEVERSTATE				= 12,
	AG2_ACSACTIONTYPE_ONCHANGEVALVESTATE		= 13,

	AG2_ACSACTIONTYPE_USEACSCAMERA				= 14,

	AG2_ACSACTIONTYPE_DOTRIGGERMIDDLE			= 15,
	AG2_ACSACTIONTYPE_DOTRIGGERREFILL			= 16,
	AG2_ACSACTIONTYPE_ENABLEPHYSFLAGS			= 17,
};


#define MAX_ANIMGRAPH2_CONDITIONS MAX_ANIMGRAPH2_DEFCONDITIONS
#define MAX_ANIMGRAPH2_PROPERTIES MAX_ANIMGRAPH2_DEFPROPERTIES
#define MAX_ANIMGRAPH2_OPERATORS MAX_ANIMGRAPH2_DEFOPERATORS
#define MAX_ANIMGRAPH2_EFFECTS MAX_ANIMGRAPH2_DEFEFFECTS
class CWO_Character_ClientData;


enum
{
	PROPERTYWEAPONAG_INT_AMMOLOAD = 0,
	PROPERTYWEAPONAG_INT_ISCROUCHING = 1,
	PROPERTYWEAPONAG_INT_TYPE		 = 2,
	AG2_MAXPROPERTYINT_WEAPONANIM,

	PROPERTYWEAPONAG_FLOAT_CONTROLANALOG = 1,
	AG2_MAXPROPERTYFLOAT_WEAPONANIM,

	TOKEN_WEAPON1 = 0,
	TOKEN_WEAPON2 = 1,
};
class CWO_Clientdata_WeaponAnim_AnimGraph2 : public CWO_ClientData_AnimGraph2Interface
{
friend class CWO_Character_ClientData;
public:
	enum
	{
//		AG2_MAXPROPERTYFLOAT_WEAPONANIM = 0,
		AG2_MAXPROPERTYBOOL_WEAPONANIM = 0,
	};
	CWO_Clientdata_WeaponAnim_AnimGraph2()
	{
		Clear();
		AG2_RegisterCallbacks(NULL);
	}

	virtual void SetInitialProperties(const CWAG2I_Context* _pContext);

	virtual void Clear()
	{
		CWO_ClientData_AnimGraph2Interface::Clear();

		// Hardcoded property sizes for now (project specific)
		SetNumProperties(AG2_MAXPROPERTYFLOAT_WEAPONANIM, AG2_MAXPROPERTYINT_WEAPONANIM,AG2_MAXPROPERTYBOOL_WEAPONANIM);
	}

	void UpdateItemProperties(class CRPG_Object* _pRoot, class CRPG_Object_Item* _pItem, CWObject_CoreData* _pObj, CWO_Character_ClientData* _pCD);

	void Copy(const CWO_Clientdata_WeaponAnim_AnimGraph2& _CD)
	{
		CWO_ClientData_AnimGraph2Interface::Copy(_CD);
	}
	virtual void UpdateImpulseState(const CWAG2I_Context* _pContext);
};
class CWO_Clientdata_Character_AnimGraph2 : public CWO_ClientData_AnimGraph2Interface
{
	friend class CWO_Character_ClientData;
	public:

		CVec3Dfp32 m_JumpDirection;
		CVec3Dfp32 m_PhysImpulse;
		fp32	m_StopLength;
		fp32 m_ClothAnimScale;
		fp32 m_MaxLookAngleZ;
		fp32 m_MaxLookAngleY;
		fp32 m_OffsetX;
		fp32 m_OffsetY;
		int32 m_ClothSimFreq;
		int32 m_StateFlagsLo;
		int32 m_StateFlagsHi;
		int32 m_StateFlagsHiToken2;
		int32 m_StateFlagsLoToken2;
		int32 m_StateFlagsLoToken3;
		int32 m_LastPhysImpulseAdjust;
		int32 m_LastToggleCrouch;
		CAG2StateIndex m_iExactPositionState;
		// Bitfield to mark which stances are supported (shift = weapontype + stance*weapontypeoffset)
		int8 m_SupportedStances[5];
		int8 m_ForcedAimingType;
		uint8 m_AnimphysMoveType;
		uint8 m_MaxBodyOffset;
		uint8 m_IdleTurnTimer;
		uint8 m_IdleTurnThreshold;
		uint8 m_bSupportedStancesSet:1;

		// Make type checking work
		//typedef bool (CWO_Clientdata_Character_AnimGraph2::*PFN_ANIMGRAPH2_CONDITION)(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams, int _iOperator, const CAG2Val &_Constant, fp32& _TimeFraction);
		//typedef bool (CWO_Clientdata_Character_AnimGraph2::*PFN_ANIMGRAPH2_OPERATOR)(const CWAG2I_Context* _pContext, const CAG2Val&, const CAG2Val&);
		//typedef void (CWO_Clientdata_Character_AnimGraph2::*PFN_ANIMGRAPH2_EFFECT)(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		
		bool StanceSupported(int32 _WeaponType, int32 _Stance);
		void SetSupportedStances(const CWAG2I_Context* _pContext, CAG2AnimGraphID _iAnimGraph = 0, bool _bReset = false);
	public:
		static PFN_ANIMGRAPH2_CONDITION ms_lpfnConditions_Server[MAX_ANIMGRAPH2_CONDITIONS];
		static PFN_ANIMGRAPH2_PROPERTY ms_lpfnProperties_Server[MAX_ANIMGRAPH2_PROPERTIES];
		static PFN_ANIMGRAPH2_OPERATOR ms_lpfnOperators_Server[MAX_ANIMGRAPH2_OPERATORS];
		static PFN_ANIMGRAPH2_EFFECT ms_lpfnEffects_Server[MAX_ANIMGRAPH2_EFFECTS];

		CWO_Clientdata_Character_AnimGraph2()
		{
			Clear();
			AG2_RegisterCallbacks2(ms_lpfnConditions_Server, MAX_ANIMGRAPH2_CONDITIONS,
				ms_lpfnProperties_Server, MAX_ANIMGRAPH2_PROPERTIES,
				ms_lpfnOperators_Server, MAX_ANIMGRAPH2_OPERATORS,
				ms_lpfnEffects_Server, MAX_ANIMGRAPH2_EFFECTS);
		}

		virtual void SetInitialProperties(const CWAG2I_Context* _pContext);

		virtual void Clear()
		{
			CWO_ClientData_AnimGraph2Interface::Clear();
			for (int32 i = 0; i < 5; i++)
				m_SupportedStances[i] = 0;
			m_JumpDirection = 0.0f; 
			m_ForcedAimingType = -1;
			m_StopLength = 0.0f;
			m_PhysImpulse = 0.0f;
			m_ClothAnimScale = -1.0f;
			m_MaxLookAngleZ = 0.25f;
			m_MaxLookAngleY = 0.25f;
			m_OffsetX = 0.0f;
			m_OffsetY = 0.0f;
			m_ClothSimFreq = -1;
			m_StateFlagsLo = 0;
			m_StateFlagsHi = 0;
			m_StateFlagsHiToken2 = 0;
			m_StateFlagsLoToken2 = 0;
			m_StateFlagsLoToken3 = 0;
			m_LastPhysImpulseAdjust = 0;
			m_LastToggleCrouch = 0;
			m_iExactPositionState = -1;
			m_AnimphysMoveType = 0;
			m_MaxBodyOffset = 0;
			m_IdleTurnTimer = 0;
			m_IdleTurnThreshold = AG2_DEFAULTIDLETURNTHRESHOLD;
			m_bSupportedStancesSet = false;

			// Hardcoded property sizes for now (project specific)
			SetNumProperties(AG2_MAXPROPERTYFLOAT_DARKNESS, AG2_MAXPROPERTYINT_DARKNESS,AG2_MAXPROPERTYBOOL_DARKNESS);
		}

		void Copy(const CWO_Clientdata_Character_AnimGraph2& _CD)
		{
			MSCOPESHORT(CWO_Clientdata_Character_AnimGraph2::Copy);
			CWO_ClientData_AnimGraph2Interface::Copy(_CD);
			for (int32 i = 0; i < 5; i++)
				m_SupportedStances[i] = _CD.m_SupportedStances[i];
			m_JumpDirection = _CD.m_JumpDirection;
			m_PhysImpulse = _CD.m_PhysImpulse;
			m_ForcedAimingType = _CD.m_ForcedAimingType;
			m_StopLength = _CD.m_StopLength;
			m_ClothAnimScale = _CD.m_ClothAnimScale;
			m_MaxLookAngleZ = _CD.m_MaxLookAngleZ;
			m_MaxLookAngleY = _CD.m_MaxLookAngleY;
			m_OffsetX = _CD.m_OffsetX;
			m_OffsetY = _CD.m_OffsetY;
			m_ClothSimFreq = _CD.m_ClothSimFreq;
			m_StateFlagsLo = _CD.m_StateFlagsLo;
			m_StateFlagsHi = _CD.m_StateFlagsHi;
			m_StateFlagsHiToken2 = _CD.m_StateFlagsHiToken2;
			m_StateFlagsLoToken2 = _CD.m_StateFlagsLoToken2;
			m_StateFlagsLoToken3 = _CD.m_StateFlagsLoToken3;
			m_LastPhysImpulseAdjust = _CD.m_LastPhysImpulseAdjust;
			m_LastToggleCrouch = _CD.m_LastToggleCrouch;
			m_iExactPositionState = _CD.m_iExactPositionState;
			m_AnimphysMoveType = _CD.m_AnimphysMoveType;
			m_MaxBodyOffset = _CD.m_MaxBodyOffset;
			m_IdleTurnTimer = _CD.m_IdleTurnTimer;
			m_IdleTurnThreshold = _CD.m_IdleTurnThreshold;
			m_bSupportedStancesSet = _CD.m_bSupportedStancesSet;
		}

		M_AGINLINE int32 GetStateFlagsLo() { return m_StateFlagsLo; }
		M_AGINLINE void SetStateFlagsLo(int32 _Flags) { m_StateFlagsLo = _Flags; }
		M_AGINLINE int32 GetStateFlagsHi() { return m_StateFlagsHi; }
		M_AGINLINE int32 GetStateFlagsHiToken2() { return m_StateFlagsHiToken2; }
		M_AGINLINE int32 GetStateFlagsLoToken2() { return m_StateFlagsLoToken2; }
		M_AGINLINE int32 GetStateFlagsLoToken3() { return m_StateFlagsLoToken3; }
		M_AGINLINE int32 GetStateFlagsLoCombined() { return (m_StateFlagsLo|m_StateFlagsLoToken2|m_StateFlagsLoToken3); }
		M_AGINLINE int32 GetStateFlagsHiCombined() { return (m_StateFlagsHi|m_StateFlagsHiToken2); }
		M_AGINLINE uint8 GetAnimPhysMoveType() { return m_AnimphysMoveType; }
		M_AGINLINE uint8 GetMaxBodyOffset() { return m_MaxBodyOffset; }
		M_AGINLINE fp32 GetStopLength() { return m_StopLength; }
		M_AGINLINE fp32 GetClothAnimScale() { return m_ClothAnimScale; }
		M_AGINLINE fp32 GetMaxLookAngleZ() { return m_MaxLookAngleZ; }
		M_AGINLINE fp32 GetMaxLookAngleY() { return m_MaxLookAngleY; }
		M_AGINLINE fp32 GetOffsetX() { return m_OffsetX;	}
		M_AGINLINE fp32 GetOffsetY() { return m_OffsetY;	}
		M_AGINLINE int32 GetClothSimFreq() { return m_ClothSimFreq; }
		M_AGINLINE int8 GetForcedAimingType() { return m_ForcedAimingType; }
		M_AGINLINE CVec3Dfp32& GetJumpDirection() { return m_JumpDirection; }
		M_AGINLINE const CVec3Dfp32& GetJumpDirection() const { return m_JumpDirection; }
		M_AGINLINE CAG2StateIndex GetExactPositionState() const { return m_iExactPositionState; }
		M_AGINLINE void AddPhysImpulse(const CVec3Dfp32& _Impulse) { m_PhysImpulse += _Impulse; }
		M_AGINLINE void SetPhysImpulse(const CVec3Dfp32& _Impulse) { m_PhysImpulse = _Impulse; }
		M_AGINLINE CVec3Dfp32 GetPhysImpulse() const { return m_PhysImpulse; }
		M_AGINLINE int32 GetLastPhysImpulseAdjust() const { return m_LastPhysImpulseAdjust; }
		M_AGINLINE int32& GetLastPhysImpulseAdjust() { return m_LastPhysImpulseAdjust; }

		virtual void AG2_RefreshStateInstanceProperties(const CWAG2I_Context* _pContext, const CWAG2I_StateInstance* _pStateInstance);
		virtual void AG2_OnEnterState(const CWAG2I_Context* _pContext, CAG2TokenID _TokenID, CAG2StateIndex _iState, CAG2AnimGraphID _iAnimGraph, CAG2ActionIndex _iEnterAction);

		bool GetStateConstantsRequestPtrs(CWAG2I*& _pAG2I, const CXRAG2_State*& _pState);

		CXRAG2_Impulse CheckWeaponType(const CWAG2I_Context* _pContext, CXRAG2_Impulse _Impulse, int32& _NewStanceStanding);
		virtual void UpdateImpulseState(const CWAG2I_Context* _pContext);
		bool ForceStance(const CWAG2I_Context* _pContext);

		bool SendHurtImpulse(const CWAG2I_Context* _pContext, CXRAG2_Impulse _HurtImpulse, CAG2TokenID _iToken = 0);
		bool SendJumpImpulse(const CWAG2I_Context* _pContext, CXRAG2_Impulse _JumpImpulse, CAG2TokenID _iToken = 0);
		bool SendAttackImpulse(const CWAG2I_Context* _pContext, CXRAG2_Impulse _AttackImpulse, CAG2TokenID _iToken = 0);
		bool SendAttackImpulseDualWield(const CWAG2I_Context* _pContext, CXRAG2_Impulse _AttackImpulse, CAG2TokenID _iToken = 0);
		bool SendBehaviorImpulse(const CWAG2I_Context* _pContext, int32 _WantedBehavior, bool _TurnIn = false);
		bool SendWalkStopImpulse(const CWAG2I_Context* _pContext);
		bool SendWalkStartImpulse(const CWAG2I_Context* _pContext);
		void SendFacialImpulse(const CWAG2I_Context* _pContext, int16 _Group, int16 _Type);

		CAG2Val Property_FixedMoveAngle8(const CWAG2I_Context* _pContext);
		CAG2Val Property_FixedMoveAngle4(const CWAG2I_Context* _pContext);
		CAG2Val Property_FixedMoveAngle4Crouch(const CWAG2I_Context* _pContext);
		CAG2Val Property_FixedMoveAngleControl8(const CWAG2I_Context* _pContext);
		CAG2Val Property_FixedMoveAngleControl4(const CWAG2I_Context* _pContext);
		CAG2Val Property_FixedMoveAngleDiff5(const CWAG2I_Context* _pContext);
		CAG2Val Property_FixedMoveAngleDiff8(const CWAG2I_Context* _pContext);
		CAG2Val Property_FixedWalkAngle4(const CWAG2I_Context* _pContext);
		CAG2Val Property_ValveState(const CWAG2I_Context* _pContext);
		// Angles :/
		CAG2Val Property_WalkAngleFwd(const CWAG2I_Context* _pContext);
		CAG2Val Property_WalkAngleRight(const CWAG2I_Context* _pContext);
		CAG2Val Property_WalkAngleBwd(const CWAG2I_Context* _pContext);
		CAG2Val Property_WalkAngleLeft(const CWAG2I_Context* _pContext);

		CAG2Val Property_CanEndACS(const CWAG2I_Context* _pContext);

		CAG2Val Property_LadderEndPoint(const CWAG2I_Context* _pContext);
		//CAG2Val Property_WalkStartDirection(const CWAG2I_Context* _pContext);
		CAG2Val Property_JumpStartDirection(const CWAG2I_Context* _pContext);
		CAG2Val Property_CanActivateItem(const CWAG2I_Context* _pContext);
		CAG2Val Property_NeedReload(const CWAG2I_Context* _pContext);
		CAG2Val Property_CanReload(const CWAG2I_Context* _pContext);
		CAG2Val Property_RandFromParam(const CWAG2I_Context* _pContext);
		CAG2Val Property_TurnInAngleDiff(const CWAG2I_Context* _pContext);

		void Effect_SwitchWeapon(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_ActivateItem(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_ActionCutsceneSwitch(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_LadderMove(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_RelAnimMoveSignal(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_SetControlMode(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_AIBehaviorSignal(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_SetRagdoll(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_CreateGrabbableItem(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_SetDestination(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_ResetLook(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_PlayDialog(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_SendImpulse(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_ToggleCrouch(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_FindRagDollAgonyType(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_SetParam(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_LedgeMode(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);
		void Effect_ResendBehavior(const CWAG2I_Context* _pContext, const CXRAG2_ICallbackParams* _pParams);

		virtual CWAG2I* GetAG2I() pure;
		virtual const CWAG2I* GetAG2I() const pure;
		virtual void Write(CCFile* _pFile);
		virtual void Read(CCFile* _pFile);
};

//--------------------------------------------------------------------------------

#endif /* AnimGraph2ClientData_Templar_h */
