mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
convert Venser, the Sojourner completely to script
This commit is contained in:
@@ -3,6 +3,10 @@ ManaCost:3 W U
|
||||
Types:Planeswalker Venser
|
||||
Text:no text
|
||||
Loyalty:3
|
||||
A:AB$ ChangeZone | Cost$ AddCounter<2/LOYALTY> | Planeswalker$ True | ValidTgts$ Permanent.YouOwn | TgtPrompt$ Select target permanent you own | Origin$ Battlefield | Destination$ Exile | RememberTargets$ True | SubAbility$ SVar=DelTrig | SpellDescription$ Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step.
|
||||
SVar:DelTrig:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturn | TriggerDescription$ Return exiled card to the battlefield.
|
||||
SVar:TrigReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Battlefield | Defined$ Remembered | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
A:AB$PumpAll | Cost$ SubCounter<1/LOYALTY> | Planeswalker$ True | ValidCards$ Creature | KW$ Unblockable | SpellDescription$ Creatures are unblockable this turn.
|
||||
A:AB$Effect | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Name$ Venser, the Sojourner emblem | Triggers$ TrigSpellCast | SVars$ EffSpellCast | Duration$ Permanent | SpellDescription$ You get an emblem with "Whenever you cast a spell, exile target permanent."
|
||||
SVar:TrigSpellCast:Mode$ SpellCast | ValidControllingPlayer$ You | Execute$ EffSpellCast | TriggerDescription$ Whenever you cast a spell, exile target permanent.
|
||||
|
||||
@@ -1462,112 +1462,6 @@ public class CardFactory_Planeswalkers {
|
||||
}
|
||||
//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if (cardName.equals("Venser, the Sojourner")) {
|
||||
|
||||
final int turn[] = new int[1];
|
||||
turn[0] = -1;
|
||||
|
||||
final SpellAbility ability1 = new Ability(card, "0") {
|
||||
@Override
|
||||
public void resolve() {
|
||||
final Card c = getTargetCard();
|
||||
|
||||
if (c != null && AllZoneUtil.isCardInPlay(c)) {
|
||||
final Command eot = new Command() {
|
||||
|
||||
private static final long serialVersionUID = -947355314271308770L;
|
||||
|
||||
public void execute() {
|
||||
if (AllZoneUtil.isCardExiled(c)) {
|
||||
PlayerZone play = c.getOwner().getZone(Constant.Zone.Battlefield);
|
||||
AllZone.getGameAction().moveTo(play, AllZoneUtil.getCardState(c));
|
||||
}
|
||||
}//execute()
|
||||
};//Command
|
||||
|
||||
card.addCounterFromNonEffect(Counters.LOYALTY, 2);
|
||||
turn[0] = AllZone.getPhase().getTurn();
|
||||
|
||||
AllZone.getGameAction().exile(c);
|
||||
AllZone.getEndOfTurn().addAt(eot);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||
list = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return CardFactoryUtil.canTarget(card, c) && c.getOwner().isComputer() &&
|
||||
!c.equals(card);
|
||||
}
|
||||
});
|
||||
if (list.size() > 0) {
|
||||
|
||||
CardList bestCards = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.getName().equals("Venerated Teacher")
|
||||
|| c.getName().equals("Stoneforge Mystic")
|
||||
|| c.getName().equals("Sun Titan")
|
||||
|| c.isType("Ally");
|
||||
}
|
||||
});
|
||||
|
||||
if (bestCards.size() > 0) {
|
||||
bestCards.shuffle();
|
||||
setTargetCard(bestCards.get(0));
|
||||
}
|
||||
setTargetCard(list.get(0));
|
||||
}
|
||||
|
||||
return card.getCounters(Counters.LOYALTY) < 8 && list.size() > 0 &&
|
||||
AllZone.getPhase().getPhase().equals("Main2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
for (int i = 0; i < AllZone.getStack().size(); i++) {
|
||||
if (AllZone.getStack().peekInstance(i).getSourceCard().equals(card)) return false;
|
||||
}
|
||||
return 0 < card.getCounters(Counters.LOYALTY)
|
||||
&& AllZone.getZoneOf(card).is(Constant.Zone.Battlefield)
|
||||
&& turn[0] != AllZone.getPhase().getTurn()
|
||||
&& Phase.canCastSorcery(card.getController());
|
||||
}//canPlay()
|
||||
|
||||
};//SpellAbility ability1
|
||||
|
||||
Input runtime = new Input() {
|
||||
private static final long serialVersionUID = 8609211991425118222L;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||
list = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.isPermanent() && c.getOwner().isHuman()
|
||||
&& CardFactoryUtil.canTarget(card, c);
|
||||
}
|
||||
});
|
||||
|
||||
stopSetNext(CardFactoryUtil.input_targetSpecific(ability1, list,
|
||||
"Select target permanent you own", true, false));
|
||||
}//showMessage()
|
||||
};//Input
|
||||
|
||||
ability1.setBeforePayMana(runtime);
|
||||
ability1.setDescription("+2: Exile target permanent you own. Return it to the battlefield under your control at the beginning of the next end step.");
|
||||
card.addSpellAbility(ability1);
|
||||
|
||||
card.setSVars(card.getSVars());
|
||||
card.setSets(card.getSets());
|
||||
|
||||
return card;
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
return card;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user