gt:         String[] effectTriggers = null;
context: package forge.card.abilityFactory;
  
  import forge.*;
  import forge.card.spellability.*;
  import forge.card.trigger.Trigger;
  import forge.card.trigger.TriggerHandler;
  
  import java.util.HashMap;
  import java.util.Random;
  
  /**
   * <p>AbilityFactory_Effect class.</p>
   *
   * @author Forge
   * @version $Id: $
   */
  public class AbilityFactory_Effect {
      /**
       * <p>createAbilityEffect.</p>
       *
       * @param AF a {@link forge.card.abilityFactory.AbilityFactory} object.
       * @return a {@link forge.card.spellability.SpellAbility} object.
       */
      public static SpellAbility createAbilityEffect(final AbilityFactory AF) {
  
          final SpellAbility abEffect = new Ability_Activated(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()) {
              private static final long serialVersionUID = 8869422603616247307L;
  
              final AbilityFactory af = AF;
  
              @Override
              public String getStackDescription() {
                  // when getStackDesc is called, just build exactly what is happening
                  return effectStackDescription(af, this);
              }
  
              public boolean canPlayAI() {
                  return effectCanPlayAI(af, this);
              }
  
              @Override
              public void resolve() {
                  effectResolve(af, this);
              }
  
              @Override
              public boolean doTrigger(boolean mandatory) {
                  return effectDoTriggerAI(af, this, mandatory);
              }
  
          };
          return abEffect;
      }
  
      /**
       * <p>createSpellEffect.</p>
       *
       * @param AF a {@link forge.card.abilityFactory.AbilityFactory} object.
       * @return a {@link forge.card.spellability.SpellAbility} object.
       */
      public static SpellAbility createSpellEffect(final AbilityFactory AF) {
          final SpellAbility spEffect = new Spell(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()) {
              private static final long serialVersionUID = 6631124959690157874L;
  
              final AbilityFactory af = AF;
  
              @Override
              public String getStackDescription() {
                  // when getStackDesc is called, just build exactly what is happening
                  return effectStackDescription(af, this);
              }
  
              public boolean canPlayAI() {
                  return effectCanPlayAI(af, this);
              }
  
              @Override
              public void resolve() {
                  effectResolve(af, this);
              }
  
          };
          return spEffect;
      }
  
      /**
       * <p>createDrawbackEffect.</p>
       *
       * @param AF a {@link forge.card.abilityFactory.AbilityFactory} object.
       * @return a {@link forge.card.spellability.SpellAbility} object.
       */
      public static SpellAbility createDrawbackEffect(final AbilityFactory AF) {
          final SpellAbility dbEffect = new Ability_Sub(AF.getHostCard(), AF.getAbTgt()) {
              private static final long serialVersionUID = 6631124959690157874L;
  
              final AbilityFactory af = AF;
  
              @Override
              public String getStackDescription() {
                  // when getStackDesc is called, just build exactly what is happening
                  return effectStackDescription(af, this);
              }
  
              public boolean canPlayAI() {
                  return effectCanPlayAI(af, this);
              }
  
              @Override
              public void resolve() {
                  effectResolve(af, this);
              }
  
              @Override
              public boolean chkAI_Drawback() {
                  return true;
              }
  
              @Override
              public boolean doTrigger(boolean mandatory) {
                  return effectDoTriggerAI(af, this, mandatory);
              }
  
          };
          return dbEffect;
      }
  
      /**
       * <p>effectStackDescription.</p>
       *
       * @param af a {@link forge.card.abilityFactory.AbilityFactory} object.
       * @param sa a {@link forge.card.spellability.SpellAbility} object.
       * @return a {@link java.lang.String} object.
       */
      public static String effectStackDescription(AbilityFactory af, SpellAbility sa) {
          StringBuilder sb = new StringBuilder();
  
          if (sa instanceof Ability_Sub)
              sb.append(" ");
          else
              sb.append(sa.getSourceCard().getName()).append(" - ");
  
          sb.append(sa.getDescription());
  
          Ability_Sub abSub = sa.getSubAbility();
          if (abSub != null) {
              sb.append(abSub.getStackDescription());
          }
  
          return sb.toString();
      }
  
      /**
       * <p>effectCanPlayAI.</p>
       *
       * @param af a {@link forge.card.abilityFactory.AbilityFactory} object.
       * @param sa a {@link forge.card.spellability.SpellAbility} object.
       * @return a boolean.
       */
      public static boolean effectCanPlayAI(final AbilityFactory af, final SpellAbility sa) {
          Random r = MyRandom.random;
  
          Target tgt = sa.getTarget();
          if (tgt != null) {
              tgt.resetTargets();
              if (tgt.canOnlyTgtOpponent())
                  tgt.addTarget(AllZone.getHumanPlayer());
              else
                  tgt.addTarget(AllZone.getComputerPlayer());
          }
  
          return ((r.nextFloat() < .6667));
      }
  
      /**
       * <p>effectDoTriggerAI.</p>
       *
       * @param af a {@link forge.card.abilityFactory.AbilityFactory} object.
       * @param sa a {@link forge.card.spellability.SpellAbility} object.
       * @param mandatory a boolean.
       * @return a boolean.
       */
      public static boolean effectDoTriggerAI(AbilityFactory af, SpellAbility sa, boolean mandatory) {
          if (!ComputerUtil.canPayCost(sa) && !mandatory)    // If there is a cost payment it's usually not mandatory
              return false;
  
          // TODO: Add targeting effects
  
          // check SubAbilities DoTrigger?
          Ability_Sub abSub = sa.getSubAbility();
          if (abSub != null) {
              return abSub.doTrigger(mandatory);
          }
  
          return true;
      }
  
      /**
       * <p>effectResolve.</p>
       *
       * @param af a {@link forge.card.abilityFactory.AbilityFactory} object.
       * @param sa a {@link forge.card.spellability.SpellAbility} object.
       */
      public static void effectResolve(final AbilityFactory af, final SpellAbility sa) {
          HashMap<String, String> params = af.getMapParams();
          Card card = af.getHostCard();
  
          String[] effectAbilities = null;
  