forked from External/mage
[SPM] Implement Behold the Sinister Six
This commit is contained in:
parent
fe7b9e3e98
commit
ffdc2a9129
2 changed files with 93 additions and 0 deletions
91
Mage.Sets/src/mage/cards/b/BeholdTheSinisterSix.java
Normal file
91
Mage.Sets/src/mage/cards/b/BeholdTheSinisterSix.java
Normal file
|
|
@ -0,0 +1,91 @@
|
||||||
|
package mage.cards.b;
|
||||||
|
|
||||||
|
import mage.MageObject;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.filter.FilterCard;
|
||||||
|
import mage.filter.common.FilterPermanentCard;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.target.common.TargetCardInYourGraveyard;
|
||||||
|
|
||||||
|
import java.util.Objects;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class BeholdTheSinisterSix extends CardImpl {
|
||||||
|
|
||||||
|
public BeholdTheSinisterSix(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{6}{B}");
|
||||||
|
|
||||||
|
// Return up to six target creature cards with different names from your graveyard to the battlefield.
|
||||||
|
this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
|
||||||
|
this.getSpellAbility().addTarget(new BeholdTheSinisterSixTarget());
|
||||||
|
}
|
||||||
|
|
||||||
|
private BeholdTheSinisterSix(final BeholdTheSinisterSix card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BeholdTheSinisterSix copy() {
|
||||||
|
return new BeholdTheSinisterSix(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BeholdTheSinisterSixTarget extends TargetCardInYourGraveyard {
|
||||||
|
|
||||||
|
private static final FilterCard filter = new FilterPermanentCard("creature cards with different names");
|
||||||
|
|
||||||
|
BeholdTheSinisterSixTarget() {
|
||||||
|
super(0, 6, filter, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private BeholdTheSinisterSixTarget(final BeholdTheSinisterSixTarget target) {
|
||||||
|
super(target);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BeholdTheSinisterSixTarget copy() {
|
||||||
|
return new BeholdTheSinisterSixTarget(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canTarget(UUID playerId, UUID id, Ability ability, Game game) {
|
||||||
|
if (!super.canTarget(playerId, id, ability, game)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Set<String> names = this.getTargets()
|
||||||
|
.stream()
|
||||||
|
.map(game::getCard)
|
||||||
|
.map(MageObject::getName)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
Card card = game.getCard(id);
|
||||||
|
return card != null && !names.contains(card.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<UUID> possibleTargets(UUID sourceControllerId, Ability source, Game game) {
|
||||||
|
Set<UUID> possibleTargets = super.possibleTargets(sourceControllerId, source, game);
|
||||||
|
Set<String> names = this.getTargets()
|
||||||
|
.stream()
|
||||||
|
.map(game::getCard)
|
||||||
|
.map(MageObject::getName)
|
||||||
|
.filter(Objects::nonNull)
|
||||||
|
.collect(Collectors.toSet());
|
||||||
|
possibleTargets.removeIf(uuid -> {
|
||||||
|
Card card = game.getCard(uuid);
|
||||||
|
return card != null && names.contains(card.getName());
|
||||||
|
});
|
||||||
|
return possibleTargets;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -25,6 +25,8 @@ public final class MarvelsSpiderMan extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Anti-Venom, Horrifying Healer", 244, Rarity.MYTHIC, mage.cards.a.AntiVenomHorrifyingHealer.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Anti-Venom, Horrifying Healer", 244, Rarity.MYTHIC, mage.cards.a.AntiVenomHorrifyingHealer.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Aunt May", 3, Rarity.UNCOMMON, mage.cards.a.AuntMay.class));
|
cards.add(new SetCardInfo("Aunt May", 3, Rarity.UNCOMMON, mage.cards.a.AuntMay.class));
|
||||||
cards.add(new SetCardInfo("Beetle, Legacy Criminal", 26, Rarity.COMMON, mage.cards.b.BeetleLegacyCriminal.class));
|
cards.add(new SetCardInfo("Beetle, Legacy Criminal", 26, Rarity.COMMON, mage.cards.b.BeetleLegacyCriminal.class));
|
||||||
|
cards.add(new SetCardInfo("Behold the Sinister Six!", 221, Rarity.MYTHIC, mage.cards.b.BeholdTheSinisterSix.class, NON_FULL_USE_VARIOUS));
|
||||||
|
cards.add(new SetCardInfo("Behold the Sinister Six!", 51, Rarity.MYTHIC, mage.cards.b.BeholdTheSinisterSix.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Carnage, Crimson Chaos", 125, Rarity.RARE, mage.cards.c.CarnageCrimsonChaos.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Carnage, Crimson Chaos", 125, Rarity.RARE, mage.cards.c.CarnageCrimsonChaos.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Carnage, Crimson Chaos", 227, Rarity.RARE, mage.cards.c.CarnageCrimsonChaos.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Carnage, Crimson Chaos", 227, Rarity.RARE, mage.cards.c.CarnageCrimsonChaos.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("City Pigeon", 4, Rarity.COMMON, mage.cards.c.CityPigeon.class));
|
cards.add(new SetCardInfo("City Pigeon", 4, Rarity.COMMON, mage.cards.c.CityPigeon.class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue