@Override
  protected boolean canPlayAI(Player ai, SpellAbility sa) {
    final TargetRestrictions tgt = sa.getTargetRestrictions();
    final Card source = sa.getHostCard();
    final Game game = source.getGame();

    boolean useAbility = true;

    //        if (card.getController().isComputer()) {
    //            final List<Card> creatures = AllZoneUtil.getCreaturesInPlay();
    //            if (!creatures.isEmpty()) {
    //                cardToCopy = CardFactoryUtil.getBestCreatureAI(creatures);
    //            }
    //        }

    // TODO - add some kind of check to answer
    // "Am I going to attack with this?"
    // TODO - add some kind of check for during human turn to answer
    // "Can I use this to block something?"

    PhaseHandler phase = game.getPhaseHandler();
    // don't use instant speed clone abilities outside computers
    // Combat_Begin step
    if (!phase.is(PhaseType.COMBAT_BEGIN)
        && phase.isPlayerTurn(ai)
        && !SpellAbilityAi.isSorcerySpeed(sa)
        && !sa.hasParam("ActivationPhases")
        && !sa.hasParam("Permanent")) {
      return false;
    }

    // don't use instant speed clone abilities outside humans
    // Combat_Declare_Attackers_InstantAbility step
    if (!phase.is(PhaseType.COMBAT_DECLARE_ATTACKERS)
        || phase.isPlayerTurn(ai)
        || game.getCombat().getAttackers().isEmpty()) {
      return false;
    }

    // don't activate during main2 unless this effect is permanent
    if (phase.is(PhaseType.MAIN2) && !sa.hasParam("Permanent")) {
      return false;
    }

    if (null == tgt) {
      final List<Card> defined = AbilityUtils.getDefinedCards(source, sa.getParam("Defined"), sa);

      boolean bFlag = false;
      for (final Card c : defined) {
        bFlag |= (!c.isCreature() && !c.isTapped() && !(c.getTurnInZone() == phase.getTurn()));

        // for creatures that could be improved (like Figure of Destiny)
        if (c.isCreature() && (sa.hasParam("Permanent") || (!c.isTapped() && !c.isSick()))) {
          int power = -5;
          if (sa.hasParam("Power")) {
            power = AbilityUtils.calculateAmount(source, sa.getParam("Power"), sa);
          }
          int toughness = -5;
          if (sa.hasParam("Toughness")) {
            toughness = AbilityUtils.calculateAmount(source, sa.getParam("Toughness"), sa);
          }
          if ((power + toughness) > (c.getCurrentPower() + c.getCurrentToughness())) {
            bFlag = true;
          }
        }
      }

      if (!bFlag) { // All of the defined stuff is cloned, not very
        // useful
        return false;
      }
    } else {
      sa.resetTargets();
      useAbility &= cloneTgtAI(sa);
    }

    return useAbility;
  } // end cloneCanPlayAI()