Implemented Tezzeret, Cruel Machinist (may have to change later based on rules)

This commit is contained in:
Evan Kranzler 2018-06-19 08:34:44 -04:00
parent 55a9648321
commit 45d5baed60
2 changed files with 116 additions and 0 deletions

View file

@ -0,0 +1,115 @@
package mage.cards.t;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.AddCardTypeTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
import mage.cards.Card;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.players.Player;
import mage.target.Target;
import mage.target.TargetPermanent;
import mage.target.common.TargetCardInHand;
import mage.target.targetpointer.FixedTarget;
/**
*
* @author TheElk801
*/
public final class TezzeretCruelMachinist extends CardImpl {
public TezzeretCruelMachinist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{4}{U}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.TEZZERET);
this.addAbility(new PlanswalkerEntersWithLoyalityCountersAbility(4));
// +1: Draw a card.
this.addAbility(new LoyaltyAbility(new DrawCardSourceControllerEffect(1), 1));
// 0: Until your next turn, target artifact you control becomes a 5/5 creature in addition to its other types.
Ability ability = new LoyaltyAbility(new AddCardTypeTargetEffect(
Duration.UntilYourNextTurn,
CardType.ARTIFACT,
CardType.CREATURE
).setText("Until your next turn, target artifact you control becomes an artifact creature"), 0);
ability.addEffect(new SetPowerToughnessTargetEffect(
5, 5, Duration.UntilYourNextTurn
).setText("with base power and toughness 5/5"));
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT));
this.addAbility(ability);
// 7: Put any number of cards from your hand onto the battlefield face down. They're 5/5 artifact creatures.
this.addAbility(new LoyaltyAbility(new TezzeretCruelMachinistEffect(), -7));
}
public TezzeretCruelMachinist(final TezzeretCruelMachinist card) {
super(card);
}
@Override
public TezzeretCruelMachinist copy() {
return new TezzeretCruelMachinist(this);
}
}
class TezzeretCruelMachinistEffect extends OneShotEffect {
public TezzeretCruelMachinistEffect() {
super(Outcome.Benefit);
this.staticText = "put any number of cards from your hand onto the battlefield face down. They're 5/5 artifact creatures";
}
public TezzeretCruelMachinistEffect(final TezzeretCruelMachinistEffect effect) {
super(effect);
}
@Override
public TezzeretCruelMachinistEffect copy() {
return new TezzeretCruelMachinistEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
Target target = new TargetCardInHand(0, Integer.MAX_VALUE, StaticFilters.FILTER_CARD);
if (!player.choose(outcome, target, source.getSourceId(), game)) {
return false;
}
Cards cardsToMove = new CardsImpl();
for (UUID cardId : target.getTargets()) {
Card card = game.getCard(cardId);
if (card == null) {
continue;
}
cardsToMove.add(card);
ContinuousEffect effect = new AddCardTypeTargetEffect(Duration.WhileOnBattlefield, CardType.ARTIFACT, CardType.CREATURE);
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1));
game.addEffect(effect, source);
effect = new SetPowerToughnessTargetEffect(5, 5, Duration.WhileOnBattlefield);
effect.setTargetPointer(new FixedTarget(card.getId(), card.getZoneChangeCounter(game) + 1));
game.addEffect(effect, source);
}
return player.moveCards(cardsToMove.getCards(game), Zone.BATTLEFIELD, source, game, false, true, true, null);
}
}

View file

@ -167,6 +167,7 @@ public final class CoreSet2019 extends ExpansionSet {
cards.add(new SetCardInfo("Take Vengeance", 40, Rarity.COMMON, mage.cards.t.TakeVengeance.class));
cards.add(new SetCardInfo("Tattered Mummy", 295, Rarity.COMMON, mage.cards.t.TatteredMummy.class));
cards.add(new SetCardInfo("Tezzeret's Strider", 290, Rarity.UNCOMMON, mage.cards.t.TezzeretsStrider.class));
cards.add(new SetCardInfo("Tezzeret, Cruel Machinist", 286, Rarity.MYTHIC, mage.cards.t.TezzeretCruelMachinist.class));
cards.add(new SetCardInfo("Thornhide Wolves", 204, Rarity.COMMON, mage.cards.t.ThornhideWolves.class));
cards.add(new SetCardInfo("Thud", 163, Rarity.UNCOMMON, mage.cards.t.Thud.class));
cards.add(new SetCardInfo("Timber Gorge", 258, Rarity.COMMON, mage.cards.t.TimberGorge.class));