Umbral Mantle
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Umbral Mantle
by zerker2000 » 08 Jul 2009, 04:30
Yes, I Am a fan of untap abilities .
First off, please correct me if I'm wrong on these:
SpellAbility:
First off, please correct me if I'm wrong on these:
SpellAbility:
- Code: Select all
public void setSourceCard(Card c) {sourceCard=c;}
- Code: Select all
public void addSpellAbility(SpellAbility a) {spellAbility.add(a);>a.setSourceCard(this);<}
- 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
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
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 111 guests