@Override public boolean apply(Game game, Ability source) { EdificeOfAuthorityRestrictionEffect effect = new EdificeOfAuthorityRestrictionEffect(); game.addEffect(effect, source); return true; } }
@Override public boolean apply(Game game, Ability source) { if (game.getPermanent(source.getSourceId()) != null) { ContinuousEffect continuousEffect = new BoostSourceEffect(2, 0, Duration.EndOfTurn); game.addEffect(continuousEffect, source); continuousEffect = new LoseAbilitySourceEffect(DefenderAbility.getInstance(), Duration.EndOfTurn); game.addEffect(continuousEffect, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); if (permanent != null) { game.addEffect(new CantBeBlockedTargetEffect(Duration.EndOfTurn), source); if (permanent.hasSubtype(SubType.SNAKE, game)) { game.addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn), source); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { if (new CardsInControllerGraveCondition(7).apply(game, source)) { game.addEffect(new GainProtectionFromColorAllEffect( Duration.EndOfTurn, StaticFilters.FILTER_CONTROLLED_CREATURES ), source); } return true; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null && KickedCondition.instance.apply(game, source)) { game.addEffect(new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, FILTER_PERMANENT_CREATURES), source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { ContinuousEffect effect = new BoostTargetEffect(amount, amount, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(source.getFirstTarget())); game.addEffect(effect, source); return true; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (super.apply(game, source) && permanent != null) { GainControlTargetEffect effect = new GainControlTargetEffect(Duration.EndOfGame); effect.setTargetPointer(targetPointer); game.addEffect(effect, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (targetCreature != null) { int toughness = targetCreature.getToughness().getBaseValueModified(); game.addEffect(new SetPowerToughnessTargetEffect(0, toughness, Duration.EndOfTurn), source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); if (player != null) { game.addEffect(new BlindingBeamEffect2(player.getId()), 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) { int amount = controller.rollDice(game, 6); game.addEffect(new BoostSourceEffect(amount, amount, Duration.EndOfTurn), source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { int newToughness = CardUtil.addWithOverflowCheck(1, new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE).calculate(game, source, this)); game.addEffect(new SetToughnessSourceEffect(new StaticValue(newToughness), Duration.Custom, SubLayer.SetPT_7b), source); return true; } }
public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getTargets().get(0).getTargetController()); if (player != null) { if (player.chooseUse(outcome, "Give targeted creature -3/-3 ?", source, game)) { game.addEffect(new BoostTargetEffect(-3, -3, Duration.EndOfTurn), source); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); Choice choice = new ChoiceBasicLandType(); if (player != null && player.choose(Outcome.Neutral, choice, game)) { game.getState().setValue(source.getSourceId().toString() + "_ElsewhereFlask", choice.getChoice()); game.addEffect(new ElsewhereFlaskContinuousEffect(), source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { new ChooseACardNameEffect(TypeOfName.ALL).apply(game, source); String cardName = (String) game.getState().getValue(source.getSourceId().toString() + ChooseACardNameEffect.INFO_KEY); FilterCard filter = new FilterCard(); filter.add(new NamePredicate(cardName)); ContinuousEffect effect = new SpellsCostReductionAllEffect(filter, 1); effect.setDuration(Duration.EndOfTurn); game.addEffect(effect, source); return true; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent == null) { return false; } game.addEffect(new SetPowerSourceEffect(new StaticValue(permanent.getPower().getValue()), Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source); return true; } }
@Override public boolean apply(Game game, Ability source) { Card card = game.getCard(source.getFirstTarget()); if (card != null) { card.moveToZone(Zone.HAND, source.getSourceId(), game, false); if (card.hasSubtype(SubType.GOBLIN, game)) { game.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), source); } return true; } return false; }
@Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { Target target = new TargetPermanent(filter); if (target.choose(Outcome.GainControl, controllerId, sourceId, game)) { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, ability); game.applyEffects(); paid = true; } return paid; }
@Override public boolean apply(Game game, Ability source) { for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { AttacksIfAbleTargetEffect effect = new AttacksIfAbleTargetEffect(Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(creature.getId())); game.addEffect(effect, source); } return true; }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); if (targetPlayer != null) { FilterPermanent filter = new FilterLandPermanent(); filter.add(new ControllerIdPredicate(targetPlayer.getId())); game.addEffect(new BecomesCreatureAllEffect(new CreatureToken(3, 3), "lands", filter, Duration.EndOfTurn, false), source); return true; } return false; } }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (sourceObject != null) { Permanent permanentReset = sourceObject.copy(); permanentReset.getCounters(game).clear(); permanentReset.getPower().resetToBaseValue(); permanentReset.getToughness().resetToBaseValue(); game.addEffect(new CopyEffect(Duration.Custom, permanentReset, event.getTargetId()), source); } return false; }