[ZNR] Implemented Zulaport Duelist

This commit is contained in:
Evan Kranzler 2020-09-03 13:10:35 -04:00
parent aadc74c8a2
commit 02b573df36
2 changed files with 84 additions and 0 deletions

View file

@ -0,0 +1,83 @@
package mage.cards.z;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
/**
* @author TheElk801
*/
public final class ZulaportDuelist extends CardImpl {
public ZulaportDuelist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// Flash
this.addAbility(FlashAbility.getInstance());
// When Zulaport Duelist enters the battlefield, up to one target creature gets -2/-0 until end of turn. Its controller mills two cards.
Ability ability = new EntersBattlefieldTriggeredAbility(new ZulaportDuelistEffect());
ability.addTarget(new TargetCreaturePermanent(0, 1));
this.addAbility(ability);
}
private ZulaportDuelist(final ZulaportDuelist card) {
super(card);
}
@Override
public ZulaportDuelist copy() {
return new ZulaportDuelist(this);
}
}
class ZulaportDuelistEffect extends OneShotEffect {
ZulaportDuelistEffect() {
super(Outcome.Benefit);
staticText = "up to one target creature gets -2/-0 until end of turn. Its controller mills two cards";
}
private ZulaportDuelistEffect(final ZulaportDuelistEffect effect) {
super(effect);
}
@Override
public ZulaportDuelistEffect copy() {
return new ZulaportDuelistEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
game.addEffect(new BoostTargetEffect(-2, 0), source);
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
Player player = game.getPlayer(permanent.getControllerId());
if (player == null) {
return false;
}
player.millCards(2, source, game);
return true;
}
}

View file

@ -141,6 +141,7 @@ public final class ZendikarRising extends ExpansionSet {
cards.add(new SetCardInfo("Tazri, Beacon of Unity", 44, Rarity.MYTHIC, mage.cards.t.TazriBeaconOfUnity.class));
cards.add(new SetCardInfo("Timbercrown Pathway", 261, Rarity.RARE, mage.cards.t.TimbercrownPathway.class));
cards.add(new SetCardInfo("Windrider Wizard", 87, Rarity.UNCOMMON, mage.cards.w.WindriderWizard.class));
cards.add(new SetCardInfo("Zulaport Duelist", 88, Rarity.COMMON, mage.cards.z.ZulaportDuelist.class));
cards.removeIf(setCardInfo -> unfinished.contains(setCardInfo.getName())); // remove when mechanics are fully implemented
}