Implemented Domri's Ambush

This commit is contained in:
Evan Kranzler 2019-04-10 15:41:10 -04:00
parent 15ad27ca98
commit 41d3cb7558
2 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.d;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageWithPowerTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreatureOrPlaneswalkerPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DomrisAmbush extends CardImpl {
private static final FilterPermanent filter
= new FilterCreatureOrPlaneswalkerPermanent("creature or planeswalker you don't control");
static {
filter.add(new ControllerPredicate(TargetController.NOT_YOU));
}
public DomrisAmbush(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{R}{G}");
// Put a +1/+1 counter on target creature you control. Then that creature deals damage equal to its power to target creature or planeswalker you don't control.
this.getSpellAbility().addEffect(new DomrisAmbushEffect());
this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
this.getSpellAbility().addTarget(new TargetPermanent(filter));
}
private DomrisAmbush(final DomrisAmbush card) {
super(card);
}
@Override
public DomrisAmbush copy() {
return new DomrisAmbush(this);
}
}
class DomrisAmbushEffect extends OneShotEffect {
DomrisAmbushEffect() {
super(Outcome.Benefit);
staticText = "Put a +1/+1 counter on target creature you control. " +
"Then that creature deals damage equal to its power " +
"to target creature or planeswalker you don't control.";
}
private DomrisAmbushEffect(final DomrisAmbushEffect effect) {
super(effect);
}
@Override
public DomrisAmbushEffect copy() {
return new DomrisAmbushEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
permanent.addCounters(CounterType.P1P1.createInstance(), source, game);
return new DamageWithPowerTargetEffect().apply(game, source);
}
}

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's Ambush", 192, Rarity.UNCOMMON, mage.cards.d.DomrisAmbush.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));