Implemented Shared Summons

This commit is contained in:
Evan Kranzler 2019-06-21 20:42:38 -04:00
parent 28951be3f5
commit 11dcc127a1
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,69 @@
package mage.cards.s;
import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.constants.CardType;
import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.target.common.TargetCardInLibrary;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SharedSummons extends CardImpl {
public SharedSummons(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}{G}");
// Search your library for up to two creature cards with different names, reveal them, put them into your hand, then shuffle your library.
this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(
new SharedSummonsTarget(), true, true
));
}
private SharedSummons(final SharedSummons card) {
super(card);
}
@Override
public SharedSummons copy() {
return new SharedSummons(this);
}
}
class SharedSummonsTarget extends TargetCardInLibrary {
private static final FilterCard filter2 = new FilterCreatureCard("creature cards with different names");
SharedSummonsTarget() {
super(0, 4, filter2);
}
private SharedSummonsTarget(final SharedSummonsTarget target) {
super(target);
}
@Override
public SharedSummonsTarget copy() {
return new SharedSummonsTarget(this);
}
@Override
public boolean canTarget(UUID id, Cards cards, Game game) {
Card card = cards.get(id, game);
if (card == null || !card.isCreature()) {
return false;
}
return !this
.getTargets()
.stream()
.map(uuid -> game.getCard(uuid))
.anyMatch(c -> c != null && c.getName().equals(card.getName()));
}
}

View file

@ -120,6 +120,7 @@ public final class CoreSet2020 extends ExpansionSet {
cards.add(new SetCardInfo("Scholar of the Ages", 74, Rarity.UNCOMMON, mage.cards.s.ScholarOfTheAges.class));
cards.add(new SetCardInfo("Scoured Barrens", 251, Rarity.COMMON, mage.cards.s.ScouredBarrens.class));
cards.add(new SetCardInfo("Scuttlemutt", 238, Rarity.UNCOMMON, mage.cards.s.Scuttlemutt.class));
cards.add(new SetCardInfo("Shared Summons", 193, Rarity.RARE, mage.cards.s.SharedSummons.class));
cards.add(new SetCardInfo("Silverback Shaman", 195, Rarity.COMMON, mage.cards.s.SilverbackShaman.class));
cards.add(new SetCardInfo("Sorin, Imperious Bloodlord", 115, Rarity.MYTHIC, mage.cards.s.SorinImperiousBloodlord.class));
cards.add(new SetCardInfo("Spectral Sailor", 76, Rarity.UNCOMMON, mage.cards.s.SpectralSailor.class));