@Override public CastOnlyIfConditionIsTrueAbility copy() { return new CastOnlyIfConditionIsTrueAbility(this); } }
public ChecksAndBalances(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}"); // Cast this spell only if there are three or more players in the game. this.addAbility(new CastOnlyIfConditionIsTrueAbility(ChecksAndBalancesCondition.instance, "Cast this spell only if there are three or more players in the game")); // Whenever a player casts a spell, each of that player’s opponents may discard a card. If they do, counter that spell. this.addAbility(new SpellCastAllTriggeredAbility(new ChecksAndBalancesEffect(), new FilterSpell("a spell"), false, SetTargetPointer.SPELL)); }
public EvenTheOdds(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{W}"); // Cast Even the Odds only if you control fewer creatures than each opponent. this.addAbility(new CastOnlyIfConditionIsTrueAbility(new ControlsPermanentsComparedToOpponentsCondition(ComparisonType.FEWER_THAN, StaticFilters.FILTER_PERMANENT_CREATURES))); // Create three 1/1 white Soldier creature tokens. this.getSpellAbility().addEffect(new CreateTokenEffect(new SoldierToken(), 3)); }
public Blizzard(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}"); // Cast Blizzard only if you control a snow land. this.addAbility(new CastOnlyIfConditionIsTrueAbility( new PermanentsOnTheBattlefieldCondition(filter, ComparisonType.MORE_THAN, 0) )); // Cumulative upkeep {2} this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{2}"))); // Creatures with flying don't untap during their controllers' untap steps. this.addAbility(new SimpleStaticAbility( Zone.BATTLEFIELD, new DontUntapInControllersUntapStepAllEffect( Duration.WhileOnBattlefield, TargetController.ANY, filter2 ) )); }
public FeastOfBlood(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}"); // Cast Feast of Blood only if you control two or more Vampires. this.addAbility(new CastOnlyIfConditionIsTrueAbility( new PermanentsOnTheBattlefieldCondition( new FilterControlledCreaturePermanent(SubType.VAMPIRE, "if you control two or more Vampires"), ComparisonType.MORE_THAN, 1))); // Destroy target creature. You gain 4 life. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addEffect(new GainLifeEffect(4)); }
public Delirium(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{B}{R}"); // Cast this spell only during an opponent’s turn. this.addAbility(new CastOnlyIfConditionIsTrueAbility(OnOpponentsTurnCondition.instance, "Cast this spell only during an opponent’s turn.")); // Tap target creature that player controls. That creature deals damage equal to its power to the player. Prevent all combat damage that would be dealt to and dealt by the creature this turn. this.getSpellAbility().addEffect(new TapTargetEffect().setText("target creature that player controls")); this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); this.getSpellAbility().addEffect(new DeliriumEffect()); this.getSpellAbility().addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, true).setText("Prevent all combat damage that would be dealt to")); this.getSpellAbility().addEffect(new PreventDamageByTargetEffect(Duration.EndOfTurn, true).setText("and dealt by the creature this turn.")); }