@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) { for (UUID targetId : targetPointer.getTargets(game, source)) { ContinuousEffect effect = new SwitchPowerToughnessTargetEffect(Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(targetId, game)); game.addEffect(effect, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { ContinuousEffect effect = new BoostTargetEffect(-1, -1, Duration.EndOfTurn); Permanent permanent = game.getPermanent(source.getFirstTarget()); if (permanent != null) { effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { for (UUID opponentId : game.getOpponents(source.getControllerId())) { ContinuousEffect effect = new SphinxsDecreeCantCastEffect(); effect.setTargetPointer(new FixedTarget(opponentId)); game.addEffect(effect, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { for (UUID opponentId : game.getOpponents(source.getControllerId())) { ContinuousEffect effect = new AzorTheLawbringerCantCastEffect(); effect.setTargetPointer(new FixedTarget(opponentId)); game.addEffect(effect, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { int xValue = new PermanentsOnBattlefieldCount(filter).calculate(game, source, this); ContinuousEffect effect = new BecomesCreatureTargetEffect(new ElvishBranchbenderToken(xValue), false, false, Duration.EndOfTurn); // fix effect.setTargetPointer(targetPointer); game.addEffect(effect, source); return false; } }
@Override public boolean apply(Game game, Ability source) { int amount = new PermanentsOnBattlefieldCount(filterAllies).calculate(game, source, this); ContinuousEffect effect = new BecomesCreatureTargetEffect(new VastwoodAnimistElementalToken(amount), false, true, Duration.EndOfTurn); effect.setTargetPointer(targetPointer); game.addEffect(effect, source); return false; } }
@Override public boolean apply(Game game, Ability source) { for (Target target : source.getTargets()) { if (target.getFirstTarget() != null) { ContinuousEffect effect = new GainControlTargetEffect(Duration.EndOfGame); effect.setTargetPointer(new FixedTarget(target.getFirstTarget())); game.addEffect(effect, source); } } return true; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getFirstTarget()); if (player != null) { ContinuousEffect effect = new DontUntapInPlayersNextUntapStepAllEffect(filter); effect.setTargetPointer(new FixedTarget(player.getId())); game.addEffect(effect, 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) { Player controller = game.getPlayer(source.getControllerId()); Player newController = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (newController != null && controller != null && !controller.equals(newController)) { ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, newController.getId()); effect.setTargetPointer(new FixedTarget(source.getSourceId())); game.addEffect(effect, source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Player newController = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (newController != null && controller != null && !controller.equals(newController)) { ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, newController.getId()); effect.setTargetPointer(new FixedTarget(source.getSourceId())); game.addEffect(effect, source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent target = game.getPermanent(targetPointer.getFirst(game, source)); if (target != null && target.isCreature()) { ContinuousEffect effect = new BoostTargetEffect(4, 0, Duration.EndOfTurn); effect.setTargetPointer(new FixedTarget(target.getId())); game.addEffect(effect, source); return true; } return false; }
@Override public boolean apply(Game game, Ability source) { List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(filter, targetPointer.getFirst(game, source), game); for (Permanent permanent : permanents) { ContinuousEffect effect = new TezzeretMasterOfMetalControlEffect(source.getControllerId()); effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { boolean ret = false; for(Permanent enchantment : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_ENCHANTMENT_PERMANENT, source.getControllerId(), source.getControllerId(), game)) { ContinuousEffect gainControl = new GainControlTargetEffect(Duration.EndOfGame); gainControl.setTargetPointer(new FixedTarget(enchantment.getId())); game.addEffect(gainControl, source); ret = true; } return ret; } }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget(); if (creature != null) { creature.addCounters(CounterType.P1P1.createInstance(), source, game, event.getAppliedEffects()); ContinuousEffect effect = new BecomesBlackZombieAdditionEffect(); effect.setTargetPointer(new FixedTarget(creature.getId(), creature.getZoneChangeCounter(game) + 1)); game.addEffect(effect, source); //discard(); why? } return false; }
@Override public boolean apply(Game game, Ability source) { Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); Permanent targetCreature = game.getPermanent(source.getFirstTarget()); if (land != null && targetCreature != null && land.hasSubtype(SubType.ISLAND, game)) { ContinuousEffect effect = new DontUntapInControllersNextUntapStepTargetEffect("that creature"); effect.setTargetPointer(new FixedTarget(targetCreature, game)); game.addEffect(effect, source); } return true; } }
@Override public boolean apply(Game game, Ability source) { Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget()); if (!permanent.isCreature() && !permanent.hasSubtype(SubType.VEHICLE, game)) { ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new LifecraftAwakeningToken(), false, true, Duration.Custom); continuousEffect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(continuousEffect, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source)); Permanent permanent = game.getPermanent(source.getTargets().get(1).getFirstTarget()); if (targetPlayer != null && permanent != null) { ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, targetPlayer.getId()); effect.setTargetPointer(new FixedTarget(permanent, game)); game.addEffect(effect, source); } return true; }
@Override public boolean apply(Game game, Ability source) { PlayerList players = game.getState().getPlayersInRange(source.getControllerId(), game); int count = players.size(); for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterNonlandPermanent(), source.getControllerId(), source.getSourceId(), game)) { ContinuousEffect effect = new GainControlTargetEffect(Duration.Custom, true, players.get(RandomUtil.nextInt(count))); effect.setTargetPointer(new FixedTarget(permanent.getId())); game.addEffect(effect, source); permanent.untap(game); } return true; }