public static boolean sacrificeCanPlayAI(final AbilityFactory af, SpellAbility sa) {

        HashMap<String, String> params = af.getMapParams();
        boolean chance = sacrificeTgtAI(af, sa);

        // Some additional checks based on what is being sacrificed, and who is sacrificing
        Target tgt = af.getAbTgt();
        if (tgt != null) {
            String valid = params.get("SacValid");
            String num = params.get("Amount");
            num = (num == null) ? "1" : num;
            int amount = AbilityFactory.calculateAmount(sa.getSourceCard(), num, sa);

            CardList list = AllZoneUtil.getPlayerCardsInPlay(AllZone.getHumanPlayer());
            list = list.getValidCards(valid.split(","), sa.getActivatingPlayer(), sa.getSourceCard());

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

            Card source = sa.getSourceCard();
            if (num.equals("X") && source.getSVar(num).equals("Count$xPaid")) {
                // Set PayX here to maximum value.
                int xPay = Math.min(ComputerUtil.determineLeftoverMana(sa), amount);
                source.setSVar("PayX", Integer.toString(xPay));
            }

            int half = amount / 2 + amount % 2;    // Half of amount rounded up

            // If the Human has at least half rounded up of the amount to be sacrificed, cast the spell
            if (list.size() < half)
                return false;
        }

        Ability_Sub subAb = sa.getSubAbility();
        if (subAb != null)
            chance &= subAb.chkAI_Drawback();

        return chance;
    }