add Agony Warp (from Archenemy)

This commit is contained in:
jendave
2011-08-06 14:12:34 +00:00
parent 8714b375cf
commit af9271f55b
3 changed files with 98 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -81,6 +81,7 @@ res/cardsfolder/agent_of_shauku.txt -text svneol=native#text/plain
res/cardsfolder/agent_of_stromgald.txt -text svneol=native#text/plain
res/cardsfolder/aggressive_urge.txt -text svneol=native#text/plain
res/cardsfolder/agility.txt -text svneol=native#text/plain
res/cardsfolder/agony_warp.txt -text svneol=native#text/plain
res/cardsfolder/air_bladder.txt -text svneol=native#text/plain
res/cardsfolder/air_elemental.txt -text svneol=native#text/plain
res/cardsfolder/air_servant.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,7 @@
Name:Agony Warp
ManaCost:U B
Types:Instant
Text:Target creature gets -3/-0 until end of turn.\r\n\r\nTarget creature gets -0/-3 until end of turn.
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/agony_warp.jpg
End

View File

@@ -4199,6 +4199,96 @@ public class CardFactory_Instants {
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Agony Warp")) {
final Card[] target = new Card[2];
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 3818559481920103914L;
@Override
public boolean canPlayAI() {
return false;
}
@Override
public void resolve() {
final Command untilEOTAtt = new Command() {
private static final long serialVersionUID = 7327217065460047190L;
public void execute() {
if(AllZone.GameAction.isCardInPlay(target[0])) {
target[0].addTempAttackBoost(3);
}
}
};
final Command untilEOTDef = new Command() {
private static final long serialVersionUID = -5195474401697095394L;
public void execute() {
if(AllZone.GameAction.isCardInPlay(target[1])) {
target[1].addTempDefenseBoost(3);
}
}
};
if(AllZone.GameAction.isCardInPlay(target[0]) && CardFactoryUtil.canTarget(card, target[0])) {
target[0].addTempAttackBoost(-3);
AllZone.EndOfTurn.addUntil(untilEOTAtt);
}
if(AllZone.GameAction.isCardInPlay(target[1]) && CardFactoryUtil.canTarget(card, target[1])) {
target[1].addTempDefenseBoost(-3);
AllZone.EndOfTurn.addUntil(untilEOTDef);
}
}
};
final Input runtime = new Input() {
private static final long serialVersionUID = -6933844881209733696L;
boolean firstTarget = true;
@Override
public void showMessage() {
StringBuilder sb = new StringBuilder();
if(firstTarget) sb.append(card.getName()).append(" - Select target creature to get -3/-0");
else sb.append(card.getName()).append(" - Select target creature to get -0/-3");
AllZone.Display.showMessage(sb.toString());
ButtonUtil.enableOnlyCancel();
}
@Override
public void selectButtonCancel() {
stop();
}
@Override
public void selectCard(Card c, PlayerZone zone) {
if(zone.is(Constant.Zone.Battlefield) && CardFactoryUtil.canTarget(card, c) &&
c.isCreature()) {
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("Target creature gets -3/-0 until end of turn.\n\nTarget creature gets -0/-3 until end of turn.");
spell.setStackDescription(cardName+" - Target creature gets -3/-0 until end of turn.\n\nTarget creature gets -0/-3 until end of turn.");
spell.setBeforePayMana(runtime);
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
return card;
}//getCard
}