public static void manaResolve(Ability_Mana abMana, AbilityFactory af, SpellAbility sa) {
        // Spells are not undoable
        abMana.setUndoable(af.isAbility() && abMana.isUndoable());

        HashMap<String, String> params = af.getMapParams();
        Card card = af.getHostCard();

        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 player : tgtPlayers)
            abMana.produceMana(generatedMana(abMana, af, sa), player);

        // convert these to SubAbilities when appropriate
        if (params.containsKey("Stuck")) {
            abMana.setUndoable(false);
            card.addExtrinsicKeyword("This card doesn't untap during your next untap step.");
        }

        String deplete = params.get("Deplete");
        if (deplete != null) {
            int num = card.getCounters(Counters.getType(deplete));
            if (num == 0) {
                abMana.setUndoable(false);
                AllZone.getGameAction().sacrifice(card);
            }
        }

        doDrawback(af, abMana, card);
    }