updated abilities with x targets

This commit is contained in:
Evan Kranzler 2017-09-16 17:07:48 -04:00
parent cd3e038223
commit 856dcb54d5
10 changed files with 76 additions and 13 deletions

View file

@ -74,7 +74,7 @@ public class AlexiZephyrMage extends CardImpl {
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));

View file

@ -61,13 +61,13 @@ public class CandelabraOfTawnos extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
ability.setTargetAdjustment(TargetAdjustment.XCOST);
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
this.addAbility(ability);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));

View file

@ -65,7 +65,7 @@ public class FloodwaterDam extends CardImpl {
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));

View file

@ -67,13 +67,13 @@ public class MagusOfTheCandelabra extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
ability.setTargetAdjustment(TargetAdjustment.XCOST);
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
this.addAbility(ability);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));

View file

@ -59,13 +59,13 @@ public class MishrasHelix extends CardImpl {
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
ability.setTargetAdjustment(TargetAdjustment.XCOST);
ability.setTargetAdjustment(TargetAdjustment.X_TARGETS);
this.addAbility(ability);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));

View file

@ -0,0 +1,61 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.target.TargetPermanent;
/**
*
* @author Loki
*/
public class SliceInTwain extends CardImpl {
public SliceInTwain(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}{G}");
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).setText("<br>br>Draw a card"));
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.ARTIFACT_OR_ENCHANTMENT_PERMANENT));
}
public SliceInTwain(final SliceInTwain card) {
super(card);
}
@Override
public SliceInTwain copy() {
return new SliceInTwain(this);
}
}

View file

@ -74,7 +74,7 @@ public class SynodArtificer extends CardImpl {
tapEffect.setText("Tap X target noncreature artifacts.");
Ability tapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, tapEffect, new ManaCostsImpl("{X}"));
tapAbility.addCost(new TapSourceCost());
tapAbility.setTargetAdjustment(TargetAdjustment.XCOST);
tapAbility.setTargetAdjustment(TargetAdjustment.X_TARGETS);
tapAbility.addTarget(new TargetPermanent(filter));
this.addAbility(tapAbility);
@ -83,14 +83,14 @@ public class SynodArtificer extends CardImpl {
untapEffect.setText("Untap X target noncreature artifacts.");
Ability untapAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, untapEffect, new ManaCostsImpl("{X}"));
untapAbility.addCost(new TapSourceCost());
untapAbility.setTargetAdjustment(TargetAdjustment.XCOST);
untapAbility.setTargetAdjustment(TargetAdjustment.X_TARGETS);
untapAbility.addTarget(new TargetPermanent(filter));
this.addAbility(untapAbility);
}
@Override
public void adjustTargets(Ability ability, Game game) {
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
if (ability.getTargetAdjustment() == TargetAdjustment.X_TARGETS) {
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
ability.getTargets().clear();
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));

View file

@ -99,7 +99,7 @@ public abstract class AbilityImpl implements Ability {
protected List<Watcher> watchers = null;
protected List<Ability> subAbilities = null;
protected boolean canFizzle = true;
protected TargetAdjustment targetAdjustment;
protected TargetAdjustment targetAdjustment = TargetAdjustment.NONE;
public AbilityImpl(AbilityType abilityType, Zone zone) {
this.id = UUID.randomUUID();
@ -148,6 +148,7 @@ public abstract class AbilityImpl implements Ability {
this.sourceObject = ability.sourceObject;
this.sourceObjectZoneChangeCounter = ability.sourceObjectZoneChangeCounter;
this.canFizzle = ability.canFizzle;
this.targetAdjustment = ability.targetAdjustment;
}
@Override

View file

@ -6,5 +6,5 @@ package mage.constants;
*/
public enum TargetAdjustment {
NONE,XCOST,DEFENDING_PLAYER
NONE, X_TARGETS, X_CMC_EQUAL_PERM, X_CMC_EQUAL_NONPERM, DEFENDING_PLAYER
}

View file

@ -87,6 +87,7 @@ public class StackAbility extends StackObjImpl implements Ability {
this.controllerId = stackAbility.controllerId;
this.name = stackAbility.name;
this.expansionSetCode = stackAbility.expansionSetCode;
this.targetAdjustment = stackAbility.targetAdjustment;
}
@Override