private static boolean preventDamageMandatoryTarget(AbilityFactory af, SpellAbility sa, boolean mandatory) {
        final Card hostCard = af.getHostCard();
        Target tgt = sa.getTarget();
        tgt.resetTargets();
        // filter AIs battlefield by what I can target
        CardList targetables = AllZoneUtil.getCardsInPlay();
        targetables = targetables.getValidCards(tgt.getValidTgts(), AllZone.getComputerPlayer(), hostCard);
        CardList compTargetables = targetables.getController(AllZone.getComputerPlayer());

        if (targetables.size() == 0)
            return false;

        if (!mandatory && compTargetables.size() == 0)
            return false;

        if (compTargetables.size() > 0) {
            CardList combatants = compTargetables.getType("Creature");
            CardListUtil.sortByEvaluateCreature(combatants);
            if (AllZone.getPhase().is(Constant.Phase.Combat_Declare_Blockers_InstantAbility)) {
                for (Card c : combatants) {
                    if (CombatUtil.combatantWouldBeDestroyed(c)) {
                        tgt.addTarget(c);
                        return true;
                    }
                }
            }

            // TODO see if something on the stack is about to kill something i can target

            tgt.addTarget(combatants.get(0));
            return true;
        }

        tgt.addTarget(CardFactoryUtil.AI_getCheapestPermanent(targetables, hostCard, true));
        return true;
    }