mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
Changed some X cost abilities (untested)
This commit is contained in:
parent
8302aa1c54
commit
d68efc21c5
10 changed files with 99 additions and 72 deletions
|
|
@ -40,10 +40,11 @@ import mage.cards.CardSetInfo;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
|
@ -54,16 +55,8 @@ import mage.target.common.TargetCardInHand;
|
|||
*/
|
||||
public class AlexiZephyrMage extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("Target creatures");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
}
|
||||
|
||||
public AlexiZephyrMage(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SPELLSHAPER);
|
||||
|
|
@ -75,22 +68,21 @@ public class AlexiZephyrMage extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{X}{U}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new DiscardTargetCost(new TargetCardInHand(2, new FilterCard("two cards"))));
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_CREATURES));
|
||||
this.addAbility(ability);
|
||||
|
||||
originalId = ability.getOriginalId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)) {
|
||||
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
|
||||
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter));
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
|
||||
}
|
||||
}
|
||||
|
||||
public AlexiZephyrMage(final AlexiZephyrMage card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -37,10 +37,13 @@ import mage.abilities.effects.common.UntapTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -48,10 +51,8 @@ import mage.target.common.TargetLandPermanent;
|
|||
*/
|
||||
public class CandelabraOfTawnos extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
public CandelabraOfTawnos(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
|
||||
|
||||
//TODO: Make ability properly copiable
|
||||
// {X}, {T}: Untap X target lands.
|
||||
|
|
@ -59,22 +60,22 @@ public class CandelabraOfTawnos extends CardImpl {
|
|||
effect.setText("untap X target lands");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
originalId = ability.getOriginalId();
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
|
||||
ability.setTargetAdjustment(TargetAdjustment.XCOST);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)){
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
|
||||
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetLandPermanent(xValue, xValue, new FilterLandPermanent(), false));
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
|
||||
}
|
||||
}
|
||||
|
||||
public CandelabraOfTawnos(final CandelabraOfTawnos card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -37,10 +37,12 @@ import mage.abilities.effects.common.TapTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -48,10 +50,8 @@ import mage.target.common.TargetLandPermanent;
|
|||
*/
|
||||
public class FloodwaterDam extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
public FloodwaterDam(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
//TODO: Make ability properly copiable
|
||||
// {X}{X}{1}, {tap}: Tap X target lands.
|
||||
|
|
@ -59,22 +59,21 @@ public class FloodwaterDam extends CardImpl {
|
|||
effect.setText("tap X target lands");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}{X}{1}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
originalId = ability.getOriginalId();
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)){
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
|
||||
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetLandPermanent(xValue, xValue, new FilterLandPermanent(), false));
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
|
||||
}
|
||||
}
|
||||
|
||||
public FloodwaterDam(final FloodwaterDam card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -39,20 +39,21 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
* @author duncant
|
||||
*/
|
||||
public class MagusOfTheCandelabra extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
public MagusOfTheCandelabra(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{G}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.WIZARD);
|
||||
|
||||
|
|
@ -65,22 +66,22 @@ public class MagusOfTheCandelabra extends CardImpl {
|
|||
effect.setText("untap X target lands");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
originalId = ability.getOriginalId();
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
|
||||
ability.setTargetAdjustment(TargetAdjustment.XCOST);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)){
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
|
||||
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetLandPermanent(xValue, xValue, StaticFilters.FILTER_LANDS, false));
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
|
||||
}
|
||||
}
|
||||
|
||||
public MagusOfTheCandelabra(final MagusOfTheCandelabra card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -37,10 +37,12 @@ import mage.abilities.effects.common.TapTargetEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -48,32 +50,30 @@ import mage.target.common.TargetLandPermanent;
|
|||
*/
|
||||
public class MishrasHelix extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
public MishrasHelix(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
|
||||
|
||||
//TODO: Make ability properly copiable
|
||||
// {X}, {tap}: Tap X target lands.
|
||||
Effect effect = new TapTargetEffect("X target lands");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{X}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
originalId = ability.getOriginalId();
|
||||
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_LANDS));
|
||||
ability.setTargetAdjustment(TargetAdjustment.XCOST);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)){
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
|
||||
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetLandPermanent(xValue, xValue, StaticFilters.FILTER_LANDS, false));
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
|
||||
}
|
||||
}
|
||||
|
||||
public MishrasHelix(final MishrasHelix card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import mage.cards.CardImpl;
|
|||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
|
|
@ -53,9 +54,7 @@ import mage.target.TargetPermanent;
|
|||
*/
|
||||
public class SynodArtificer extends CardImpl {
|
||||
|
||||
private final UUID tapId;
|
||||
private final UUID untapId;
|
||||
private static final FilterPermanent filter = new FilterPermanent("Target noncreature artifacts");
|
||||
private static final FilterPermanent filter = new FilterPermanent("noncreature artifacts");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
|
|
@ -63,7 +62,7 @@ public class SynodArtificer extends CardImpl {
|
|||
}
|
||||
|
||||
public SynodArtificer(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||
this.subtype.add(SubType.VEDALKEN);
|
||||
this.subtype.add(SubType.ARTIFICER);
|
||||
this.power = new MageInt(1);
|
||||
|
|
@ -75,6 +74,8 @@ 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.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(tapAbility);
|
||||
|
||||
// {X}, {tap}: Untap X target noncreature artifacts.
|
||||
|
|
@ -82,24 +83,22 @@ 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.addTarget(new TargetPermanent(filter));
|
||||
this.addAbility(untapAbility);
|
||||
|
||||
tapId = tapAbility.getOriginalId();
|
||||
untapId = untapAbility.getOriginalId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(tapId) || ability.getOriginalId().equals(untapId)) {
|
||||
if (ability.getTargetAdjustment() == TargetAdjustment.XCOST) {
|
||||
FilterPermanent filter2 = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter));
|
||||
ability.addTarget(new TargetPermanent(ability.getManaCostsToPay().getX(), filter2));
|
||||
}
|
||||
}
|
||||
|
||||
public SynodArtificer(final SynodArtificer card) {
|
||||
super(card);
|
||||
this.tapId = card.tapId;
|
||||
this.untapId = card.untapId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import mage.abilities.effects.Effects;
|
|||
import mage.constants.AbilityType;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.EffectType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Controllable;
|
||||
import mage.game.Game;
|
||||
|
|
@ -539,4 +540,8 @@ public interface Ability extends Controllable, Serializable {
|
|||
void setCanFizzle(boolean canFizzle);
|
||||
|
||||
boolean canFizzle();
|
||||
|
||||
void setTargetAdjustment(TargetAdjustment targetAdjustment);
|
||||
|
||||
TargetAdjustment getTargetAdjustment();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,6 +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;
|
||||
|
||||
public AbilityImpl(AbilityType abilityType, Zone zone) {
|
||||
this.id = UUID.randomUUID();
|
||||
|
|
@ -1233,4 +1234,13 @@ public abstract class AbilityImpl implements Ability {
|
|||
this.canFizzle = canFizzle;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTargetAdjustment(TargetAdjustment targetAdjustment) {
|
||||
this.targetAdjustment = targetAdjustment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetAdjustment getTargetAdjustment() {
|
||||
return targetAdjustment;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
10
Mage/src/main/java/mage/constants/TargetAdjustment.java
Normal file
10
Mage/src/main/java/mage/constants/TargetAdjustment.java
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package mage.constants;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum TargetAdjustment {
|
||||
|
||||
NONE,XCOST,DEFENDING_PLAYER
|
||||
}
|
||||
|
|
@ -74,6 +74,7 @@ public class StackAbility extends StackObjImpl implements Ability {
|
|||
private UUID controllerId;
|
||||
private String name;
|
||||
private String expansionSetCode;
|
||||
private TargetAdjustment targetAdjustment = TargetAdjustment.NONE;
|
||||
|
||||
public StackAbility(Ability ability, UUID controllerId) {
|
||||
this.ability = ability;
|
||||
|
|
@ -612,4 +613,13 @@ public class StackAbility extends StackObjImpl implements Ability {
|
|||
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTargetAdjustment(TargetAdjustment targetAdjustment) {
|
||||
this.targetAdjustment = targetAdjustment;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetAdjustment getTargetAdjustment() {
|
||||
return targetAdjustment;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue