public static Card attachToCardAIPreferences(AbilityFactory af, final SpellAbility sa, Map<String,String> params, boolean mandatory){
		Target tgt = sa.getTarget();
		Card attachSource = sa.getSourceCard();
		// TODO AttachSource is currently set for the Source of the Spell, but at some point can support attaching a different card
		
		CardList list = AllZoneUtil.getCardsInZone(tgt.getZone());
		list = list.getValidCards(tgt.getValidTgts(), sa.getActivatingPlayer(), sa.getSourceCard());
		
		// TODO: If Attaching without casting, don't need to actually target. 
		// I believe this is the only case where mandatory will be true, so just check that when starting that work
		// But we shouldn't attach to things with Protection
		if (tgt.getZone().equals("Battlefield"))
			list = list.getTargetableCards(sa.getSourceCard());
		
		if (list.size() == 0)
			return null;
		
		Card c = attachGeneralAI(sa, list, mandatory, attachSource, params.get("AILogic"));
		
		if (c == null && mandatory){
			list.shuffle();
			c = list.get(0);
		}
		
		return c;
	}