mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Converted Echoing Decay to script.
This commit is contained in:
@@ -1,7 +1,10 @@
|
|||||||
Name:Echoing Decay
|
Name:Echoing Decay
|
||||||
ManaCost:1 B
|
ManaCost:1 B
|
||||||
Types:Instant
|
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:Rarity:Common
|
||||||
SVar:Picture:http://resources.wizards.com/magic/cards/dst/en-us/card46176.jpg
|
SVar:Picture:http://resources.wizards.com/magic/cards/dst/en-us/card46176.jpg
|
||||||
SetInfo:DST|Common|http://magiccards.info/scans/en/ds/41.jpg
|
SetInfo:DST|Common|http://magiccards.info/scans/en/ds/41.jpg
|
||||||
|
|||||||
@@ -274,79 +274,6 @@ public class CardFactoryInstants {
|
|||||||
card.addSpellAbility(spell);
|
card.addSpellAbility(spell);
|
||||||
} //*************** END ************ END **************************
|
} //*************** 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 **************************
|
// *************** START *********** START **************************
|
||||||
else if (cardName.equals("Hidetsugu's Second Rite")) {
|
else if (cardName.equals("Hidetsugu's Second Rite")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user