Implemented Persistent Petitioners

This commit is contained in:
Evan Kranzler 2019-01-10 13:40:40 -05:00
parent 46a68beb45
commit 84a4681767
3 changed files with 86 additions and 7 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.p;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.target.TargetPlayer;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class PersistentPetitioners extends CardImpl {
private static final FilterControlledPermanent filter
= new FilterControlledPermanent("untapped Advisors you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
filter.add(new SubtypePredicate(SubType.ADVISOR));
}
public PersistentPetitioners(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ADVISOR);
this.power = new MageInt(1);
this.toughness = new MageInt(3);
// {1}, {T}: Target player puts the top card of their library into their graveyard.
Ability ability = new SimpleActivatedAbility(
new PutLibraryIntoGraveTargetEffect(1), new GenericManaCost(1)
);
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// Tap four untapped Advisors you control: Target player puts the top twelve cards of their library into their graveyard.
ability = new SimpleActivatedAbility(
new PutLibraryIntoGraveTargetEffect(12),
new TapTargetCost(new TargetControlledPermanent(
4, 4, filter, true
))
);
ability.addTarget(new TargetPlayer());
this.addAbility(ability);
// A deck can have any number of cards named Persistent Petitioners.
this.getSpellAbility().addEffect(new InfoEffect("A deck can have any number of cards named Persistent Petitioners."));
}
private PersistentPetitioners(final PersistentPetitioners card) {
super(card);
}
@Override
public PersistentPetitioners copy() {
return new PersistentPetitioners(this);
}
}

View file

@ -121,6 +121,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Orzhov Guildgate", 253, Rarity.COMMON, mage.cards.o.OrzhovGuildgate.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Orzhov Locket", 236, Rarity.COMMON, mage.cards.o.OrzhovLocket.class));
cards.add(new SetCardInfo("Orzhov Racketeers", 80, Rarity.UNCOMMON, mage.cards.o.OrzhovRacketeers.class));
cards.add(new SetCardInfo("Persistent Petitioners", 44, Rarity.COMMON, mage.cards.p.PersistentPetitioners.class));
cards.add(new SetCardInfo("Pestilent Spirit", 81, Rarity.RARE, mage.cards.p.PestilentSpirit.class));
cards.add(new SetCardInfo("Pitiless Pontiff", 194, Rarity.UNCOMMON, mage.cards.p.PitilessPontiff.class));
cards.add(new SetCardInfo("Precognitive Perception", 45, Rarity.RARE, mage.cards.p.PrecognitivePerception.class));

View file

@ -1,26 +1,29 @@
package mage.cards.decks;
import java.util.*;
import java.util.Map.Entry;
import mage.cards.Card;
import mage.cards.repository.CardInfo;
import mage.cards.repository.CardRepository;
import mage.constants.Rarity;
import org.apache.log4j.Logger;
import java.util.*;
import java.util.Map.Entry;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Constructed extends DeckValidator {
private static final Logger logger = Logger.getLogger(DeckValidator.class);
protected static final List<String> anyNumberCardsAllowed = new ArrayList<>(Arrays.asList("Relentless Rats", "Shadowborn Apostle", "Rat Colony"));
protected static final List<String> basicLandNames = new ArrayList<>(
Arrays.asList("Forest", "Island", "Mountain", "Swamp", "Plains", "Wastes", "Snow-Covered Forest",
"Snow-Covered Island", "Snow-Covered Mountain", "Snow-Covered Swamp", "Snow-Covered Plains"));
protected static final List<String> anyNumberCardsAllowed = Arrays.asList(
"Relentless Rats", "Shadowborn Apostle", "Rat Colony", "Persistent Petitioners"
);
protected static final List<String> basicLandNames = Arrays.asList(
"Forest", "Island", "Mountain", "Swamp", "Plains", "Wastes", "Snow-Covered Forest",
"Snow-Covered Island", "Snow-Covered Mountain", "Snow-Covered Swamp", "Snow-Covered Plains"
);
protected List<String> banned = new ArrayList<>();
protected List<String> restricted = new ArrayList<>();
protected List<String> setCodes = new ArrayList<>();