forked from External/mage
* Reworked ENTERS_THE_BATTLEFIELD event for replacement effects. Some rework to card movement.
This commit is contained in:
parent
c642165020
commit
59ef2a2889
247 changed files with 1842 additions and 2287 deletions
|
|
@ -31,7 +31,6 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
|
|
@ -97,7 +96,7 @@ class ArsenalThresherEffect extends OneShotEffect {
|
|||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
Permanent arsenalThresher = (Permanent) getValue(EntersBattlefieldEffect.ENTERING_PERMANENT);
|
||||
Permanent arsenalThresher = game.getPermanentEntering(source.getSourceId());
|
||||
FilterArtifactCard filter = new FilterArtifactCard();
|
||||
filter.add(new AnotherCardPredicate());
|
||||
if (controller.chooseUse(Outcome.Benefit, "Do you want to reveal other artifacts in your hand?", source, game)) {
|
||||
|
|
|
|||
|
|
@ -68,14 +68,14 @@ public class Anavolver extends CardImpl {
|
|||
// If Anavolver was kicked with its {1}{U} kicker, it enters the battlefield with two +1/+1 counters on it and with flying.
|
||||
EntersBattlefieldAbility ability1 = new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(2),false),
|
||||
new KickedCostCondition("{1}{U}"), true, "If {this} was kicked with its {1}{U} kicker, it enters the battlefield with two +1/+1 counters on it and with flying.",
|
||||
new KickedCostCondition("{1}{U}"), "If {this} was kicked with its {1}{U} kicker, it enters the battlefield with two +1/+1 counters on it and with flying.",
|
||||
"{this} enters the battlefield with two +1/+1 counters on it and with flying");
|
||||
((EntersBattlefieldEffect)ability1.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability1);
|
||||
|
||||
// If Anavolver was kicked with its {B} kicker, it enters the battlefield with a +1/+1 counter on it and with "Pay 3 life: Regenerate Anavolver."
|
||||
EntersBattlefieldAbility ability2 = new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{B}"), true,
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{B}"),
|
||||
"If {this} was kicked with its {B} kicker, it enters the battlefield with a +1/+1 counter on it and with \"Pay 3 life: Regenerate Anavolver.\"",
|
||||
"{this} enters the battlefield with a +1/+1 counter on it and with \"Pay 3 life: Regenerate Anavolver.\"");
|
||||
((EntersBattlefieldEffect)ability2.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new PayLifeCost(3)), Duration.WhileOnBattlefield));
|
||||
|
|
|
|||
|
|
@ -65,14 +65,14 @@ public class Cetavolver extends CardImpl {
|
|||
// If Cetavolver was kicked with its {1}{R} kicker, it enters the battlefield with two +1/+1 counters on it and with first strike.
|
||||
EntersBattlefieldAbility ability1 = new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(2),false),
|
||||
new KickedCostCondition("{1}{R}"), true, "If Cetavolver was kicked with its {1}{R} kicker, it enters the battlefield with two +1/+1 counters on it and with first strike.",
|
||||
new KickedCostCondition("{1}{R}"), "If Cetavolver was kicked with its {1}{R} kicker, it enters the battlefield with two +1/+1 counters on it and with first strike.",
|
||||
"{this} enters the battlefield with two +1/+1 counters on it and with first strike");
|
||||
((EntersBattlefieldEffect)ability1.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability1);
|
||||
|
||||
// If Cetavolver was kicked with its {G} kicker, it enters the battlefield with a +1/+1 counter on it and with trample.
|
||||
EntersBattlefieldAbility ability2 = new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{G}"), true,
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{G}"),
|
||||
"If Cetavolver was kicked with its {G} kicker, it enters the battlefield with a +1/+1 counter on it and with trample.",
|
||||
"{this} enters the battlefield with a +1/+1 counter on it and with trample");
|
||||
((EntersBattlefieldEffect)ability2.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
|
|
|
|||
|
|
@ -69,14 +69,14 @@ public class Degavolver extends CardImpl {
|
|||
// If Degavolver was kicked with its {1}{B} kicker, it enters the battlefield with two +1/+1 counters on it and with "Pay 3 life: Regenerate Degavolver."
|
||||
EntersBattlefieldAbility ability1 = new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(2),false),
|
||||
new KickedCostCondition("{1}{B}"), true, "If Degavolver was kicked with its {1}{B} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Pay 3 life: Regenerate Degavolver.\"",
|
||||
new KickedCostCondition("{1}{B}"), "If Degavolver was kicked with its {1}{B} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Pay 3 life: Regenerate Degavolver.\"",
|
||||
"{this} enters the battlefield with two +1/+1 counters on it and with \"Pay 3 life: Regenerate Degavolver.\"");
|
||||
((EntersBattlefieldEffect)ability1.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new PayLifeCost(3)), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability1);
|
||||
|
||||
// If Degavolver was kicked with its {R} kicker, it enters the battlefield with a +1/+1 counter on it and with first strike.
|
||||
EntersBattlefieldAbility ability2 = new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{R}"), true,
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1),false), new KickedCostCondition("{R}"),
|
||||
"If Degavolver was kicked with its {R} kicker, it enters the battlefield with a +1/+1 counter on it and with first strike.",
|
||||
"{this} enters the battlefield with a +1/+1 counter on it and with first strike");
|
||||
((EntersBattlefieldEffect)ability2.getEffects().get(0)).addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
|
|
|
|||
|
|
@ -64,12 +64,12 @@ public class Necravolver extends CardImpl {
|
|||
this.addAbility(kickerAbility);
|
||||
// If Necravolver was kicked with its {1}{G} kicker, it enters the battlefield with two +1/+1 counters on it and with trample.
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
new KickedCostCondition("{1}{G}"), true, "If {this} was kicked with its {1}{G} kicker, it enters the battlefield with two +1/+1 counters on it and with trample.", "");
|
||||
new KickedCostCondition("{1}{G}"), "If {this} was kicked with its {1}{G} kicker, it enters the battlefield with two +1/+1 counters on it and with trample.", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
// If Necravolver was kicked with its {W} kicker, it enters the battlefield with a +1/+1 counter on it and with "Whenever Necravolver deals damage, you gain that much life."
|
||||
ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||
new KickedCostCondition("{W}"), true, "If {this} was kicked with its {W} kicker, it enters the battlefield with a +1/+1 counter on it and with \"Whenever {this} deals damage, you gain that much life.\"", "");
|
||||
new KickedCostCondition("{W}"), "If {this} was kicked with its {W} kicker, it enters the battlefield with a +1/+1 counter on it and with \"Whenever {this} deals damage, you gain that much life.\"", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(new DealsDamageGainLifeSourceTriggeredAbility(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,12 +64,12 @@ public class Rakavolver extends CardImpl {
|
|||
this.addAbility(kickerAbility);
|
||||
// If Rakavolver was kicked with its {1}{W} kicker, it enters the battlefield with two +1/+1 counters on it and with "Whenever Rakavolver deals damage, you gain that much life."
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
new KickedCostCondition("{1}{W}"), true, "If {this} was kicked with its {1}{W} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Whenever {this} deals damage, you gain that much life.\"", "");
|
||||
new KickedCostCondition("{1}{W}"), "If {this} was kicked with its {1}{W} kicker, it enters the battlefield with two +1/+1 counters on it and with \"Whenever {this} deals damage, you gain that much life.\"", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(new DealsDamageGainLifeSourceTriggeredAbility(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
// If Rakavolver was kicked with its {U} kicker, it enters the battlefield with a +1/+1 counter on it and with flying.
|
||||
ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||
new KickedCostCondition("{U}"), true, "If {this} was kicked with its {U} kicker, it enters the battlefield with a +1/+1 counter on it and with flying.", "");
|
||||
new KickedCostCondition("{U}"), "If {this} was kicked with its {U} kicker, it enters the battlefield with a +1/+1 counter on it and with flying.", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
|||
|
|
@ -30,19 +30,18 @@ package mage.sets.avacynrestored;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.PutCardIntoGraveFromAnywhereAllTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.abilities.effects.common.DontUntapInControllersNextUntapStepTargetEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect.HandSizeModification;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
|
|
@ -50,7 +49,6 @@ import mage.constants.Rarity;
|
|||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
|
|
@ -71,8 +69,7 @@ public class TamiyoTheMoonSage extends CardImpl {
|
|||
this.expansionSetCode = "AVR";
|
||||
this.subtype.add("Tamiyo");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Tap target permanent. It doesn't untap during its controller's next untap step.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new TapTargetEffect(), 1);
|
||||
|
|
@ -130,7 +127,8 @@ class TappedCreaturesControlledByTargetCount implements DynamicValue {
|
|||
}
|
||||
|
||||
/**
|
||||
* Emblem with "You have no maximum hand size" and "Whenever a card is put into your graveyard from anywhere, you may return it to your hand."
|
||||
* Emblem with "You have no maximum hand size" and "Whenever a card is put into
|
||||
* your graveyard from anywhere, you may return it to your hand."
|
||||
*/
|
||||
class TamiyoTheMoonSageEmblem extends Emblem {
|
||||
|
||||
|
|
|
|||
|
|
@ -29,29 +29,27 @@ package mage.sets.avacynrestored;
|
|||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardControllerEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardControllerEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -70,8 +68,7 @@ public class TibaltTheFiendBlooded extends CardImpl {
|
|||
this.expansionSetCode = "AVR";
|
||||
this.subtype.add("Tibalt");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2));
|
||||
|
||||
// +1: Draw a card, then discard a card at random.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
|
|
@ -39,14 +39,12 @@ import mage.abilities.effects.common.GetEmblemEffect;
|
|||
import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
|
|
@ -61,7 +59,7 @@ public class GideonAllyOfZendikar extends CardImpl {
|
|||
this.expansionSetCode = "BFZ";
|
||||
this.subtype.add("Gideon");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Until end of turn, Gideon, Ally of Zendikar becomes a 5/5 Human Soldier Ally creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonAllyOfZendikarToken(), "planeswalker", Duration.EndOfTurn), 1);
|
||||
|
|
|
|||
|
|
@ -32,13 +32,12 @@ import mage.MageInt;
|
|||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
|
|
@ -48,7 +47,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
|
|
@ -73,7 +71,7 @@ public class KioraMasterOfTheDepths extends CardImpl {
|
|||
this.expansionSetCode = "BFZ";
|
||||
this.subtype.add("Kiora");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Untap up to one target creature and up to one target land.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new KioraUntapEffect(), 1);
|
||||
|
|
|
|||
|
|
@ -30,18 +30,16 @@ package mage.sets.battleforzendikar;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.GetEmblemTargetPlayerEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -60,7 +58,7 @@ public class ObNixilisReignited extends CardImpl {
|
|||
this.expansionSetCode = "BFZ";
|
||||
this.subtype.add("Nixilis");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
|
||||
|
||||
// +1: You draw a card and you lose 1 life.
|
||||
Effect effect = new DrawCardSourceControllerEffect(1);
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ public class OranRiefHydra extends CardImpl {
|
|||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
|
||||
// <i>Landfall</i> - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra.
|
||||
|
||||
// <i>Landfall</i> - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra.
|
||||
// If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.
|
||||
this.addAbility(new OranRiefHydraTriggeredAbility());
|
||||
}
|
||||
|
|
@ -77,9 +77,9 @@ public class OranRiefHydra extends CardImpl {
|
|||
}
|
||||
|
||||
class OranRiefHydraTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
private static final String text = "<i>Landfall</i> - Whenever a land enters the battlefield under your control, put a +1/+1 counter on Oran-Rief Hydra. "
|
||||
+ "If that land is a Forest, put two +1/+1 counters on Oran-Rief Hydra instead.";
|
||||
|
||||
private static final String text = "<i>Landfall</i> - Whenever a land enters the battlefield under your control, put a +1/+1 counter on {this}. "
|
||||
+ "If that land is a Forest, put two +1/+1 counters on {this} instead.";
|
||||
|
||||
public OranRiefHydraTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new OranRiefHydraEffect());
|
||||
|
|
@ -106,12 +106,13 @@ class OranRiefHydraTriggeredAbility extends TriggeredAbilityImpl {
|
|||
&& permanent.getCardType().contains(CardType.LAND)
|
||||
&& permanent.getControllerId().equals(getControllerId())) {
|
||||
Permanent sourcePermanent = game.getPermanent(getSourceId());
|
||||
if (sourcePermanent != null)
|
||||
if (sourcePermanent != null) {
|
||||
for (Effect effect : getEffects()) {
|
||||
if (effect instanceof OranRiefHydraEffect) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
if (effect instanceof OranRiefHydraEffect) {
|
||||
effect.setTargetPointer(new FixedTarget(permanent, game));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class PrismArray extends CardImpl {
|
|||
// <i>Converge</i> - Prism Array enters the battlefield with a crystal counter on it for each color of mana spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.CRYSTAL.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true),
|
||||
null, true, "<i>Converge</i> — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
null, "<i>Converge</i> — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
|
||||
// Remove a crystal counter from Prism Array: Tap target creature.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class SkyriderElf extends CardImpl {
|
|||
// <i>Converge</i>-Skyrider Elf enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true),
|
||||
null, true, "<i>Converge</i> — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
null, "<i>Converge</i> — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class TajuruStalwart extends CardImpl {
|
|||
// <i>Converge</i> - Tajuru Stalwart enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true),
|
||||
null, true, "<i>Converge</i> - {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
null, "<i>Converge</i> - {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class UlamogsDespoiler extends CardImpl {
|
|||
this.toughness = new MageInt(5);
|
||||
|
||||
// As Ulamog's Despoiler enters the battlefield, you may put two cards your opponents own from exile into their owners' graveyards. If you do, Ulamog's Despoiler enters the battlefield with four +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new UlamogsDespoilerEffect(), null, true,
|
||||
this.addAbility(new EntersBattlefieldAbility(new UlamogsDespoilerEffect(), null,
|
||||
"As {this} enters the battlefield, you may put two cards your opponents own from exile into their owners' graveyards. If you do, {this} enters the battlefield with four +1/+1 counters on it", null));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class WoodlandWanderer extends CardImpl {
|
|||
// <i>Converge</i> - Woodland Wanderer enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(), ColorsOfManaSpentToCastCount.getInstance(), true),
|
||||
null, true, "<i>Converge</i> — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
null, "<i>Converge</i> — {this} enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.", null));
|
||||
}
|
||||
|
||||
public WoodlandWanderer(final WoodlandWanderer card) {
|
||||
|
|
|
|||
|
|
@ -28,12 +28,15 @@
|
|||
package mage.sets.betrayersofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -47,7 +50,7 @@ public class OrbOfDreams extends CardImpl {
|
|||
public OrbOfDreams(UUID ownerId) {
|
||||
super(ownerId, 156, "Orb of Dreams", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
this.expansionSetCode = "BOK";
|
||||
|
||||
|
||||
// Permanents enter the battlefield tapped.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new OrbOfDreamsEffect()));
|
||||
}
|
||||
|
|
@ -60,7 +63,7 @@ public class OrbOfDreams extends CardImpl {
|
|||
public OrbOfDreams copy() {
|
||||
return new OrbOfDreams(this);
|
||||
}
|
||||
|
||||
|
||||
private class OrbOfDreamsEffect extends ReplacementEffectImpl {
|
||||
|
||||
OrbOfDreamsEffect() {
|
||||
|
|
@ -79,23 +82,22 @@ public class OrbOfDreams extends CardImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
Permanent permanent = game.getPermanentEntering(event.getTargetId());
|
||||
if (permanent != null) {
|
||||
permanent.setTapped(true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,20 +32,18 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.PreventionEffectImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.continuous.PlayAdditionalLandsControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -64,6 +62,7 @@ import mage.util.CardUtil;
|
|||
public class KioraTheCrashingWave extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("permanent an opponent control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||
}
|
||||
|
|
@ -73,8 +72,7 @@ public class KioraTheCrashingWave extends CardImpl {
|
|||
this.expansionSetCode = "BNG";
|
||||
this.subtype.add("Kiora");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(2)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(2));
|
||||
|
||||
// +1: Until your next turn, prevent all damage that would be dealt to and dealt by target permanent an opponent controls.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new KioraPreventionEffect(), 1);
|
||||
|
|
@ -89,7 +87,6 @@ public class KioraTheCrashingWave extends CardImpl {
|
|||
// -5: You get an emblem with "At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield."
|
||||
this.addAbility(new LoyaltyAbility(new GetEmblemEffect(new KioraEmblem()), -5));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public KioraTheCrashingWave(final KioraTheCrashingWave card) {
|
||||
|
|
@ -126,10 +123,10 @@ class KioraPreventionEffect extends PreventionEffectImpl {
|
|||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
for(UUID targetId :this.getTargetPointer().getTargets(game, source)) {
|
||||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(),CardUtil.addToolTipMarkTags("All damage that would be dealt to and dealt by this permanent is prevented."), game);
|
||||
permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(), CardUtil.addToolTipMarkTags("All damage that would be dealt to and dealt by this permanent is prevented."), game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -138,7 +135,7 @@ class KioraPreventionEffect extends PreventionEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (super.applies(event, source, game) && event instanceof DamageEvent) {
|
||||
Permanent targetPermanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
|
||||
if (targetPermanent != null
|
||||
if (targetPermanent != null
|
||||
&& (event.getSourceId().equals(targetPermanent.getId()) || event.getTargetId().equals(targetPermanent.getId()))) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -149,10 +146,10 @@ class KioraPreventionEffect extends PreventionEffectImpl {
|
|||
@Override
|
||||
public boolean isInactive(Ability source, Game game) {
|
||||
if (super.isInactive(source, game)) {
|
||||
for(UUID targetId :this.getTargetPointer().getTargets(game, source)) {
|
||||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(),"", game);
|
||||
permanent.addInfo(new StringBuilder("kioraPrevention").append(getId()).toString(), "", game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -162,9 +159,11 @@ class KioraPreventionEffect extends PreventionEffectImpl {
|
|||
}
|
||||
|
||||
/**
|
||||
* Emblem: "At the beginning of your end step, put a 9/9 blue Kraken creature token onto the battlefield."
|
||||
* Emblem: "At the beginning of your end step, put a 9/9 blue Kraken creature
|
||||
* token onto the battlefield."
|
||||
*/
|
||||
class KioraEmblem extends Emblem {
|
||||
|
||||
public KioraEmblem() {
|
||||
this.setName("EMBLEM: Kiora, the Crashing Wave");
|
||||
Ability ability = new BeginningOfEndStepTriggeredAbility(Zone.COMMAND, new CreateTokenEffect(new KioraKrakenToken()), TargetController.YOU, null, false);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ package mage.sets.bornofthegods;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.TributeNotPaidCondition;
|
||||
|
|
|
|||
|
|
@ -25,14 +25,10 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObjectReference;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
|
|
@ -40,8 +36,10 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.ExileZone;
|
||||
|
|
@ -61,7 +59,7 @@ public class OtherworldlyJourney extends CardImpl {
|
|||
super(ownerId, 37, "Otherworldly Journey", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
|
||||
this.expansionSetCode = "CHK";
|
||||
this.subtype.add("Arcane");
|
||||
|
||||
|
||||
// Exile target creature. At the beginning of the next end step, return that card to the battlefield under its owner's control with a +1/+1 counter on it.
|
||||
this.getSpellAbility().addEffect(new OtherworldlyJourneyEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
|
@ -82,7 +80,7 @@ class OtherworldlyJourneyEffect extends OneShotEffect {
|
|||
|
||||
private static final String effectText = "Exile target creature. At the beginning of the next end step, return that card to the battlefield under its owner's control with a +1/+1 counter on it";
|
||||
|
||||
OtherworldlyJourneyEffect ( ) {
|
||||
OtherworldlyJourneyEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = effectText;
|
||||
}
|
||||
|
|
@ -102,12 +100,12 @@ class OtherworldlyJourneyEffect extends OneShotEffect {
|
|||
Card card = game.getCard(permanent.getId());
|
||||
if (card != null) {
|
||||
//create delayed triggered ability
|
||||
DelayedTriggeredAbility delayedAbility =
|
||||
new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OtherworldlyJourneyReturnFromExileEffect(new MageObjectReference(card, game)));
|
||||
DelayedTriggeredAbility delayedAbility
|
||||
= new AtTheBeginOfNextEndStepDelayedTriggeredAbility(new OtherworldlyJourneyReturnFromExileEffect(new MageObjectReference(card, game)));
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
delayedAbility.setSourceObject(source.getSourceObject(game), game);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
@ -126,6 +124,7 @@ class OtherworldlyJourneyEffect extends OneShotEffect {
|
|||
class OtherworldlyJourneyReturnFromExileEffect extends OneShotEffect {
|
||||
|
||||
MageObjectReference objectToReturn;
|
||||
|
||||
public OtherworldlyJourneyReturnFromExileEffect(MageObjectReference objectToReturn) {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.objectToReturn = objectToReturn;
|
||||
|
|
@ -148,19 +147,18 @@ class OtherworldlyJourneyReturnFromExileEffect extends OneShotEffect {
|
|||
if (card != null && objectToReturn.refersTo(card, game)) {
|
||||
Player owner = game.getPlayer(card.getOwnerId());
|
||||
if (owner != null) {
|
||||
game.addEffect(new OtherworldlyJourneyEntersBattlefieldEffect(objectToReturn), source);
|
||||
owner.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
|
||||
game.addEffect(new OtherworldlyJourneyEntersBattlefieldEffect(objectToReturn), source);
|
||||
owner.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class OtherworldlyJourneyEntersBattlefieldEffect extends ReplacementEffectImpl {
|
||||
|
||||
|
||||
MageObjectReference objectToReturn;
|
||||
|
||||
|
||||
public OtherworldlyJourneyEntersBattlefieldEffect(MageObjectReference objectToReturn) {
|
||||
super(Duration.Custom, Outcome.BoostCreature);
|
||||
this.objectToReturn = objectToReturn;
|
||||
|
|
@ -187,7 +185,7 @@ class OtherworldlyJourneyEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
Permanent permanent = game.getPermanentEntering(event.getTargetId());
|
||||
if (permanent != null) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(), game);
|
||||
discard(); // use only once
|
||||
|
|
|
|||
|
|
@ -28,13 +28,16 @@
|
|||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.*;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.game.Game;
|
||||
|
|
@ -61,7 +64,7 @@ public class ShimatsuTheBloodcloaked extends CardImpl {
|
|||
this.toughness = new MageInt(0);
|
||||
|
||||
// As Shimatsu the Bloodcloaked enters the battlefield, sacrifice any number of permanents. Shimatsu enters the battlefield with that many +1/+1 counters on it.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShimatsuTheBloodcloakedEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new ShimatsuTheBloodcloakedEffect()));
|
||||
}
|
||||
|
||||
public ShimatsuTheBloodcloaked(final ShimatsuTheBloodcloaked card) {
|
||||
|
|
@ -75,16 +78,16 @@ public class ShimatsuTheBloodcloaked extends CardImpl {
|
|||
}
|
||||
|
||||
class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl {
|
||||
|
||||
|
||||
public ShimatsuTheBloodcloakedEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
|
||||
super(Duration.EndOfGame, Outcome.BoostCreature);
|
||||
this.staticText = "As {this} enters the battlefield, sacrifice any number of permanents. {this} enters the battlefield with that many +1/+1 counters on it";
|
||||
}
|
||||
|
||||
|
||||
public ShimatsuTheBloodcloakedEffect(final ShimatsuTheBloodcloakedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ShimatsuTheBloodcloakedEffect copy() {
|
||||
return new ShimatsuTheBloodcloakedEffect(this);
|
||||
|
|
@ -94,15 +97,15 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl {
|
|||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return event.getTargetId().equals(source.getSourceId());
|
||||
return event.getTargetId().equals(source.getSourceId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = game.getPermanent(event.getTargetId());
|
||||
Permanent creature = game.getPermanentEntering(event.getTargetId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (creature != null && controller != null) {
|
||||
Target target = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledPermanent(), true);
|
||||
|
|
@ -112,8 +115,8 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl {
|
|||
controller.chooseTarget(Outcome.Detriment, target, source, game);
|
||||
if (target.getTargets().size() > 0) {
|
||||
int sacrificedCreatures = target.getTargets().size();
|
||||
game.informPlayers(new StringBuilder(controller.getLogName()).append(" sacrifices ").append(sacrificedCreatures).append(" creatures for ").append(creature.getName()).toString());
|
||||
for (UUID targetId: target.getTargets()) {
|
||||
game.informPlayers(controller.getLogName() + " sacrifices " + sacrificedCreatures + " creatures for " + creature.getLogName());
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Permanent targetCreature = game.getPermanent(targetId);
|
||||
if (targetCreature == null || !targetCreature.sacrifice(source.getSourceId(), game)) {
|
||||
return false;
|
||||
|
|
@ -124,5 +127,5 @@ class ShimatsuTheBloodcloakedEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,33 +101,6 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl {
|
|||
return new ChorusOfTheConclaveReplacementEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
int xCost = 0;
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
if (you.chooseUse(Outcome.Benefit, "Do you wish to pay the additonal cost to add +1/+1 counters to the creature you cast?", source, game)) {
|
||||
xCost += playerPaysXGenericMana(you, source, game);
|
||||
// save the x value to be available for ETB replacement effect
|
||||
Object object = game.getState().getValue("spellX" + source.getSourceId());
|
||||
Map<String, Integer> spellX;
|
||||
if (object != null && object instanceof Map) {
|
||||
spellX = (Map<String, Integer>) object;
|
||||
} else {
|
||||
spellX = new HashMap<>();
|
||||
}
|
||||
spellX.put(event.getSourceId().toString() + game.getState().getZoneChangeCounter(event.getSourceId()), xCost);
|
||||
game.getState().setValue("spellX" + source.getSourceId(), spellX);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.CAST_SPELL;
|
||||
|
|
@ -144,6 +117,28 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
int xCost = 0;
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (controller.chooseUse(Outcome.Benefit, "Do you wish to pay the additonal cost to add +1/+1 counters to the creature you cast?", source, game)) {
|
||||
xCost += playerPaysXGenericMana(controller, source, game);
|
||||
// save the x value to be available for ETB replacement effect
|
||||
Object object = game.getState().getValue("spellX" + source.getSourceId());
|
||||
Map<String, Integer> spellX;
|
||||
if (object != null && object instanceof Map) {
|
||||
spellX = (Map<String, Integer>) object;
|
||||
} else {
|
||||
spellX = new HashMap<>();
|
||||
}
|
||||
spellX.put(event.getSourceId().toString() + game.getState().getZoneChangeCounter(event.getSourceId()), xCost);
|
||||
game.getState().setValue("spellX" + source.getSourceId(), spellX);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static int playerPaysXGenericMana(Player player, Ability source, Game game) {
|
||||
int xValue = 0;
|
||||
boolean payed = false;
|
||||
|
|
@ -191,16 +186,18 @@ class ChorusOfTheConclaveReplacementEffect2 extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Map<String, Integer> spellX = (Map<String, Integer>) game.getState().getValue("spellX" + source.getSourceId());
|
||||
return spellX != null && event.getSourceId() != null && spellX.containsKey(event.getSourceId().toString() + (game.getState().getZoneChangeCounter(event.getSourceId()) - 2));
|
||||
return spellX != null
|
||||
&& event.getSourceId() != null
|
||||
&& spellX.containsKey(event.getSourceId().toString() + (game.getState().getZoneChangeCounter(event.getSourceId()) - 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
Permanent creature = game.getPermanentEntering(event.getSourceId());
|
||||
Map<String, Integer> spellX = (Map<String, Integer>) game.getState().getValue("spellX" + source.getSourceId());
|
||||
MageObject sourceObject = source.getSourceObject(game);
|
||||
if (sourceObject != null && creature != null && spellX != null) {
|
||||
String key = event.getSourceId().toString() + (game.getState().getZoneChangeCounter(event.getSourceId()) - 2);
|
||||
String key = event.getSourceId().toString() + (game.getState().getZoneChangeCounter(event.getSourceId()) - 1);
|
||||
int xValue = spellX.get(key);
|
||||
if (xValue > 0) {
|
||||
creature.addCounters(CounterType.P1P1.createInstance(xValue), game);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.dynamicvalue.common.CardsInAllGraveyardsCount;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CopyEffect;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -98,7 +97,7 @@ class TheMimeoplasmEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = (Permanent) getValue(EntersBattlefieldEffect.ENTERING_PERMANENT);
|
||||
Permanent permanent = game.getPermanentEntering(source.getSourceId());
|
||||
if (controller != null && permanent != null) {
|
||||
if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 2) {
|
||||
if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", source, game)) {
|
||||
|
|
|
|||
|
|
@ -66,8 +66,9 @@ public class NayaSoulbeast extends CardImpl {
|
|||
|
||||
// Trample
|
||||
this.addAbility(TrampleAbility.getInstance());
|
||||
// When you cast Naya Soulbeast, each player reveals the top card of his or her library. Naya Soulbeast enters the battlefield with X +1/+1 counters on it, where X is the total converted mana cost of all cards revealed this way.
|
||||
// When you cast Naya Soulbeast, each player reveals the top card of his or her library.
|
||||
Ability ability = new CastSourceTriggeredAbility(new NayaSoulbeastCastEffect(), false);
|
||||
// Naya Soulbeast enters the battlefield with X +1/+1 counters on it, where X is the total converted mana cost of all cards revealed this way.
|
||||
ability.addEffect(new NayaSoulbeastReplacementEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class OpalPalace extends CardImpl {
|
|||
ability = new SimpleStaticAbility(Zone.ALL, new OpalPalaceEntersBattlefieldEffect());
|
||||
ability.setRuleVisible(false);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public OpalPalace(final OpalPalace card) {
|
||||
|
|
@ -91,10 +91,10 @@ class OpalPalaceWatcher extends Watcher {
|
|||
|
||||
public List<UUID> commanderId = new ArrayList<>();
|
||||
private final String originalId;
|
||||
|
||||
|
||||
public OpalPalaceWatcher(String originalId) {
|
||||
super("ManaPaidFromOpalPalaceWatcher", WatcherScope.CARD);
|
||||
this.originalId = originalId;
|
||||
this.originalId = originalId;
|
||||
}
|
||||
|
||||
public OpalPalaceWatcher(final OpalPalaceWatcher watcher) {
|
||||
|
|
@ -116,16 +116,16 @@ class OpalPalaceWatcher extends Watcher {
|
|||
if (spell != null) {
|
||||
Card card = spell.getCard();
|
||||
if (card != null) {
|
||||
for (UUID playerId :game.getPlayerList()) {
|
||||
for (UUID playerId : game.getPlayerList()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
if (player.getCommanderId() != null && player.getCommanderId().equals(card.getId())) {
|
||||
commanderId.add(card.getId());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -153,19 +153,19 @@ class OpalPalaceEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
OpalPalaceWatcher watcher = (OpalPalaceWatcher) game.getState().getWatchers().get("ManaPaidFromOpalPalaceWatcher", source.getSourceId());
|
||||
return watcher != null &&
|
||||
watcher.commanderId.contains(event.getTargetId());
|
||||
return watcher != null
|
||||
&& watcher.commanderId.contains(event.getTargetId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
Permanent permanent = game.getPermanentEntering(event.getTargetId());
|
||||
if (permanent != null) {
|
||||
Integer castCount = (Integer)game.getState().getValue(permanent.getId() + "_castCount");
|
||||
Integer castCount = (Integer) game.getState().getValue(permanent.getId() + "_castCount");
|
||||
if (castCount != null && castCount > 0) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(castCount), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -92,7 +91,7 @@ class BitterFeudEntersBattlefieldEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = (Permanent) getValue(EntersBattlefieldEffect.ENTERING_PERMANENT);
|
||||
Permanent permanent = game.getPermanentEntering(source.getSourceId());
|
||||
if (controller != null && permanent != null) {
|
||||
TargetPlayer target = new TargetPlayer(2, 2, true);
|
||||
controller.chooseTarget(outcome, target, source, game);
|
||||
|
|
|
|||
|
|
@ -33,13 +33,12 @@ import mage.abilities.DelayedTriggeredAbility;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -47,7 +46,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterArtifactCard;
|
||||
import mage.filter.common.FilterControlledArtifactPermanent;
|
||||
|
|
@ -75,7 +73,7 @@ public class DarettiScrapSavant extends CardImpl {
|
|||
this.expansionSetCode = "C14";
|
||||
this.subtype.add("Daretti");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +2: Discard up to two cards, then draw that many cards.
|
||||
this.addAbility(new LoyaltyAbility(new DarettiDiscardDrawEffect(), 2));
|
||||
|
|
@ -179,7 +177,6 @@ class DarettiSacrificeEffect extends OneShotEffect {
|
|||
class DarettiScrapSavantEmblem extends Emblem {
|
||||
|
||||
// You get an emblem with "Whenever an artifact is put into your graveyard from the battlefield, return that card to the battlefield at the beginning of the next end step."
|
||||
|
||||
public DarettiScrapSavantEmblem() {
|
||||
this.setName("Emblem - Daretti");
|
||||
this.getAbilities().add(new DarettiScrapSavantTriggeredAbility());
|
||||
|
|
|
|||
|
|
@ -32,19 +32,17 @@ import mage.MageInt;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.mana.GreenManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.TargetPermanent;
|
||||
|
|
@ -56,6 +54,7 @@ import mage.target.TargetPermanent;
|
|||
public class FreyaliseLlanowarsFury extends CardImpl {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filterGreen = new FilterControlledCreaturePermanent("green creature you control");
|
||||
|
||||
static {
|
||||
filterGreen.add(new ColorPredicate(ObjectColor.GREEN));
|
||||
}
|
||||
|
|
@ -65,8 +64,8 @@ public class FreyaliseLlanowarsFury extends CardImpl {
|
|||
this.expansionSetCode = "C14";
|
||||
this.subtype.add("Freyalise");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +2: Put a 1/1 green Elf Druid creature token onto the battlefield with "{T}: Add {G} to your mana pool."
|
||||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new FreyaliseLlanowarsFuryToken()), 2));
|
||||
// -2: Destroy target artifact or enchantment.
|
||||
|
|
@ -106,4 +105,4 @@ class FreyaliseLlanowarsFuryToken extends Token {
|
|||
// {T}: Add {G} to your mana pool.
|
||||
this.addAbility(new GreenManaAbility());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,14 +28,11 @@
|
|||
package mage.sets.commander2014;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
|
@ -45,6 +42,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
|
|||
* @author LevelX2
|
||||
*/
|
||||
public class MasterworkOfIngenuity extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("artifact");
|
||||
|
||||
static {
|
||||
|
|
@ -58,12 +56,7 @@ public class MasterworkOfIngenuity extends CardImpl {
|
|||
this.subtype.add("Equipment");
|
||||
|
||||
// You may have Masterwork of Ingenuity enter the battlefield as a copy of any Equipment on the battlefield.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(
|
||||
new CopyPermanentEffect(filter),
|
||||
"You may have {this} enter the battlefield as a copy of any Equipment on the battlefield",
|
||||
true));
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(filter), true));
|
||||
}
|
||||
|
||||
public MasterworkOfIngenuity(final MasterworkOfIngenuity card) {
|
||||
|
|
|
|||
|
|
@ -27,15 +27,11 @@
|
|||
*/
|
||||
package mage.sets.commander2014;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
|
|
@ -43,7 +39,6 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
|
|
@ -55,7 +50,6 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
|
|
@ -80,8 +74,7 @@ public class NahiriTheLithomancer extends CardImpl {
|
|||
this.expansionSetCode = "C14";
|
||||
this.subtype.add("Nahiri");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +2: Put a 1/1 white Kor Soldier creature token onto the battlefield. You may attach an Equipment you control to it.
|
||||
this.addAbility(new LoyaltyAbility(new NahiriTheLithomancerFirstAbilityEffect(), 2));
|
||||
|
|
@ -111,6 +104,7 @@ public class NahiriTheLithomancer extends CardImpl {
|
|||
class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("an Equipment you control");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Equipment"));
|
||||
}
|
||||
|
|
@ -139,8 +133,8 @@ class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
|||
if (tokenPermanent != null) {
|
||||
//TODO: Make sure the Equipment can legally enchant the token, preferably on targetting.
|
||||
Target target = new TargetControlledPermanent(0, 1, filter, true);
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game) &&
|
||||
controller.chooseUse(outcome, "Attach an Equipment you control to the created Token?", source, game)) {
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game)
|
||||
&& controller.chooseUse(outcome, "Attach an Equipment you control to the created Token?", source, game)) {
|
||||
if (target.choose(Outcome.Neutral, source.getControllerId(), source.getSourceId(), game)) {
|
||||
Permanent equipmentPermanent = game.getPermanent(target.getFirstTarget());
|
||||
if (equipmentPermanent != null) {
|
||||
|
|
@ -164,6 +158,7 @@ class NahiriTheLithomancerFirstAbilityEffect extends OneShotEffect {
|
|||
class NahiriTheLithomancerSecondAbilityEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("an Equipment");
|
||||
|
||||
static {
|
||||
filter.add(new SubtypePredicate("Equipment"));
|
||||
}
|
||||
|
|
@ -193,8 +188,7 @@ class NahiriTheLithomancerSecondAbilityEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Target target = new TargetCardInYourGraveyard(0, 1, filter);
|
||||
target.choose(Outcome.PutCardInPlay, source.getControllerId(), source.getSourceId(), game);
|
||||
Card card = controller.getGraveyard().get(target.getFirstTarget(), game);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,6 @@ public class NecromanticSelection extends CardImpl {
|
|||
super(ownerId, 26, "Necromantic Selection", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{B}{B}{B}");
|
||||
this.expansionSetCode = "C14";
|
||||
|
||||
|
||||
// Destroy all creatures, then return a creature card put into a graveyard this way to the battlefield under your control. It's a black Zombie in addition to its other colors and types. Exile Necromantic Selection.
|
||||
this.getSpellAbility().addEffect(new NecromanticSelectionEffect());
|
||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||
|
|
@ -110,7 +109,7 @@ class NecromanticSelectionEffect extends OneShotEffect {
|
|||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (sourceObject != null && controller != null) {
|
||||
Cards cards = new CardsImpl();
|
||||
for(Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
if (game.getState().getZone(permanent.getId()).equals(Zone.GRAVEYARD)) {
|
||||
cards.add(permanent);
|
||||
|
|
@ -118,7 +117,7 @@ class NecromanticSelectionEffect extends OneShotEffect {
|
|||
}
|
||||
FilterCard filter = new FilterCreatureCard("creature card put into a graveyard with " + sourceObject.getLogName());
|
||||
ArrayList<Predicate<MageObject>> cardIdPredicates = new ArrayList<>();
|
||||
for(UUID cardId: cards) {
|
||||
for (UUID cardId : cards) {
|
||||
cardIdPredicates.add(new CardIdPredicate(cardId));
|
||||
}
|
||||
filter.add(Predicates.or(cardIdPredicates));
|
||||
|
|
@ -126,7 +125,7 @@ class NecromanticSelectionEffect extends OneShotEffect {
|
|||
if (controller.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
ContinuousEffect effect = new NecromanticSelectionContinuousEffect();
|
||||
effect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
game.addEffect(effect, source);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
|
@ -44,14 +44,11 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
|||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.token.DemonToken;
|
||||
|
|
@ -69,8 +66,7 @@ public class ObNixilisOfTheBlackOath extends CardImpl {
|
|||
this.expansionSetCode = "C14";
|
||||
this.subtype.add("Nixilis");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +2: Each opponent loses 1 life. You gain life equal to the life lost this way.
|
||||
this.addAbility(new LoyaltyAbility(new ObNixilisOfTheBlackOathEffect1(), 2));
|
||||
|
|
@ -113,7 +109,7 @@ class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
int loseLife = 0;
|
||||
for (UUID opponentId: game.getOpponents(source.getControllerId())) {
|
||||
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
loseLife += opponent.loseLife(1, game);
|
||||
|
|
@ -134,13 +130,15 @@ class ObNixilisOfTheBlackOathEffect1 extends OneShotEffect {
|
|||
}
|
||||
|
||||
class ObNixilisOfTheBlackOathEmblem extends Emblem {
|
||||
|
||||
// You get an emblem with "{1}{B}, Sacrifice a creature: You gain X life and draw X cards, where X is the sacrificed creature's power."
|
||||
|
||||
public ObNixilisOfTheBlackOathEmblem() {
|
||||
this.setName("EMBLEM: Ob Nixilis of the Black Oath");
|
||||
DynamicValue xValue = new SacrificeCostCreaturesPower();
|
||||
Effect effect = new GainLifeEffect(xValue);
|
||||
effect.setText("You gain X life");
|
||||
Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}"));
|
||||
Ability ability = new SimpleActivatedAbility(Zone.COMMAND, effect, new ManaCostsImpl("{1}{B}"));
|
||||
ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent()));
|
||||
effect = new DrawCardSourceControllerEffect(xValue);
|
||||
effect.setText("and draw X cards, where X is the sacrificed creature's power");
|
||||
|
|
|
|||
|
|
@ -31,14 +31,13 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.CanBeYourCommanderAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -46,7 +45,6 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
|
|
@ -64,7 +62,7 @@ public class TeferiTemporalArchmage extends CardImpl {
|
|||
this.expansionSetCode = "C14";
|
||||
this.subtype.add("Teferi");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
|
||||
|
||||
// +1: Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
|
||||
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(
|
||||
|
|
@ -96,7 +94,6 @@ public class TeferiTemporalArchmage extends CardImpl {
|
|||
class TeferiTemporalArchmageEmblem extends Emblem {
|
||||
|
||||
// "You may activate loyalty abilities of planeswalkers you control on any player's turn any time you could cast an instant."
|
||||
|
||||
public TeferiTemporalArchmageEmblem() {
|
||||
this.setName("EMBLEM: Teferi, Temporal Archmage");
|
||||
this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new TeferiTemporalArchmageAsThoughEffect()));
|
||||
|
|
|
|||
|
|
@ -63,7 +63,8 @@ public class ApocalypseHydra extends CardImpl {
|
|||
this.toughness = new MageInt(0);
|
||||
|
||||
// Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ApocalypseHydraEffect(), true));
|
||||
this.addAbility(new EntersBattlefieldAbility(new ApocalypseHydraEffect()));
|
||||
|
||||
// {1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{1}{R}"));
|
||||
ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance()));
|
||||
|
|
@ -94,12 +95,12 @@ class ApocalypseHydraEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanentEntering(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
|
||||
if (spellAbility != null
|
||||
&& spellAbility.getSourceId().equals(source.getSourceId())
|
||||
&& permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
&& permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
int amount = spellAbility.getManaCostsToPay().getX();
|
||||
if (amount > 0) {
|
||||
if (amount < 5) {
|
||||
|
|
|
|||
|
|
@ -28,19 +28,17 @@
|
|||
package mage.sets.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
|
@ -65,8 +63,7 @@ public class NicolBolasPlaneswalker extends CardImpl {
|
|||
this.expansionSetCode = "CON";
|
||||
this.subtype.add("Bolas");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
|
||||
|
||||
// +3: Destroy target noncreature permanent.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new DestroyTargetEffect(), 3);
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class AcademyEliteEffect1 extends OneShotEffect {
|
|||
SpellAbility spellAbility = (SpellAbility) getValue(EntersBattlefieldEffect.SOURCE_CAST_SPELL_ABILITY);
|
||||
if (spellAbility != null
|
||||
&& spellAbility.getSourceId().equals(source.getSourceId())
|
||||
&& permanent.getZoneChangeCounter(game) - 1 == spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
&& permanent.getZoneChangeCounter(game) == spellAbility.getSourceObjectZoneChangeCounter()) {
|
||||
CardsInAllGraveyardsCount instantsAndSorceries = new CardsInAllGraveyardsCount(new FilterInstantOrSorceryCard("instant or sorcery cards"));
|
||||
int instantsAndSorceriesCount = instantsAndSorceries.calculate(game, source, this);
|
||||
if (instantsAndSorceriesCount > 0) {
|
||||
|
|
|
|||
|
|
@ -34,13 +34,12 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -50,7 +49,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -73,8 +71,7 @@ public class DackFayden extends CardImpl {
|
|||
this.expansionSetCode = "CNS";
|
||||
this.subtype.add("Dack");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +1: Target player draws two cards, then discards two cards.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new DrawCardTargetEffect(2), 1);
|
||||
|
|
@ -83,14 +80,14 @@ public class DackFayden extends CardImpl {
|
|||
ability.addEffect(effect);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// -2: Gain control of target artifact.
|
||||
effect = new GainControlTargetEffect(Duration.EndOfGame, true);
|
||||
effect.setText("Gain control of target artifact");
|
||||
ability = new LoyaltyAbility(effect, -2);
|
||||
ability.addTarget(new TargetArtifactPermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// -6: You get an emblem with "Whenever you cast a spell that targets one or more permanents, gain control of those permanents."
|
||||
effect = new GetEmblemEffect(new DackFaydenEmblem());
|
||||
effect.setText("You get an emblem with \"Whenever you cast a spell that targets one or more permanents, gain control of those permanents.\"");
|
||||
|
|
@ -109,7 +106,7 @@ public class DackFayden extends CardImpl {
|
|||
}
|
||||
|
||||
class DackFaydenEmblem extends Emblem {
|
||||
|
||||
|
||||
DackFaydenEmblem() {
|
||||
this.setName("EMBLEM: Dack Fayden");
|
||||
this.getAbilities().add(new DackFaydenEmblemTriggeredAbility());
|
||||
|
|
@ -117,15 +114,15 @@ class DackFaydenEmblem extends Emblem {
|
|||
}
|
||||
|
||||
class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
|
||||
DackFaydenEmblemTriggeredAbility() {
|
||||
super(Zone.COMMAND, new DackFaydenEmblemEffect(), false);
|
||||
}
|
||||
|
||||
|
||||
DackFaydenEmblemTriggeredAbility(final DackFaydenEmblemTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DackFaydenEmblemTriggeredAbility copy() {
|
||||
return new DackFaydenEmblemTriggeredAbility(this);
|
||||
|
|
@ -135,7 +132,7 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
boolean returnValue = false;
|
||||
|
|
@ -175,7 +172,7 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you cast a spell that targets one or more permanents, gain control of those permanents.";
|
||||
|
|
@ -183,24 +180,24 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
|
||||
class DackFaydenEmblemEffect extends ContinuousEffectImpl {
|
||||
|
||||
|
||||
protected List<UUID> permanents;
|
||||
|
||||
|
||||
DackFaydenEmblemEffect() {
|
||||
super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
|
||||
this.staticText = "gain control of those permanents";
|
||||
}
|
||||
|
||||
|
||||
DackFaydenEmblemEffect(final DackFaydenEmblemEffect effect) {
|
||||
super(effect);
|
||||
this.permanents = effect.permanents;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DackFaydenEmblemEffect copy() {
|
||||
return new DackFaydenEmblemEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID permanentId : this.permanents) {
|
||||
|
|
@ -211,7 +208,7 @@ class DackFaydenEmblemEffect extends ContinuousEffectImpl {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void setPermanents(List<UUID> targettedPermanents) {
|
||||
this.permanents = new ArrayList<>(targettedPermanents);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ package mage.sets.conspiracy;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -114,17 +113,16 @@ class ExtractFromDarknessReturnFromGraveyardToBattlefieldEffect extends OneShotE
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Target target = new TargetCardInGraveyard(new FilterCreatureCard());
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
|
||||
&& player.chooseTarget(outcome, target, source, game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
|
||||
&& controller.chooseTarget(outcome, target, source, game)) {
|
||||
return controller.moveCards(game.getCard(target.getFirstTarget()), Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,14 +99,14 @@ class MuzzioVisionaryArchitectEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (player == null || sourcePermanent == null) {
|
||||
if (controller == null || sourcePermanent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int highCMC = 0;
|
||||
List<Permanent> controlledArtifacts = game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), player.getId(), game);
|
||||
List<Permanent> controlledArtifacts = game.getBattlefield().getAllActivePermanents(new FilterArtifactPermanent(), controller.getId(), game);
|
||||
for (Permanent permanent : controlledArtifacts) {
|
||||
if (permanent.getSpellAbility() != null) {
|
||||
int cmc = permanent.getSpellAbility().getManaCosts().convertedManaCost();
|
||||
|
|
@ -119,26 +119,26 @@ class MuzzioVisionaryArchitectEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
|
||||
for (int i = 0; i < highCMC; i++) {
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
Card card = controller.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
}
|
||||
}
|
||||
player.lookAtCards(sourcePermanent.getName(), cards, game);
|
||||
controller.lookAtCards(sourcePermanent.getIdName(), cards, game);
|
||||
|
||||
if (!cards.isEmpty()) {
|
||||
TargetCard target = new TargetCard(Zone.LIBRARY, new FilterArtifactCard("artifact card to put onto the battlefield"));
|
||||
if (target.canChoose(source.getSourceId(), player.getId(), game) && player.choose(Outcome.Benefit, cards, target, game)) {
|
||||
if (target.canChoose(source.getSourceId(), controller.getId(), game) && controller.choose(Outcome.Benefit, cards, target, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
player.revealCards(sourcePermanent.getName(), new CardsImpl(card), game);
|
||||
controller.revealCards(sourcePermanent.getIdName(), new CardsImpl(card), game);
|
||||
cards.remove(card);
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
player.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||
controller.putCardsOnBottomOfLibrary(cards, game, source, true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,25 +27,24 @@
|
|||
*/
|
||||
package mage.sets.darkascension;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.counters.CounterType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
|
@ -56,8 +55,6 @@ import mage.game.permanent.token.Token;
|
|||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward
|
||||
|
|
@ -77,8 +74,7 @@ public class SorinLordOfInnistrad extends CardImpl {
|
|||
this.expansionSetCode = "DKA";
|
||||
this.subtype.add("Sorin");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +1: Put a 1/1 black Vampire creature token with lifelink onto the battlefield.
|
||||
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new VampireToken()), 1));
|
||||
|
|
@ -103,6 +99,7 @@ public class SorinLordOfInnistrad extends CardImpl {
|
|||
}
|
||||
|
||||
class VampireToken extends Token {
|
||||
|
||||
VampireToken() {
|
||||
super("Vampire", "a 1/1 black Vampire creature token with lifelink");
|
||||
cardType.add(CardType.CREATURE);
|
||||
|
|
@ -142,7 +139,7 @@ class SorinLordOfInnistradEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (UUID targetId: source.getTargets().get(0).getTargets()) {
|
||||
for (UUID targetId : source.getTargets().get(0).getTargets()) {
|
||||
Permanent perm = game.getPermanent(targetId);
|
||||
if (perm != null) {
|
||||
perm.destroy(source.getSourceId(), game, false);
|
||||
|
|
@ -150,7 +147,7 @@ class SorinLordOfInnistradEffect extends OneShotEffect {
|
|||
}
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
for (UUID targetId: source.getTargets().get(0).getTargets()) {
|
||||
for (UUID targetId : source.getTargets().get(0).getTargets()) {
|
||||
if (game.getState().getZone(targetId) == Zone.GRAVEYARD) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
|
|
|
|||
|
|
@ -28,11 +28,6 @@
|
|||
package mage.sets.darksteel;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
|
|
@ -41,6 +36,11 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
|
|
@ -107,18 +107,20 @@ class AEtherVialEffect extends OneShotEffect {
|
|||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, count));
|
||||
String choiceText = "Put a " + filter.getMessage() + " from your hand onto the battlefield?";
|
||||
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null || player.getHand().count(filter, game) == 0
|
||||
|| !player.chooseUse(this.outcome, choiceText, source, game)) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
if (controller.getHand().count(filter, game) == 0
|
||||
|| !controller.chooseUse(this.outcome, choiceText, source, game)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
TargetCardInHand target = new TargetCardInHand(filter);
|
||||
if (player.choose(this.outcome, target, source.getSourceId(), game)) {
|
||||
if (controller.choose(this.outcome, target, source.getSourceId(), game)) {
|
||||
Card card = game.getCard(target.getFirstTarget());
|
||||
if (card != null) {
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
|
||||
return true;
|
||||
return controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -78,47 +78,42 @@ public class ProteanHulk extends CardImpl {
|
|||
}
|
||||
|
||||
class ProteanHulkEffect extends OneShotEffect {
|
||||
|
||||
|
||||
ProteanHulkEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.staticText = "search your library for any number of creature cards with total converted mana cost 6 or less and put them onto the battlefield. Then shuffle your library";
|
||||
}
|
||||
|
||||
|
||||
ProteanHulkEffect(final ProteanHulkEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ProteanHulkEffect copy() {
|
||||
return new ProteanHulkEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Cards cardsPicked = this.ProteanHulkSearch(game, source);
|
||||
for (UUID cardId : cardsPicked) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.PICK, source.getSourceId());
|
||||
}
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
controller.moveCards(cardsPicked.getCards(game), Zone.BATTLEFIELD, source, game);
|
||||
controller.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Cards ProteanHulkSearch(Game game, Ability source) {
|
||||
Cards cardsPicked = new CardsImpl(Zone.PICK);
|
||||
Cards cardsPicked = new CardsImpl(Zone.LIBRARY);
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
GameEvent event = GameEvent.getEvent(GameEvent.EventType.SEARCH_LIBRARY, source.getControllerId(), source.getControllerId(), source.getControllerId(), Integer.MAX_VALUE);
|
||||
if (!game.replaceEvent(event)) {
|
||||
int manaCostLeftToFetch = 6;
|
||||
int librarySearchLimit = event.getAmount();
|
||||
|
||||
|
||||
FilterCard filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less (6 CMC left)");
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
|
||||
|
|
@ -131,15 +126,14 @@ class ProteanHulkEffect extends OneShotEffect {
|
|||
break;
|
||||
}
|
||||
cardsPicked.add(card);
|
||||
game.setZone(card.getId(), Zone.PICK);
|
||||
game.getState().getLookedAt(source.getControllerId()).add("Protean Hulk", cardsPicked);
|
||||
|
||||
|
||||
librarySearchLimit--;
|
||||
if (librarySearchLimit == 0) {
|
||||
break;
|
||||
}
|
||||
manaCostLeftToFetch -= card.getManaCost().convertedManaCost();
|
||||
filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less ("+ manaCostLeftToFetch +" CMC left)");
|
||||
filter = new FilterCreatureCard("number of creature cards with total converted mana cost 6 or less (" + manaCostLeftToFetch + " CMC left)");
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, manaCostLeftToFetch + 1));
|
||||
target = new TargetCardInLibrary(0, 1, filter);
|
||||
target.setCardLimit(librarySearchLimit);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.dragonsmaze;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -39,13 +38,11 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.BirdToken;
|
||||
|
||||
|
||||
|
||||
public class BeckCall extends SplitCard {
|
||||
|
||||
public BeckCall(UUID ownerId) {
|
||||
|
|
@ -58,7 +55,7 @@ public class BeckCall extends SplitCard {
|
|||
|
||||
// Call
|
||||
// Put four 1/1 white Bird creature tokens with flying onto the battlefield.
|
||||
getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken(),4));
|
||||
getRightHalfCard().getSpellAbility().addEffect(new CreateTokenEffect(new BirdToken(), 4));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -94,10 +91,7 @@ class BeckTriggeredAbility extends DelayedTriggeredAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
UUID targetId = event.getTargetId();
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return filter.match(permanent, getSourceId(), getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -30,18 +30,16 @@ package mage.sets.dragonsmaze;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.condition.common.SourceMatchesFilterCondition;
|
||||
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.PutTokenOntoBattlefieldCopySourceEffect;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
|
|
@ -72,17 +70,16 @@ public class ProgenitorMimic extends CardImpl {
|
|||
// put a token onto the battlefield that's a copy of this creature."
|
||||
Effect effect = new PutTokenOntoBattlefieldCopySourceEffect();
|
||||
effect.setText("put a token onto the battlefield that's a copy of this creature");
|
||||
|
||||
AbilityApplier applier = new AbilityApplier(
|
||||
new ConditionalTriggeredAbility(
|
||||
new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, false),
|
||||
new SourceMatchesFilterCondition(filter),
|
||||
"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.")
|
||||
);
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new EntersBattlefieldEffect(new CopyPermanentEffect(applier),
|
||||
"You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.\"",
|
||||
true)));
|
||||
effect = new CopyPermanentEffect();
|
||||
effect.setText("as a copy of any creature on the battlefield except it gains \"At the beginning of your upkeep, if this creature isn't a token, put a token onto the battlefield that's a copy of this creature.\"");
|
||||
this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(applier), true));
|
||||
}
|
||||
|
||||
public ProgenitorMimic(final ProgenitorMimic card) {
|
||||
|
|
|
|||
|
|
@ -28,17 +28,15 @@
|
|||
package mage.sets.dragonsmaze;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -58,8 +56,7 @@ public class RalZarek extends CardImpl {
|
|||
this.expansionSetCode = "DGM";
|
||||
this.subtype.add("Ral");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Tap target permanent, then untap another target permanent.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new RalZarekTapUntapEffect(), 1);
|
||||
|
|
@ -86,7 +83,6 @@ public class RalZarek extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class RalZarekTapUntapEffect extends OneShotEffect {
|
||||
|
||||
public RalZarekTapUntapEffect() {
|
||||
|
|
@ -112,10 +108,10 @@ class RalZarekTapUntapEffect extends OneShotEffect {
|
|||
i++;
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
if (i==1) {
|
||||
if (i == 1) {
|
||||
permanent.tap(game);
|
||||
}
|
||||
if (i==2) {
|
||||
if (i == 2) {
|
||||
permanent.untap(game);
|
||||
}
|
||||
}
|
||||
|
|
@ -146,7 +142,7 @@ class RalZarekExtraTurnsEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (int i=0; i<5; i++) {
|
||||
for (int i = 0; i < 5; i++) {
|
||||
if (controller.flipCoin(game)) {
|
||||
game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
|
|
@ -40,7 +40,6 @@ import mage.abilities.effects.Effect;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.ReboundAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -52,7 +51,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -71,7 +69,7 @@ public class NarsetTranscendent extends CardImpl {
|
|||
this.expansionSetCode = "DTK";
|
||||
this.subtype.add("Narset");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6));
|
||||
|
||||
// +1: Look at the top card of your library. If it's a noncreature, nonland card, you may reveal it and put it into your hand.
|
||||
this.addAbility(new LoyaltyAbility(new NarsetTranscendentEffect1(), 1));
|
||||
|
|
|
|||
|
|
@ -33,10 +33,9 @@ import java.util.UUID;
|
|||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.choices.Choice;
|
||||
|
|
@ -44,7 +43,6 @@ import mage.choices.ChoiceImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
|
|
@ -69,7 +67,7 @@ public class SarkhanUnbroken extends CardImpl {
|
|||
this.expansionSetCode = "DTK";
|
||||
this.subtype.add("Sarkhan");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Draw a card, then add one mana of any color to your mana pool.
|
||||
this.addAbility(new LoyaltyAbility(new SarkhanUnbrokenAbility1(), 1));
|
||||
|
|
@ -127,7 +125,7 @@ class SarkhanUnbrokenAbility1 extends OneShotEffect {
|
|||
Mana mana = new Mana();
|
||||
|
||||
controller.choose(Outcome.Benefit, manaChoice, game);
|
||||
|
||||
|
||||
if (manaChoice.getChoice() == null) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -95,7 +94,7 @@ class CankerAbominationEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent cankerAbomination = (Permanent) getValue(EntersBattlefieldEffect.ENTERING_PERMANENT);
|
||||
Permanent cankerAbomination = game.getPermanentEntering(source.getSourceId());
|
||||
if (controller != null && cankerAbomination != null) {
|
||||
Target target = new TargetOpponent();
|
||||
target.setNotTarget(true);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class CitadelSiege extends CardImpl {
|
|||
this.expansionSetCode = "FRF";
|
||||
|
||||
// As Citadel Siege enters the battlefield, choose Khans or Dragons.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, true,
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null,
|
||||
"As {this} enters the battlefield, choose Khans or Dragons.",""));
|
||||
|
||||
// * Khans - At the beginning of combat on your turn, put two +1/+1 counters on target creature you control.
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class FrontierMastodon extends CardImpl {
|
|||
// <i>Ferocious</i> - Frontier Mastodon enters the battlefield with a +1/+1 counter on it if you control a creature with power 4 or greater.
|
||||
this.addAbility(new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||
FerociousCondition.getInstance(), true,
|
||||
FerociousCondition.getInstance(),
|
||||
"<i>Ferocious</i> — {this} enters the battlefield with a +1/+1 counter on it if you control a creature with power 4 or greater.",""
|
||||
));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class FrontierSiege extends CardImpl {
|
|||
this.expansionSetCode = "FRF";
|
||||
|
||||
// As Frontier Siege enters the battlefield, choose Khans or Dragons.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, true,
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null,
|
||||
"As {this} enters the battlefield, choose Khans or Dragons.", ""));
|
||||
|
||||
// * Khans - At the beginning of each of your main phases, add {G}{G} to your mana pool.
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class MonasterySiege extends CardImpl {
|
|||
this.expansionSetCode = "FRF";
|
||||
|
||||
// As Monastery Siege enters the battlefield, choose Khans or Dragons.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, true,
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null,
|
||||
"As {this} enters the battlefield, choose Khans or Dragons.", ""));
|
||||
|
||||
// * Khans - At the beginning of your draw step, draw an additional card, then discard a card.
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public class OutpostSiege extends CardImpl {
|
|||
this.expansionSetCode = "FRF";
|
||||
|
||||
// As Outpost Siege enters the battlefield, choose Khans or Dragons.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null, true,
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?", "Khans", "Dragons"), null,
|
||||
"As {this} enters the battlefield, choose Khans or Dragons.", ""));
|
||||
|
||||
// * Khans - At the beginning of your upkeep, exile the top card of your library. Until end of turn, you may play that card.
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class PalaceSiege extends CardImpl {
|
|||
this.expansionSetCode = "FRF";
|
||||
|
||||
// As Palace Siege enters the battlefield, choose Khans or Dragons.
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null, true,
|
||||
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Khans or Dragons?","Khans", "Dragons"),null,
|
||||
"As {this} enters the battlefield, choose Khans or Dragons.",""));
|
||||
|
||||
// * Khans - At the beginning of your upkeep, return target creature card from your graveyard to your hand.
|
||||
|
|
|
|||
|
|
@ -30,19 +30,17 @@ package mage.sets.fatereforged;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.PayVariableLoyaltyCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter.ComparisonType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterPermanentCard;
|
||||
|
|
@ -59,7 +57,6 @@ import mage.target.common.TargetCreatureOrPlayer;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class UginTheSpiritDragon extends CardImpl {
|
||||
|
||||
public UginTheSpiritDragon(UUID ownerId) {
|
||||
|
|
@ -67,7 +64,7 @@ public class UginTheSpiritDragon extends CardImpl {
|
|||
this.expansionSetCode = "FRF";
|
||||
this.subtype.add("Ugin");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(7)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(7));
|
||||
|
||||
// +2: Ugin, the Spirit Dragon deals 3 damage to target creature or player.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new DamageTargetEffect(3), 2);
|
||||
|
|
@ -126,7 +123,7 @@ class UginTheSpiritDragonEffect2 extends OneShotEffect {
|
|||
FilterPermanent filter = new FilterPermanent("permanent with converted mana cost X or less that's one or more colors");
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.LessThan, cmc + 1));
|
||||
filter.add(Predicates.not(new ColorlessPredicate()));
|
||||
for(Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
|
||||
controller.moveCardToExileWithInfo(permanent, null, "", source.getSourceId(), game, Zone.BATTLEFIELD, true);
|
||||
}
|
||||
return true;
|
||||
|
|
@ -157,7 +154,7 @@ class UginTheSpiritDragonEffect3 extends OneShotEffect {
|
|||
controller.drawCards(7, game);
|
||||
TargetCardInHand target = new TargetCardInHand(0, 7, new FilterPermanentCard("permanent cards"));
|
||||
if (controller.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
|
||||
for (UUID targetId: target.getTargets()) {
|
||||
for (UUID targetId : target.getTargets()) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getControllerId());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package mage.sets.fifthdawn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -15,17 +16,15 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author andyfries
|
||||
*/
|
||||
public class Acquire extends CardImpl{
|
||||
public class Acquire extends CardImpl {
|
||||
|
||||
public Acquire(UUID ownerId) {
|
||||
super(ownerId, 21, "Acquire", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}{U}");
|
||||
this.expansionSetCode = "5DN";
|
||||
|
||||
|
||||
// Search target opponent's library for an artifact card and put that card onto the battlefield under your control.
|
||||
// Then that player shuffles his or her library.
|
||||
this.getSpellAbility().addEffect(new AcquireEffect());
|
||||
|
|
@ -68,7 +67,7 @@ class AcquireEffect extends OneShotEffect {
|
|||
controller.searchLibrary(target, game, opponent.getId());
|
||||
Card targetCard = game.getCard(target.getFirstTarget());
|
||||
if (targetCard != null) {
|
||||
controller.putOntoBattlefieldWithInfo(targetCard, game, Zone.LIBRARY, source.getSourceId());
|
||||
controller.moveCards(targetCard, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
opponent.shuffleLibrary(game);
|
||||
return true;
|
||||
|
|
@ -81,4 +80,3 @@ class AcquireEffect extends OneShotEffect {
|
|||
return new AcquireEffect(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -79,26 +79,25 @@ class KismetEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent target = game.getPermanent(event.getTargetId());
|
||||
Permanent target = game.getPermanentEntering(event.getTargetId());
|
||||
if (target != null) {
|
||||
target.setTapped(true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && (permanent.getCardType().contains(CardType.ARTIFACT) ||
|
||||
permanent.getCardType().contains(CardType.CREATURE) ||
|
||||
permanent.getCardType().contains(CardType.LAND))) {
|
||||
if (permanent != null && (permanent.getCardType().contains(CardType.ARTIFACT)
|
||||
|| permanent.getCardType().contains(CardType.CREATURE)
|
||||
|| permanent.getCardType().contains(CardType.LAND))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public class PrimalClay extends CardImpl {
|
|||
this.toughness = new MageInt(0);
|
||||
|
||||
// As Primal Clay enters the battlefield, it becomes your choice of a 3/3 artifact creature, a 2/2 artifact creature with flying, or a 1/6 Wall artifact creature with defender in addition to its other types.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PrimalPlasmaReplacementEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.ALL, new PrimalPlasmaReplacementEffect()));
|
||||
}
|
||||
|
||||
public PrimalClay(final PrimalClay card) {
|
||||
|
|
@ -101,7 +101,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
Permanent sourcePermanent = game.getPermanentEntering(event.getTargetId());
|
||||
if (sourcePermanent != null && !sourcePermanent.isFaceDown(game)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Permanent permanent = game.getPermanentEntering(event.getTargetId());
|
||||
if (permanent != null) {
|
||||
Choice choice = new ChoiceImpl(true);
|
||||
choice.setMessage("Choose what " + permanent.getIdName() + " becomes to");
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.AsEntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -75,7 +74,7 @@ class CloudKeyChooseTypeEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject mageObject = (Permanent) getValue(EntersBattlefieldEffect.ENTERING_PERMANENT);
|
||||
MageObject mageObject = game.getPermanentEntering(source.getSourceId());
|
||||
if (mageObject == null) {
|
||||
mageObject = game.getObject(source.getSourceId());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class KavuPrimarch extends CardImpl {
|
|||
|
||||
|
||||
// If Kavu Primarch was kicked, it enters the battlefield with four +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),KickedCondition.getInstance(), true,
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),KickedCondition.getInstance(),
|
||||
"If Kavu Primarch was kicked, it enters the battlefield with four +1/+1 counters on it.", ""));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class RavagingRiftwurm extends CardImpl {
|
|||
this.addAbility(new VanishingSacrificeAbility());
|
||||
// If Ravaging Riftwurm was kicked, it enters the battlefield with three additional time counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.TIME.createInstance(3)),
|
||||
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with three additional time counters on it.", ""));
|
||||
KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with three additional time counters on it.", ""));
|
||||
}
|
||||
|
||||
public RavagingRiftwurm(final RavagingRiftwurm card) {
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class ScaleguardSentinels extends CardImpl {
|
|||
|
||||
// Scaleguard Sentinels enters the battlefield with a +1/+1 counter on it if you revealed a Dragon card or controlled a Dragon as you cast Scaleguard Sentinels.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(), true),
|
||||
ScaleguardSentinelsCondition.getInstance(), true,
|
||||
ScaleguardSentinelsCondition.getInstance(),
|
||||
"{this} enters the battlefield with a +1/+1 counter on it if you revealed a Dragon card or controlled a Dragon as you cast {this}", ""),
|
||||
new DragonOnTheBattlefieldWhileSpellWasCastWatcher());
|
||||
|
||||
|
|
|
|||
|
|
@ -28,16 +28,16 @@
|
|||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.keyword.ExtortAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -52,7 +52,6 @@ public class BlindObedience extends CardImpl {
|
|||
super(ownerId, 6, "Blind Obedience", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
||||
this.expansionSetCode = "GTC";
|
||||
|
||||
|
||||
// Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.)
|
||||
this.addAbility(new ExtortAbility());
|
||||
|
||||
|
|
@ -72,6 +71,7 @@ public class BlindObedience extends CardImpl {
|
|||
}
|
||||
|
||||
class BlindObedienceTapEffect extends ReplacementEffectImpl {
|
||||
|
||||
BlindObedienceTapEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Tap);
|
||||
staticText = "Artifacts and creatures your opponents control enter the battlefield tapped";
|
||||
|
|
@ -83,22 +83,22 @@ class BlindObedienceTapEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent target = game.getPermanent(event.getTargetId());
|
||||
Permanent target = game.getPermanentEntering(event.getTargetId());
|
||||
if (target != null) {
|
||||
target.setTapped(true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
Permanent permanent = game.getPermanentEntering(event.getTargetId());
|
||||
if (permanent != null && (permanent.getCardType().contains(CardType.CREATURE) || permanent.getCardType().contains(CardType.ARTIFACT))) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,13 +31,12 @@ import java.util.UUID;
|
|||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.FightTargetsEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.HexproofAbility;
|
||||
|
|
@ -50,7 +49,6 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
|
|
@ -70,7 +68,7 @@ public class DomriRade extends CardImpl {
|
|||
this.expansionSetCode = "GTC";
|
||||
this.subtype.add("Domri");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +1: Look at the top card of your library. If it's a creature card, you may reveal it and put it into your hand.
|
||||
this.addAbility(new LoyaltyAbility(new DomriRadeEffect1(), 1));
|
||||
|
|
@ -138,7 +136,6 @@ class DomriRadeEffect1 extends OneShotEffect {
|
|||
class DomriRadeEmblem extends Emblem {
|
||||
|
||||
// "Creatures you control have double strike, trample, hexproof and haste."
|
||||
|
||||
public DomriRadeEmblem() {
|
||||
this.setName("EMBLEM: Domri Rade");
|
||||
FilterPermanent filter = new FilterControlledCreaturePermanent("Creatures");
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
/*
|
||||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
|
|
@ -60,7 +60,7 @@ public class FathomMage extends CardImpl {
|
|||
// Evolve (Whenever a creature enters the battlefield under your control, if that creature
|
||||
// has greater power or toughness than this creature, put a +1/+1 counter on this creature.)
|
||||
this.addAbility(new EvolveAbility());
|
||||
|
||||
|
||||
//Whenever a +1/+1 counter is placed on Fathom Mage, you may draw a card.
|
||||
this.addAbility(new FathomMageTriggeredAbility());
|
||||
}
|
||||
|
|
@ -75,11 +75,10 @@ public class FathomMage extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class FathomMageTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public FathomMageTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), true);
|
||||
super(Zone.ALL, new DrawCardSourceControllerEffect(1), true);
|
||||
}
|
||||
|
||||
public FathomMageTriggeredAbility(FathomMageTriggeredAbility ability) {
|
||||
|
|
|
|||
|
|
@ -27,10 +27,11 @@
|
|||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.CountersCount;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsTargetOpponentControlsCount;
|
||||
|
|
@ -41,7 +42,11 @@ import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
|||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
|
|
@ -49,8 +54,6 @@ import mage.game.permanent.Permanent;
|
|||
import mage.game.permanent.token.Token;
|
||||
import mage.target.common.TargetOpponent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -62,7 +65,7 @@ public class GideonChampionOfJustice extends CardImpl {
|
|||
this.expansionSetCode = "GTC";
|
||||
this.subtype.add("Gideon");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Put a loyalty counter on Gideon, Champion of Justice for each creature target opponent controls.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(
|
||||
|
|
|
|||
|
|
@ -1,30 +1,30 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
|
@ -48,31 +48,31 @@ import mage.game.permanent.Permanent;
|
|||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class MasterBiomancer extends CardImpl {
|
||||
|
||||
public MasterBiomancer(UUID ownerId) {
|
||||
super(ownerId, 176, "Master Biomancer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{U}");
|
||||
this.expansionSetCode = "GTC";
|
||||
this.subtype.add("Elf");
|
||||
this.subtype.add("Wizard");
|
||||
super(ownerId, 176, "Master Biomancer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}{U}");
|
||||
this.expansionSetCode = "GTC";
|
||||
this.subtype.add("Elf");
|
||||
this.subtype.add("Wizard");
|
||||
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(4);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// Each other creature you control enters the battlefield with a number of additional +1/+1 counters on it equal to Master Biomancer's power and as a Mutant in addition to its other types.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MasterBiomancerEntersBattlefieldEffect()));
|
||||
// Each other creature you control enters the battlefield with a number of additional +1/+1 counters on it equal to Master Biomancer's power and as a Mutant in addition to its other types.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new MasterBiomancerEntersBattlefieldEffect()));
|
||||
}
|
||||
|
||||
public MasterBiomancer(final MasterBiomancer card) {
|
||||
super(card);
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MasterBiomancer copy() {
|
||||
return new MasterBiomancer(this);
|
||||
return new MasterBiomancer(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -86,16 +86,16 @@ class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
public MasterBiomancerEntersBattlefieldEffect(MasterBiomancerEntersBattlefieldEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = game.getPermanent(event.getTargetId());
|
||||
return creature != null && creature.getControllerId().equals(source.getControllerId())
|
||||
Permanent creature = game.getPermanentEntering(event.getTargetId());
|
||||
return creature != null && creature.getControllerId().equals(source.getControllerId())
|
||||
&& creature.getCardType().contains(CardType.CREATURE)
|
||||
&& !event.getTargetId().equals(source.getSourceId());
|
||||
}
|
||||
|
|
@ -103,7 +103,7 @@ class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent sourceCreature = game.getPermanent(source.getSourceId());
|
||||
Permanent creature = game.getPermanent(event.getTargetId());
|
||||
Permanent creature = game.getPermanentEntering(event.getTargetId());
|
||||
if (sourceCreature != null && creature != null) {
|
||||
int power = sourceCreature.getPower().getValue();
|
||||
if (power > 0) {
|
||||
|
|
@ -116,7 +116,6 @@ class MasterBiomancerEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MasterBiomancerEntersBattlefieldEffect copy() {
|
||||
return new MasterBiomancerEntersBattlefieldEffect(this);
|
||||
|
|
|
|||
|
|
@ -28,29 +28,24 @@
|
|||
package mage.sets.gatecrash;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.RemoveCounterCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -58,8 +53,6 @@ import mage.target.targetpointer.FixedTarget;
|
|||
*/
|
||||
public class ZameckGuildmage extends CardImpl {
|
||||
|
||||
private static final String ruleText = "This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it";
|
||||
|
||||
public ZameckGuildmage(UUID ownerId) {
|
||||
super(ownerId, 209, "Zameck Guildmage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{G}{U}");
|
||||
this.expansionSetCode = "GTC";
|
||||
|
|
@ -69,9 +62,8 @@ public class ZameckGuildmage extends CardImpl {
|
|||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
|
||||
// {G}{U}: This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(1)), ruleText), new ManaCostsImpl("{G}{U}")));
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.ALL, new ZameckGuildmageEntersBattlefieldEffect(), new ManaCostsImpl("{G}{U}")));
|
||||
|
||||
// {G}{U}, Remove a +1/+1 counter from a creature you control: Draw a card.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{G}{U}"));
|
||||
|
|
@ -89,25 +81,15 @@ public class ZameckGuildmage extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
||||
class ZameckGuildmageEntersBattlefieldEffect extends ReplacementEffectImpl {
|
||||
|
||||
protected Effects baseEffects = new Effects();
|
||||
protected String text;
|
||||
|
||||
public EntersBattlefieldEffect(Effect baseEffect, String text) {
|
||||
super(Duration.EndOfTurn, baseEffect.getOutcome());
|
||||
this.baseEffects.add(baseEffect);
|
||||
this.text = text;
|
||||
public ZameckGuildmageEntersBattlefieldEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.BoostCreature);
|
||||
this.staticText = "This turn, each creature you control enters the battlefield with an additional +1/+1 counter on it";
|
||||
}
|
||||
|
||||
public EntersBattlefieldEffect(EntersBattlefieldEffect effect) {
|
||||
public ZameckGuildmageEntersBattlefieldEffect(ZameckGuildmageEntersBattlefieldEffect effect) {
|
||||
super(effect);
|
||||
this.baseEffects = effect.baseEffects.copy();
|
||||
this.text = effect.text;
|
||||
}
|
||||
|
||||
public void addEffect(Effect effect) {
|
||||
baseEffects.add(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -117,11 +99,8 @@ class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
Permanent permanent = game.getPermanentEntering(event.getTargetId());
|
||||
return permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -131,23 +110,15 @@ class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
for (Effect effect: baseEffects) {
|
||||
Permanent target = game.getPermanent(event.getTargetId());
|
||||
if (target != null) {
|
||||
effect.setTargetPointer(new FixedTarget(target.getId()));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
Permanent target = game.getPermanentEntering(event.getTargetId());
|
||||
if (target != null) {
|
||||
target.addCounters(CounterType.P1P1.createInstance(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return (text == null || text.isEmpty()) ? baseEffects.getText(mode) : text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntersBattlefieldEffect copy() {
|
||||
return new EntersBattlefieldEffect(this);
|
||||
public ZameckGuildmageEntersBattlefieldEffect copy() {
|
||||
return new ZameckGuildmageEntersBattlefieldEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,39 +27,29 @@
|
|||
*/
|
||||
package mage.sets.innistrad;
|
||||
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
* @author nantuko
|
||||
*/
|
||||
public class DearlyDeparted extends CardImpl {
|
||||
|
||||
private static final String ruleText = "As long as {this} is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it";
|
||||
|
||||
public DearlyDeparted(UUID ownerId) {
|
||||
super(ownerId, 9, "Dearly Departed", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{W}{W}");
|
||||
this.expansionSetCode = "ISD";
|
||||
|
|
@ -71,8 +61,7 @@ public class DearlyDeparted extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// As long as Dearly Departed is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD,
|
||||
new EntersBattlefieldEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(1)), ruleText)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.GRAVEYARD, new DearlyDepartedEntersBattlefieldEffect()));
|
||||
}
|
||||
|
||||
public DearlyDeparted(final DearlyDeparted card) {
|
||||
|
|
@ -85,43 +74,26 @@ public class DearlyDeparted extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
||||
class DearlyDepartedEntersBattlefieldEffect extends ReplacementEffectImpl {
|
||||
|
||||
protected Effects baseEffects = new Effects();
|
||||
protected String text;
|
||||
|
||||
public static final String SOURCE_CAST_SPELL_ABILITY = "sourceCastSpellAbility";
|
||||
|
||||
public EntersBattlefieldEffect(Effect baseEffect) {
|
||||
this(baseEffect, "");
|
||||
public DearlyDepartedEntersBattlefieldEffect() {
|
||||
super(Duration.OneUse, Outcome.BoostCreature);
|
||||
staticText = "As long as {this} is in your graveyard, each Human creature you control enters the battlefield with an additional +1/+1 counter on it";
|
||||
}
|
||||
|
||||
public EntersBattlefieldEffect(Effect baseEffect, String text) {
|
||||
super(Duration.OneUse, baseEffect.getOutcome());
|
||||
this.baseEffects.add(baseEffect);
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public EntersBattlefieldEffect(EntersBattlefieldEffect effect) {
|
||||
public DearlyDepartedEntersBattlefieldEffect(DearlyDepartedEntersBattlefieldEffect effect) {
|
||||
super(effect);
|
||||
this.baseEffects = effect.baseEffects.copy();
|
||||
this.text = effect.text;
|
||||
}
|
||||
|
||||
public void addEffect(Effect effect) {
|
||||
baseEffects.add(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
Permanent permanent = game.getPermanentEntering(event.getTargetId());
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype("Human")) {
|
||||
setValue("target", permanent);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -129,33 +101,16 @@ class EntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getSourceId());
|
||||
for (Effect effect: baseEffects) {
|
||||
Object target = getValue("target");
|
||||
if (target != null && target instanceof Permanent) {
|
||||
effect.setTargetPointer(new FixedTarget(((Permanent)target).getId()));
|
||||
if (effect instanceof ContinuousEffect) {
|
||||
game.addEffect((ContinuousEffect) effect, source);
|
||||
}
|
||||
else {
|
||||
if (spell != null) {
|
||||
effect.setValue(SOURCE_CAST_SPELL_ABILITY, spell.getSpellAbility());
|
||||
}
|
||||
effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
Permanent target = game.getPermanentEntering(event.getTargetId());
|
||||
if (target != null) {
|
||||
target.addCounters(CounterType.P1P1.createInstance(), game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
return (text == null || text.isEmpty()) ? baseEffects.getText(mode) : text;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntersBattlefieldEffect copy() {
|
||||
return new EntersBattlefieldEffect(this);
|
||||
public DearlyDepartedEntersBattlefieldEffect copy() {
|
||||
return new DearlyDepartedEntersBattlefieldEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,19 +28,17 @@
|
|||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.CopyEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
|
@ -89,21 +87,18 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl {
|
|||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent perm = game.getPermanent(event.getTargetId());
|
||||
Permanent perm = game.getPermanentEntering(event.getTargetId());
|
||||
return perm != null && perm.getCardType().contains(CardType.CREATURE) && perm.getControllerId().equals(source.getControllerId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Permanent perm = game.getPermanent(source.getSourceId());
|
||||
if (perm != null) {
|
||||
perm = perm.copy();
|
||||
perm.reset(game);
|
||||
perm.assignNewId();
|
||||
game.addEffect(new EssenceOfTheWildCopyEffect(perm, event.getTargetId()), source);
|
||||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (sourceObject != null) {
|
||||
game.addEffect(new CopyEffect(Duration.Custom, sourceObject, event.getTargetId()), source);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -114,59 +109,3 @@ class EssenceOfTheWildEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class EssenceOfTheWildCopyEffect extends ContinuousEffectImpl {
|
||||
|
||||
private final Permanent essence;
|
||||
private final UUID targetId;
|
||||
|
||||
public EssenceOfTheWildCopyEffect(Permanent essence, UUID targetId) {
|
||||
super(Duration.EndOfGame, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature);
|
||||
this.essence = essence;
|
||||
this.targetId = targetId;
|
||||
}
|
||||
|
||||
public EssenceOfTheWildCopyEffect(final EssenceOfTheWildCopyEffect effect) {
|
||||
super(effect);
|
||||
this.essence = effect.essence.copy();
|
||||
this.targetId = effect.targetId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent != null) {
|
||||
permanent.setName(essence.getName());
|
||||
permanent.getColor(game).setColor(essence.getColor(game));
|
||||
permanent.getManaCost().clear();
|
||||
permanent.getManaCost().add(essence.getManaCost());
|
||||
permanent.getCardType().clear();
|
||||
for (CardType type: essence.getCardType()) {
|
||||
permanent.getCardType().add(type);
|
||||
}
|
||||
permanent.getSubtype().clear();
|
||||
for (String type: essence.getSubtype()) {
|
||||
permanent.getSubtype().add(type);
|
||||
}
|
||||
permanent.getSupertype().clear();
|
||||
for (String type: essence.getSupertype()) {
|
||||
permanent.getSupertype().add(type);
|
||||
}
|
||||
permanent.getAbilities().clear();
|
||||
for (Ability ability: essence.getAbilities()) {
|
||||
permanent.addAbility(ability, game);
|
||||
}
|
||||
permanent.getPower().setValue(essence.getPower().getValue());
|
||||
permanent.getToughness().setValue(essence.getToughness().getValue());
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EssenceOfTheWildCopyEffect copy() {
|
||||
return new EssenceOfTheWildCopyEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,11 +31,11 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -65,11 +65,10 @@ public class EvilTwin extends CardImpl {
|
|||
this.toughness = new MageInt(0);
|
||||
|
||||
// You may have Evil Twin enter the battlefield as a copy of any creature on the battlefield except it gains "{U}{B}, {T}: Destroy target creature with the same name as this creature."
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new EntersBattlefieldEffect(new CopyPermanentEffect(new EvilTwinApplyToPermanent()),
|
||||
"You may have {this} enter the battlefield as a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature\"",
|
||||
true)));
|
||||
Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new EvilTwinApplyToPermanent());
|
||||
effect.setText("a copy of any creature on the battlefield except it gains \"{U}{B}, {T}: Destroy target creature with the same name as this creature.\"");
|
||||
this.addAbility(new EntersBattlefieldAbility(effect, true));
|
||||
|
||||
}
|
||||
|
||||
public EvilTwin(final EvilTwin card) {
|
||||
|
|
|
|||
|
|
@ -31,11 +31,10 @@ import java.util.UUID;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.TransformSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -60,11 +59,10 @@ public class GarrukRelentless extends CardImpl {
|
|||
this.expansionSetCode = "ISD";
|
||||
this.subtype.add("Garruk");
|
||||
|
||||
|
||||
this.canTransform = true;
|
||||
this.secondSideCard = new GarrukTheVeilCursed(ownerId);
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// When Garruk Relentless has two or fewer loyalty counters on him, transform him.
|
||||
this.addAbility(new TransformAbility());
|
||||
|
|
@ -160,4 +158,4 @@ class GarrukRelentlessDamageEffect extends OneShotEffect {
|
|||
return new GarrukRelentlessDamageEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,18 +27,19 @@
|
|||
*/
|
||||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
|
|
@ -47,10 +48,6 @@ import mage.players.Player;
|
|||
import mage.target.TargetPermanent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
|
|
@ -62,17 +59,16 @@ public class LilianaOfTheVeil extends CardImpl {
|
|||
this.expansionSetCode = "ISD";
|
||||
this.subtype.add("Liliana");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +1: Each player discards a card.
|
||||
this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(), 1));
|
||||
|
||||
|
||||
// -2: Target player sacrifices a creature.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"), -2);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// -6: Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.
|
||||
ability = new LoyaltyAbility(new LilianaOfTheVeilEffect(), -6);
|
||||
ability.addTarget(new TargetPlayer());
|
||||
|
|
@ -124,7 +120,7 @@ class LilianaOfTheVeilEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
List<Permanent> pile2 = new ArrayList<>();
|
||||
for (Permanent p: game.getBattlefield().getAllActivePermanents(targetPlayer.getId())) {
|
||||
for (Permanent p : game.getBattlefield().getAllActivePermanents(targetPlayer.getId())) {
|
||||
if (!pile1.contains(p)) {
|
||||
pile2.add(p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public class AlloyGolem extends CardImpl {
|
|||
// As Alloy Golem enters the battlefield, choose a color.
|
||||
// Alloy Golem is the chosen color.
|
||||
this.addAbility(new EntersBattlefieldAbility(new BecomesColorSourceEffect(Duration.WhileOnBattlefield),
|
||||
null, true, "As {this} enters the battlefield, choose a color.\n{this} is the chosen color.", ""));
|
||||
null, "As {this} enters the battlefield, choose a color.\n{this} is the chosen color.", ""));
|
||||
}
|
||||
|
||||
public AlloyGolem(final AlloyGolem card) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class ArdentSoldier extends CardImpl {
|
|||
this.addAbility(VigilanceAbility.getInstance());
|
||||
// If Ardent Soldier was kicked, it enters the battlefield with a +1/+1 counter on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", ""));
|
||||
KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", ""));
|
||||
}
|
||||
|
||||
public ArdentSoldier(final ArdentSoldier card) {
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class BenalishLancer extends CardImpl {
|
|||
|
||||
// If Benalish Lancer was kicked, it enters the battlefield with two +1/+1 counters on it and with first strike.
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
KickedCondition.getInstance(), true,
|
||||
KickedCondition.getInstance(),
|
||||
"If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with first strike.", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class Duskwalker extends CardImpl {
|
|||
|
||||
// If Duskwalker was kicked, it enters the battlefield with two +1/+1 counters on it and with fear.
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
KickedCondition.getInstance(), true,
|
||||
KickedCondition.getInstance(),
|
||||
"If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with fear.", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(FearAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class FaerieSquadron extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{3}{U}"));
|
||||
// If Faerie Squadron was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.", "");
|
||||
KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with flying.", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class KavuAggressor extends CardImpl {
|
|||
this.addAbility(new CantBlockAbility());
|
||||
// If Kavu Aggressor was kicked, it enters the battlefield with a +1/+1 counter on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", ""));
|
||||
KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it.", ""));
|
||||
}
|
||||
|
||||
public KavuAggressor(final KavuAggressor card) {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public class KavuTitan extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{2}{G}"));
|
||||
// If Kavu Titan was kicked, it enters the battlefield with three +1/+1 counters on it and with trample.
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)),
|
||||
KickedCondition.getInstance(), true,
|
||||
KickedCondition.getInstance(),
|
||||
"If Kavu Titan was kicked, it enters the battlefield with three +1/+1 counters on it and with trample.", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class PouncingKavu extends CardImpl {
|
|||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
// If Pouncing Kavu was kicked, it enters the battlefield with two +1/+1 counters on it and with haste.
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)),
|
||||
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with haste.", "");
|
||||
KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with two +1/+1 counters on it and with haste.", "");
|
||||
ability.addEffect(new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class PrisonBarricade extends CardImpl {
|
|||
this.addAbility(new KickerAbility("{1}{W}"));
|
||||
// If Prison Barricade was kicked, it enters the battlefield with a +1/+1 counter on it and with "Prison Barricade can attack as though it didn't have defender."
|
||||
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", "");
|
||||
KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with a +1/+1 counter on it and with \"{this} can attack as though it didn't have defender.\"", "");
|
||||
ability.addEffect(new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class UrborgSkeleton extends CardImpl {
|
|||
// If Urborg Skeleton was kicked, it enters the battlefield with a +1/+1 counter on it.
|
||||
Ability ability = new EntersBattlefieldAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)),
|
||||
KickedCondition.getInstance(),false, staticText,"");
|
||||
KickedCondition.getInstance(), staticText,"");
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ public class VodalianSerpent extends CardImpl {
|
|||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(new FilterLandPermanent("Island", "an Island"))));
|
||||
// If Vodalian Serpent was kicked, it enters the battlefield with four +1/+1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(4)),
|
||||
KickedCondition.getInstance(), true, "If {this} was kicked, it enters the battlefield with four +1/+1 counters on it.", ""));
|
||||
KickedCondition.getInstance(), "If {this} was kicked, it enters the battlefield with four +1/+1 counters on it.", ""));
|
||||
}
|
||||
|
||||
public VodalianSerpent(final VodalianSerpent card) {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ package mage.sets.jacevsvraska;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CopyEffect;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -40,10 +39,8 @@ import mage.constants.CardType;
|
|||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
|
@ -63,11 +60,7 @@ public class BodyDouble extends CardImpl {
|
|||
this.toughness = new MageInt(0);
|
||||
|
||||
// You may have Body Double enter the battlefield as a copy of any creature card in a graveyard.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(
|
||||
new BodyDoubleCopyEffect(),
|
||||
"You may have {this} enter the battlefield as a copy of any creature card in a graveyard",
|
||||
true));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new EntersBattlefieldAbility(new BodyDoubleCopyEffect(), true));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +78,7 @@ class BodyDoubleCopyEffect extends OneShotEffect {
|
|||
|
||||
public BodyDoubleCopyEffect() {
|
||||
super(Outcome.Copy);
|
||||
this.staticText = "You may have {this} enter the battlefield as a copy of any creature card in a graveyard";
|
||||
this.staticText = "as a copy of any creature card in a graveyard";
|
||||
}
|
||||
|
||||
public BodyDoubleCopyEffect(final BodyDoubleCopyEffect effect) {
|
||||
|
|
@ -95,8 +88,7 @@ class BodyDoubleCopyEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (player != null && sourcePermanent != null) {
|
||||
if (player != null) {
|
||||
Target target = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"));
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(source.getControllerId(), game)) {
|
||||
|
|
|
|||
|
|
@ -30,11 +30,10 @@ package mage.sets.journeyintonyx;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.LookLibraryAndPickControllerEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -62,7 +61,7 @@ public class AjaniMentorOfHeroes extends CardImpl {
|
|||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
private static final FilterCard filterCard = new FilterCard("an Aura, creature, or planeswalker card");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filterCard.add(Predicates.or(
|
||||
|
|
@ -70,23 +69,22 @@ public class AjaniMentorOfHeroes extends CardImpl {
|
|||
new CardTypePredicate(CardType.CREATURE),
|
||||
new CardTypePredicate(CardType.PLANESWALKER)));
|
||||
}
|
||||
|
||||
|
||||
public AjaniMentorOfHeroes(UUID ownerId) {
|
||||
super(ownerId, 145, "Ajani, Mentor of Heroes", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{G}{W}");
|
||||
this.expansionSetCode = "JOU";
|
||||
this.subtype.add("Ajani");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Distribute three +1/+1 counters among one, two, or three target creatures you control
|
||||
Ability ability = new LoyaltyAbility(new AjaniMentorOfHeroesAddCountersEffect(), 1);
|
||||
ability.addTarget(new TargetCreaturePermanentAmount(3, filter));
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// +1: Look at the top four cards of your library. You may reveal an Aura, creature, or planeswalker card from among them and put that card into your hand. Put the rest on the bottom of your library in any order.
|
||||
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(4,1, filterCard,true, false, Zone.HAND, true), 1));
|
||||
|
||||
this.addAbility(new LoyaltyAbility(new LookLibraryAndPickControllerEffect(4, 1, filterCard, true, false, Zone.HAND, true), 1));
|
||||
|
||||
// -8: You gain 100 life.
|
||||
this.addAbility(new LoyaltyAbility(new GainLifeEffect(100), -8));
|
||||
}
|
||||
|
|
@ -122,7 +120,7 @@ class AjaniMentorOfHeroesAddCountersEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && source.getTargets().size() > 0) {
|
||||
Target multiTarget = source.getTargets().get(0);
|
||||
for (UUID target: multiTarget.getTargets()) {
|
||||
for (UUID target : multiTarget.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(target);
|
||||
if (permanent != null) {
|
||||
permanent.addCounters(CounterType.P1P1.createInstance(multiTarget.getTargetAmount(target)), game);
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ public class BloodcrazedHoplite extends CardImpl {
|
|||
class BloodcrazedHopliteTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public BloodcrazedHopliteTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new RemoveCounterTargetEffect(CounterType.P1P1.createInstance()), true);
|
||||
super(Zone.ALL, new RemoveCounterTargetEffect(CounterType.P1P1.createInstance()), true);
|
||||
}
|
||||
|
||||
public BloodcrazedHopliteTriggeredAbility(BloodcrazedHopliteTriggeredAbility ability) {
|
||||
|
|
|
|||
|
|
@ -37,8 +37,9 @@ import mage.abilities.costs.common.ExileSourceCost;
|
|||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
|
|
@ -51,7 +52,6 @@ import mage.filter.predicate.mageobject.ColorPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -75,7 +75,7 @@ public class BalthorTheDefiled extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BalthorTheDefiledEffect(), new ManaCostsImpl("{B}{B}{B}"));
|
||||
ability.addCost(new ExileSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public BalthorTheDefiled(final BalthorTheDefiled card) {
|
||||
|
|
@ -98,32 +98,32 @@ class BalthorTheDefiledEffect extends OneShotEffect {
|
|||
new ColorPredicate(ObjectColor.RED)));
|
||||
}
|
||||
|
||||
public BalthorTheDefiledEffect() {
|
||||
public BalthorTheDefiledEffect() {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "Each player returns all black and all red creature cards from his or her graveyard to the battlefield";
|
||||
}
|
||||
|
||||
public BalthorTheDefiledEffect(final BalthorTheDefiledEffect effect) {
|
||||
public BalthorTheDefiledEffect(final BalthorTheDefiledEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BalthorTheDefiledEffect copy() {
|
||||
return new BalthorTheDefiledEffect(this);
|
||||
public BalthorTheDefiledEffect copy() {
|
||||
return new BalthorTheDefiledEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId: controller.getInRange()) {
|
||||
Cards cardsToReturn = new CardsImpl();
|
||||
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
for (Card card: player.getGraveyard().getCards(filter, source.getSourceId(), source.getControllerId(), game)) {
|
||||
player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId());
|
||||
}
|
||||
cardsToReturn.addAll(player.getGraveyard().getCards(filter, source.getSourceId(), source.getControllerId(), game));
|
||||
}
|
||||
}
|
||||
controller.moveCards(cardsToReturn.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -29,13 +29,11 @@ package mage.sets.khansoftarkir;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterNonlandPermanent;
|
||||
|
||||
/**
|
||||
|
|
@ -53,10 +51,7 @@ public class CleverImpersonator extends CardImpl {
|
|||
this.toughness = new MageInt(0);
|
||||
|
||||
// You may have Clever Impersonator enter the battlefield as a copy of any nonland permanent on the battlefield.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
|
||||
new EntersBattlefieldEffect(new CopyPermanentEffect(new FilterNonlandPermanent()),
|
||||
"You may have {this} enter the battlefield as a copy of any nonland permanent on the battlefield",
|
||||
true)));
|
||||
this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(new FilterNonlandPermanent()), true));
|
||||
}
|
||||
|
||||
public CleverImpersonator(final CleverImpersonator card) {
|
||||
|
|
|
|||
|
|
@ -34,13 +34,12 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.BeginningOfDrawTriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardHandControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
|
|
@ -54,7 +53,6 @@ import mage.constants.Rarity;
|
|||
import mage.constants.SubLayer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -71,16 +69,16 @@ public class SarkhanTheDragonspeaker extends CardImpl {
|
|||
this.expansionSetCode = "KTK";
|
||||
this.subtype.add("Sarkhan");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Until end of turn, Sarkhan, the Dragonspeaker becomes a legendary 4/4 red Dragon creature with flying, indestructible, and haste.
|
||||
this.addAbility(new LoyaltyAbility(new SarkhanTheDragonspeakerEffect(), 1));
|
||||
|
||||
|
||||
// -3: Sarkhan, the Dragonspeaker deals 4 damage to target creature.
|
||||
LoyaltyAbility ability = new LoyaltyAbility(new DamageTargetEffect(4), -3);
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// -6: You get an emblem with "At the beginning of your draw step, draw two additional cards" and "At the beginning of your end step, discard your hand."
|
||||
Effect effect = new GetEmblemEffect(new SarkhanTheDragonspeakerEmblem());
|
||||
effect.setText("You get an emblem with \"At the beginning of your draw step, draw two additional cards\" and \"At the beginning of your end step, discard your hand.\"");
|
||||
|
|
@ -98,7 +96,7 @@ public class SarkhanTheDragonspeaker extends CardImpl {
|
|||
}
|
||||
|
||||
class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl {
|
||||
|
||||
|
||||
SarkhanTheDragonspeakerEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.BecomeCreature);
|
||||
staticText = "Until end of turn, {this} becomes a legendary 4/4 red Dragon creature with flying, indestructible, and haste.";
|
||||
|
|
@ -112,7 +110,7 @@ class SarkhanTheDragonspeakerEffect extends ContinuousEffectImpl {
|
|||
public SarkhanTheDragonspeakerEffect copy() {
|
||||
return new SarkhanTheDragonspeakerEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
|
|
|
|||
|
|
@ -32,14 +32,13 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.GetEmblemEffect;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -48,12 +47,10 @@ import mage.constants.Duration;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
|
|
@ -65,8 +62,7 @@ public class SorinSolemnVisitor extends CardImpl {
|
|||
this.expansionSetCode = "KTK";
|
||||
this.subtype.add("Sorin");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: Until your next turn, creatures you control get +1/+0 and gain lifelink.
|
||||
Effect effect = new BoostControlledEffect(1, 0, Duration.UntilYourNextTurn, new FilterCreaturePermanent());
|
||||
|
|
@ -94,18 +90,22 @@ public class SorinSolemnVisitor extends CardImpl {
|
|||
return new SorinSolemnVisitor(this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emblem: "At the beginning of each opponent's upkeep, that player sacrifices a creature."
|
||||
* Emblem: "At the beginning of each opponent's upkeep, that player sacrifices a
|
||||
* creature."
|
||||
*/
|
||||
class SorinEmblem extends Emblem {
|
||||
|
||||
public SorinEmblem() {
|
||||
this.setName("EMBLEM: Sorin, Solemn Visitor");
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, new SacrificeEffect(new FilterCreaturePermanent(),1 ,"that player"), TargetController.OPPONENT, false, true);
|
||||
Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, new SacrificeEffect(new FilterCreaturePermanent(), 1, "that player"), TargetController.OPPONENT, false, true);
|
||||
this.getAbilities().add(ability);
|
||||
}
|
||||
}
|
||||
|
||||
class SorinSolemnVisitorVampireToken extends Token {
|
||||
|
||||
SorinSolemnVisitorVampireToken() {
|
||||
super("Vampire", "a 2/2 black Vampire creature token with flying");
|
||||
setOriginalExpansionSetCode("KTK");
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ public class WarNameAspirant extends CardImpl {
|
|||
// <i>Raid</i> - War-Name Aspirant enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(1), false),
|
||||
RaidCondition.getInstance(),
|
||||
true,
|
||||
"<i>Raid</i> - {this} enters the battlefield with a +1/+1 counter on it if you attacked with a creature this turn",
|
||||
"{this} enters the battlefield with a +1/+1 counter"),
|
||||
new PlayerAttackedWatcher());
|
||||
|
|
|
|||
|
|
@ -70,15 +70,14 @@ public class AnimateDead extends CardImpl {
|
|||
this.expansionSetCode = "LEA";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
|
||||
// Enchant creature card in a graveyard
|
||||
TargetCardInGraveyard auraTarget = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard"));
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AnimateDeadAttachEffect(Outcome.PutCreatureInPlay));
|
||||
Ability enchantAbility = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(enchantAbility);
|
||||
// When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard"
|
||||
// and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield
|
||||
this.addAbility(enchantAbility);
|
||||
// When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard"
|
||||
// and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield
|
||||
// under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.
|
||||
Ability ability = new ConditionalTriggeredAbility(
|
||||
new EntersBattlefieldTriggeredAbility(new AnimateDeadReAttachEffect(), false),
|
||||
|
|
@ -86,11 +85,11 @@ public class AnimateDead extends CardImpl {
|
|||
"When {this} enters the battlefield, if it's on the battlefield, it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with {this}.\" Return enchanted creature card to the battlefield under your control and attach {this} to it.");
|
||||
ability.addEffect(new AnimateDeadChangeAbilityEffect());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new AnimateDeadLeavesBattlefieldTriggeredEffect(), false));
|
||||
|
||||
this.addAbility(new LeavesBattlefieldTriggeredAbility(new AnimateDeadLeavesBattlefieldTriggeredEffect(), false));
|
||||
|
||||
// Enchanted creature gets -1/-0.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-1, 0, Duration.WhileOnBattlefield)));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public AnimateDead(final AnimateDead card) {
|
||||
|
|
@ -104,36 +103,36 @@ public class AnimateDead extends CardImpl {
|
|||
}
|
||||
|
||||
class AnimateDeadReAttachEffect extends OneShotEffect {
|
||||
|
||||
|
||||
public AnimateDeadReAttachEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Return enchanted creature card to the battlefield under your control and attach {this} to it";
|
||||
}
|
||||
|
||||
|
||||
public AnimateDeadReAttachEffect(final AnimateDeadReAttachEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AnimateDeadReAttachEffect copy() {
|
||||
return new AnimateDeadReAttachEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
|
||||
|
||||
if (controller != null && enchantment != null) {
|
||||
Card cardInGraveyard = game.getCard(enchantment.getAttachedTo());
|
||||
if (cardInGraveyard == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// put card into play
|
||||
controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId());
|
||||
controller.moveCards(cardInGraveyard, Zone.BATTLEFIELD, source, game);
|
||||
Permanent enchantedCreature = game.getPermanent(cardInGraveyard.getId());
|
||||
|
||||
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with Animate Dead");
|
||||
filter.add(new PermanentIdPredicate(cardInGraveyard.getId()));
|
||||
Target target = new TargetCreaturePermanent(filter);
|
||||
|
|
@ -146,27 +145,27 @@ class AnimateDeadReAttachEffect extends OneShotEffect {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class AnimateDeadLeavesBattlefieldTriggeredEffect extends OneShotEffect {
|
||||
|
||||
|
||||
public AnimateDeadLeavesBattlefieldTriggeredEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "enchanted creature's controller sacrifices it";
|
||||
}
|
||||
|
||||
|
||||
public AnimateDeadLeavesBattlefieldTriggeredEffect(final AnimateDeadLeavesBattlefieldTriggeredEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AnimateDeadLeavesBattlefieldTriggeredEffect copy() {
|
||||
return new AnimateDeadLeavesBattlefieldTriggeredEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
|
@ -223,17 +222,16 @@ class AnimateDeadAttachEffect extends OneShotEffect {
|
|||
class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements SourceEffect {
|
||||
|
||||
private final static Ability newAbility = new EnchantAbility("creature put onto the battlefield with Animate Dead");
|
||||
|
||||
|
||||
static {
|
||||
newAbility.setRuleAtTheTop(true);
|
||||
}
|
||||
|
||||
|
||||
public AnimateDeadChangeAbilityEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.AddAbility);
|
||||
staticText = "it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with Animate Dead\"";
|
||||
}
|
||||
|
||||
|
||||
public AnimateDeadChangeAbilityEffect(final AnimateDeadChangeAbilityEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
|
@ -242,7 +240,7 @@ class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements Sou
|
|||
public AnimateDeadChangeAbilityEffect copy() {
|
||||
return new AnimateDeadChangeAbilityEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
|
|
@ -254,7 +252,7 @@ class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements Sou
|
|||
Permanent permanent = affectedObjectList.get(0).getPermanent(game);
|
||||
if (permanent != null) {
|
||||
Ability abilityToRemove = null;
|
||||
for (Ability ability: permanent.getAbilities()) {
|
||||
for (Ability ability : permanent.getAbilities()) {
|
||||
if (ability instanceof EnchantAbility) {
|
||||
abilityToRemove = ability;
|
||||
}
|
||||
|
|
@ -264,7 +262,7 @@ class AnimateDeadChangeAbilityEffect extends ContinuousEffectImpl implements Sou
|
|||
}
|
||||
permanent.addAbility(newAbility, source.getSourceId(), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,24 +28,14 @@
|
|||
package mage.sets.limitedalpha;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.EntersBattlefieldEffect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CopyPermanentEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.util.functions.ApplyToPermanent;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.util.functions.CardTypeApplier;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -59,11 +49,9 @@ public class CopyArtifact extends CardImpl {
|
|||
this.expansionSetCode = "LEA";
|
||||
|
||||
// You may have Copy Artifact enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types.
|
||||
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(
|
||||
new CopyArtifactEffect(),
|
||||
"You may have {this} enter the battlefield as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types",
|
||||
true));
|
||||
this.addAbility(ability);
|
||||
Effect effect = new CopyPermanentEffect(new FilterArtifactPermanent(), new CardTypeApplier(CardType.ENCHANTMENT));
|
||||
effect.setText("as a copy of any artifact on the battlefield, except it's an enchantment in addition to its other types");
|
||||
this.addAbility(new EntersBattlefieldAbility(effect, true));
|
||||
}
|
||||
|
||||
public CopyArtifact(final CopyArtifact card) {
|
||||
|
|
@ -75,64 +63,3 @@ public class CopyArtifact extends CardImpl {
|
|||
return new CopyArtifact(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CopyArtifactEffect extends OneShotEffect {
|
||||
|
||||
ApplyToPermanent applier = new ApplyToPermanent() {
|
||||
@Override
|
||||
public Boolean apply(Game game, Permanent permanent) {
|
||||
if (!permanent.getCardType().contains(CardType.ENCHANTMENT)) {
|
||||
permanent.getCardType().add(CardType.ENCHANTMENT);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean apply(Game game, MageObject mageObject) {
|
||||
if (!mageObject.getCardType().contains(CardType.ENCHANTMENT)) {
|
||||
mageObject.getCardType().add(CardType.ENCHANTMENT);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("artifact");
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.ARTIFACT));
|
||||
}
|
||||
|
||||
public CopyArtifactEffect() {
|
||||
super(Outcome.Copy);
|
||||
}
|
||||
|
||||
public CopyArtifactEffect(final CopyArtifactEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (player != null && sourceObject != null) {
|
||||
Target target = new TargetPermanent(filter);
|
||||
target.setNotTarget(true);
|
||||
if (target.canChoose(source.getControllerId(), game)) {
|
||||
player.choose(Outcome.Copy, target, source.getSourceId(), game);
|
||||
Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
|
||||
if (copyFromPermanent != null) {
|
||||
game.copyPermanent(copyFromPermanent, sourceObject.getId(), source, applier);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CopyArtifactEffect copy() {
|
||||
return new CopyArtifactEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
|
@ -20,15 +20,26 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.magic2010;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersAllEffect;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
|
|
@ -36,19 +47,6 @@ import mage.constants.Outcome;
|
|||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersAllEffect;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
|
@ -68,7 +66,7 @@ public class AjaniGoldmane extends CardImpl {
|
|||
this.expansionSetCode = "M10";
|
||||
this.subtype.add("Ajani");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
|
||||
|
||||
// +1: You gain 2 life.
|
||||
this.addAbility(new LoyaltyAbility(new GainLifeEffect(2), 1));
|
||||
|
|
@ -136,4 +134,4 @@ class AvatarTokenEffect extends ContinuousEffectImpl {
|
|||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
|
@ -20,17 +20,17 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.magic2010;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.PayVariableLoyaltyCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
|
|
@ -38,18 +38,14 @@ import mage.abilities.effects.Effect;
|
|||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com, nantuko
|
||||
|
|
@ -61,8 +57,7 @@ public class ChandraNalaar extends CardImpl {
|
|||
this.expansionSetCode = "M10";
|
||||
this.subtype.add("Chandra");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(6)), false));
|
||||
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(6));
|
||||
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1);
|
||||
ability1.addTarget(new TargetPlayer());
|
||||
|
|
@ -98,7 +93,7 @@ class ChandraNalaarXValue implements DynamicValue {
|
|||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
for (Cost cost : sourceAbility.getCosts()) {
|
||||
if (cost instanceof PayVariableLoyaltyCost) {
|
||||
return ((PayVariableLoyaltyCost)cost).getAmount();
|
||||
return ((PayVariableLoyaltyCost) cost).getAmount();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
@ -123,4 +118,3 @@ class ChandraNalaarXValue implements DynamicValue {
|
|||
return defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,49 +1,46 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage.sets.magic2010;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.Effects;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.UntapTargetEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.TrampleAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.permanent.token.BeastToken;
|
||||
import mage.target.common.TargetLandPermanent;
|
||||
|
|
@ -61,8 +58,7 @@ public class GarrukWildspeaker extends CardImpl {
|
|||
this.expansionSetCode = "M10";
|
||||
this.subtype.add("Garruk");
|
||||
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +1: Untap two target lands.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new UntapTargetEffect(), 1);
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
|
|
@ -20,25 +20,22 @@
|
|||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.magic2010;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.common.DrawCardAllEffect;
|
||||
import mage.abilities.effects.common.DrawCardTargetEffect;
|
||||
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
|
|
@ -52,9 +49,9 @@ public class JaceBeleren extends CardImpl {
|
|||
this.expansionSetCode = "M10";
|
||||
this.subtype.add("Jace");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(3));
|
||||
|
||||
// +2: Each player draws a card.
|
||||
// +2: Each player draws a card.
|
||||
this.addAbility(new LoyaltyAbility(new DrawCardAllEffect(1), 2));
|
||||
|
||||
// -1: Target player draws a card.
|
||||
|
|
|
|||
|
|
@ -32,9 +32,8 @@ import java.util.Set;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.LoyaltyAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -43,7 +42,6 @@ import mage.constants.CardType;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
|
@ -60,7 +58,7 @@ public class LilianaVess extends CardImpl {
|
|||
this.expansionSetCode = "M10";
|
||||
this.subtype.add("Liliana");
|
||||
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(5)), false));
|
||||
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(5));
|
||||
// +1: Target player discards a card.
|
||||
LoyaltyAbility ability1 = new LoyaltyAbility(new DiscardTargetEffect(1), 1);
|
||||
ability1.addTarget(new TargetPlayer());
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue