mirror of
https://github.com/correl/mage.git
synced 2024-12-26 19:16:54 +00:00
* Fixed some adjustTargets methods of cards were that the target adjustment could be applied to abilities not intended (fixes #1384).
This commit is contained in:
parent
b637d2c65c
commit
fbb3929d0a
26 changed files with 179 additions and 92 deletions
|
@ -52,6 +52,8 @@ import mage.target.TargetPermanent;
|
||||||
*/
|
*/
|
||||||
public class GorillaShaman1 extends CardImpl {
|
public class GorillaShaman1 extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public GorillaShaman1(UUID ownerId) {
|
public GorillaShaman1(UUID ownerId) {
|
||||||
super(ownerId, 106, "Gorilla Shaman", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
|
super(ownerId, 106, "Gorilla Shaman", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}");
|
||||||
this.expansionSetCode = "ALL";
|
this.expansionSetCode = "ALL";
|
||||||
|
@ -63,12 +65,13 @@ public class GorillaShaman1 extends CardImpl {
|
||||||
// {X}{X}{1}: Destroy target noncreature artifact with converted mana cost X.
|
// {X}{X}{1}: Destroy target noncreature artifact with converted mana cost X.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}"));
|
||||||
ability.addTarget(new TargetPermanent(new FilterArtifactPermanent("noncreature artifact with converted mana cost X")));
|
ability.addTarget(new TargetPermanent(new FilterArtifactPermanent("noncreature artifact with converted mana cost X")));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterArtifactPermanent filter = new FilterArtifactPermanent(new StringBuilder("noncreature artifact with converted mana cost ").append(xValue).toString());
|
FilterArtifactPermanent filter = new FilterArtifactPermanent(new StringBuilder("noncreature artifact with converted mana cost ").append(xValue).toString());
|
||||||
|
@ -81,6 +84,7 @@ public class GorillaShaman1 extends CardImpl {
|
||||||
|
|
||||||
public GorillaShaman1(final GorillaShaman1 card) {
|
public GorillaShaman1(final GorillaShaman1 card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -29,6 +29,7 @@ package mage.sets.apocalypse;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.SpellAbility;
|
||||||
import mage.abilities.condition.common.KickedCondition;
|
import mage.abilities.condition.common.KickedCondition;
|
||||||
import mage.abilities.costs.Cost;
|
import mage.abilities.costs.Cost;
|
||||||
import mage.abilities.costs.Costs;
|
import mage.abilities.costs.Costs;
|
||||||
|
@ -72,8 +73,10 @@ public class DwarvenLandslide extends CardImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (KickedCondition.getInstance().apply(game, ability)) {
|
if (ability instanceof SpellAbility) {
|
||||||
getSpellAbility().addTarget(new TargetLandPermanent(new FilterLandPermanent("land (Kicker)")));
|
if (KickedCondition.getInstance().apply(game, ability)) {
|
||||||
|
getSpellAbility().addTarget(new TargetLandPermanent(new FilterLandPermanent("land (Kicker)")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,6 @@
|
||||||
package mage.sets.betrayersofkamigawa;
|
package mage.sets.betrayersofkamigawa;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -39,6 +36,8 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Rarity;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.Filter;
|
import mage.filter.Filter;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
@ -54,6 +53,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class MinamoSightbender extends CardImpl {
|
public class MinamoSightbender extends CardImpl {
|
||||||
|
|
||||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power X or less");
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power X or less");
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public MinamoSightbender(UUID ownerId) {
|
public MinamoSightbender(UUID ownerId) {
|
||||||
super(ownerId, 41, "Minamo Sightbender", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
super(ownerId, 41, "Minamo Sightbender", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||||
|
@ -69,19 +69,20 @@ public class MinamoSightbender extends CardImpl {
|
||||||
Target target = new TargetCreaturePermanent(filter);
|
Target target = new TargetCreaturePermanent(filter);
|
||||||
ability.addTarget(target);
|
ability.addTarget(target);
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
for (Effect effect :ability.getEffects()) {
|
for (Effect effect : ability.getEffects()) {
|
||||||
if (effect instanceof CantBeBlockedTargetEffect) {
|
if (effect instanceof CantBeBlockedTargetEffect) {
|
||||||
int manaX = ability.getManaCostsToPay().getX();
|
int manaX = ability.getManaCostsToPay().getX();
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterCreaturePermanent newFilter = new FilterCreaturePermanent(new StringBuilder("creature with power ").append(manaX).append(" or less").toString());
|
FilterCreaturePermanent newFilter = new FilterCreaturePermanent(new StringBuilder("creature with power ").append(manaX).append(" or less").toString());
|
||||||
filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, manaX +1));
|
filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, manaX + 1));
|
||||||
Target target = new TargetCreaturePermanent(newFilter);
|
Target target = new TargetCreaturePermanent(newFilter);
|
||||||
ability.addTarget(target);
|
ability.addTarget(target);
|
||||||
break;
|
break;
|
||||||
|
@ -92,6 +93,7 @@ public class MinamoSightbender extends CardImpl {
|
||||||
|
|
||||||
public MinamoSightbender(final MinamoSightbender card) {
|
public MinamoSightbender(final MinamoSightbender card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -59,6 +59,7 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
public class QuillmaneBaku extends CardImpl {
|
public class QuillmaneBaku extends CardImpl {
|
||||||
|
|
||||||
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
|
private static final FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public QuillmaneBaku(UUID ownerId) {
|
public QuillmaneBaku(UUID ownerId) {
|
||||||
super(ownerId, 48, "Quillmane Baku", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}");
|
super(ownerId, 48, "Quillmane Baku", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}");
|
||||||
|
@ -76,12 +77,13 @@ public class QuillmaneBaku extends CardImpl {
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(1)));
|
ability.addCost(new RemoveVariableCountersSourceCost(CounterType.KI.createInstance(1)));
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
int maxConvManaCost = 0;
|
int maxConvManaCost = 0;
|
||||||
for (Cost cost : ability.getCosts()) {
|
for (Cost cost : ability.getCosts()) {
|
||||||
if (cost instanceof RemoveVariableCountersSourceCost) {
|
if (cost instanceof RemoveVariableCountersSourceCost) {
|
||||||
|
@ -98,6 +100,7 @@ public class QuillmaneBaku extends CardImpl {
|
||||||
|
|
||||||
public QuillmaneBaku(final QuillmaneBaku card) {
|
public QuillmaneBaku(final QuillmaneBaku card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.bornofthegods;
|
package mage.sets.bornofthegods;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
|
@ -47,14 +48,13 @@ import mage.filter.predicate.permanent.AnotherPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author LevelX2
|
* @author LevelX2
|
||||||
*/
|
*/
|
||||||
public class ChampionOfStraySouls extends CardImpl {
|
public class ChampionOfStraySouls extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures");
|
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other creatures");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -71,8 +71,9 @@ public class ChampionOfStraySouls extends CardImpl {
|
||||||
this.toughness = new MageInt(4);
|
this.toughness = new MageInt(4);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* You choose the targets of the first ability as you activate that ability,
|
* You choose the targets of the first ability as you activate that
|
||||||
* before you pay any costs. You can't target any of the creatures you sacrifice.
|
* ability, before you pay any costs. You can't target any of the
|
||||||
|
* creatures you sacrifice.
|
||||||
*/
|
*/
|
||||||
// {3}{B}{B}, {T}, Sacrifice X other creatures: Return X target creatures from your graveyard to the battlefield.
|
// {3}{B}{B}, {T}, Sacrifice X other creatures: Return X target creatures from your graveyard to the battlefield.
|
||||||
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
||||||
|
@ -80,11 +81,12 @@ public class ChampionOfStraySouls extends CardImpl {
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{B}{B}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{3}{B}{B}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addCost(new SacrificeXTargetCost(filter));
|
ability.addCost(new SacrificeXTargetCost(filter));
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(0,Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
|
ability.addTarget(new TargetCardInYourGraveyard(0, Integer.MAX_VALUE, new FilterCreatureCard("creature cards from your graveyard")));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// {5}{B}{B}: Put Champion of Stray Souls on top of your library from your graveyard.
|
// {5}{B}{B}: Put Champion of Stray Souls on top of your library from your graveyard.
|
||||||
this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD,
|
this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD,
|
||||||
new PutOnLibrarySourceEffect(true, "Put {this} on top of your library from your graveyard"),
|
new PutOnLibrarySourceEffect(true, "Put {this} on top of your library from your graveyard"),
|
||||||
new ManaCostsImpl("{5}{B}{B}")));
|
new ManaCostsImpl("{5}{B}{B}")));
|
||||||
|
|
||||||
|
@ -92,12 +94,12 @@ public class ChampionOfStraySouls extends CardImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
for (Effect effect : ability.getEffects()) {
|
for (Effect effect : ability.getEffects()) {
|
||||||
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
|
if (effect instanceof ReturnFromGraveyardToBattlefieldTargetEffect) {
|
||||||
int xValue = new GetXValue().calculate(game, ability, null);
|
int xValue = new GetXValue().calculate(game, ability, null);
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
ability.addTarget(new TargetCardInYourGraveyard(xValue,xValue, new FilterCreatureCard("creature cards from your graveyard")));
|
ability.addTarget(new TargetCardInYourGraveyard(xValue, xValue, new FilterCreatureCard("creature cards from your graveyard")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,6 +107,7 @@ public class ChampionOfStraySouls extends CardImpl {
|
||||||
|
|
||||||
public ChampionOfStraySouls(final ChampionOfStraySouls card) {
|
public ChampionOfStraySouls(final ChampionOfStraySouls card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -25,20 +25,19 @@
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.sets.championsofkamigawa;
|
package mage.sets.championsofkamigawa;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.constants.CardType;
|
|
||||||
import mage.constants.Rarity;
|
|
||||||
import mage.constants.Zone;
|
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleActivatedAbility;
|
import mage.abilities.common.SimpleActivatedAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
import mage.abilities.costs.mana.*;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.filter.Filter;
|
import mage.filter.Filter;
|
||||||
import mage.filter.common.FilterArtifactPermanent;
|
import mage.filter.common.FilterArtifactPermanent;
|
||||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||||
|
@ -51,6 +50,8 @@ import mage.target.TargetPermanent;
|
||||||
*/
|
*/
|
||||||
public class HearthKami extends CardImpl {
|
public class HearthKami extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public HearthKami(UUID ownerId) {
|
public HearthKami(UUID ownerId) {
|
||||||
super(ownerId, 171, "Hearth Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
super(ownerId, 171, "Hearth Kami", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||||
this.expansionSetCode = "CHK";
|
this.expansionSetCode = "CHK";
|
||||||
|
@ -63,12 +64,13 @@ public class HearthKami extends CardImpl {
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}"));
|
||||||
ability.addCost(new SacrificeSourceCost());
|
ability.addCost(new SacrificeSourceCost());
|
||||||
ability.addTarget(new TargetPermanent(new FilterArtifactPermanent("artifact with converted mana cost X")));
|
ability.addTarget(new TargetPermanent(new FilterArtifactPermanent("artifact with converted mana cost X")));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterArtifactPermanent filter = new FilterArtifactPermanent(new StringBuilder("artifact with converted mana cost ").append(xValue).toString());
|
FilterArtifactPermanent filter = new FilterArtifactPermanent(new StringBuilder("artifact with converted mana cost ").append(xValue).toString());
|
||||||
|
@ -80,6 +82,7 @@ public class HearthKami extends CardImpl {
|
||||||
|
|
||||||
public HearthKami(final HearthKami card) {
|
public HearthKami(final HearthKami card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -57,6 +57,8 @@ import mage.target.common.TargetCardInHand;
|
||||||
*/
|
*/
|
||||||
public class MartyrOfBones extends CardImpl {
|
public class MartyrOfBones extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public MartyrOfBones(UUID ownerId) {
|
public MartyrOfBones(UUID ownerId) {
|
||||||
super(ownerId, 65, "Martyr of Bones", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}");
|
super(ownerId, 65, "Martyr of Bones", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}");
|
||||||
this.expansionSetCode = "CSP";
|
this.expansionSetCode = "CSP";
|
||||||
|
@ -72,16 +74,18 @@ public class MartyrOfBones extends CardImpl {
|
||||||
ability.addCost(new RevealVariableBlackCardsFromHandCost());
|
ability.addCost(new RevealVariableBlackCardsFromHandCost());
|
||||||
ability.addCost(new SacrificeSourceCost());
|
ability.addCost(new SacrificeSourceCost());
|
||||||
ability.addTarget(new TargetCardInASingleGraveyard(0, 1, new FilterCard("cards in a single graveyard")));
|
ability.addTarget(new TargetCardInASingleGraveyard(0, 1, new FilterCard("cards in a single graveyard")));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public MartyrOfBones(final MartyrOfBones card) {
|
public MartyrOfBones(final MartyrOfBones card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
int amount = 0;
|
int amount = 0;
|
||||||
for (Cost cost : ability.getCosts()) {
|
for (Cost cost : ability.getCosts()) {
|
||||||
if (cost instanceof RevealVariableBlackCardsFromHandCost) {
|
if (cost instanceof RevealVariableBlackCardsFromHandCost) {
|
||||||
|
@ -100,36 +104,37 @@ public class MartyrOfBones extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
||||||
|
|
||||||
private static final FilterCard filter = new FilterCard("X black cards from your hand");
|
private static final FilterCard filter = new FilterCard("X black cards from your hand");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
||||||
}
|
}
|
||||||
|
|
||||||
RevealVariableBlackCardsFromHandCost() {
|
RevealVariableBlackCardsFromHandCost() {
|
||||||
super("black cards to reveal");
|
super("black cards to reveal");
|
||||||
this.text = new StringBuilder("Reveal ").append(xText).append(" black cards from {this}").toString();
|
this.text = new StringBuilder("Reveal ").append(xText).append(" black cards from {this}").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
RevealVariableBlackCardsFromHandCost(final RevealVariableBlackCardsFromHandCost cost) {
|
RevealVariableBlackCardsFromHandCost(final RevealVariableBlackCardsFromHandCost cost) {
|
||||||
super(cost);
|
super(cost);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RevealVariableBlackCardsFromHandCost copy() {
|
public RevealVariableBlackCardsFromHandCost copy() {
|
||||||
return new RevealVariableBlackCardsFromHandCost(this);
|
return new RevealVariableBlackCardsFromHandCost(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Cost getFixedCostsFromAnnouncedValue(int xValue) {
|
public Cost getFixedCostsFromAnnouncedValue(int xValue) {
|
||||||
return new RevealTargetFromHandCost(new TargetCardInHand(0, xValue, filter));
|
return new RevealTargetFromHandCost(new TargetCardInHand(0, xValue, filter));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMinValue(Ability source, Game game) {
|
public int getMinValue(Ability source, Game game) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getMaxValue(Ability source, Game game) {
|
public int getMaxValue(Ability source, Game game) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
|
@ -138,4 +143,4 @@ class RevealVariableBlackCardsFromHandCost extends VariableCostImpl {
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,11 +52,14 @@ import mage.target.TargetPermanent;
|
||||||
*/
|
*/
|
||||||
public class DeepfireElemental extends CardImpl {
|
public class DeepfireElemental extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
private static final FilterPermanent filter = new FilterPermanent("artifact or creature with converted mana cost X");
|
private static final FilterPermanent filter = new FilterPermanent("artifact or creature with converted mana cost X");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE)));
|
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.CREATURE)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public DeepfireElemental(UUID ownerId) {
|
public DeepfireElemental(UUID ownerId) {
|
||||||
super(ownerId, 185, "Deepfire Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}{R}");
|
super(ownerId, 185, "Deepfire Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}{R}");
|
||||||
this.expansionSetCode = "C13";
|
this.expansionSetCode = "C13";
|
||||||
|
@ -68,12 +71,13 @@ public class DeepfireElemental extends CardImpl {
|
||||||
// {X}{X}{1}: Destroy target artifact or creature with converted mana cost X.
|
// {X}{X}{1}: Destroy target artifact or creature with converted mana cost X.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{X}{X}{1}"));
|
||||||
ability.addTarget(new TargetPermanent(filter));
|
ability.addTarget(new TargetPermanent(filter));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterPermanent newFilter = filter.copy();
|
FilterPermanent newFilter = filter.copy();
|
||||||
newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append("}").toString());
|
newFilter.setMessage(new StringBuilder("artifact or creature with converted mana cost {").append(ability.getManaCostsToPay().getX()).append("}").toString());
|
||||||
|
@ -85,6 +89,7 @@ public class DeepfireElemental extends CardImpl {
|
||||||
|
|
||||||
public DeepfireElemental(final DeepfireElemental card) {
|
public DeepfireElemental(final DeepfireElemental card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -38,7 +38,6 @@ import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.abilities.keyword.HasteAbility;
|
import mage.abilities.keyword.HasteAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
@ -52,6 +51,8 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public class TyrantsFamiliar extends CardImpl {
|
public class TyrantsFamiliar extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public TyrantsFamiliar(UUID ownerId) {
|
public TyrantsFamiliar(UUID ownerId) {
|
||||||
super(ownerId, 39, "Tyrant's Familiar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
|
super(ownerId, 39, "Tyrant's Familiar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{R}{R}");
|
||||||
this.expansionSetCode = "C14";
|
this.expansionSetCode = "C14";
|
||||||
|
@ -62,30 +63,32 @@ public class TyrantsFamiliar extends CardImpl {
|
||||||
|
|
||||||
// Flying
|
// Flying
|
||||||
this.addAbility(FlyingAbility.getInstance());
|
this.addAbility(FlyingAbility.getInstance());
|
||||||
|
|
||||||
// Haste
|
// Haste
|
||||||
this.addAbility(HasteAbility.getInstance());
|
this.addAbility(HasteAbility.getInstance());
|
||||||
|
|
||||||
// Lieutenant - As long as you control your commander, Tyrant's Familiar gets +2/+2 and has "Whenever Tyrant's Familiar attacks, it deals 7 damage to target creature defending player controls."
|
// Lieutenant - As long as you control your commander, Tyrant's Familiar gets +2/+2 and has "Whenever Tyrant's Familiar attacks, it deals 7 damage to target creature defending player controls."
|
||||||
Ability gainedAbility = new AttacksTriggeredAbility(new DamageTargetEffect(7), false);
|
Ability gainedAbility = new AttacksTriggeredAbility(new DamageTargetEffect(7), false);
|
||||||
gainedAbility.addTarget(new TargetCreaturePermanent());
|
gainedAbility.addTarget(new TargetCreaturePermanent());
|
||||||
ContinuousEffect effect = new GainAbilitySourceEffect(gainedAbility);
|
ContinuousEffect effect = new GainAbilitySourceEffect(gainedAbility);
|
||||||
effect.setText("and has \"Whenever {this} attacks, it deals 7 damage to target creature defending player controls\"");
|
effect.setText("and has \"Whenever {this} attacks, it deals 7 damage to target creature defending player controls\"");
|
||||||
|
originalId = gainedAbility.getOriginalId();
|
||||||
this.addAbility(new LieutenantAbility(effect));
|
this.addAbility(new LieutenantAbility(effect));
|
||||||
}
|
}
|
||||||
|
|
||||||
public TyrantsFamiliar(final TyrantsFamiliar card) {
|
public TyrantsFamiliar(final TyrantsFamiliar card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TyrantsFamiliar copy() {
|
public TyrantsFamiliar copy() {
|
||||||
return new TyrantsFamiliar(this);
|
return new TyrantsFamiliar(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
||||||
|
|
|
@ -55,6 +55,7 @@ import mage.target.TargetPlayer;
|
||||||
*/
|
*/
|
||||||
public class OathOfDruids extends CardImpl {
|
public class OathOfDruids extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
private static final FilterPlayer filter = new FilterPlayer();
|
private static final FilterPlayer filter = new FilterPlayer();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -68,12 +69,13 @@ public class OathOfDruids extends CardImpl {
|
||||||
// At the beginning of each player's upkeep, that player chooses target player who controls more creatures than he or she does and is his or her opponent. The first player may reveal cards from the top of his or her library until he or she reveals a creature card. If he or she does, that player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard.
|
// At the beginning of each player's upkeep, that player chooses target player who controls more creatures than he or she does and is his or her opponent. The first player may reveal cards from the top of his or her library until he or she reveals a creature card. If he or she does, that player puts that card onto the battlefield and all other cards revealed this way into his or her graveyard.
|
||||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfDruidsEffect(), TargetController.ANY, true);
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(new OathOfDruidsEffect(), TargetController.ANY, true);
|
||||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof BeginningOfUpkeepTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
if (activePlayer != null) {
|
if (activePlayer != null) {
|
||||||
ability.setControllerId(activePlayer.getId());
|
ability.setControllerId(activePlayer.getId());
|
||||||
|
@ -86,6 +88,7 @@ public class OathOfDruids extends CardImpl {
|
||||||
|
|
||||||
public OathOfDruids(final OathOfDruids card) {
|
public OathOfDruids(final OathOfDruids card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,6 +54,7 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
*/
|
*/
|
||||||
public class OathOfLieges extends CardImpl {
|
public class OathOfLieges extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
private static final FilterPlayer filter = new FilterPlayer("player who controls more lands than you do and is his your opponent");
|
private static final FilterPlayer filter = new FilterPlayer("player who controls more lands than you do and is his your opponent");
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
@ -69,16 +70,18 @@ public class OathOfLieges extends CardImpl {
|
||||||
effect.setText("that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library");
|
effect.setText("that player chooses target player who controls more lands than he or she does and is his or her opponent. The first player may search his or her library for a basic land card, put that card onto the battlefield, then shuffle his or her library");
|
||||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, true);
|
Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, true);
|
||||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OathOfLieges(final OathOfLieges card) {
|
public OathOfLieges(final OathOfLieges card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof BeginningOfUpkeepTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
Player activePlayer = game.getPlayer(game.getActivePlayerId());
|
||||||
if (activePlayer != null) {
|
if (activePlayer != null) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
|
|
|
@ -61,6 +61,8 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public class LinessaZephyrMage extends CardImpl {
|
public class LinessaZephyrMage extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public LinessaZephyrMage(UUID ownerId) {
|
public LinessaZephyrMage(UUID ownerId) {
|
||||||
super(ownerId, 51, "Linessa, Zephyr Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
super(ownerId, 51, "Linessa, Zephyr Mage", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||||
this.expansionSetCode = "FUT";
|
this.expansionSetCode = "FUT";
|
||||||
|
@ -75,6 +77,7 @@ public class LinessaZephyrMage extends CardImpl {
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{X}{U}{U}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandTargetEffect(), new ManaCostsImpl("{X}{U}{U}"));
|
||||||
ability.addCost(new TapSourceCost());
|
ability.addCost(new TapSourceCost());
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
// Grandeur - Discard another card named Linessa, Zephyr Mage: Target player returns a creature he or she controls to its owner's hand, then repeats this process for an artifact, an enchantment, and a land.
|
// Grandeur - Discard another card named Linessa, Zephyr Mage: Target player returns a creature he or she controls to its owner's hand, then repeats this process for an artifact, an enchantment, and a land.
|
||||||
|
@ -85,11 +88,12 @@ public class LinessaZephyrMage extends CardImpl {
|
||||||
|
|
||||||
public LinessaZephyrMage(final LinessaZephyrMage card) {
|
public LinessaZephyrMage(final LinessaZephyrMage card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost " + xValue);
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with converted mana cost " + xValue);
|
||||||
|
|
|
@ -33,7 +33,6 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.common.AttacksTriggeredAbility;
|
import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
import mage.abilities.effects.common.TapTargetEffect;
|
import mage.abilities.effects.common.TapTargetEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
@ -47,6 +46,8 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public class MasterOfDiversion extends CardImpl {
|
public class MasterOfDiversion extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public MasterOfDiversion(UUID ownerId) {
|
public MasterOfDiversion(UUID ownerId) {
|
||||||
super(ownerId, 24, "Master of Diversion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
super(ownerId, 24, "Master of Diversion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||||
this.expansionSetCode = "M14";
|
this.expansionSetCode = "M14";
|
||||||
|
@ -59,17 +60,19 @@ public class MasterOfDiversion extends CardImpl {
|
||||||
// Whenever Master of Diversion attacks, tap target creature defending player controls.
|
// Whenever Master of Diversion attacks, tap target creature defending player controls.
|
||||||
Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), false);
|
Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), false);
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public MasterOfDiversion(final MasterOfDiversion card) {
|
public MasterOfDiversion(final MasterOfDiversion card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
||||||
|
|
|
@ -53,6 +53,8 @@ import mage.target.targetpointer.FirstTargetPointer;
|
||||||
*/
|
*/
|
||||||
public class SentinelOfTheEternalWatch extends CardImpl {
|
public class SentinelOfTheEternalWatch extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public SentinelOfTheEternalWatch(UUID ownerId) {
|
public SentinelOfTheEternalWatch(UUID ownerId) {
|
||||||
super(ownerId, 30, "Sentinel of the Eternal Watch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}");
|
super(ownerId, 30, "Sentinel of the Eternal Watch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}");
|
||||||
this.expansionSetCode = "ORI";
|
this.expansionSetCode = "ORI";
|
||||||
|
@ -64,12 +66,15 @@ public class SentinelOfTheEternalWatch extends CardImpl {
|
||||||
// Vigilance
|
// Vigilance
|
||||||
this.addAbility(VigilanceAbility.getInstance());
|
this.addAbility(VigilanceAbility.getInstance());
|
||||||
// At the beginning of combat on each opponent's turn, tap target creature that player controls.
|
// At the beginning of combat on each opponent's turn, tap target creature that player controls.
|
||||||
this.addAbility(new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect("target creature that player controls"), TargetController.OPPONENT, false, true));
|
Ability ability = new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect("target creature that player controls"), TargetController.OPPONENT, false, true);
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SentinelOfTheEternalWatch(final SentinelOfTheEternalWatch card) {
|
public SentinelOfTheEternalWatch(final SentinelOfTheEternalWatch card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,8 +84,8 @@ public class SentinelOfTheEternalWatch extends CardImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof BeginningOfCombatTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
for (Effect effect: ability.getEffects()) {
|
for (Effect effect : ability.getEffects()) {
|
||||||
UUID opponentId = effect.getTargetPointer().getFirst(game, ability);
|
UUID opponentId = effect.getTargetPointer().getFirst(game, ability);
|
||||||
Player opponent = game.getPlayer(opponentId);
|
Player opponent = game.getPlayer(opponentId);
|
||||||
if (opponent != null) {
|
if (opponent != null) {
|
||||||
|
@ -93,6 +98,5 @@ public class SentinelOfTheEternalWatch extends CardImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ import mage.abilities.common.AttacksTriggeredAbility;
|
||||||
import mage.abilities.effects.common.TapTargetEffect;
|
import mage.abilities.effects.common.TapTargetEffect;
|
||||||
import mage.abilities.keyword.FlankingAbility;
|
import mage.abilities.keyword.FlankingAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
|
@ -48,6 +47,8 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public class SidarJabari extends CardImpl {
|
public class SidarJabari extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public SidarJabari(UUID ownerId) {
|
public SidarJabari(UUID ownerId) {
|
||||||
super(ownerId, 243, "Sidar Jabari", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
super(ownerId, 243, "Sidar Jabari", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||||
this.expansionSetCode = "MIR";
|
this.expansionSetCode = "MIR";
|
||||||
|
@ -59,20 +60,22 @@ public class SidarJabari extends CardImpl {
|
||||||
|
|
||||||
// Flanking
|
// Flanking
|
||||||
this.addAbility(new FlankingAbility());
|
this.addAbility(new FlankingAbility());
|
||||||
|
|
||||||
// Whenever Sidar Jabari attacks, tap target creature defending player controls.
|
// Whenever Sidar Jabari attacks, tap target creature defending player controls.
|
||||||
Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), false);
|
Ability ability = new AttacksTriggeredAbility(new TapTargetEffect(), false);
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SidarJabari(final SidarJabari card) {
|
public SidarJabari(final SidarJabari card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
||||||
|
|
|
@ -48,7 +48,8 @@ import mage.target.TargetSpell;
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public class DeclarationOfNaught extends CardImpl {
|
public class DeclarationOfNaught extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
static final private FilterSpell filter = new FilterSpell("spell with the chosen name");
|
static final private FilterSpell filter = new FilterSpell("spell with the chosen name");
|
||||||
|
|
||||||
public DeclarationOfNaught(UUID ownerId) {
|
public DeclarationOfNaught(UUID ownerId) {
|
||||||
|
@ -61,13 +62,14 @@ public class DeclarationOfNaught extends CardImpl {
|
||||||
// {U}: Counter target spell with the chosen name.
|
// {U}: Counter target spell with the chosen name.
|
||||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}"));
|
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterTargetEffect(), new ManaCostsImpl("{U}"));
|
||||||
ability.addTarget(new TargetSpell(filter));
|
ability.addTarget(new TargetSpell(filter));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterSpell filter2 = new FilterSpell("spell with the chosen name");
|
FilterSpell filter2 = new FilterSpell("spell with the chosen name");
|
||||||
filter2.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + NameACardEffect.INFO_KEY)));
|
filter2.add(new NamePredicate((String) game.getState().getValue(ability.getSourceId().toString() + NameACardEffect.INFO_KEY)));
|
||||||
|
@ -78,10 +80,11 @@ public class DeclarationOfNaught extends CardImpl {
|
||||||
|
|
||||||
public DeclarationOfNaught(final DeclarationOfNaught card) {
|
public DeclarationOfNaught(final DeclarationOfNaught card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DeclarationOfNaught copy() {
|
public DeclarationOfNaught copy() {
|
||||||
return new DeclarationOfNaught(this);
|
return new DeclarationOfNaught(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,20 +46,22 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
*/
|
*/
|
||||||
public class BurningSands extends CardImpl {
|
public class BurningSands extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
private static final FilterLandPermanent filter = new FilterLandPermanent("a land");
|
private static final FilterLandPermanent filter = new FilterLandPermanent("a land");
|
||||||
|
|
||||||
public BurningSands(UUID ownerId) {
|
public BurningSands(UUID ownerId) {
|
||||||
super(ownerId, 180, "Burning Sands", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}");
|
super(ownerId, 180, "Burning Sands", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}");
|
||||||
this.expansionSetCode = "ODY";
|
this.expansionSetCode = "ODY";
|
||||||
|
|
||||||
|
|
||||||
// Whenever a creature dies, that creature's controller sacrifices a land.
|
// Whenever a creature dies, that creature's controller sacrifices a land.
|
||||||
this.addAbility(new DiesCreatureTriggeredAbility(new SacrificeEffect(filter, 1, "that creature's controller"), false, false, true));
|
Ability ability = new DiesCreatureTriggeredAbility(new SacrificeEffect(filter, 1, "that creature's controller"), false, false, true);
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof DiesCreatureTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
||||||
Permanent creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD);
|
Permanent creature = (Permanent) game.getLastKnownInformation(creatureId, Zone.BATTLEFIELD);
|
||||||
if (creature != null) {
|
if (creature != null) {
|
||||||
|
@ -70,6 +72,7 @@ public class BurningSands extends CardImpl {
|
||||||
|
|
||||||
public BurningSands(final BurningSands card) {
|
public BurningSands(final BurningSands card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -35,9 +35,7 @@ import mage.abilities.effects.ContinuousEffect;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||||
import mage.abilities.keyword.FlyingAbility;
|
import mage.abilities.keyword.FlyingAbility;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.AbilityType;
|
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Duration;
|
import mage.constants.Duration;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
@ -60,6 +58,8 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
*/
|
*/
|
||||||
public class SkyfireKirin extends CardImpl {
|
public class SkyfireKirin extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public SkyfireKirin(UUID ownerId) {
|
public SkyfireKirin(UUID ownerId) {
|
||||||
super(ownerId, 113, "Skyfire Kirin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
|
super(ownerId, 113, "Skyfire Kirin", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
|
||||||
this.expansionSetCode = "SOK";
|
this.expansionSetCode = "SOK";
|
||||||
|
@ -75,12 +75,13 @@ public class SkyfireKirin extends CardImpl {
|
||||||
// Whenever you cast a Spirit or Arcane spell, you may gain control of target creature with that spell's converted mana cost until end of turn.
|
// Whenever you cast a Spirit or Arcane spell, you may gain control of target creature with that spell's converted mana cost until end of turn.
|
||||||
Ability ability = new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new SkyfireKirinEffect(), new FilterSpiritOrArcaneCard(), true, true);
|
Ability ability = new SpellCastControllerTriggeredAbility(Zone.BATTLEFIELD, new SkyfireKirinEffect(), new FilterSpiritOrArcaneCard(), true, true);
|
||||||
ability.addTarget(new TargetCreaturePermanent());
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getAbilityType().equals(AbilityType.TRIGGERED)) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
Spell spell = game.getStack().getSpell(ability.getEffects().get(0).getTargetPointer().getFirst(game, ability));
|
Spell spell = game.getStack().getSpell(ability.getEffects().get(0).getTargetPointer().getFirst(game, ability));
|
||||||
if (spell != null) {
|
if (spell != null) {
|
||||||
int cmc = spell.getConvertedManaCost();
|
int cmc = spell.getConvertedManaCost();
|
||||||
|
@ -94,6 +95,7 @@ public class SkyfireKirin extends CardImpl {
|
||||||
|
|
||||||
public SkyfireKirin(final SkyfireKirin card) {
|
public SkyfireKirin(final SkyfireKirin card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -121,7 +123,7 @@ class SkyfireKirinEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Permanent targetCreature = null;
|
Permanent targetCreature = null;
|
||||||
for(Target target: source.getTargets()) {
|
for (Target target : source.getTargets()) {
|
||||||
if (target instanceof TargetPermanent) {
|
if (target instanceof TargetPermanent) {
|
||||||
targetCreature = game.getPermanent(target.getFirstTarget());
|
targetCreature = game.getPermanent(target.getFirstTarget());
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,8 @@ import mage.target.common.TargetCardInOpponentsGraveyard;
|
||||||
*/
|
*/
|
||||||
public class GethLordOfTheVault extends CardImpl {
|
public class GethLordOfTheVault extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public GethLordOfTheVault(UUID ownerId) {
|
public GethLordOfTheVault(UUID ownerId) {
|
||||||
super(ownerId, 64, "Geth, Lord of the Vault", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
super(ownerId, 64, "Geth, Lord of the Vault", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}");
|
||||||
this.expansionSetCode = "SOM";
|
this.expansionSetCode = "SOM";
|
||||||
|
@ -70,16 +72,17 @@ public class GethLordOfTheVault extends CardImpl {
|
||||||
// {X}{B}: Put target artifact or creature card with converted mana cost X from an opponent's graveyard onto the battlefield under your control tapped.
|
// {X}{B}: Put target artifact or creature card with converted mana cost X from an opponent's graveyard onto the battlefield under your control tapped.
|
||||||
// Then that player puts the top X cards of his or her library into his or her graveyard.
|
// Then that player puts the top X cards of his or her library into his or her graveyard.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}"));
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GethLordOfTheVaultEffect(), new ManaCostsImpl("{X}{B}"));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
ability.addTarget(new TargetCardInOpponentsGraveyard(new FilterCard("artifact or creature card with converted mana cost X from an opponent's graveyard")));
|
ability.addTarget(new TargetCardInOpponentsGraveyard(new FilterCard("artifact or creature card with converted mana cost X from an opponent's graveyard")));
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
FilterCard filter = new FilterCard(new StringBuilder("artifact or creature card with converted mana cost ").append(xValue).append(" from an opponent's graveyard").toString());
|
FilterCard filter = new FilterCard("artifact or creature card with converted mana cost " + xValue + " from an opponent's graveyard");
|
||||||
filter.add(Predicates.or(
|
filter.add(Predicates.or(
|
||||||
new CardTypePredicate(CardType.ARTIFACT),
|
new CardTypePredicate(CardType.ARTIFACT),
|
||||||
new CardTypePredicate(CardType.CREATURE)));
|
new CardTypePredicate(CardType.CREATURE)));
|
||||||
|
@ -91,6 +94,7 @@ public class GethLordOfTheVault extends CardImpl {
|
||||||
|
|
||||||
public GethLordOfTheVault(final GethLordOfTheVault card) {
|
public GethLordOfTheVault(final GethLordOfTheVault card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -54,6 +54,8 @@ import mage.target.common.TargetCreaturePermanent;
|
||||||
*/
|
*/
|
||||||
public class LegacysAllure extends CardImpl {
|
public class LegacysAllure extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public LegacysAllure(UUID ownerId) {
|
public LegacysAllure(UUID ownerId) {
|
||||||
super(ownerId, 71, "Legacy's Allure", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}");
|
super(ownerId, 71, "Legacy's Allure", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}");
|
||||||
this.expansionSetCode = "TMP";
|
this.expansionSetCode = "TMP";
|
||||||
|
@ -62,18 +64,20 @@ public class LegacysAllure extends CardImpl {
|
||||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(new Counter("treasure")), TargetController.YOU, true));
|
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(new Counter("treasure")), TargetController.YOU, true));
|
||||||
|
|
||||||
// Sacrifice Legacy's Allure: Gain control of target creature with power less than or equal to the number of treasure counters on Legacy's Allure.
|
// Sacrifice Legacy's Allure: Gain control of target creature with power less than or equal to the number of treasure counters on Legacy's Allure.
|
||||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true),new SacrificeSourceCost());
|
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame, true), new SacrificeSourceCost());
|
||||||
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with power less than or equal to the number of treasure counters on " + getLogName())));
|
ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature with power less than or equal to the number of treasure counters on " + getLogName())));
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LegacysAllure(final LegacysAllure card) {
|
public LegacysAllure(final LegacysAllure card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof SimpleActivatedAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
|
Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
|
||||||
if (sourcePermanent != null) {
|
if (sourcePermanent != null) {
|
||||||
int numbCounters = sourcePermanent.getCounters().getCount("treasure");
|
int numbCounters = sourcePermanent.getCounters().getCount("treasure");
|
||||||
|
|
|
@ -64,6 +64,8 @@ public class PolisCrusher extends CardImpl {
|
||||||
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public PolisCrusher(UUID ownerId) {
|
public PolisCrusher(UUID ownerId) {
|
||||||
super(ownerId, 198, "Polis Crusher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
|
super(ownerId, 198, "Polis Crusher", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
|
||||||
this.expansionSetCode = "THS";
|
this.expansionSetCode = "THS";
|
||||||
|
@ -83,16 +85,18 @@ public class PolisCrusher extends CardImpl {
|
||||||
new DealsCombatDamageToAPlayerTriggeredAbility(new DestroyTargetEffect(), false, true),
|
new DealsCombatDamageToAPlayerTriggeredAbility(new DestroyTargetEffect(), false, true),
|
||||||
MonstrousCondition.getInstance(),
|
MonstrousCondition.getInstance(),
|
||||||
"Whenever {this} deals combat damage to a player, if {this} is monstrous, destroy target enchantment that player controls.");
|
"Whenever {this} deals combat damage to a player, if {this} is monstrous, destroy target enchantment that player controls.");
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PolisCrusher(final PolisCrusher card) {
|
public PolisCrusher(final PolisCrusher card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof ConditionalTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
for (Effect effect : ability.getEffects()) {
|
for (Effect effect : ability.getEffects()) {
|
||||||
if (effect instanceof DestroyTargetEffect) {
|
if (effect instanceof DestroyTargetEffect) {
|
||||||
Player attackedPlayer = game.getPlayer(effect.getTargetPointer().getFirst(game, ability));
|
Player attackedPlayer = game.getPlayer(effect.getTargetPointer().getFirst(game, ability));
|
||||||
|
|
|
@ -49,6 +49,8 @@ import mage.target.common.TargetCreatureOrPlayer;
|
||||||
*/
|
*/
|
||||||
public class Pandemonium extends CardImpl {
|
public class Pandemonium extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public Pandemonium(UUID ownerId) {
|
public Pandemonium(UUID ownerId) {
|
||||||
super(ownerId, 68, "Pandemonium", Rarity.SPECIAL, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
super(ownerId, 68, "Pandemonium", Rarity.SPECIAL, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}");
|
||||||
this.expansionSetCode = "TSB";
|
this.expansionSetCode = "TSB";
|
||||||
|
@ -56,22 +58,24 @@ public class Pandemonium extends CardImpl {
|
||||||
// Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice.
|
// Whenever a creature enters the battlefield, that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice.
|
||||||
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PandemoniumEffect(), new FilterCreaturePermanent(), false, SetTargetPointer.PERMANENT, "");
|
Ability ability = new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new PandemoniumEffect(), new FilterCreaturePermanent(), false, SetTargetPointer.PERMANENT, "");
|
||||||
ability.addTarget(new TargetCreatureOrPlayer());
|
ability.addTarget(new TargetCreatureOrPlayer());
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Pandemonium(final Pandemonium card) {
|
public Pandemonium(final Pandemonium card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof EntersBattlefieldAllTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
UUID creatureId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
||||||
Permanent creature = game.getPermanent(creatureId);
|
Permanent creature = game.getPermanent(creatureId);
|
||||||
if (creature != null) {
|
if (creature != null) {
|
||||||
ability.getTargets().get(0).setTargetController(creature.getControllerId());
|
ability.getTargets().get(0).setTargetController(creature.getControllerId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -81,21 +85,21 @@ public class Pandemonium extends CardImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
class PandemoniumEffect extends OneShotEffect {
|
class PandemoniumEffect extends OneShotEffect {
|
||||||
|
|
||||||
public PandemoniumEffect() {
|
public PandemoniumEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice";
|
this.staticText = "that creature's controller may have it deal damage equal to its power to target creature or player of his or her choice";
|
||||||
}
|
}
|
||||||
|
|
||||||
public PandemoniumEffect(final PandemoniumEffect effect) {
|
public PandemoniumEffect(final PandemoniumEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PandemoniumEffect copy() {
|
public PandemoniumEffect copy() {
|
||||||
return new PandemoniumEffect(this);
|
return new PandemoniumEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
|
@ -106,7 +110,7 @@ class PandemoniumEffect extends OneShotEffect {
|
||||||
if (targetPermanent != null) {
|
if (targetPermanent != null) {
|
||||||
targetPermanent.damage(enteringCreature.getPower().getValue(), source.getSourceId(), game, false, true);
|
targetPermanent.damage(enteringCreature.getPower().getValue(), source.getSourceId(), game, false, true);
|
||||||
} else {
|
} else {
|
||||||
Player targetPlayer = game.getPlayer(source.getTargets().getFirstTarget());
|
Player targetPlayer = game.getPlayer(source.getTargets().getFirstTarget());
|
||||||
if (targetPlayer != null) {
|
if (targetPlayer != null) {
|
||||||
targetPlayer.damage(enteringCreature.getPower().getValue(), source.getSourceId(), game, false, true);
|
targetPlayer.damage(enteringCreature.getPower().getValue(), source.getSourceId(), game, false, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,8 @@ import mage.target.targetpointer.FirstTargetPointer;
|
||||||
*/
|
*/
|
||||||
public class SigilOfSleep extends CardImpl {
|
public class SigilOfSleep extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public SigilOfSleep(UUID ownerId) {
|
public SigilOfSleep(UUID ownerId) {
|
||||||
super(ownerId, 46, "Sigil of Sleep", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}");
|
super(ownerId, 46, "Sigil of Sleep", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}");
|
||||||
this.expansionSetCode = "UDS";
|
this.expansionSetCode = "UDS";
|
||||||
|
@ -67,13 +69,14 @@ public class SigilOfSleep extends CardImpl {
|
||||||
Effect effect = new ReturnToHandTargetEffect();
|
Effect effect = new ReturnToHandTargetEffect();
|
||||||
effect.setText("return target creature that player controls to its owner's hand");
|
effect.setText("return target creature that player controls to its owner's hand");
|
||||||
ability = new DealsDamageToAPlayerAttachedTriggeredAbility(effect, "enchanted", false, true, false);
|
ability = new DealsDamageToAPlayerAttachedTriggeredAbility(effect, "enchanted", false, true, false);
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof DealsDamageToAPlayerAttachedTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
UUID playerId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
UUID playerId = ability.getEffects().get(0).getTargetPointer().getFirst(game, ability);
|
||||||
if (playerId != null) {
|
if (playerId != null) {
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls");
|
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature that player controls");
|
||||||
|
@ -89,6 +92,7 @@ public class SigilOfSleep extends CardImpl {
|
||||||
|
|
||||||
public SigilOfSleep(final SigilOfSleep card) {
|
public SigilOfSleep(final SigilOfSleep card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.worldwake;
|
package mage.sets.worldwake;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
@ -37,7 +38,11 @@ import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffec
|
||||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||||
import mage.abilities.keyword.MultikickerAbility;
|
import mage.abilities.keyword.MultikickerAbility;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
import mage.constants.*;
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Duration;
|
||||||
|
import mage.constants.Rarity;
|
||||||
|
import mage.constants.TargetController;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.common.FilterCreaturePermanent;
|
import mage.filter.common.FilterCreaturePermanent;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
|
@ -45,8 +50,6 @@ import mage.filter.predicate.permanent.ControllerPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCardInYourGraveyard;
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
|
@ -62,11 +65,12 @@ public class MarshalsAnthem extends CardImpl {
|
||||||
filterCard.add(new CardTypePredicate(CardType.CREATURE));
|
filterCard.add(new CardTypePredicate(CardType.CREATURE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public MarshalsAnthem(UUID ownerId) {
|
public MarshalsAnthem(UUID ownerId) {
|
||||||
super(ownerId, 15, "Marshal's Anthem", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
|
super(ownerId, 15, "Marshal's Anthem", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}");
|
||||||
this.expansionSetCode = "WWK";
|
this.expansionSetCode = "WWK";
|
||||||
|
|
||||||
|
|
||||||
// Multikicker {1}{W}
|
// Multikicker {1}{W}
|
||||||
this.addAbility(new MultikickerAbility("{1}{W}"));
|
this.addAbility(new MultikickerAbility("{1}{W}"));
|
||||||
|
|
||||||
|
@ -74,18 +78,18 @@ public class MarshalsAnthem extends CardImpl {
|
||||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter, false)));
|
||||||
|
|
||||||
// When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked.
|
// When Marshal's Anthem enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times Marshal's Anthem was kicked.
|
||||||
|
|
||||||
Ability ability = new ConditionalTriggeredAbility(
|
Ability ability = new ConditionalTriggeredAbility(
|
||||||
new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false),
|
new EntersBattlefieldTriggeredAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), false),
|
||||||
KickedCondition.getInstance(),
|
KickedCondition.getInstance(),
|
||||||
"When {this} enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times {this} was kicked.");
|
"When {this} enters the battlefield, return up to X target creature cards from your graveyard to the battlefield, where X is the number of times {this} was kicked.");
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof ConditionalTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
int numbTargets = new MultikickerCount().calculate(game, ability, null);
|
int numbTargets = new MultikickerCount().calculate(game, ability, null);
|
||||||
if (numbTargets > 0) {
|
if (numbTargets > 0) {
|
||||||
|
@ -96,6 +100,7 @@ public class MarshalsAnthem extends CardImpl {
|
||||||
|
|
||||||
public MarshalsAnthem(final MarshalsAnthem card) {
|
public MarshalsAnthem(final MarshalsAnthem card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
*/
|
*/
|
||||||
package mage.sets.worldwake;
|
package mage.sets.worldwake;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
@ -43,14 +44,14 @@ import mage.constants.Rarity;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.target.common.TargetCreaturePermanent;
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author jeffwadsworth
|
* @author jeffwadsworth
|
||||||
*/
|
*/
|
||||||
public class VoyagerDrake extends CardImpl {
|
public class VoyagerDrake extends CardImpl {
|
||||||
|
|
||||||
|
private final UUID originalId;
|
||||||
|
|
||||||
public VoyagerDrake(UUID ownerId) {
|
public VoyagerDrake(UUID ownerId) {
|
||||||
super(ownerId, 45, "Voyager Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
super(ownerId, 45, "Voyager Drake", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
|
||||||
this.expansionSetCode = "WWK";
|
this.expansionSetCode = "WWK";
|
||||||
|
@ -70,21 +71,24 @@ public class VoyagerDrake extends CardImpl {
|
||||||
new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false),
|
new EntersBattlefieldTriggeredAbility(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), false),
|
||||||
KickedCondition.getInstance(),
|
KickedCondition.getInstance(),
|
||||||
"When {this} enters the battlefield, up to X target creatures gain flying until end of turn, where X is the number of times {this} was kicked.");
|
"When {this} enters the battlefield, up to X target creatures gain flying until end of turn, where X is the number of times {this} was kicked.");
|
||||||
|
originalId = ability.getOriginalId();
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability instanceof ConditionalTriggeredAbility) {
|
if (ability.getOriginalId().equals(originalId)) {
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
int numbTargets = new MultikickerCount().calculate(game, ability, null);
|
int numbTargets = new MultikickerCount().calculate(game, ability, null);
|
||||||
if (numbTargets > 0) {
|
if (numbTargets > 0) {
|
||||||
ability.addTarget(new TargetCreaturePermanent(0,numbTargets));
|
ability.addTarget(new TargetCreaturePermanent(0, numbTargets));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public VoyagerDrake(final VoyagerDrake card) {
|
public VoyagerDrake(final VoyagerDrake card) {
|
||||||
super(card);
|
super(card);
|
||||||
|
this.originalId = card.originalId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -516,12 +516,11 @@ public abstract class AbilityImpl implements Ability {
|
||||||
// set the xcosts to paid
|
// set the xcosts to paid
|
||||||
variableCost.setAmount(xValue);
|
variableCost.setAmount(xValue);
|
||||||
((Cost) variableCost).setPaid();
|
((Cost) variableCost).setPaid();
|
||||||
String message = new StringBuilder(controller.getLogName())
|
String message = controller.getLogName() + " announces a value of " + xValue + " (" + variableCost.getActionText() + ")";
|
||||||
.append(" announces a value of ").append(xValue).append(" (").append(variableCost.getActionText()).append(")").toString();
|
|
||||||
if (announceString == null) {
|
if (announceString == null) {
|
||||||
announceString = message;
|
announceString = message;
|
||||||
} else {
|
} else {
|
||||||
announceString = new StringBuilder(announceString).append(" ").append(message).toString();
|
announceString = announceString + " " + message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue