Implemented Domri, Anarch of Bolas

This commit is contained in:
Evan Kranzler 2019-04-10 15:35:44 -04:00
parent 9e9dec8d89
commit 15ad27ca98
2 changed files with 103 additions and 0 deletions

View file

@ -0,0 +1,102 @@
package mage.cards.d;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CantBeCounteredControlledEffect;
import mage.abilities.effects.common.FightTargetsEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.FilterPermanent;
import mage.filter.StaticFilters;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DomriAnarchOfBolas extends CardImpl {
private static final FilterPermanent filter
= new FilterCreaturePermanent("creature you don't control");
static {
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
}
public DomriAnarchOfBolas(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{1}{R}{G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.DOMRI);
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(3));
// Creatures you control get +1/+0.
this.addAbility(new SimpleStaticAbility(
new BoostControlledEffect(1, 0, Duration.WhileOnBattlefield)
));
// +1: Add {R} or {G}. Creature spells you cast this turn can't be countered.
this.addAbility(new LoyaltyAbility(new DomriAnarchOfBolasEffect(), 1));
// -2: Target creature you control fights target creature you don't control.
Ability ability = new LoyaltyAbility(new FightTargetsEffect(), -2);
ability.addTarget(new TargetControlledCreaturePermanent());
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
private DomriAnarchOfBolas(final DomriAnarchOfBolas card) {
super(card);
}
@Override
public DomriAnarchOfBolas copy() {
return new DomriAnarchOfBolas(this);
}
}
class DomriAnarchOfBolasEffect extends OneShotEffect {
DomriAnarchOfBolasEffect() {
super(Outcome.Benefit);
staticText = "Add {R} or {G}. Creature spells you cast this turn can't be countered.";
}
private DomriAnarchOfBolasEffect(final DomriAnarchOfBolasEffect effect) {
super(effect);
}
@Override
public DomriAnarchOfBolasEffect copy() {
return new DomriAnarchOfBolasEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Mana mana = new Mana();
if (player.chooseUse(outcome, "Choose a color of mana to add", null, "Red", "Green", source, game)) {
mana.increaseRed();
} else {
mana.increaseGreen();
}
player.getManaPool().addMana(mana, game, source);
game.addEffect(new CantBeCounteredControlledEffect(StaticFilters.FILTER_SPELL_A_CREATURE, Duration.EndOfTurn), source);
return true;
}
}

View file

@ -55,6 +55,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Defiant Strike", 9, Rarity.COMMON, mage.cards.d.DefiantStrike.class));
cards.add(new SetCardInfo("Demolish", 123, Rarity.COMMON, mage.cards.d.Demolish.class));
cards.add(new SetCardInfo("Devouring Hellion", 124, Rarity.UNCOMMON, mage.cards.d.DevouringHellion.class));
cards.add(new SetCardInfo("Domri, Anarch of Bolas", 191, Rarity.RARE, mage.cards.d.DomriAnarchOfBolas.class));
cards.add(new SetCardInfo("Dovin's Veto", 193, Rarity.UNCOMMON, mage.cards.d.DovinsVeto.class));
cards.add(new SetCardInfo("Dovin, Hand of Control", 229, Rarity.UNCOMMON, mage.cards.d.DovinHandOfControl.class));
cards.add(new SetCardInfo("Dreadhorde Arcanist", 125, Rarity.RARE, mage.cards.d.DreadhordeArcanist.class));