class FilterStimTargets extends EffectObjectSingleFilter_Scripted
{

	public export function Process( ctx : EffectScriptContext, filterCtx : EffectSingleFilterScriptContext ) : Bool
	{
		var puppet : NPCPuppet;
		var entity : Entity;
		var targets : array< NPCstubData >;
		var targetsVariant : Variant;
		EffectData.GetVariant( EffectScriptContext.GetSharedData( ctx ), GetAllBlackboardDefs().EffectSharedData.targets, targetsVariant );
		if( targetsVariant.IsValid() )
		{
			targets = ( ( array< NPCstubData > )targetsVariant );
		}
		if( targets.Size() <= 0 )
		{
			return true;
		}
		entity = EffectSingleFilterScriptContext.GetEntity( filterCtx );
		puppet = ( ( NPCPuppet )( entity ) );
		if( puppet )
		{
			return EvaluateTarget( puppet, targets );
		}
		return false;
	}

	private function EvaluateTarget( puppet : NPCPuppet, const targets : ref< array< NPCstubData > > ) : Bool
	{
		var i : Int32;
		for( i = 0; i < targets.Size(); i += 1 )
		{
			if( puppet.CheckStubData( targets[ i ] ) )
			{
				return true;
			}
		}
		return false;
	}

}

