private static void untapChooseUpTo(AbilityFactory af, SpellAbility sa, HashMap<String, String> params) {
        int num = Integer.parseInt(params.get("Amount"));
        String valid = params.get("UntapType");

        Player activatingPlayer = sa.getActivatingPlayer();

        // Reuse existing UntapUpTo Input
        if (activatingPlayer.isHuman())
            AllZone.getInputControl().setInput(CardFactoryUtil.input_UntapUpToNType(num, valid));
        else {
            CardList list = AllZoneUtil.getPlayerCardsInPlay(AllZone.getComputerPlayer());
            list = list.getType(valid);
            list = list.filter(AllZoneUtil.tapped);

            int count = 0;
            while (list.size() != 0)
                for (int i = 0; i < num && i < list.size(); i++) {

                    Card c = CardFactoryUtil.AI_getBestLand(list);
                    c.untap();
                    list.remove(c);
                    count++;
                }
        }
    }