- Convert Serra Avenger to script

This commit is contained in:
Sol
2013-02-27 02:58:08 +00:00
parent bbe1dc10ce
commit 03772dd095
3 changed files with 11 additions and 18 deletions

View File

@@ -1,10 +1,11 @@
Name:Serra Avenger Name:Serra Avenger
ManaCost:W W ManaCost:W W
Types:Creature Angel Types:Creature Angel
Text:You can't play Serra Avenger during your first, second, or third turns of the game.
PT:3/3 PT:3/3
K:Flying K:Flying
K:Vigilance K:Vigilance
S:Mode$ CantBeCast | ValidCard$ Card.Self | EffectZone$ All | CheckSVar$ X | SVarCompare$ LE3 | Description$ You can't play Serra Avenger during your first, second, or third turns of the game.
SVar:X:Count$YourTurns
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://resources.wizards.com/magic/cards/tsp/en-us/card113519.jpg SVar:Picture:http://resources.wizards.com/magic/cards/tsp/en-us/card113519.jpg
SetInfo:M13|Rare|http://magiccards.info/scans/en/m13/33.jpg SetInfo:M13|Rare|http://magiccards.info/scans/en/m13/33.jpg

View File

@@ -1920,6 +1920,15 @@ public class CardFactoryUtil {
} }
} }
if (sq[0].equals("YourTurns")) {
return CardFactoryUtil.doXMath(cardController.getTurn(), m, c);
}
if (sq[0].equals("TotalTurns")) {
// Sorry for the Singleton use, replace this once this function has game passed into it
return CardFactoryUtil.doXMath(Singletons.getModel().getGame().getPhaseHandler().getTurn(), m, c);
}
// Generic Zone-based counting // Generic Zone-based counting
// Count$QualityAndZones.Subquality // Count$QualityAndZones.Subquality

View File

@@ -260,23 +260,6 @@ public class SpellPermanent extends Spell {
} // Spell_Permanent() } // Spell_Permanent()
/** {@inheritDoc} */
@Override
public boolean canPlay() {
final Card source = this.getSourceCard();
final Player turn = Singletons.getModel().getGame().getPhaseHandler().getPlayerTurn();
if (source.getName().equals("Serra Avenger")) {
if (turn.equals(source.getController()) && (turn.getTurn() <= 3)) {
return false;
}
}
// Flash handled by super.canPlay
return super.canPlay();
}
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
public boolean canPlayAI() { public boolean canPlayAI() {