diff --git a/Mage.Sets/src/mage/cards/b/BattlemagesBracers.java b/Mage.Sets/src/mage/cards/b/BattlemagesBracers.java index b934f0e4a0..a8c0b05380 100644 --- a/Mage.Sets/src/mage/cards/b/BattlemagesBracers.java +++ b/Mage.Sets/src/mage/cards/b/BattlemagesBracers.java @@ -3,7 +3,7 @@ package mage.cards.b; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.CopyStackAbilityEffect; +import mage.abilities.effects.common.CopyStackObjectEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -55,7 +55,7 @@ public final class BattlemagesBracers extends CardImpl { class BattlemagesBracersTriggeredAbility extends TriggeredAbilityImpl { BattlemagesBracersTriggeredAbility() { - super(Zone.BATTLEFIELD, new DoIfCostPaid(new CopyStackAbilityEffect(), new GenericManaCost(1))); + super(Zone.BATTLEFIELD, new DoIfCostPaid(new CopyStackObjectEffect(), new GenericManaCost(1))); } private BattlemagesBracersTriggeredAbility(final BattlemagesBracersTriggeredAbility ability) { @@ -82,7 +82,7 @@ class BattlemagesBracersTriggeredAbility extends TriggeredAbilityImpl { if (stackAbility == null || stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl) { return false; } - getEffects().setValue("stackAbility", stackAbility); + getEffects().setValue("stackObject", stackAbility); return true; } diff --git a/Mage.Sets/src/mage/cards/c/ChandrasRegulator.java b/Mage.Sets/src/mage/cards/c/ChandrasRegulator.java index 31f5678b20..6ed9c3af63 100644 --- a/Mage.Sets/src/mage/cards/c/ChandrasRegulator.java +++ b/Mage.Sets/src/mage/cards/c/ChandrasRegulator.java @@ -96,7 +96,7 @@ class ChandrasRegulatorEffect extends OneShotEffect { if (!cost.pay(source, game, source, source.getControllerId(), false, null)) { return true; } - StackAbility ability = (StackAbility) getValue("stackAbility"); + StackAbility ability = (StackAbility) getValue("stackObject"); Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (ability == null || controller == null || sourcePermanent == null) { diff --git a/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java b/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java index 592bd86cc3..b2df2bab91 100644 --- a/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java +++ b/Mage.Sets/src/mage/cards/i/IllusionistsBracers.java @@ -2,7 +2,7 @@ package mage.cards.i; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.CopyStackAbilityEffect; +import mage.abilities.effects.common.CopyStackObjectEffect; import mage.abilities.keyword.EquipAbility; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.cards.CardImpl; @@ -47,7 +47,7 @@ public final class IllusionistsBracers extends CardImpl { class IllusionistsBracersTriggeredAbility extends TriggeredAbilityImpl { IllusionistsBracersTriggeredAbility() { - super(Zone.BATTLEFIELD, new CopyStackAbilityEffect()); + super(Zone.BATTLEFIELD, new CopyStackObjectEffect()); } private IllusionistsBracersTriggeredAbility(final IllusionistsBracersTriggeredAbility ability) { @@ -74,7 +74,7 @@ class IllusionistsBracersTriggeredAbility extends TriggeredAbilityImpl { if (stackAbility == null || stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl) { return false; } - this.getEffects().setValue("stackAbility", stackAbility); + this.getEffects().setValue("stackObject", stackAbility); return true; } diff --git a/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java b/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java index 001ee763f4..ea591d6cd2 100644 --- a/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java +++ b/Mage.Sets/src/mage/cards/k/KurkeshOnakkeAncient.java @@ -3,7 +3,7 @@ package mage.cards.k; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.CopyStackAbilityEffect; +import mage.abilities.effects.common.CopyStackObjectEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.cards.Card; @@ -50,7 +50,7 @@ public final class KurkeshOnakkeAncient extends CardImpl { class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl { KurkeshOnakkeAncientTriggeredAbility() { - super(Zone.BATTLEFIELD, new DoIfCostPaid(new CopyStackAbilityEffect(), new GenericManaCost(1))); + super(Zone.BATTLEFIELD, new DoIfCostPaid(new CopyStackObjectEffect(), new GenericManaCost(1))); setTriggerPhrase("Whenever you activate an ability of an artifact, if it isn't a mana ability"); } @@ -81,7 +81,7 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl { if (stackAbility == null || stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl) { return false; } - this.getEffects().setValue("stackAbility", stackAbility); + this.getEffects().setValue("stackObject", stackAbility); return true; } } diff --git a/Mage.Sets/src/mage/cards/m/MagusLuceaKane.java b/Mage.Sets/src/mage/cards/m/MagusLuceaKane.java new file mode 100644 index 0000000000..4a94419fa4 --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MagusLuceaKane.java @@ -0,0 +1,102 @@ +package mage.cards.m; + +import mage.MageInt; +import mage.Mana; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.BeginningOfCombatTriggeredAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.VariableManaCost; +import mage.abilities.effects.common.CopyStackObjectEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.abilities.mana.SimpleManaAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.StackObject; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class MagusLuceaKane extends CardImpl { + + public MagusLuceaKane(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{U}{R}"); + + this.addSuperType(SuperType.LEGENDARY); + this.subtype.add(SubType.HUMAN); + this.subtype.add(SubType.TYRANID); + this.subtype.add(SubType.WIZARD); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Spiritual Leader -- At the beginning of combat on your turn, put a +1/+1 counter on target creature. + Ability ability = new BeginningOfCombatTriggeredAbility( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()), + TargetController.YOU, false + ); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability.withFlavorWord("Spiritual Leader")); + + // Psychic Stimulus -- {T}: Add {C}{C}. When you next cast a spell with {X} in its mana cost or activate an ability with {X} in its activation cost this turn, copy that spell or ability. You may choose new targets for the copy. + ability = new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(2), new TapSourceCost()); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new MagusLuceaKaneTriggeredAbility())); + this.addAbility(ability.withFlavorWord("Psychic Stimulus")); + } + + private MagusLuceaKane(final MagusLuceaKane card) { + super(card); + } + + @Override + public MagusLuceaKane copy() { + return new MagusLuceaKane(this); + } +} + +class MagusLuceaKaneTriggeredAbility extends DelayedTriggeredAbility { + + MagusLuceaKaneTriggeredAbility() { + super(new CopyStackObjectEffect(), Duration.EndOfTurn, true, false); + } + + private MagusLuceaKaneTriggeredAbility(final MagusLuceaKaneTriggeredAbility ability) { + super(ability); + } + + @Override + public MagusLuceaKaneTriggeredAbility copy() { + return new MagusLuceaKaneTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.ACTIVATED_ABILITY + || event.getType() == GameEvent.EventType.SPELL_CAST; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + StackObject stackObject = game.getStack().getStackObject(event.getTargetId()); + if (stackObject != null + && stackObject.isControlledBy(getControllerId()) + && stackObject.getManaCost().stream().anyMatch(VariableManaCost.class::isInstance)) { + this.getEffects().setValue("stackObject", stackObject); + return true; + } + return false; + } + + @Override + public String getRule() { + return "When you next cast a spell with {X} in its mana cost or activate an ability with {X} in its " + + "activation cost this turn, copy that spell or ability. You may choose new targets for the copy."; + } +} diff --git a/Mage.Sets/src/mage/cards/r/RingsOfBrighthearth.java b/Mage.Sets/src/mage/cards/r/RingsOfBrighthearth.java index 38b19028b0..493a818219 100644 --- a/Mage.Sets/src/mage/cards/r/RingsOfBrighthearth.java +++ b/Mage.Sets/src/mage/cards/r/RingsOfBrighthearth.java @@ -2,7 +2,7 @@ package mage.cards.r; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.common.CopyStackAbilityEffect; +import mage.abilities.effects.common.CopyStackObjectEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.cards.CardImpl; @@ -40,7 +40,7 @@ public final class RingsOfBrighthearth extends CardImpl { class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl { RingsOfBrighthearthTriggeredAbility() { - super(Zone.BATTLEFIELD, new DoIfCostPaid(new CopyStackAbilityEffect(), new GenericManaCost(2))); + super(Zone.BATTLEFIELD, new DoIfCostPaid(new CopyStackObjectEffect(), new GenericManaCost(2))); } private RingsOfBrighthearthTriggeredAbility(final RingsOfBrighthearthTriggeredAbility ability) { @@ -66,7 +66,7 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl { if (stackAbility == null || stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl) { return false; } - this.getEffects().setValue("stackAbility", stackAbility); + this.getEffects().setValue("stackObject", stackAbility); return true; } diff --git a/Mage.Sets/src/mage/cards/v/VerrakWarpedSengir.java b/Mage.Sets/src/mage/cards/v/VerrakWarpedSengir.java index 89740ada80..10346841b4 100644 --- a/Mage.Sets/src/mage/cards/v/VerrakWarpedSengir.java +++ b/Mage.Sets/src/mage/cards/v/VerrakWarpedSengir.java @@ -3,7 +3,7 @@ package mage.cards.v; import mage.MageInt; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.costs.common.PayLifeCost; -import mage.abilities.effects.common.CopyStackAbilityEffect; +import mage.abilities.effects.common.CopyStackObjectEffect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.keyword.DeathtouchAbility; import mage.abilities.keyword.FlyingAbility; @@ -96,8 +96,8 @@ class VerrakWarpedSengirTriggeredAbility extends TriggeredAbilityImpl { ).mapToInt(PayLifeCost::getLifePaid).sum(); if (lifePaid > 0) { this.getEffects().clear(); - this.addEffect(new DoIfCostPaid(new CopyStackAbilityEffect(), new PayLifeCost(lifePaid))); - this.getEffects().setValue("stackAbility", stackAbility); + this.addEffect(new DoIfCostPaid(new CopyStackObjectEffect(), new PayLifeCost(lifePaid))); + this.getEffects().setValue("stackObject", stackAbility); return true; } return false; diff --git a/Mage.Sets/src/mage/sets/Warhammer40000.java b/Mage.Sets/src/mage/sets/Warhammer40000.java index a4c38f2ec8..69aa7d7446 100644 --- a/Mage.Sets/src/mage/sets/Warhammer40000.java +++ b/Mage.Sets/src/mage/sets/Warhammer40000.java @@ -157,6 +157,7 @@ public final class Warhammer40000 extends ExpansionSet { cards.add(new SetCardInfo("Lord of Change", 24, Rarity.RARE, mage.cards.l.LordOfChange.class)); cards.add(new SetCardInfo("Lychguard", 39, Rarity.RARE, mage.cards.l.Lychguard.class)); cards.add(new SetCardInfo("Magnus the Red", 131, Rarity.RARE, mage.cards.m.MagnusTheRed.class)); + cards.add(new SetCardInfo("Magus Lucea Kane", 7, Rarity.MYTHIC, mage.cards.m.MagusLuceaKane.class)); cards.add(new SetCardInfo("Malanthrope", 132, Rarity.RARE, mage.cards.m.Malanthrope.class)); cards.add(new SetCardInfo("Mandate of Abaddon", 40, Rarity.RARE, mage.cards.m.MandateOfAbaddon.class)); cards.add(new SetCardInfo("Marneus Calgar", 8, Rarity.MYTHIC, mage.cards.m.MarneusCalgar.class)); diff --git a/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java b/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java index 465c9d096f..24ff936b8b 100644 --- a/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/common/ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility.java @@ -49,7 +49,7 @@ public class ActivatePlaneswalkerLoyaltyAbilityTriggeredAbility extends Triggere || !permanent.hasSubtype(planeswalkerSubType, game)) { return false; } - this.getEffects().setValue("stackAbility", stackAbility); + this.getEffects().setValue("stackObject", stackAbility); return true; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/CopyStackAbilityEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CopyStackObjectEffect.java similarity index 66% rename from Mage/src/main/java/mage/abilities/effects/common/CopyStackAbilityEffect.java rename to Mage/src/main/java/mage/abilities/effects/common/CopyStackObjectEffect.java index d78243bbae..a8a14037cc 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CopyStackAbilityEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CopyStackObjectEffect.java @@ -4,32 +4,32 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; import mage.game.Game; -import mage.game.stack.StackAbility; +import mage.game.stack.StackObject; import mage.players.Player; /** * @author TheElk801 */ -public class CopyStackAbilityEffect extends OneShotEffect { +public class CopyStackObjectEffect extends OneShotEffect { - public CopyStackAbilityEffect() { + public CopyStackObjectEffect() { super(Outcome.Copy); staticText = "copy that ability. You may choose new targets for the copy"; } - private CopyStackAbilityEffect(final CopyStackAbilityEffect effect) { + private CopyStackObjectEffect(final CopyStackObjectEffect effect) { super(effect); } @Override - public CopyStackAbilityEffect copy() { - return new CopyStackAbilityEffect(this); + public CopyStackObjectEffect copy() { + return new CopyStackObjectEffect(this); } @Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); - StackAbility ability = (StackAbility) getValue("stackAbility"); + StackObject ability = (StackObject) getValue("stackObject"); if (controller == null || ability == null) { return false; } diff --git a/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java b/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java index 4f0ac71713..6c840d043d 100644 --- a/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java +++ b/Mage/src/main/java/mage/game/command/emblems/RowanKenrithEmblem.java @@ -1,7 +1,7 @@ package mage.game.command.emblems; import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.common.CopyStackAbilityEffect; +import mage.abilities.effects.common.CopyStackObjectEffect; import mage.abilities.mana.ActivatedManaAbilityImpl; import mage.constants.Zone; import mage.game.Game; @@ -28,7 +28,7 @@ public final class RowanKenrithEmblem extends Emblem { class RowanKenrithEmblemTriggeredAbility extends TriggeredAbilityImpl { RowanKenrithEmblemTriggeredAbility() { - super(Zone.COMMAND, new CopyStackAbilityEffect(), false); + super(Zone.COMMAND, new CopyStackObjectEffect(), false); } private RowanKenrithEmblemTriggeredAbility(final RowanKenrithEmblemTriggeredAbility ability) { @@ -54,7 +54,7 @@ class RowanKenrithEmblemTriggeredAbility extends TriggeredAbilityImpl { if (stackAbility == null || stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl) { return false; } - this.getEffects().setValue("stackAbility", stackAbility); + this.getEffects().setValue("stackObject", stackAbility); return true; }