Implemented Witch's Vengeance

This commit is contained in:
Evan Kranzler 2019-09-09 18:57:13 -04:00
parent 3f804a4121
commit 07516081c3
2 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,75 @@
package mage.cards.w;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.ChoiceCreatureType;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class WitchsVengeance extends CardImpl {
public WitchsVengeance(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{B}{B}");
// Creatures of the creature type of your choice get -3/-3 until end of turn.
this.getSpellAbility().addEffect(new WitchsVengeanceEffect());
}
private WitchsVengeance(final WitchsVengeance card) {
super(card);
}
@Override
public WitchsVengeance copy() {
return new WitchsVengeance(this);
}
}
class WitchsVengeanceEffect extends OneShotEffect {
WitchsVengeanceEffect() {
super(Outcome.Benefit);
staticText = "Creatures of the creature type of your choice get -3/-3 until end of turn.";
}
private WitchsVengeanceEffect(final WitchsVengeanceEffect effect) {
super(effect);
}
@Override
public WitchsVengeanceEffect copy() {
return new WitchsVengeanceEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
ChoiceCreatureType choice = new ChoiceCreatureType();
if (!player.choose(outcome, choice, game)) {
return false;
}
FilterCreaturePermanent filter = new FilterCreaturePermanent();
filter.add(new SubtypePredicate(SubType.byDescription(choice.getChoice())));
game.addEffect(new BoostAllEffect(
-3, -3, Duration.EndOfTurn, filter, false
), source);
return true;
}
}

View file

@ -111,6 +111,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Wintermoor Commander", 205, Rarity.UNCOMMON, mage.cards.w.WintermoorCommander.class));
cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class));
cards.add(new SetCardInfo("Witch's Cottage", 249, Rarity.COMMON, mage.cards.w.WitchsCottage.class));
cards.add(new SetCardInfo("Witch's Vengeance", 111, Rarity.RARE, mage.cards.w.WitchsVengeance.class));
cards.add(new SetCardInfo("Witching Well", 74, Rarity.COMMON, mage.cards.w.WitchingWell.class));
cards.add(new SetCardInfo("Workshop Elders", 318, Rarity.RARE, mage.cards.w.WorkshopElders.class));