@Override public CantBeTargetedTargetEffect copy() { return new CantBeTargetedTargetEffect(this); }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (getTargetPointer().getTargets(game, source).contains(event.getTargetId())) { if (targetController == TargetController.OPPONENT && !game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) { return false; } StackObject stackObject = game.getStack().getStackObject(event.getSourceId()); MageObject sourceObject; if (stackObject instanceof StackAbility) { sourceObject = ((StackAbility) stackObject).getSourceObject(game); } else { sourceObject = stackObject; } if (sourceObject != null && filterSource.match(sourceObject, game)) { return true; } } return false; }
public VinesOfVastwood(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}"); // Kicker {G} (You may pay an additional {G} as you cast this spell.) this.addAbility(new KickerAbility("{G}")); // Target creature can't be the target of spells or abilities your opponents control this turn. this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new CantBeTargetedTargetEffect(filter, Duration.EndOfTurn, TargetController.OPPONENT)); // If Vines of Vastwood was kicked, that creature gets +4/+4 until end of turn. this.getSpellAbility().addEffect(new ConditionalContinuousEffect(new BoostTargetEffect(4, 4, Duration.EndOfTurn), new LockedInCondition(KickedCondition.instance), staticText)); }