Implemented Vraska, Swarm's Eminence

This commit is contained in:
Evan Kranzler 2019-03-31 20:13:39 -04:00
parent a493f26b4f
commit 3dd6836559
3 changed files with 137 additions and 0 deletions

View file

@ -0,0 +1,61 @@
package mage.cards.v;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
import mage.abilities.common.PlaneswalkerEntersWithLoyaltyCountersAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SetTargetPointer;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.permanent.token.AssassinToken2;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class VraskaSwarmsEminence extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent("creature you control with deathtouch");
static {
filter.add(new AbilityPredicate(DeathtouchAbility.class));
}
public VraskaSwarmsEminence(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{B/G}{B/G}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.VRASKA);
this.addAbility(new PlaneswalkerEntersWithLoyaltyCountersAbility(5));
// Whenever a creature you control with deathtouch deals damage to a player or planeswalker, put a +1/+1 counter on that creature.
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
new AddCountersTargetEffect(
CounterType.P1P1.createInstance()
).setText("put a +1/+1 counter on that creature"),
filter, false, SetTargetPointer.PERMANENT, false)
);
// -2: Create a 1/1 black Assassin creature token with deathtouch and "Whenever this creature deals damage to a planeswalker, destroy that planeswalker."
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new AssassinToken2()), -2));
}
private VraskaSwarmsEminence(final VraskaSwarmsEminence card) {
super(card);
}
@Override
public VraskaSwarmsEminence copy() {
return new VraskaSwarmsEminence(this);
}
}

View file

@ -60,6 +60,7 @@ public final class WarOfTheSpark extends ExpansionSet {
cards.add(new SetCardInfo("Tibalt, Rakish Instigator", 146, Rarity.UNCOMMON, mage.cards.t.TibaltRakishInstigator.class));
cards.add(new SetCardInfo("Time Wipe", 223, Rarity.RARE, mage.cards.t.TimeWipe.class));
cards.add(new SetCardInfo("Vraska's Finisher", 112, Rarity.COMMON, mage.cards.v.VraskasFinisher.class));
cards.add(new SetCardInfo("Vraska, Swarm's Eminence", 236, Rarity.UNCOMMON, mage.cards.v.VraskaSwarmsEminence.class));
cards.add(new SetCardInfo("Widespread Brutality", 226, Rarity.RARE, mage.cards.w.WidespreadBrutality.class));
}
}

View file

@ -0,0 +1,75 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.target.targetpointer.FixedTarget;
/**
* @author TheElk801
*/
public final class AssassinToken2 extends TokenImpl {
public AssassinToken2() {
super("Assassin", "1/1 black Assassin creature token with deathtouch and \"Whenever this creature deals damage to a planeswalker, destroy that planeswalker.\"");
cardType.add(CardType.CREATURE);
color.setBlack(true);
subtype.add(SubType.ASSASSIN);
power = new MageInt(1);
toughness = new MageInt(1);
addAbility(DeathtouchAbility.getInstance());
addAbility(new AssassinToken2TriggeredAbility());
}
private AssassinToken2(final AssassinToken2 token) {
super(token);
}
public AssassinToken2 copy() {
return new AssassinToken2(this);
}
}
class AssassinToken2TriggeredAbility extends TriggeredAbilityImpl {
AssassinToken2TriggeredAbility() {
super(Zone.BATTLEFIELD, new DestroyTargetEffect());
}
private AssassinToken2TriggeredAbility(final AssassinToken2TriggeredAbility effect) {
super(effect);
}
@Override
public AssassinToken2TriggeredAbility copy() {
return new AssassinToken2TriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getSourceId().equals(getSourceId())) {
for (Effect effect : this.getAllEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}
return false;
}
@Override
public String getRule() {
return "Whenever this creature deals damage to a planeswalker, destroy that planeswalker.";
}
}