public static ArrayList<SpellAbility> getDefinedSpellAbilities(Card card, String def, SpellAbility sa) {
        ArrayList<SpellAbility> sas = new ArrayList<SpellAbility>();
        String defined = (def == null) ? "Self" : def;    // default to Self

        SpellAbility s = null;

        //TODO - this probably needs to be fleshed out a bit, but the basics work
        if (defined.equals("Self")) {
            s = sa;
        } else if (defined.equals("Targeted")) {
            SpellAbility parent = findParentsTargetedSpellAbility(sa);
            sas.addAll(parent.getTarget().getTargetSAs());
        } else if (defined.startsWith("Triggered")) {
        	SpellAbility root = sa.getRootSpellAbility();
        	
            String triggeringType = defined.substring(9);
            Object o = root.getTriggeringObject(triggeringType); 
            if (o instanceof SpellAbility)
                s = (SpellAbility) o;
        } else if (defined.startsWith("Imprinted")) {
            for (Card imp : card.getImprinted())
                sas.addAll(imp.getSpellAbilities());
        }

        if (s != null)
            sas.add(s);

        return sas;
    }