public Reset(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}{U}"); // Cast Reset only during an opponent's turn after their upkeep step. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, null, new CompoundCondition(OnOpponentsTurnCondition.instance, AfterUpkeepStepCondtion.instance), "Cast this spell only during an opponent's turn after their upkeep step")); // Untap all lands you control. this.getSpellAbility().addEffect(new UntapAllLandsControllerEffect()); }
@Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { controller.getAlternativeSourceCosts().add(new AlternativeCostSourceAbility( null, new CompoundCondition(SourceIsSpellCondition.instance, new IsBeingCastFromHandCondition()), null, new FilterNonlandCard(), true)); return true; } return false; }
public BarrenGlory(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{W}{W}"); // At the beginning of your upkeep, if you control no permanents other than Barren Glory and have no cards in hand, you win the game. this.addAbility(new ConditionalInterveningIfTriggeredAbility( new BeginningOfUpkeepTriggeredAbility(new WinGameSourceControllerEffect(), TargetController.YOU, false), new CompoundCondition( new CardsInHandCondition(ComparisonType.EQUAL_TO, 0), new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.EQUAL_TO, 0) ), "At the beginning of your upkeep, if you control no permanents other than {this} and have no cards in hand, you win the game")); }
public TrapRunner(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(2); this.toughness = new MageInt(3); // {T}: Target unblocked attacking creature becomes blocked. Activate this ability only during combat after blockers are declared. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new TrapRunnerEffect(), new TapSourceCost(), new CompoundCondition("during combat after blockers are declared", new IsPhaseCondition(TurnPhase.COMBAT), AfterBlockersAreDeclaredCondition.instance)); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); }
private static Condition makeAndCondition(ObjectColor color1, ObjectColor color2) { FilterPermanent filter1 = new FilterPermanent(); filter1.add(new ColorPredicate(color1)); Condition condition1 = new PermanentsOnTheBattlefieldCondition(filter1); FilterPermanent filter2 = new FilterPermanent(); filter2.add(new ColorPredicate(color2)); Condition condition2 = new PermanentsOnTheBattlefieldCondition(filter2); return new CompoundCondition(condition1, condition2); }
public SirensCall(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{U}"); // Cast Siren's Call only during an opponent's turn, before attackers are declared. this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, null, new CompoundCondition(OnOpponentsTurnCondition.instance, BeforeAttackersAreDeclaredCondition.instance), "Cast this spell only during an opponent's turn, before attackers are declared")); // Creatures the active player controls attack this turn if able. this.getSpellAbility().addEffect(new SirensCallMustAttackEffect()); // At the beginning of the next end step, destroy all non-Wall creatures that player controls that didn't attack this turn. Ignore this effect for each creature the player didn't control continuously since the beginning of the turn. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new SirensCallDestroyEffect()))); this.getSpellAbility().addWatcher(new AttackedThisTurnWatcher()); }
public RushwoodLegate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); this.subtype.add(SubType.DRYAD); this.power = new MageInt(2); this.toughness = new MageInt(1); // If an opponent controls an Island and you control a Forest, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls an Island and you control a Forest", new OpponentControlsPermanentCondition(filterIsland), new PermanentsOnTheBattlefieldCondition(filterForest)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); }
public Massacre(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{B}{B}"); // If an opponent controls a Plains and you control a Swamp, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Plains and you control a Swamp", new OpponentControlsPermanentCondition(filterPlains), new PermanentsOnTheBattlefieldCondition(filterSwamp)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); // All creatures get -2/-2 until end of turn. this.getSpellAbility().addEffect(new BoostAllEffect(-2, -2, Duration.EndOfTurn)); }
public WillowSatyr(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}"); this.subtype.add(SubType.SATYR); this.power = new MageInt(1); this.toughness = new MageInt(1); // You may choose not to untap Willow Satyr during your untap step. this.addAbility(new SkipUntapOptionalAbility()); // {tap}: Gain control of target legendary creature for as long as you control Willow Satyr and Willow Satyr remains tapped. ConditionalContinuousEffect effect = new ConditionalContinuousEffect( new GainControlTargetEffect(Duration.Custom), new CompoundCondition(SourceTappedCondition.instance, new SourceOnBattlefieldControlUnchangedCondition()), "Gain control of target legendary creature for as long as you control {this} and {this} remains tapped"); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(filter)); this.addAbility(ability); }
public KongmingsContraptions(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(2); this.toughness = new MageInt(4); // {T}: Kongming's Contraptions deals 2 damage to target attacking creature. Activate this ability only during the declare attackers step and only if you've been attacked this step. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost(), new CompoundCondition("during the declare attackers step and only if you've been attacked this step", new IsStepCondition(PhaseStep.DECLARE_ATTACKERS, false), AttackedThisStepCondition.instance) ); ability.addTarget(new TargetPermanent(new FilterAttackingCreature())); this.addAbility(ability, new PlayerAttackedStepWatcher()); }
public SivvisRuse(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{W}{W}"); // If an opponent controls a Mountain and you control a Plains, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Mountain and you control a Plains", new OpponentControlsPermanentCondition(filterMountain), new PermanentsOnTheBattlefieldCondition(filterPlains)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); // Prevent all damage that would be dealt this turn to creatures you control. this.getSpellAbility().addEffect(new PreventAllDamageToAllEffect(Duration.EndOfTurn, new FilterControlledCreatureInPlay())); }
public TradeCaravan(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.NOMAD); this.power = new MageInt(1); this.toughness = new MageInt(1); // At the beginning of your upkeep, put a currency counter on Trade Caravan. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.CURRENCY.createInstance()), TargetController.YOU, false)); // Remove two currency counters from Trade Caravan: Untap target basic land. Activate this ability only during an opponent's upkeep. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new UntapTargetEffect(), new RemoveCountersSourceCost(CounterType.CURRENCY.createInstance(2)), new CompoundCondition(OnOpponentsTurnCondition.instance, new IsStepCondition(PhaseStep.UPKEEP, false)), "Remove two currency counters from {this}: Untap target basic land. Activate this ability only during an opponent's upkeep."); ability.addTarget(new TargetPermanent(filter)); this.addAbility(ability); }
public SaprazzanLegate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}"); this.subtype.add(SubType.MERFOLK, SubType.SOLDIER); this.power = new MageInt(1); this.toughness = new MageInt(3); // Flying this.addAbility(FlyingAbility.getInstance()); // If an opponent controls a Mountain and you control an Island, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Mountain and you control an Island", new OpponentControlsPermanentCondition(filterMountain), new PermanentsOnTheBattlefieldCondition(filterIsland)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); }
public KyrenLegate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); this.subtype.add(SubType.GOBLIN); this.power = new MageInt(1); this.toughness = new MageInt(1); // Haste this.addAbility(HasteAbility.getInstance()); // If an opponent controls a Plains and you control a Mountain, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Plains and you control a Mountain", new OpponentControlsPermanentCondition(filterPlains), new PermanentsOnTheBattlefieldCondition(filterMountain)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); }
public Submerge(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{4}{U}"); // If an opponent controls a Forest and you control an Island, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Forest and you control an Island", new OpponentControlsPermanentCondition(filterForest), new PermanentsOnTheBattlefieldCondition(filterIsland)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); // Put target creature on top of its owner's library. this.getSpellAbility().addEffect(new PutOnLibraryTargetEffect(true)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); }
public MoggSalvage(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{R}"); // If an opponent controls an Island and you control a Mountain, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls an Island and you control a Mountain", new OpponentControlsPermanentCondition(filterIsland), new PermanentsOnTheBattlefieldCondition(filterMountain)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); // Destroy target artifact. this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); }
public RefreshingRain(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{G}"); // If an opponent controls a Swamp and you control a Forest, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Swamp and you control a Forest", new OpponentControlsPermanentCondition(filterSwamp), new PermanentsOnTheBattlefieldCondition(filterForest)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); // Target player gains 6 life. this.getSpellAbility().addEffect(new GainLifeTargetEffect(6)); this.getSpellAbility().addTarget(new TargetPlayer()); }
public ChoArrimLegate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.SOLDIER); this.power = new MageInt(1); this.toughness = new MageInt(2); // Protection from black this.addAbility(ProtectionAbility.from(ObjectColor.BLACK)); // If an opponent controls a Swamp and you control a Plains, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Swamp and you control a Plains", new OpponentControlsPermanentCondition(filterSwamp), new PermanentsOnTheBattlefieldCondition(filterPlains)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); }
public DeepwoodLegate(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}"); this.subtype.add(SubType.SHADE); this.power = new MageInt(1); this.toughness = new MageInt(1); // If an opponent controls a Forest and you control a Swamp, you may cast this spell without paying its mana cost. Condition condition = new CompoundCondition("If an opponent controls a Forest and you control a Swamp", new OpponentControlsPermanentCondition(filterForest), new PermanentsOnTheBattlefieldCondition(filterSwamp)); this.addAbility(new AlternativeCostSourceAbility(null, condition)); // {B}: Deepwood Legate gets +1/+1 until end of turn. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.EndOfTurn), new ManaCostsImpl("{B}"))); }
public Melee(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{R}"); // Cast Melee only during your turn and only during combat before blockers are declared. Condition condition = new CompoundCondition(BeforeBlockersAreDeclaredCondition.instance, new IsPhaseCondition(TurnPhase.COMBAT), MyTurnCondition.instance); this.addAbility(new CastOnlyDuringPhaseStepSourceAbility(null, null, condition, "Cast this spell only during your turn and only during combat before blockers are declared")); // You choose which creatures block this combat and how those creatures block. // (only the last resolved Melee spell's blocking effect applies) this.getSpellAbility().addEffect(new MeleeChooseBlockersEffect()); this.getSpellAbility().addWatcher(new ChooseBlockersRedundancyWatcher()); this.getSpellAbility().addEffect(new ChooseBlockersRedundancyWatcherIncrementEffect()); // Whenever a creature attacks and isn't blocked this combat, untap it and remove it from combat. this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new MeleeTriggeredAbility())); }