abstract class HitConditions extends AIbehaviorconditionScript
{
}

class CheckLastHitReaction extends HitConditions
{
	editable var m_hitReactionToCheck : animHitReactionType;

	protected override function Check( context : ScriptExecutionContext ) : AIbehaviorConditionOutcomes
	{
		var hitReactionBehaviorData : HitReactionBehaviorData;
		hitReactionBehaviorData = GetHitReactionComponent( context ).GetLastHitReactionBehaviorData();
		if( !( hitReactionBehaviorData ) )
		{
			return false;
		}
		if( hitReactionBehaviorData.m_hitReactionType == m_hitReactionToCheck )
		{
			return true;
		}
		else
		{
			return false;
		}
	}

}

class CheckCurrentHitReaction extends HitConditions
{
	editable var m_HitReactionTypeToCompare : animHitReactionType;
	editable var m_CustomStimNameToCompare : CName;
	editable var m_shouldCheckDeathStimName : Bool;
	default m_shouldCheckDeathStimName = false;

	protected export override function Check( context : ScriptExecutionContext ) : AIbehaviorConditionOutcomes
	{
		if( !( ScriptedPuppet.IsAlive( ScriptExecutionContext.GetOwner( context ) ) ) && m_shouldCheckDeathStimName )
		{
			if( m_CustomStimNameToCompare == '' )
			{
				return ( ( NPCPuppet )( GetPuppet( context ) ) ).GetHitReactionComponent().GetDeathStimName() == EnumValueToName( 'animHitReactionType', ( ( Int32 )( m_HitReactionTypeToCompare ) ) );
			}
			else
			{
				return ( ( NPCPuppet )( GetPuppet( context ) ) ).GetHitReactionComponent().GetDeathStimName() == m_CustomStimNameToCompare;
			}
		}
		else
		{
			if( m_CustomStimNameToCompare == '' )
			{
				return ( ( NPCPuppet )( GetPuppet( context ) ) ).GetHitReactionComponent().GetLastStimName() == EnumValueToName( 'animHitReactionType', ( ( Int32 )( m_HitReactionTypeToCompare ) ) );
			}
			else
			{
				return ( ( NPCPuppet )( GetPuppet( context ) ) ).GetHitReactionComponent().GetLastStimName() == m_CustomStimNameToCompare;
			}
		}
	}

}

abstract class CheckStimID extends AIbehaviorconditionScript
{
}

class CheckHitReactionStimID extends CheckStimID
{

	protected export override function CheckOnEvent( context : ScriptExecutionContext, behaviorEvent : AIEvent ) : AIbehaviorConditionOutcomes
	{
		var se : StimuliEvent;
		se = ( ( StimuliEvent )( behaviorEvent ) );
		if( se.id == GetPuppet( context ).GetHitReactionComponent().GetLastStimID() )
		{
			return true;
		}
		return false;
	}

}

