- Convert AEther Tradewinds to ChangeZone

This commit is contained in:
jendave
2011-08-06 14:29:48 +00:00
parent f1ae4d0c2e
commit ddc19d0dcb
3 changed files with 6 additions and 65 deletions

View File

@@ -2,6 +2,8 @@ Name:AEther Tradewinds
ManaCost:2 U
Types:Instant
Text:no text
A:SP$ChangeZone | Cost$ 2 U | Origin$ Battlefield | Destination$ Hand | ValidTgts$ Permanent.YouCtrl | TgtPrompt$ Select target permanent you control | SubAbility$ SVar=DBChange | SpellDescription$ Return target permanent you control and target permanent you don't control to their owners' hands.
SVar:DBChange:DB$ChangeZone | Origin$ Battlefield | Destination$ Hand | ValidTgts$ Permanent.YouDontCtrl | TgtPrompt$ Select target permanent you don't control
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/aether_tradewinds.jpg

View File

@@ -695,7 +695,10 @@ public class AbilityFactory_ChangeZone {
StringBuilder sb = new StringBuilder();
Card host = af.getHostCard();
sb.append(host.getName()).append(" - ");
if (!(sa instanceof Ability_Sub))
sb.append(host.getName()).append(" -");
sb.append(" ");
String destination = params.get("Destination");
String origin = params.get("Origin");

View File

@@ -4357,71 +4357,7 @@ public class CardFactory_Instants {
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("AEther Tradewinds")) {
final Card[] target = new Card[2];
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -3811167493596209322L;
@Override
public boolean canPlayAI() {
return false;
}
@Override
public void resolve() {
for(int i = 0; i < target.length; i++) {
if(AllZone.GameAction.isCardInPlay(target[i]) && CardFactoryUtil.canTarget(card, target[i])) {
AllZone.GameAction.moveToHand(target[i]);
}
}
}
};
final Input runtime = new Input() {
private static final long serialVersionUID = -8139950662809697287L;
boolean firstTarget = true;
@Override
public void showMessage() {
StringBuilder sb = new StringBuilder();
if(firstTarget) sb.append(card.getName()).append(" - Select target permanent you control");
else sb.append(card.getName()).append(" - Select target permanent you don't control");
AllZone.Display.showMessage(sb.toString());
ButtonUtil.enableOnlyCancel();
}
@Override
public void selectButtonCancel() {
stop();
}
@Override
public void selectCard(Card c, PlayerZone zone) {
Player player = firstTarget ? AllZone.HumanPlayer : AllZone.ComputerPlayer;
if(zone.is(Constant.Zone.Battlefield, player) && CardFactoryUtil.canTarget(card, c)) {
if(null == target[0]) {
target[0] = c;
firstTarget = false;
showMessage();
}
else if(null == target[1]) {
target[1] = c;
stopSetNext(new Input_PayManaCost(spell));
}
}
}
};
spell.setDescription("Return target permanent you control and target permanent you don't control to their owners' hands.");
spell.setStackDescription(cardName+" - Return target permanents to their owners' hands.");
spell.setBeforePayMana(runtime);
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
return card;
}//getCard