class TargetNPCRarityHitPrereqCondition extends BaseHitPrereqCondition
{
	var m_rarity : gamedataNPCRarity;

	public override function SetData( recordID : TweakDBID )
	{
		var str : String;
		str = TweakDBInterface.GetString( recordID + T".rarity", "" );
		m_rarity = ( ( gamedataNPCRarity )( ( ( Int32 )( EnumValueFromString( "gamedataNPCRarity", str ) ) ) ) );
		super.SetData( recordID );
	}

	public override function Evaluate( hitEvent : gameHitEvent ) : Bool
	{
		var rarity : gamedataNPCRarity;
		var result : Bool;
		var objectToCheck : weak< ScriptedPuppet >;
		objectToCheck = ( ( ScriptedPuppet )( hitEvent.target ) );
		if( objectToCheck )
		{
			rarity = objectToCheck.GetNPCRarity();
			result = rarity == m_rarity;
			if( result )
			{
				result = CheckOnlyOncePerShot( hitEvent );
			}
			return ( ( m_invert ) ? ( !( result ) ) : ( result ) );
		}
		return false;
	}

}

