- Converted Burn the Impure to script.

This commit is contained in:
jeffwadsworth
2012-01-22 17:47:07 +00:00
parent 89a6989c76
commit 3c1deb616b
2 changed files with 3 additions and 66 deletions

View File

@@ -2,6 +2,9 @@ Name:Burn the Impure
ManaCost:1 R
Types:Instant
Text:no text
A:SP$ DealDamage | Cost$ 1 R | NumDmg$ 3 | ValidTgts$ Creature | TgtPrompt$ Select target creature | SubAbility$ DBDamage | SpellDescription$ CARDNAME deals 3 damage to target creature. If that creature has infect, Burn the Impure deals 3 damage to that creature's controller.
SVar:DBDamage:DB$ DealDamage | Defined$ TargetedController | NumDmg$ 3 | ConditionCheckSVar$ X | ConditionSVarCompare$ EQ1
SVar:X:Targeted$Valid Creature.withInfect
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/burn_the_impure.jpg
SetInfo:MBS|Common|http://magiccards.info/scans/en/mbs/59.jpg

View File

@@ -621,72 +621,6 @@ public class CardFactoryInstants {
card.addSpellAbility(spell);
} // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Burn the Impure")) {
/*
* Burn the Impure deals 3 damage to target creature. If that
* creature has infect, Burn the Impure deals 3 damage to that
* creature's controller.
*/
final Cost abCost = new Cost("1 R", cardName, false);
final SpellAbility spell = new Spell(card, abCost, new Target(card, "TgtC")) {
private static final long serialVersionUID = -3069135027502686218L;
private final int damage = 3;
@Override
public void chooseTargetAI() {
CardList creatures = AllZoneUtil.getCreaturesInPlay(AllZone.getHumanPlayer());
creatures = creatures.filter(new CardListFilter() {
@Override
public boolean addCard(final Card c) {
return (c.getNetAttack() <= damage) && !c.hasKeyword("Indestructible");
}
});
final CardList infect = creatures.getKeyword("Infect");
if (infect.size() > 0) {
final Card c = CardFactoryUtil.getBestCreatureAI(infect);
this.setTargetCard(c);
} else {
final Card c = CardFactoryUtil.getBestCreatureAI(creatures);
this.setTargetCard(c);
}
} // chooseTargetAI()
@Override
public boolean canPlayAI() {
CardList creatures = AllZoneUtil.getCreaturesInPlay(AllZone.getHumanPlayer());
creatures = creatures.filter(new CardListFilter() {
@Override
public boolean addCard(final Card c) {
return (c.getNetAttack() <= damage) && !c.hasKeyword("Indestructible");
}
});
return creatures.size() > 0;
}
@Override
public void resolve() {
if (AllZoneUtil.isCardInPlay(this.getTargetCard()) && this.getTargetCard().canBeTargetedBy(this)) {
final Card c = this.getTargetCard();
c.addDamage(this.damage, card);
if (c.hasKeyword("Infect")) {
c.getController().addDamage(3, card);
}
}
}
}; // SpellAbility
final StringBuilder sb = new StringBuilder();
sb.append(cardName);
sb.append(" deals 3 damage to target creature. If that creature has infect, ");
sb.append(cardName);
sb.append(" deals 3 damage to that creature's controller.");
spell.setDescription(sb.toString());
card.addSpellAbility(spell);
} // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Turnabout")) {