mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Implemented Shared Summons
This commit is contained in:
parent
28951be3f5
commit
11dcc127a1
2 changed files with 70 additions and 0 deletions
69
Mage.Sets/src/mage/cards/s/SharedSummons.java
Normal file
69
Mage.Sets/src/mage/cards/s/SharedSummons.java
Normal 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()));
|
||||
}
|
||||
}
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue