@Override public RemoveCounterSourceEffect copy() { return new RemoveCounterSourceEffect(this); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller == null) { return false; } MageObject sourceObject = source.getSourceObjectIfItStillExists(game); if (sourceObject instanceof Card) { Card card = (Card) sourceObject; new RemoveCounterSourceEffect(CounterType.EGG.createInstance()).apply(game, source); if (card.getCounters(game).getCount(CounterType.EGG) == 0) { controller.moveCards(card, Zone.BATTLEFIELD, source, game); } return true; } return false; } }
public RemoveCounterSourceEffect(Counter counter) { super(Outcome.UnboostCreature); this.counter = counter; setText(); }
public AzorsElocutorsTriggeredAbility() { super(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.FILIBUSTER.createInstance()), false); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (controller != null && sourcePermanent != null) { if (!sourcePermanent.getCounters(game).containsKey(CounterType.PLAGUE) || controller.chooseUse(outcome, "Put a plague counter on? (No removes one)", source, game)) { return new AddCountersSourceEffect(CounterType.PLAGUE.createInstance(), true).apply(game, source); } else { return new RemoveCounterSourceEffect(CounterType.PLAGUE.createInstance()).apply(game, source); } } return false; } }
public SuspendBeginningOfUpkeepInterveningIfTriggeredAbility() { super(new BeginningOfUpkeepTriggeredAbility(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), TargetController.YOU, false), SuspendedCondition.instance, "At the beginning of your upkeep, if this card ({this}) is suspended, remove a time counter from it."); this.setRuleVisible(false); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanent(source.getSourceId()); if (controller != null && sourcePermanent != null) { if (!sourcePermanent.getCounters(game).containsKey(CounterType.CHARGE) || controller.chooseUse(outcome, "Put a charge counter on? (No removes one)", source, game)) { return new AddCountersSourceEffect(CounterType.CHARGE.createInstance(), true).apply(game, source); } else { return new RemoveCounterSourceEffect(CounterType.CHARGE.createInstance()).apply(game, source); } } return false; } }
public RepairBeginningOfUpkeepInterveningIfTriggeredAbility() { super(new BeginningOfUpkeepTriggeredAbility(Zone.GRAVEYARD, new RemoveCounterSourceEffect(CounterType.REPAIR.createInstance()), TargetController.YOU, false), new SourceHasCounterCondition(CounterType.REPAIR), "At the beginning of your upkeep, remove a repair counter from {this}"); this.setRuleVisible(false); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { if (controller.flipCoin(source, game, true)) { game.informPlayers("Chaotic Goo: Won flip. Put a +1/+1 counter on Chaotic Goo."); new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)).apply(game, source); return true; } else { game.informPlayers("Chaotic Goo: Lost flip. Remove a +1/+1 counter on Chaotic Goo."); new RemoveCounterSourceEffect(CounterType.P1P1.createInstance(1)).apply(game, source); return true; } } return false; }
public MerseineActivatedAbility() { super(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.NET.createInstance()), new MerseineCost()); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Permanent permanent = game.getPermanent(source.getSourceId()); if (controller != null && permanent != null) { if (controller.flipCoin(source, game, true)) { game.informPlayers("Goblin Bomb: Won flip. Put a fuse counter on Goblin Bomb."); new AddCountersSourceEffect(CounterType.FUSE.createInstance(1)).apply(game, source); return true; } else { game.informPlayers("Goblin Bomb: Lost flip. Remove a fuse counter from Goblin Bomb."); new RemoveCounterSourceEffect(CounterType.FUSE.createInstance(1)).apply(game, source); return true; } } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent p = game.getPermanent(source.getSourceId()); if (p != null) { AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance())); game.addDelayedTriggeredAbility(ability, source); } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent p = game.getPermanent(source.getSourceId()); if (p != null) { AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance())); game.addDelayedTriggeredAbility(ability, source); } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent p = game.getPermanent(source.getSourceId()); if (p != null) { AtTheEndOfCombatDelayedTriggeredAbility ability = new AtTheEndOfCombatDelayedTriggeredAbility(new RemoveCounterSourceEffect(CounterType.P1P1.createInstance())); game.addDelayedTriggeredAbility(ability, source); } return false; }
public BelligerentHatchling(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R/W}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(6); this.toughness = new MageInt(6); // First strike this.addAbility(FirstStrikeAbility.getInstance()); // Belligerent Hatchling enters the battlefield with four -1/-1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)),"with four -1/-1 counters on it")); // Whenever you cast a red spell, remove a -1/-1 counter from Belligerent Hatchling. this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterRedSpell, false)); // Whenever you cast a white spell, remove a -1/-1 counter from Belligerent Hatchling. this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterWhiteSpell, false)); }
public NoxiousHatchling(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B/G}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(6); this.toughness = new MageInt(6); // Noxious Hatchling enters the battlefield with four -1/-1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)),"with four -1/-1 counters on it")); // Wither (This deals damage to creatures in the form of -1/-1 counters.) this.addAbility(WitherAbility.getInstance()); // Whenever you cast a black spell, remove a -1/-1 counter from Noxious Hatchling. this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filterBlackSpell, false)); // Whenever you cast a green spell, remove a -1/-1 counter from Noxious Hatchling. this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filterGreenSpell, false)); }
public GreaterGargadonAbility() { super(Zone.EXILED, new RemoveCounterSourceEffect(CounterType.TIME.createInstance()), new SacrificeTargetCost(new TargetControlledPermanent(filter))); }
public DivineIntervention(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{6}{W}{W}"); // Divine Intervention enters the battlefield with 2 intervention counters on it. Effect effect = new AddCountersSourceEffect(CounterType.INTERVENTION.createInstance(2)); this.addAbility(new EntersBattlefieldAbility(effect, "with 2 intervention counters")); // At the beginning of your upkeep, remove an intervention counter from Divine Intervention. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new RemoveCounterSourceEffect(CounterType.INTERVENTION.createInstance()), TargetController.YOU, false)); // Whenever a intervention counter is removed from Protean Hydra, put two intervention counters on it at the beginning of the next end step. this.addAbility(new DivineInterventionAbility()); }
public VoraciousHatchling(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W/B}"); this.subtype.add(SubType.ELEMENTAL); this.power = new MageInt(6); this.toughness = new MageInt(6); // Lifelink this.addAbility(LifelinkAbility.getInstance()); // Voracious Hatchling enters the battlefield with four -1/-1 counters on it. this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)),"with four -1/-1 counters on it")); // Whenever you cast a white spell, remove a -1/-1 counter from Voracious Hatchling. this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterWhiteSpell, false)); // Whenever you cast a black spell, remove a -1/-1 counter from Voracious Hatchling. this.addAbility(new SpellCastControllerTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterBlackSpell, false)); }
public CelestialConvergence(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); // Celestial Convergence enters the battlefield with seven omen counters on it. Effect effect = new AddCountersSourceEffect(CounterType.OMEN.createInstance(7)); this.addAbility(new EntersBattlefieldAbility(effect, "with seven omen counters")); // At the beginning of your upkeep, remove an omen counter from Celestial Convergence. If there are no omen counters on Celestial Convergence, the player with the highest life total wins the game. If two or more players are tied for highest life total, the game is a draw. Ability ability = new BeginningOfUpkeepTriggeredAbility( Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.OMEN.createInstance(1)), TargetController.YOU, false); ability.addEffect(new CelestialConvergenceEffect()); this.addAbility(ability); }