private static void shuffleResolve(final AbilityFactory af, final SpellAbility sa) {
        Card host = af.getHostCard();
        HashMap<String, String> params = af.getMapParams();
        boolean optional = params.containsKey("Optional");

        ArrayList<Player> tgtPlayers;

        Target tgt = af.getAbTgt();
        if (tgt != null)
            tgtPlayers = tgt.getTargetPlayers();
        else
            tgtPlayers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), params.get("Defined"), sa);

        for (Player p : tgtPlayers) {
            if (tgt == null || p.canTarget(af.getHostCard())) {
                if (optional && sa.getActivatingPlayer().isHuman() && !GameActionUtil.showYesNoDialog(host, "Have " + p + " shuffle?")) {
                    ; //do nothing
                } else {
                    p.shuffle();
                }
            }
        }
    }