Implemented Rankle, Master of Pranks

This commit is contained in:
Evan Kranzler 2019-09-04 10:11:49 -04:00
parent dd3bedb5c0
commit 52279895cf
4 changed files with 77 additions and 7 deletions

View file

@ -0,0 +1,67 @@
package mage.cards.r;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.common.DrawCardAllEffect;
import mage.abilities.effects.common.LoseLifeAllPlayersEffect;
import mage.abilities.effects.common.SacrificeAllEffect;
import mage.abilities.effects.common.discard.DiscardEachPlayerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.filter.StaticFilters;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RankleMasterOfPranks extends CardImpl {
public RankleMasterOfPranks(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.FAERIE);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(3);
this.toughness = new MageInt(3);
// Flying
this.addAbility(FlyingAbility.getInstance());
// Haste
this.addAbility(HasteAbility.getInstance());
// Whenever Rankle, Master of Pranks deals combat damage to a player, choose any number
// Each player discards a card.
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardEachPlayerEffect(), false);
// Each player loses 1 life and draws a card.
Mode mode = new Mode(new LoseLifeAllPlayersEffect(1));
mode.addEffect(new DrawCardAllEffect(1).setText("and draws a card"));
ability.addMode(mode);
// Each player sacrifices a creature.
ability.addMode(new Mode(new SacrificeAllEffect(StaticFilters.FILTER_CONTROLLED_CREATURE_SHORT_TEXT)));
ability.getModes().setMinModes(0);
ability.getModes().setMaxModes(3);
this.addAbility(ability);
}
private RankleMasterOfPranks(final RankleMasterOfPranks card) {
super(card);
}
@Override
public RankleMasterOfPranks copy() {
return new RankleMasterOfPranks(this);
}
}

View file

@ -33,6 +33,7 @@ public final class ThroneOfEldraine extends ExpansionSet {
cards.add(new SetCardInfo("Gilded Goose", 160, Rarity.RARE, mage.cards.g.GildedGoose.class));
cards.add(new SetCardInfo("Golden Egg", 220, Rarity.COMMON, mage.cards.g.GoldenEgg.class));
cards.add(new SetCardInfo("Maraleaf Pixie", 196, Rarity.UNCOMMON, mage.cards.m.MaraleafPixie.class));
cards.add(new SetCardInfo("Rankle, Master of Pranks", 356, Rarity.MYTHIC, mage.cards.r.RankleMasterOfPranks.class));
cards.add(new SetCardInfo("Run Away Together", 62, Rarity.COMMON, mage.cards.r.RunAwayTogether.class));
cards.add(new SetCardInfo("Tome Raider", 68, Rarity.COMMON, mage.cards.t.TomeRaider.class));
cards.add(new SetCardInfo("Wishful Merfolk", 73, Rarity.COMMON, mage.cards.w.WishfulMerfolk.class));

View file

@ -336,6 +336,8 @@ public class Modes extends LinkedHashMap<UUID, Mode> {
sb.append("choose one or more. Each mode must target ").append(getMaxModesFilter().getMessage());
} else if (this.getMinModes() == 0 && this.getMaxModes() == 1) {
sb.append("choose up to one");
} else if (this.getMinModes() == 0 && this.getMaxModes() == 3) {
sb.append("choose any number");
} else if (this.getMinModes() == 1 && this.getMaxModes() > 2) {
sb.append("choose one or more");
} else if (this.getMinModes() == 1 && this.getMaxModes() == 2) {

View file

@ -1,9 +1,6 @@
package mage.abilities.effects.common;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.dynamicvalue.common.StaticValue;
@ -16,8 +13,11 @@ import mage.players.Player;
import mage.target.common.TargetControlledPermanent;
import mage.util.CardUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class SacrificeAllEffect extends OneShotEffect {
@ -86,10 +86,10 @@ public class SacrificeAllEffect extends OneShotEffect {
sb.append("each player sacrifices ");
if (amount.toString().equals("X")) {
sb.append(amount.toString());
} else {
sb.append(CardUtil.numberToText(amount.toString(), "a"));
sb.append(' ');
} else if (!filter.getMessage().startsWith("a ")) {
sb.append(CardUtil.numberToText(amount.toString(), "a "));
}
sb.append(' ');
sb.append(filter.getMessage());
staticText = sb.toString();
}