@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; } }
@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; } }
@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; } }
@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; }
@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; }