- Converted Echoing Decay to script.

This commit is contained in:
jeffwadsworth
2012-01-22 00:16:02 +00:00
parent 95da753ab5
commit e1140d3d9a
2 changed files with 4 additions and 74 deletions

View File

@@ -1,7 +1,10 @@
Name:Echoing Decay
ManaCost:1 B
Types:Instant
Text:Target creature and all other creatures with the same name as that creature get -2/-2 until end of turn.
Text:no text
A:SP$ Pump | Cost$ 1 B | ValidTgts$ Creature | TgtPrompt$ Select target creature | RememberTargets$ True | NumAtt$ -2 | NumDef$ -2 | SubAbility$ DBPumpAll | SpellDescription$ Target creature and all other creatures with the same name as that creature get -2/-2 until end of turn.
SVar:DBPumpAll:DB$ PumpAll | ValidCards$ Remembered.sameName | NumAtt$ -2 | NumDef$ -2 | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Rarity:Common
SVar:Picture:http://resources.wizards.com/magic/cards/dst/en-us/card46176.jpg
SetInfo:DST|Common|http://magiccards.info/scans/en/ds/41.jpg

View File

@@ -274,79 +274,6 @@ public class CardFactoryInstants {
card.addSpellAbility(spell);
} //*************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Echoing Decay")) {
final Cost cost = new Cost(card.getManaCost(), cardName, false);
final Target tgt = new Target(card, "C");
final SpellAbility spell = new Spell(card, cost, tgt) {
private static final long serialVersionUID = 3154935854257358023L;
@Override
public boolean canPlayAI() {
final CardList cl = CardFactoryUtil.getHumanCreatureAI(2, this, true);
if (cl.isEmpty()) {
return false;
}
Card best = CardFactoryUtil.getBestCreatureAI(cl);
// don't target a creature that would hurt your own
if (!AllZone.getComputerPlayer().getCardsIn(Constant.Zone.Battlefield, best.getName()).isEmpty()) {
return false;
}
this.setTargetCard(best);
return true;
} // canPlayAI()
@Override
public void resolve() {
if (AllZoneUtil.isCardInPlay(this.getTargetCard()) && this.getTargetCard().canBeTargetedBy(this)) {
final Card c = this.getTargetCard();
c.addTempAttackBoost(-2);
c.addTempDefenseBoost(-2);
AllZone.getEndOfTurn().addUntil(new Command() {
private static final long serialVersionUID = 1327455269456577020L;
@Override
public void execute() {
c.addTempAttackBoost(2);
c.addTempDefenseBoost(2);
}
});
// get all creatures
CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield);
list = list.getName(this.getTargetCard().getName());
list.remove(this.getTargetCard());
if (!this.getTargetCard().isFaceDown()) {
for (int i = 0; i < list.size(); i++) {
final Card crd = list.get(i);
crd.addTempAttackBoost(-2);
crd.addTempDefenseBoost(-2);
AllZone.getEndOfTurn().addUntil(new Command() {
private static final long serialVersionUID = 5151337777143949221L;
@Override
public void execute() {
crd.addTempAttackBoost(2);
crd.addTempDefenseBoost(2);
}
});
}
}
} // in play?
} // resolve()
}; // SpellAbility
card.addSpellAbility(spell);
card.setSVar("PlayMain1", "TRUE");
} // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Hidetsugu's Second Rite")) {