mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 19:41:59 -08:00
GRN - Add Card - Plaguecrafter - 082
This commit is contained in:
parent
18ba009667
commit
34f46b27f3
2 changed files with 95 additions and 0 deletions
94
Mage.Sets/src/mage/cards/p/Plaguecrafter.java
Normal file
94
Mage.Sets/src/mage/cards/p/Plaguecrafter.java
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.SacrificeEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author themogwi
|
||||
*/
|
||||
public final class Plaguecrafter extends CardImpl {
|
||||
|
||||
public Plaguecrafter(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.SHAMAN);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// When Plaguecrafter enters the battlefield.
|
||||
// Each player sacrifices a creature or planeswalker.
|
||||
// Each player who can't discards a card.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new PlaguecrafterEffect()));
|
||||
}
|
||||
|
||||
public Plaguecrafter(final Plaguecrafter card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Plaguecrafter copy() {
|
||||
return new Plaguecrafter(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class PlaguecrafterEffect extends OneShotEffect {
|
||||
|
||||
public PlaguecrafterEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Each player sacrifices a creature or planeswalker. "
|
||||
+ "Each player who can't discards a card.";
|
||||
}
|
||||
|
||||
public PlaguecrafterEffect(final PlaguecrafterEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlaguecrafterEffect copy() {
|
||||
return new PlaguecrafterEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
game.getPlayers().forEach((playerId, player) -> {
|
||||
if (!(player == null)) {
|
||||
FilterPermanent filter = new FilterCreatureOrPlaneswalkerPermanent();
|
||||
filter.add(new ControllerIdPredicate(playerId));
|
||||
if (game.getBattlefield().getActivePermanents(
|
||||
filter, source.getControllerId(), game
|
||||
).isEmpty()) {
|
||||
Effect discardEffect = new DiscardTargetEffect(1);
|
||||
discardEffect.setTargetPointer(new FixedTarget(playerId, game));
|
||||
discardEffect.apply(game, source);
|
||||
} else {
|
||||
Effect effect = new SacrificeEffect(
|
||||
StaticFilters.FILTER_PERMANENT_CREATURE_OR_PLANESWALKER_A, 1, null
|
||||
);
|
||||
effect.setTargetPointer(new FixedTarget(playerId, game));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -198,6 +198,7 @@ public final class GuildsOfRavnica extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Pilfering Imp", 81, Rarity.UNCOMMON, mage.cards.p.PilferingImp.class));
|
||||
cards.add(new SetCardInfo("Piston-Fist Cyclops", 217, Rarity.COMMON, mage.cards.p.PistonFistCyclops.class));
|
||||
cards.add(new SetCardInfo("Pitiless Gorgon", 218, Rarity.COMMON, mage.cards.p.PitilessGorgon.class));
|
||||
cards.add(new SetCardInfo("Plaguecrafter", 82, Rarity.UNCOMMON, mage.cards.p.Plaguecrafter.class));
|
||||
cards.add(new SetCardInfo("Plains", 260, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Portcullis Vine", 142, Rarity.COMMON, mage.cards.p.PortcullisVine.class));
|
||||
cards.add(new SetCardInfo("Precision Bolt", 267, Rarity.COMMON, mage.cards.p.PrecisionBolt.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue