- Converted Drekavac to script.

This commit is contained in:
Sloth
2012-02-09 12:38:57 +00:00
parent bbeaf03a6d
commit fc1cabecc5
4 changed files with 6 additions and 108 deletions

1
.gitattributes vendored
View File

@@ -3344,7 +3344,6 @@ res/cardsfolder/g/genju_of_the_spires.txt svneol=native#text/plain
res/cardsfolder/g/geothermal_crevice.txt svneol=native#text/plain res/cardsfolder/g/geothermal_crevice.txt svneol=native#text/plain
res/cardsfolder/g/geralfs_messenger.txt -text res/cardsfolder/g/geralfs_messenger.txt -text
res/cardsfolder/g/geralfs_mindcrusher.txt -text res/cardsfolder/g/geralfs_mindcrusher.txt -text
res/cardsfolder/g/gerrard__capashen.txt -text svneol=unset#text/plain
res/cardsfolder/g/gerrard_capashen.txt -text res/cardsfolder/g/gerrard_capashen.txt -text
res/cardsfolder/g/gerrards_battle_cry.txt svneol=native#text/plain res/cardsfolder/g/gerrards_battle_cry.txt svneol=native#text/plain
res/cardsfolder/g/gerrards_command.txt svneol=native#text/plain res/cardsfolder/g/gerrards_command.txt svneol=native#text/plain

View File

@@ -1,8 +1,13 @@
Name:Drekavac Name:Drekavac
ManaCost:1 B ManaCost:1 B
Types:Creature Beast Types:Creature Beast
Text:When CARDNAME enters the battlefield, sacrifice it unless you discard a noncreature card. Text:
PT:3/3 PT:3/3
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigDiscard | TriggerDescription$ When CARDNAME enters the battlefield, sacrifice it unless you discard a noncreature card.
SVar:TrigDiscard:AB$ Discard | Cost$ 0 | NumCards$ 1 | DiscardValid$ Card.nonCreature | Mode$ TgtChoose | Optional$ True | RememberDiscarded$ True | SubAbility$ DBSacSelf
SVar:DBSacSelf:DB$ Sacrifice | Cost$ 0 | Defined$ Self | SubAbility$ DBCleanup | ConditionCheckSVar$ X | ConditionSVarCompare$ LT1
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:X:Remembered$Amount
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://resources.wizards.com/magic/cards/dis/en-us/card111258.jpg SVar:Picture:http://resources.wizards.com/magic/cards/dis/en-us/card111258.jpg

View File

@@ -1,14 +0,0 @@
Name:Gerrard Capashen
ManaCost:3 W W
Types:Legendary Creature Human Soldier
Text:no text
PT:3/4
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | Execute$ TrigGainLife | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you gain 1 life for each card in target opponent's hand.
SVar:TrigGainLife:AB$ GainLife | Cost$ 0 | LifeAmount$ X | ValidTgts$ Opponent | TgtPrompt$ Select target opponent | Defined$ You
A:AB$ Tap | Cost$ 3 W | ValidTgts$ Creature | TgtPrompt$ Select target creature | IsPresent$ Card.Self+attacking | SpellDescription$ Tap target creature. Activate this ability only if CARDNAME is attacking.
SVar:X:TargetedPlayer$CardsInHand
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/gerrard_capashen.jpg
SetInfo:APC|Rare|http://magiccards.info/scans/en/ap/11.jpg
Oracle:At the beginning of your upkeep, you gain 1 life for each card in target opponent's hand.\n{3}{W}: Tap target creature. Activate this ability only if Gerrard Capashen is attacking.
End

View File

@@ -305,98 +305,6 @@ public class CardFactoryCreatures {
card.addComesIntoPlayCommand(intoPlay); card.addComesIntoPlayCommand(intoPlay);
} // *************** END ************ END ************************** } // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Drekavac")) {
final Input discard = new Input() {
private static final long serialVersionUID = -6392468000100283596L;
@Override
public void showMessage() {
AllZone.getDisplay().showMessage("Select a noncreature card to discard");
ButtonUtil.enableOnlyCancel();
}
@Override
public void selectCard(final Card c, final PlayerZone zone) {
if (zone.is(Constant.Zone.Hand) && !c.isCreature()) {
c.getController().discard(c, null);
this.stop();
}
}
@Override
public void selectButtonCancel() {
AllZone.getGameAction().sacrifice(card);
this.stop();
}
}; // Input
final SpellAbility ability = new Ability(card, "0") {
@Override
public void resolve() {
if (card.getController().isHuman()) {
if (AllZone.getHumanPlayer().getCardsIn(Zone.Hand).size() == 0) {
AllZone.getGameAction().sacrifice(card);
} else {
AllZone.getInputControl().setInput(discard);
}
} else {
CardList list = AllZone.getComputerPlayer().getCardsIn(Zone.Hand);
list = list.filter(new CardListFilter() {
@Override
public boolean addCard(final Card c) {
return (!c.isCreature());
}
});
list.get(0).getController().discard(list.get(0), this);
} // else
} // resolve()
}; // SpellAbility
final Command intoPlay = new Command() {
private static final long serialVersionUID = 9202753910259054021L;
@Override
public void execute() {
final StringBuilder sb = new StringBuilder();
sb.append(card.getController());
sb.append(" sacrifices Drekavac unless he discards a noncreature card");
ability.setStackDescription(sb.toString());
AllZone.getStack().addSimultaneousStackEntry(ability);
}
};
final SpellAbility spell = new SpellPermanent(card) {
private static final long serialVersionUID = -2940969025405788931L;
// could never get the AI to work correctly
// it always played the same card 2 or 3 times
@Override
public boolean canPlayAI() {
return false;
}
@Override
public boolean canPlay() {
CardList list = card.getController().getCardsIn(Zone.Hand);
list.remove(card);
list = list.filter(new CardListFilter() {
@Override
public boolean addCard(final Card c) {
return (!c.isCreature());
}
});
return list.size() != 0;
} // canPlay()
};
card.addComesIntoPlayCommand(intoPlay);
// Do not remove SpellAbilities created by AbilityFactory or
// Keywords.
card.clearFirstSpell();
card.addSpellAbility(spell);
} // *************** END ************ END **************************
// *************** START *********** START ************************** // *************** START *********** START **************************
else if (cardName.equals("Minotaur Explorer") || cardName.equals("Balduvian Horde") else if (cardName.equals("Minotaur Explorer") || cardName.equals("Balduvian Horde")