Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions Mage.Sets/src/mage/cards/d/DoctorDoomKingOfLatveria.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package mage.cards.d;

import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.effects.common.DiscardOneOrMoreCardsTriggeredAbility;
import mage.abilities.effects.common.LoseLifeOpponentsEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.effects.keyword.ConniveTargetEffect;
import mage.abilities.keyword.MenaceAbility;
import mage.abilities.triggers.BeginningOfCombatTriggeredAbility;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.common.FilterLandCard;
import mage.target.common.TargetControlledPermanent;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;

/**
*
* @author muz
*/
public final class DoctorDoomKingOfLatveria extends CardImpl {

private static final FilterCard filter = new FilterLandCard("one or more land cards");
private static final FilterControlledPermanent filter2 =
new FilterControlledPermanent(SubType.VILLAIN, "Villain you control");

public DoctorDoomKingOfLatveria(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{B}{R}");

this.supertype.add(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.NOBLE);
this.subtype.add(SubType.VILLAIN);
this.power = new MageInt(3);
this.toughness = new MageInt(3);

// Whenever you discard one or more land cards, each opponent loses 2 life.
this.addAbility(new DiscardOneOrMoreCardsTriggeredAbility(
Zone.BATTLEFIELD, new LoseLifeOpponentsEffect(2), false, filter
));

// At the beginning of combat on your turn, target Villain you control gains menace until end of turn. It connives.
Ability ability = new BeginningOfCombatTriggeredAbility(
new GainAbilityTargetEffect(new MenaceAbility(false))
);
ability.addEffect(new ConniveTargetEffect().setText("it connives"));
ability.addTarget(new TargetControlledPermanent(filter2));
this.addAbility(ability);
}

private DoctorDoomKingOfLatveria(final DoctorDoomKingOfLatveria card) {
super(card);
}

@Override
public DoctorDoomKingOfLatveria copy() {
return new DoctorDoomKingOfLatveria(this);
}
}
18 changes: 9 additions & 9 deletions Mage.Sets/src/mage/cards/m/MishraExcavationProdigy.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import mage.abilities.costs.common.DiscardCardCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DiscardCardControllerTriggeredAbility;
import mage.abilities.effects.common.DiscardOneOrMoreCardsTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.mana.BasicManaEffect;
import mage.abilities.keyword.HasteAbility;
Expand All @@ -16,19 +16,16 @@
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterCard;
import mage.filter.common.FilterArtifactCard;

import mage.constants.Zone;
import mage.filter.StaticFilters;
import java.util.UUID;

/**
* @author TheElk801
*/
public final class MishraExcavationProdigy extends CardImpl {

private static final FilterCard filter = new FilterArtifactCard("one or more artifact cards");

public MishraExcavationProdigy(UUID ownerId, CardSetInfo setInfo) {
public MishraExcavationProdigy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");

this.supertype.add(SuperType.LEGENDARY);
Expand All @@ -47,8 +44,11 @@ public MishraExcavationProdigy(UUID ownerId, CardSetInfo setInfo) {
this.addAbility(ability);

// Whenever you discard one or more artifact cards, add {R}{R}. This ability triggers only once each turn.
this.addAbility(new DiscardCardControllerTriggeredAbility(
new BasicManaEffect(Mana.RedMana(2)), false, filter
this.addAbility(new DiscardOneOrMoreCardsTriggeredAbility(
Zone.BATTLEFIELD,
new BasicManaEffect(Mana.RedMana(2)),
false,
StaticFilters.FILTER_CARD_ARTIFACTS
).setTriggersLimitEachTurn(1));
}

Expand Down
15 changes: 8 additions & 7 deletions Mage.Sets/src/mage/cards/u/UrzaPowerstoneProdigy.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DiscardCardControllerTriggeredAbility;
import mage.abilities.effects.common.DiscardOneOrMoreCardsTriggeredAbility;
import mage.abilities.effects.common.DrawDiscardControllerEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.FilterCard;
import mage.filter.common.FilterArtifactCard;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.permanent.token.PowerstoneToken;

import java.util.UUID;
Expand All @@ -25,8 +25,6 @@
*/
public final class UrzaPowerstoneProdigy extends CardImpl {

private static final FilterCard filter = new FilterArtifactCard("one or more artifact cards");

public UrzaPowerstoneProdigy(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}");

Expand All @@ -47,8 +45,11 @@ public UrzaPowerstoneProdigy(UUID ownerId, CardSetInfo setInfo) {
this.addAbility(ability);

// Whenever you discard one or more artifact cards, create a tapped Powerstone token. This ability triggers only once each turn.
this.addAbility(new DiscardCardControllerTriggeredAbility(
new CreateTokenEffect(new PowerstoneToken(), 1, true), false, filter
this.addAbility(new DiscardOneOrMoreCardsTriggeredAbility(
Zone.BATTLEFIELD,
new CreateTokenEffect(new PowerstoneToken(), 1, true),
false,
StaticFilters.FILTER_CARD_ARTIFACTS
).setTriggersLimitEachTurn(1));
}

Expand Down
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/MarvelSuperHeroesCommander.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ private MarvelSuperHeroesCommander() {
this.hasBasicLands = false; // temporary

cards.add(new SetCardInfo("Captain America, Team Leader", 5, Rarity.MYTHIC, mage.cards.c.CaptainAmericaTeamLeader.class));
cards.add(new SetCardInfo("Doctor Doom, King of Latveria", 6, Rarity.MYTHIC, mage.cards.d.DoctorDoomKingOfLatveria.class));
cards.add(new SetCardInfo("Human Torch", 3, Rarity.MYTHIC, mage.cards.h.HumanTorch.class));
cards.add(new SetCardInfo("Invisible Woman", 1, Rarity.MYTHIC, mage.cards.i.InvisibleWoman.class));
cards.add(new SetCardInfo("Mister Fantastic", 2, Rarity.MYTHIC, mage.cards.m.MisterFantastic.class));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package org.mage.test.cards.triggers;

import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;

/**
*
* @author muz
*/
public class DoctorDoomKingOfLatveriaTest extends CardTestPlayerBase {

@Test
public void testDoctorDoomKingOfLatveriaLandDiscardTrigger() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
// Target player discards a card.
addCard(Zone.HAND, playerA, "Raven's Crime");

// Whenever you discard one or more land cards, each opponent loses 2 life.
addCard(Zone.BATTLEFIELD, playerB, "Doctor Doom, King of Latveria", 1);
addCard(Zone.HAND, playerB, "Forest", 1);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Raven's Crime", playerB);
// Let choice be autopicked since there is only one option

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertGraveyardCount(playerA, "Raven's Crime", 1);
assertPermanentCount(playerB, "Doctor Doom, King of Latveria", 1);

assertLife(playerA, 18); // -2 from Doctor Doom, King of Latveria's ability
assertLife(playerB, 20);
}

@Test
public void testDoctorDoomKingOfLatveriaNonLandDiscardTrigger() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
// Target player discards a card.
addCard(Zone.HAND, playerA, "Raven's Crime");

// Whenever you discard one or more land cards, each opponent loses 2 life.
addCard(Zone.BATTLEFIELD, playerB, "Doctor Doom, King of Latveria", 1);
addCard(Zone.HAND, playerB, "Lightning Bolt", 1);

castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Raven's Crime", playerB);
// Let choice be autopicked since there is only one option

setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();

assertGraveyardCount(playerA, "Raven's Crime", 1);
assertPermanentCount(playerB, "Doctor Doom, King of Latveria", 1);

assertLife(playerA, 20); // No life lost since a non-land card was discarded
assertLife(playerB, 20);
}

}
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
package mage.abilities.effects.common;

import java.util.Set;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.cards.Card;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.DiscardedCardsEvent;
import mage.game.events.GameEvent;

/**
* @author TheElk801
*/
public class DiscardOneOrMoreCardsTriggeredAbility extends TriggeredAbilityImpl {

private final FilterCard filter;

public DiscardOneOrMoreCardsTriggeredAbility(Effect effect) {
this(effect, false);
}

public DiscardOneOrMoreCardsTriggeredAbility(Effect effect, boolean optional) {
this(Zone.BATTLEFIELD, effect, optional);
this(Zone.BATTLEFIELD, effect, optional, StaticFilters.FILTER_CARD_CARDS);
}

public DiscardOneOrMoreCardsTriggeredAbility(Zone zone, Effect effect, boolean optional) {
public DiscardOneOrMoreCardsTriggeredAbility(Zone zone, Effect effect, boolean optional, FilterCard filter) {
super(zone, effect, optional);
setTriggerPhrase("Whenever you discard one or more cards, ");
this.filter = filter;
setTriggerPhrase("Whenever you discard one or more " + filter.getMessage() + ", ");
}

private DiscardOneOrMoreCardsTriggeredAbility(final DiscardOneOrMoreCardsTriggeredAbility ability) {
super(ability);
this.filter = ability.filter;
}

@Override
Expand All @@ -43,7 +52,13 @@ public boolean checkTrigger(GameEvent event, Game game) {
if (!isControlledBy(event.getPlayerId())) {
return false;
}
this.getEffects().setValue("discarded", event.getAmount());
DiscardedCardsEvent discardedCardsEvent = (DiscardedCardsEvent) event;
Set<Card> discardedCards = discardedCardsEvent.getDiscardedCards().getCards(filter, game);
if (discardedCards.isEmpty()) {
return false;
}

this.getEffects().setValue("discarded", discardedCards.size());
return true;
}
}
1 change: 1 addition & 0 deletions Utils/mtg-cards-data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61792,6 +61792,7 @@ Mister Fantastic|Marvel Super Heroes Commander|2|M|{2}{U}|Legendary Creature - H
Human Torch|Marvel Super Heroes Commander|3|M|{3}{R}|Legendary Creature - Human Hero|3|2|At the beginning of combat on your turn, if you've cast a noncreature spell this turn, Human Torch gains flying, double strike, and haste until end of turn.$Whenever Human Torch attacks, you may pay {R}{G}{W}{U}. If you do, until end of turn, whenever he deals combat damage to an opponent, he deals that much damage to each other opponent.|
The Thing|Marvel Super Heroes Commander|4|M|{5}{G}|Legendary Creature - Human Hero|5|5|Trample$At the beginning of combat on your turn, if you've cast a noncreature spell this turn, put four +1/+1 counters on The Thing.$Whenever The Thing attacks, you may pay {R}{G}{W}{U}. When you do, double the number of each kind of counter on any number of target permanents you control.|
Captain America, Team Leader|Marvel Super Heroes Commander|5|M|{R}{W}{B}|Legendary Creature - Human Soldier Hero|3|3|Whenever another Hero you control enters, it gains vigilance and haste until end of turn. Put a +1/+1 counter on that Hero and a +1/+1 counter on Captain America.|
Doctor Doom, King of Latveria|Marvel Super Heroes Commander|6|M|{1}{U}{B}{R}|Legendary Creature - Human Noble Villain|3|3|Whenever you discard one or more land cards, each opponent loses 2 life.$At the beginning of combat on your turn, target Villain you control gains menace until end of turn. It connives.|
T'Challa, the Black Panther|Marvel Super Heroes Commander|7|M|{1}{G}{W}|Legendary Creature - Human Noble Hero|2|2|Whenever T'Challa enters or attacks, create a tapped Vibranium token.$Whenever you cast an artifact spell with mana value 4 or greater, put two +1/+1 counters on T'Challa.|
Ashling, the Limitless|Lorwyn Eclipsed Commander|1|M|{2}{R}|Legendary Creature - Elemental Sorcerer|2|3|Elemental permanent spells you cast from your hand gain evoke {4} as you cast them.$Whenever you sacrifice a nontoken Elemental, create a token that's a copy of it. The token gains haste until end of turn. At the beginning of your next end step, sacrifice it unless you pay {W}{U}{B}{R}{G}.|
Auntie Ool, Cursewretch|Lorwyn Eclipsed Commander|2|M|{1}{B}{R}{G}|Legendary Creature - Goblin Warlock|4|4|Ward--Blight 2.$Whenever one or more -1/-1 counters are put on a creature, draw a card if you control that creature. If you don't control it, its controller loses 1 life.|
Expand Down