class StrikeFilterSingle_NPC extends EffectObjectSingleFilter_Scripted
{
	editable var onlyAlive : Bool;
	editable var onlyEnemies : Bool;

	public export function Process( ctx : EffectScriptContext, filterCtx : EffectSingleFilterScriptContext ) : Bool
	{
		var puppet : NPCPuppet;
		puppet = ( ( NPCPuppet )( EffectSingleFilterScriptContext.GetEntity( filterCtx ) ) );
		return ( puppet && ( ( onlyAlive ) ? ( ScriptedPuppet.IsAlive( puppet ) ) : ( true ) ) ) && ( ( onlyEnemies ) ? ( puppet.IsEnemy() ) : ( true ) );
	}

}

class FilterNPCsByType extends EffectObjectSingleFilter_Scripted
{
	const editable var m_allowedTypes : array< gamedataNPCType >;
	editable var m_invert : Bool;

	public function Process( ctx : EffectScriptContext, filterCtx : EffectSingleFilterScriptContext ) : Bool
	{
		var puppet : NPCPuppet;
		var entity : Entity;
		var isTypeInList : Bool;
		entity = EffectSingleFilterScriptContext.GetEntity( filterCtx );
		puppet = ( ( NPCPuppet )( entity ) );
		if( puppet )
		{
			isTypeInList = m_allowedTypes.Contains( puppet.GetNPCType() );
			return ( ( m_invert ) ? ( !( isTypeInList ) ) : ( isTypeInList ) );
		}
		return true;
	}

}

