class Crosshair_Melee_Nano_Wire extends CrosshairGameController_Melee
{
	private var m_animEnterADS : inkAnimProxy;
	private var m_inAimDownSight : Bool;
	private var m_isHoveringOfficer : Bool;
	private var m_inChargedHold : Bool;
	private var anim_EnterHipFire : inkAnimProxy;
	private var anim_HoverEnterEnemy : inkAnimProxy;
	private var anim_EnterStrongAttack : inkAnimProxy;
	private var anim_EnterThrowAttack : inkAnimProxy;
	private var anim_EnterEveryOtherAttack : inkAnimProxy;
	private var anim_EnterChargedHold : inkAnimProxy;
	private var anim_HoverExitEnemy : inkAnimProxy;

	public override function GetIntroAnimation( firstEquip : Bool ) : inkAnimProxy
	{
		var anim : inkAnimDef;
		var alphaInterpolator : inkAnimTransparency;
		anim = new inkAnimDef;
		alphaInterpolator = new inkAnimTransparency;
		alphaInterpolator.SetStartTransparency( 0.0 );
		alphaInterpolator.SetEndTransparency( 1.0 );
		alphaInterpolator.SetDuration( 0.25 );
		alphaInterpolator.SetType( inkanimInterpolationType.Linear );
		alphaInterpolator.SetMode( inkanimInterpolationMode.EasyIn );
		anim.AddInterpolator( alphaInterpolator );
		return m_rootWidget.PlayAnimation( anim );
	}

	public override function GetOutroAnimation() : inkAnimProxy
	{
		var anim : inkAnimDef;
		var alphaInterpolator : inkAnimTransparency;
		anim = new inkAnimDef;
		alphaInterpolator = new inkAnimTransparency;
		alphaInterpolator.SetStartTransparency( 1.0 );
		alphaInterpolator.SetEndTransparency( 0.0 );
		alphaInterpolator.SetDuration( 0.25 );
		alphaInterpolator.SetType( inkanimInterpolationType.Linear );
		alphaInterpolator.SetMode( inkanimInterpolationMode.EasyIn );
		anim.AddInterpolator( alphaInterpolator );
		return m_rootWidget.PlayAnimation( anim );
	}

	protected override function ApplyCrosshairGUIState( state : CName, aimedAtEntity : Entity )
	{
		var aimedAtGameObject : weak< GameObject >;
		var puppet : weak< ScriptedPuppet >;
		aimedAtGameObject = ( ( GameObject )( aimedAtEntity ) );
		puppet = ( ( ScriptedPuppet )( aimedAtGameObject ) );
		m_isHoveringOfficer = puppet.GetNPCRarity() == gamedataNPCRarity.Officer;
		if( state == 'Hostile' )
		{
			if( m_inAimDownSight && m_isHoveringOfficer )
			{
				if( !( anim_HoverEnterEnemy.IsPlaying() ) )
				{
					anim_HoverEnterEnemy = PlayLibraryAnimation( 'HoverEnterEnemy' );
				}
			}
		}
		else
		{
			if( !( anim_HoverExitEnemy.IsPlaying() ) )
			{
				anim_HoverExitEnemy = PlayLibraryAnimation( 'HoverExitEnemy' );
			}
		}
		super.ApplyCrosshairGUIState( state, aimedAtEntity );
	}

	protected override function OnMeleeState_Update( value : gamePSMMeleeWeapon )
	{
		if( ( value == gamePSMMeleeWeapon.Idle || value == gamePSMMeleeWeapon.Default ) || value == gamePSMMeleeWeapon.Equipping )
		{
			if( m_animEnterADS.IsPlaying() )
			{
				m_animEnterADS.Stop();
			}
			if( !( anim_EnterHipFire.IsPlaying() ) )
			{
				anim_EnterHipFire = PlayLibraryAnimation( 'EnterHipFire' );
			}
		}
		else if( value == gamePSMMeleeWeapon.Targeting )
		{
			if( !( m_animEnterADS.IsPlaying() ) )
			{
				m_animEnterADS = PlayLibraryAnimation( 'EnterAimDownSight' );
			}
			if( m_isHoveringOfficer )
			{
				if( !( anim_HoverEnterEnemy.IsPlaying() ) )
				{
					anim_HoverEnterEnemy = PlayLibraryAnimation( 'HoverEnterEnemy' );
				}
				;
			}
		}
		else if( value == gamePSMMeleeWeapon.StrongAttack )
		{
			if( !( anim_EnterStrongAttack.IsPlaying() ) )
			{
				anim_EnterStrongAttack = PlayLibraryAnimation( 'EnterStrongAttack' );
			}
		}
		else if( value == gamePSMMeleeWeapon.ThrowAttack )
		{
			if( !( anim_EnterThrowAttack.IsPlaying() ) )
			{
				anim_EnterThrowAttack = PlayLibraryAnimation( 'EnterThrowAttack' );
			}
		}
		else if( ( ( ( ( ( value == gamePSMMeleeWeapon.ComboAttack || value == gamePSMMeleeWeapon.FinalAttack ) || value == gamePSMMeleeWeapon.SafeAttack ) || value == gamePSMMeleeWeapon.BlockAttack ) || value == gamePSMMeleeWeapon.SprintAttack ) || value == gamePSMMeleeWeapon.CrouchAttack ) || value == gamePSMMeleeWeapon.JumpAttack )
		{
			if( !( anim_EnterEveryOtherAttack.IsPlaying() ) )
			{
				anim_EnterEveryOtherAttack = PlayLibraryAnimation( 'EnterEveryOtherAttack' );
			}
		}
		else if( value == gamePSMMeleeWeapon.ChargedHold )
		{
			m_inChargedHold = true;
			if( !( anim_EnterChargedHold.IsPlaying() ) )
			{
				anim_EnterChargedHold = PlayLibraryAnimation( 'EnterChargedHold' );
			}
		}
		else if( m_inChargedHold && value != gamePSMMeleeWeapon.ChargedHold )
		{
			m_inChargedHold = false;
			if( !( anim_EnterHipFire.IsPlaying() ) )
			{
				anim_EnterHipFire = PlayLibraryAnimation( 'EnterHipFire' );
			}
		}
		m_inAimDownSight = value == gamePSMMeleeWeapon.Targeting;
		super.OnMeleeState_Update( value );
	}

}

