Implemented Ravager Wurm

This commit is contained in:
Evan Kranzler 2019-01-03 21:09:39 -05:00
parent b459c208e4
commit a7b0f05890
3 changed files with 88 additions and 9 deletions

View file

@ -0,0 +1,82 @@
package mage.cards.r;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.FightTargetSourceEffect;
import mage.abilities.keyword.RiotAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityType;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RavagerWurm extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("land with an activated ability that isn't a mana ability");
static {
filter.add(RavagerWurmPredicate.instance);
}
public RavagerWurm(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{G}{G}");
this.subtype.add(SubType.WURM);
this.power = new MageInt(4);
this.toughness = new MageInt(5);
// Riot
this.addAbility(new RiotAbility());
// When Ravager Wurm enters the battlefield, choose up to one
// Ravager Wurm fights target creature you don't control.
Ability ability = new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect().setText("{this} fights target creature you don't control"), false);
ability.getModes().setMinModes(0);
ability.getModes().setMaxModes(1);
// Destroy target land with an activated ability that isn't a mana ability.
Mode mode = new Mode(new DestroyTargetEffect());
mode.addTarget(new TargetPermanent(filter));
ability.addMode(mode);
this.addAbility(ability);
}
private RavagerWurm(final RavagerWurm card) {
super(card);
}
@Override
public RavagerWurm copy() {
return new RavagerWurm(this);
}
}
enum RavagerWurmPredicate implements Predicate<Permanent> {
instance;
@Override
public boolean apply(Permanent input, Game game) {
if (input == null || !input.isLand()) {
return false;
}
for (Ability ability : input.getAbilities()) {
if (ability.getAbilityType() == AbilityType.ACTIVATED) {
return true;
}
}
return false;
}
}

View file

@ -77,6 +77,7 @@ public final class RavnicaAllegiance extends ExpansionSet {
cards.add(new SetCardInfo("Rakdos Guildgate", 255, Rarity.COMMON, mage.cards.r.RakdosGuildgate.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Rakdos Guildgate", 256, Rarity.COMMON, mage.cards.r.RakdosGuildgate.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Rakdos Locket", 237, Rarity.COMMON, mage.cards.r.RakdosLocket.class));
cards.add(new SetCardInfo("Ravager Wurm", 200, Rarity.MYTHIC, mage.cards.r.RavagerWurm.class));
cards.add(new SetCardInfo("Rix Maadi Reveler", 109, Rarity.RARE, mage.cards.r.RixMaadiReveler.class));
cards.add(new SetCardInfo("Seraph of the Scales", 205, Rarity.MYTHIC, mage.cards.s.SeraphOfTheScales.class));
cards.add(new SetCardInfo("Simic Ascendancy", 207, Rarity.RARE, mage.cards.s.SimicAscendancy.class));

View file

@ -1,13 +1,6 @@
package mage.abilities;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mage.abilities.costs.OptionalAdditionalModeSourceCosts;
import mage.cards.Card;
import mage.constants.Outcome;
@ -18,8 +11,9 @@ import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
import java.util.*;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Modes extends LinkedHashMap<UUID, Mode> {
@ -340,7 +334,9 @@ public class Modes extends LinkedHashMap<UUID, Mode> {
StringBuilder sb = new StringBuilder();
if (this.getMaxModesFilter() != null) {
sb.append("choose one or more. Each mode must target ").append(getMaxModesFilter().getMessage());
} else if (this.getMinModes() == 1 && this.getMaxModes() == 3) {
} else if (this.getMinModes() == 0 && this.getMaxModes() == 1) {
sb.append("choose up to one ");
} else if (this.getMinModes() == 1 && this.getMaxModes() > 2) {
sb.append("choose one or more ");
} else if (this.getMinModes() == 1 && this.getMaxModes() == 2) {
sb.append("choose one or both ");