Implemented Dockside Extortionist

This commit is contained in:
Evan Kranzler 2019-08-06 15:11:42 -04:00
parent 36a0a34585
commit 9754542be2
2 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,76 @@
package mage.cards.d;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.TreasureToken;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class DocksideExtortionist extends CardImpl {
public DocksideExtortionist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.subtype.add(SubType.GOBLIN);
this.subtype.add(SubType.PIRATE);
this.power = new MageInt(1);
this.toughness = new MageInt(2);
// When Dockside Extortionist enters the battlefield, create X Treasure tokens, where X is the number of artifacts and enchantments your opponents control.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new CreateTokenEffect(new TreasureToken(), DocksideExtortionistValue.instance)
));
}
private DocksideExtortionist(final DocksideExtortionist card) {
super(card);
}
@Override
public DocksideExtortionist copy() {
return new DocksideExtortionist(this);
}
}
enum DocksideExtortionistValue implements DynamicValue {
instance;
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
return game
.getOpponents(sourceAbility.getControllerId())
.stream()
.mapToInt(uuid -> game.getBattlefield().getAllActivePermanents(
StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT, uuid, game
).size())
.sum();
}
@Override
public DocksideExtortionistValue copy() {
return instance;
}
@Override
public String getMessage() {
return "the number of artifacts and enchantments your opponents control";
}
@Override
public String toString() {
return "X";
}
}

View file

@ -29,6 +29,7 @@ public final class Commander2019Edition extends ExpansionSet {
cards.add(new SetCardInfo("Clever Impersonator", 82, Rarity.MYTHIC, mage.cards.c.CleverImpersonator.class));
cards.add(new SetCardInfo("Deathmist Raptor", 160, Rarity.MYTHIC, mage.cards.d.DeathmistRaptor.class));
cards.add(new SetCardInfo("Den Protector", 161, Rarity.RARE, mage.cards.d.DenProtector.class));
cards.add(new SetCardInfo("Dockside Extortionist", 24, Rarity.RARE, mage.cards.d.DocksideExtortionist.class));
cards.add(new SetCardInfo("Farseek", 165, Rarity.COMMON, mage.cards.f.Farseek.class));
cards.add(new SetCardInfo("Forest", 300, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Gerrard, Weatherlight Hero", 41, Rarity.RARE, mage.cards.g.GerrardWeatherlightHero.class));