add Desert (from Arabian Nights). Made possible by the new Phase code changes. Thanks Sol!

This commit is contained in:
jendave
2011-08-06 10:01:01 +00:00
parent d565c0ae0b
commit e4b6e4d8ff
3 changed files with 52 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -1058,6 +1058,7 @@ res/cardsfolder/deranged_hermit.txt -text svneol=native#text/plain
res/cardsfolder/derelor.txt -text svneol=native#text/plain
res/cardsfolder/descendant_of_soramaro.txt -text svneol=native#text/plain
res/cardsfolder/desecrated_earth.txt -text svneol=native#text/plain
res/cardsfolder/desert.txt -text svneol=native#text/plain
res/cardsfolder/desert_drake.txt -text svneol=native#text/plain
res/cardsfolder/desert_sandstorm.txt -text svneol=native#text/plain
res/cardsfolder/desert_twister.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,8 @@
Name:Desert
ManaCost:no cost
Types:Land
Text:no text
K:tap: add 1
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/desert.jpg
End

View File

@@ -3603,6 +3603,49 @@ class CardFactory_Lands {
card.addSpellAbility(addMana);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Desert")) {
/*
* Tap: Add 1 to your mana pool.
* Tap: Desert deals 1 damage to target attacking creature.
* Activate this ability only during the end of combat step.
*/
final String Tgts[] = {"Creature.attacking"};
Target target = new Target("TgtV", "Select target attacking creature.", Tgts);
Ability_Cost abCost = new Ability_Cost("T", card.getName(), true);
final SpellAbility ability = new Ability_Activated(card, abCost, target) {
private static final long serialVersionUID = 4707010813373688290L;
@Override
public boolean canPlayAI() {
CardList list = AllZoneUtil.getCreaturesInPlay(card.getController().getOpponent());
list = list.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isAttacking();
}
});
return list.size() > 0 && canPlay();
}//canPlayAI()
@Override
public boolean canPlay() {
return AllZone.Phase.getPhase().equals(Constant.Phase.Combat_End);
}
@Override
public void resolve() {
if(getTargetCard() == null) return;
Card c = getTargetCard();
c.addDamage(1, card);
}//resolve()
};//SpellAbility
ability.setDescription(abCost+"Desert deals 1 damage to target attacking creature. Activate this ability only during the end of combat step.");
card.addSpellAbility(ability);//ability.setBeforePayMana(CardFactoryUtil.input_targetCreatureKeyword_NoCost_TapAbility("Flying", ability));
}//*************** END ************ END **************************
return card;
}