Page 1 of 1

Armadillo Cloak

PostPosted: 28 Sep 2009, 20:40
by mtgrares
Someone sent me this code for Armadillo Cloak and I didn't want to lose it. I pointed these forums out to him but I'm not sure if he is going to register or not. The code looks ok but there might be small problems with it.

Code: Select all
//*************** START *********** START **************************
if(cardName.equals("Armadillo Cloak"))
{
  final SpellAbility spell = new Spell(card)
  {

   private static final long serialVersionUID = 4227124619270545652L;
   public boolean canPlayAI()
    {
      CardList list = new CardList(AllZone.Computer_Play.getCards());
      list = list.getType("Creature");

      if(list.isEmpty())
       return false;

      //else
      CardListUtil.sortAttack(list);
      CardListUtil.sortFlying(list);

      setTargetCard(list.get(0));
      return true;
    }//canPlayAI()
    public void resolve()
    {
      PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
      play.add(card);
     
      Card c = getTargetCard();
     
      if(AllZone.GameAction.isCardInPlay(c)  && CardFactoryUtil.canTarget(card, c) )
      {
         card.enchantCard(c);
         System.out.println("Enchanted: " +getTargetCard());
      }
    }//resolve()
  };//SpellAbility
  card.clearSpellAbility();
  card.addSpellAbility(spell);
 
  Command onEnchant = new Command()
  {   

   public void execute()
      {
         if (card.isEnchanting())
         {
            Card crd = card.getEnchanting().get(0);
            crd.addExtrinsicKeyword("Trample");
            crd.addExtrinsicKeyword("Lifelink");
            crd.addSemiPermanentAttackBoost(2);
            crd.addSemiPermanentDefenseBoost(2);
         } 
      }//execute()
  };//Command
 

  Command onUnEnchant = new Command()
  {   
   

      public void execute()
      {
         if (card.isEnchanting())
         {
            Card crd = card.getEnchanting().get(0);
            crd.removeExtrinsicKeyword("Trample");

            crd.removeExtrinsicKeyword("Lifelink");
   
            crd.addSemiPermanentAttackBoost(-2);               
            crd.addSemiPermanentDefenseBoost(-2);
         }
      
      }//execute()
   };//Command
   
   Command onLeavesPlay = new Command()
   {
   
   public void execute()
      {
         if (card.isEnchanting())
         {
            Card crd = card.getEnchanting().get(0);
            card.unEnchantCard(crd);
         }
      }
   };
 
  card.setEnchant(onEnchant);
  card.setUnEnchant(onUnEnchant);
  card.setLeavesPlay(onLeavesPlay);
 
  spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
}//*************** END ************ END **************************

Re: Armadillo Cloak

PostPosted: 28 Sep 2009, 20:47
by DennisBergkamp
Looks fine to me (he did register and posted it also in the main thread). I'll add this to the next version (which has almost 2000 cards now!)

Re: Armadillo Cloak

PostPosted: 28 Sep 2009, 21:04
by silly freak
wow, that sounds awesome! do you have the vanilla & easy zendikars already there? that would maybe do the trick...

Re: Armadillo Cloak

PostPosted: 28 Sep 2009, 21:11
by mtgrares
Oops, I didn't see the main thread. Disregard.

Re: Armadillo Cloak

PostPosted: 28 Sep 2009, 21:25
by Chris H.
silly freak wrote:wow, that sounds awesome! do you have the vanilla & easy zendikars already there? that would maybe do the trick...
We are very close to the 2000 mark. I am working on a few more (simple ???) keywords but I have no idea how long it will take me. :)

Re: Armadillo Cloak

PostPosted: 28 Sep 2009, 21:56
by DennisBergkamp
wow, that sounds awesome! do you have the vanilla & easy zendikars already there? that would maybe do the trick...
I have them in my local version, which I will release in a few days (still fixing some bugs, and testing some random things). According to my deck editor it has 1985 cards now. It also includes all your IO updates :)