private static void preventDamageResolve(final AbilityFactory af, final SpellAbility sa) {
        final HashMap<String, String> params = af.getMapParams();
        int numDam = AbilityFactory.calculateAmount(af.getHostCard(), params.get("Amount"), sa);

        ArrayList<Object> tgts;
        if (sa.getTarget() == null)
            tgts = AbilityFactory.getDefinedObjects(sa.getSourceCard(), params.get("Defined"), sa);
        else
            tgts = sa.getTarget().getTargets();

        boolean targeted = (af.getAbTgt() != null);

        for (Object o : tgts) {
            if (o instanceof Card) {
                Card c = (Card) o;
                if (AllZoneUtil.isCardInPlay(c) && (!targeted || CardFactoryUtil.canTarget(af.getHostCard(), c))) {
                    c.addPreventNextDamage(numDam);
                }

            } else if (o instanceof Player) {
                Player p = (Player) o;
                if (!targeted || p.canTarget(af.getHostCard())) {
                    p.addPreventNextDamage(numDam);
                }
            }
        }
    }//doResolve