Act of Aggression can only target opponent's creatures

This commit is contained in:
Neil Gentleman 2016-02-14 16:24:13 -08:00
parent 1a95e2021a
commit a3836f6ec7
2 changed files with 11 additions and 2 deletions

View file

@ -36,6 +36,9 @@ import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.target.common.TargetCreaturePermanent;
/**
@ -44,12 +47,18 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class ActOfAggression extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
}
public ActOfAggression(UUID ownerId) {
super(ownerId, 78, "Act of Aggression", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{RP}{RP}");
this.expansionSetCode = "NPH";
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));
this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new UntapTargetEffect());
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));

View file

@ -67,7 +67,7 @@ public class GainControlTargetEffect extends ContinuousEffectImpl {
/**
*
* @param duration
* @param controllingPlayerId Player that controlls the target creature
* @param controllingPlayerId Player that controls the target creature
*/
public GainControlTargetEffect(Duration duration, UUID controllingPlayerId) {
this(duration, true, controllingPlayerId);