diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java index 94c5ed286b..7fad492607 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/Commander.java @@ -33,7 +33,7 @@ import mage.abilities.Ability; import mage.abilities.common.CanBeYourCommanderAbility; import mage.abilities.costs.mana.ManaCost; import mage.abilities.keyword.PartnerAbility; -import mage.abilities.keyword.PartnersWithAbility; +import mage.abilities.keyword.PartnerWithAbility; import mage.cards.Card; import mage.cards.ExpansionSet; import mage.cards.Sets; @@ -151,8 +151,8 @@ public class Commander extends Constructed { if (deck.getSideboard().size() == 2 && !commander.getAbilities().contains(PartnerAbility.getInstance())) { boolean partnersWith = false; for (Ability ability : commander.getAbilities()) { - if (ability instanceof PartnersWithAbility - && commanderNames.contains(((PartnersWithAbility) ability).getPartnerName())) { + if (ability instanceof PartnerWithAbility + && commanderNames.contains(((PartnerWithAbility) ability).getPartnerName())) { partnersWith = true; break; } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java index 32fc877413..970ca92f9f 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/FreeformCommander.java @@ -30,7 +30,7 @@ package mage.deck; import java.util.*; import mage.abilities.Ability; import mage.abilities.keyword.PartnerAbility; -import mage.abilities.keyword.PartnersWithAbility; +import mage.abilities.keyword.PartnerWithAbility; import mage.cards.Card; import mage.cards.ExpansionSet; import mage.cards.Sets; @@ -102,8 +102,8 @@ public class FreeformCommander extends Constructed { if (deck.getSideboard().size() == 2 && !commander.getAbilities().contains(PartnerAbility.getInstance())) { boolean partnersWith = false; for (Ability ability : commander.getAbilities()) { - if (ability instanceof PartnersWithAbility - && commanderNames.contains(((PartnersWithAbility) ability).getPartnerName())) { + if (ability instanceof PartnerWithAbility + && commanderNames.contains(((PartnerWithAbility) ability).getPartnerName())) { partnersWith = true; break; } diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java index 0d23661a43..e09c5f3ee8 100644 --- a/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java +++ b/Mage.Server.Plugins/Mage.Deck.Constructed/src/mage/deck/PennyDreadfulCommander.java @@ -32,7 +32,7 @@ import java.util.Map.Entry; import mage.abilities.Ability; import mage.abilities.common.CanBeYourCommanderAbility; import mage.abilities.keyword.PartnerAbility; -import mage.abilities.keyword.PartnersWithAbility; +import mage.abilities.keyword.PartnerWithAbility; import mage.cards.Card; import mage.cards.ExpansionSet; import mage.cards.Sets; @@ -113,8 +113,8 @@ public class PennyDreadfulCommander extends Constructed { if (deck.getSideboard().size() == 2 && !commander.getAbilities().contains(PartnerAbility.getInstance())) { boolean partnersWith = false; for (Ability ability : commander.getAbilities()) { - if (ability instanceof PartnersWithAbility - && commanderNames.contains(((PartnersWithAbility) ability).getPartnerName())) { + if (ability instanceof PartnerWithAbility + && commanderNames.contains(((PartnerWithAbility) ability).getPartnerName())) { partnersWith = true; break; } diff --git a/Mage.Sets/src/mage/cards/p/PirImaginativeRascal.java b/Mage.Sets/src/mage/cards/p/PirImaginativeRascal.java index d022fcf943..c9fabcc66b 100644 --- a/Mage.Sets/src/mage/cards/p/PirImaginativeRascal.java +++ b/Mage.Sets/src/mage/cards/p/PirImaginativeRascal.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ReplacementEffectImpl; -import mage.abilities.keyword.PartnersWithAbility; +import mage.abilities.keyword.PartnerWithAbility; import mage.constants.SubType; import mage.constants.SuperType; import mage.cards.CardImpl; @@ -61,7 +61,7 @@ public class PirImaginativeRascal extends CardImpl { this.toughness = new MageInt(1); // Partner with Toothy, Imaginary Friend (When this creature enters the battlefield, target player may put Toothy into their hand from their library, then shuffle.) - this.addAbility(new PartnersWithAbility("Toothy, Imaginary Friend")); + this.addAbility(new PartnerWithAbility("Toothy, Imaginary Friend", true)); // If one or more counters would be put on a permanent your team controls, that many plus one of each of those kinds of counters are put on that permanent instead. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PirImaginativeRascalEffect())); diff --git a/Mage.Sets/src/mage/cards/t/ToothyImaginaryFriend.java b/Mage.Sets/src/mage/cards/t/ToothyImaginaryFriend.java index d26c078467..d480130b85 100644 --- a/Mage.Sets/src/mage/cards/t/ToothyImaginaryFriend.java +++ b/Mage.Sets/src/mage/cards/t/ToothyImaginaryFriend.java @@ -34,7 +34,7 @@ import mage.abilities.common.LeavesBattlefieldTriggeredAbility; import mage.abilities.dynamicvalue.common.CountersSourceCount; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; -import mage.abilities.keyword.PartnersWithAbility; +import mage.abilities.keyword.PartnerWithAbility; import mage.constants.SubType; import mage.constants.SuperType; import mage.cards.CardImpl; @@ -57,7 +57,7 @@ public class ToothyImaginaryFriend extends CardImpl { this.toughness = new MageInt(1); // Partner with Pir, Imaginative Rascal (When this creature enters the battlefield, target player may put Pir into their hand from their library, then shuffle.) - this.addAbility(new PartnersWithAbility("Pir, Imaginative Rascal")); + this.addAbility(new PartnerWithAbility("Pir, Imaginative Rascal", true)); // Whenever you draw a card, put a +1/+1 counter on Toothy, Imaginary Friend. this.addAbility(new DrawCardControllerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true)); diff --git a/Mage/src/main/java/mage/abilities/keyword/PartnersWithAbility.java b/Mage/src/main/java/mage/abilities/keyword/PartnerWithAbility.java similarity index 87% rename from Mage/src/main/java/mage/abilities/keyword/PartnersWithAbility.java rename to Mage/src/main/java/mage/abilities/keyword/PartnerWithAbility.java index 54eb5984a3..15daf1a2a5 100644 --- a/Mage/src/main/java/mage/abilities/keyword/PartnersWithAbility.java +++ b/Mage/src/main/java/mage/abilities/keyword/PartnerWithAbility.java @@ -46,32 +46,40 @@ import mage.target.common.TargetCardInLibrary; * * @author TheElk801 */ -public class PartnersWithAbility extends EntersBattlefieldTriggeredAbility { +public class PartnerWithAbility extends EntersBattlefieldTriggeredAbility { private final String partnerName; private final String shortName; - public PartnersWithAbility(String partnerName) { + public PartnerWithAbility(String partnerName) { + this(partnerName, false); + } + + public PartnerWithAbility(String partnerName, boolean isLegendary) { super(new PartnersWithSearchEffect(partnerName), false); this.addTarget(new TargetPlayer()); this.partnerName = partnerName; - this.shortName = shortenName(partnerName); + if (isLegendary) { + this.shortName = shortenName(partnerName); + } else { + this.shortName = partnerName; + } } - public PartnersWithAbility(final PartnersWithAbility ability) { + public PartnerWithAbility(final PartnerWithAbility ability) { super(ability); this.partnerName = ability.partnerName; this.shortName = ability.shortName; } @Override - public PartnersWithAbility copy() { - return new PartnersWithAbility(this); + public PartnerWithAbility copy() { + return new PartnerWithAbility(this); } @Override public String getRule() { - return "Partners with" + partnerName + return "Partner with " + partnerName + " (When this creature enters the battlefield, target player may put " + shortName + " into their hand from their library, then shuffle.)"; } @@ -122,7 +130,7 @@ class PartnersWithSearchEffect extends OneShotEffect { FilterCard filter = new FilterCard("card named " + partnerName); filter.add(new NamePredicate(partnerName)); TargetCardInLibrary target = new TargetCardInLibrary(filter); - if (player.chooseUse(Outcome.Benefit, "Search your library for a card named" + partnerName + " and put it into your hand?", source, game)) { + if (player.chooseUse(Outcome.Benefit, "Search your library for a card named " + partnerName + " and put it into your hand?", source, game)) { player.searchLibrary(target, game); for (UUID cardId : target.getTargets()) { Card card = player.getLibrary().getCard(cardId, game);