It is currently 18 Apr 2024, 11:46
   
Text Size

Umbral Mantle

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Umbral Mantle

Postby zerker2000 » 08 Jul 2009, 04:30

Yes, I Am a fan of untap abilities :P.
First off, please correct me if I'm wrong on these:
SpellAbility:
Code: Select all
  public void setSourceCard(Card c) {sourceCard=c;}
Card:
Code: Select all
  public void addSpellAbility(SpellAbility a) {spellAbility.add(a);>a.setSourceCard(this);<}
Now, with those agreed on, here's the card:
Code: Select all
    if (cardName.equals("Umbral Mantle"))
    {
       final Ability equip = new Ability(card, "0")
       {
          public void resolve()
          {
             if (AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) )
             {
                if (card.isEquipping())
                {
                   Card crd = card.getEquipping().get(0);
                   if (crd.equals(getTargetCard()) )
                      return;
                   
                   card.unEquipCard(crd);
                }
             
                card.equipCard(getTargetCard());
             }
          }
          
          public boolean canPlay()
          {
             return AllZone.getZone(card).is(Constant.Zone.Play) &&           
                      AllZone.Phase.getActivePlayer().equals(card.getController()) &&
                      !AllZone.Phase.getPhase().equals("End of Turn") &&
                   !AllZone.Phase.getPhase().equals(Constant.Phase.Combat_Declare_Blockers_InstantAbility);
          }
          

          public boolean canPlayAI()
            {
              return false;
            }
       };//equip ability

       
       final Ability untapboost=new Ability (card, "3")
      {
          public void resolve(){
            getSourceCard().addTempAttackBoost(2);
            getSourceCard().addTempDefenseBoost(2);
            getSourceCard().untap();
         }
         public boolean canPlay(){return (getSourceCard().isTapped() && !getSourceCard().hasSickness() && super.canPlay());}
      };//equiped creature's ability
      
       Command onEquip = new Command()
       {   
         private static final long serialVersionUID = 1L;

         public void execute()
           {
            if (card.isEquipping())
             {
               Card crd=card.getEquipping().get(0);
               untapboost.setDescription("3, Untap:"+crd+" gets +2/+2 until end of turn");
                untapboost.setStackDescription(crd+ " - +2/+2 until EOT");
               
               crd.addSpellAbility(untapboost);
             }
           }//execute()
       };//Command
      

       Command onUnEquip = new Command()
       {   
         private static final long serialVersionUID = -3427116314295067303L;

         public void execute()
           {
            if (card.isEquipping())
             {
                Card crd = card.getEquipping().get(0);
                crd.removeSpellAbility(untapboost);
             }
            
           }//execute()
       };//Command
       
       equip.setBeforePayMana(CardFactoryUtil.input_targetCreature(equip));
       
       equip.setDescription("Equip: 1");
       card.addSpellAbility(equip);
       
       card.setEquip(onEquip);
       card.setUnEquip(onUnEquip);
    } //*************** END ************ END **************************   
O forest, hold thy wand'ring son
Though fears assail the door.
O foliage, cloak thy ravaged one
In vestments cut for war.


--Eladamri, the Seed of Freyalise
zerker2000
Programmer
 
Posts: 569
Joined: 09 May 2009, 21:40
Location: South Pasadena, CA
Has thanked: 0 time
Been thanked: 0 time

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 57 guests


Who is online

In total there are 57 users online :: 0 registered, 0 hidden and 57 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 57 guests

Login Form