From ebae1b9c17db6929a61b59a5f4b322eec0297e92 Mon Sep 17 00:00:00 2001 From: fireshoes Date: Sun, 8 Mar 2015 00:11:36 -0600 Subject: [PATCH] [DTK] Added Dragonlord Ojutai, Acid-Spewer Dragon, Stormwing Dragon, Cunning Breezedancer --- .../dragonsoftarkir/AcidSpewerDragon.java | 87 +++++ .../dragonsoftarkir/CunningBreezedancer.java | 77 +++++ .../dragonsoftarkir/DragonlordOjutai.java | 86 +++++ .../sets/dragonsoftarkir/StormwingDragon.java | 87 +++++ .../sets/fatereforged/JeskaiInfiltrator.java | 303 +++++++++--------- Utils/mtg-cards-data.txt | 3 +- 6 files changed, 489 insertions(+), 154 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/dragonsoftarkir/AcidSpewerDragon.java create mode 100644 Mage.Sets/src/mage/sets/dragonsoftarkir/CunningBreezedancer.java create mode 100644 Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordOjutai.java create mode 100644 Mage.Sets/src/mage/sets/dragonsoftarkir/StormwingDragon.java diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/AcidSpewerDragon.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/AcidSpewerDragon.java new file mode 100644 index 00000000000..692e5e01660 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/AcidSpewerDragon.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dragonsoftarkir; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.DeathtouchAbility; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author fireshoes + */ +public class AcidSpewerDragon extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("each other Dragon creature you control"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new SubtypePredicate("Dragon")); + } + + public AcidSpewerDragon(UUID ownerId) { + super(ownerId, 86, "Acid-Spewer Dragon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{B}"); + this.expansionSetCode = "DTK"; + this.subtype.add("Dragon"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Deathtouch + this.addAbility(DeathtouchAbility.getInstance()); + + // Megamorph {5}{B}{B} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{5}{B}{B}"), true)); + + // When Acid-Spewer Dragon is turned face up, put a +1/+1 counter on each other Dragon creature you control. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), false, false)); + } + + public AcidSpewerDragon(final AcidSpewerDragon card) { + super(card); + } + + @Override + public AcidSpewerDragon copy() { + return new AcidSpewerDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/CunningBreezedancer.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/CunningBreezedancer.java new file mode 100644 index 00000000000..4bb654658e2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/CunningBreezedancer.java @@ -0,0 +1,77 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dragonsoftarkir; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; + +/** + * + * @author fireshoes + */ +public class CunningBreezedancer extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("a noncreature spell"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE))); + } + + public CunningBreezedancer(UUID ownerId) { + super(ownerId, 215, "Cunning Breezedancer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}{U}"); + this.expansionSetCode = "DTK"; + this.subtype.add("Dragon"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Whenever you cast a noncreature spell, Cunning Breezedancer gets +2/+2 until end of turn. + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect(2, 2, Duration.EndOfTurn), filter, false)); + } + + public CunningBreezedancer(final CunningBreezedancer card) { + super(card); + } + + @Override + public CunningBreezedancer copy() { + return new CunningBreezedancer(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordOjutai.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordOjutai.java new file mode 100644 index 00000000000..3becfe1fda1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/DragonlordOjutai.java @@ -0,0 +1,86 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dragonsoftarkir; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.InvertCondition; +import mage.abilities.condition.common.SourceTappedCondition; +import mage.abilities.decorator.ConditionalContinuousEffect; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.LookLibraryAndPickControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilitySourceEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; + +/** + * + * @author fireshoes + */ +public class DragonlordOjutai extends CardImpl { + + public DragonlordOjutai(UUID ownerId) { + super(ownerId, 219, "Dragonlord Ojutai", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{W}{U}"); + this.expansionSetCode = "DTK"; + this.supertype.add("Legendary"); + this.subtype.add("Elder"); + this.subtype.add("Dragon"); + this.power = new MageInt(5); + this.toughness = new MageInt(4); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // Dragonlord Ojutai has hexproof as long as it's untapped. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( + new GainAbilitySourceEffect(HexproofAbility.getInstance(), Duration.WhileOnBattlefield), + new InvertCondition(new SourceTappedCondition()), + "{this} has hexproof as long as it's untapped"))); + + // Whenever Dragonlord Ojutai deals combat damage to a player, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LookLibraryAndPickControllerEffect + (new StaticValue(3), false, new StaticValue(1), new FilterCard(), Zone.LIBRARY, false, false), false)); + } + + public DragonlordOjutai(final DragonlordOjutai card) { + super(card); + } + + @Override + public DragonlordOjutai copy() { + return new DragonlordOjutai(this); + } +} diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/StormwingDragon.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/StormwingDragon.java new file mode 100644 index 00000000000..529672b28dd --- /dev/null +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/StormwingDragon.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.dragonsoftarkir; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.TurnedFaceUpSourceTriggeredAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.counter.AddCountersAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.MorphAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.counters.CounterType; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AnotherPredicate; + +/** + * + * @author fireshoes + */ +public class StormwingDragon extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("each other Dragon creature you control"); + + static { + filter.add(new AnotherPredicate()); + filter.add(new SubtypePredicate("Dragon")); + } + + public StormwingDragon(UUID ownerId) { + super(ownerId, 159, "Stormwing Dragon", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{R}"); + this.expansionSetCode = "DTK"; + this.subtype.add("Dragon"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + + // First strike + this.addAbility(FirstStrikeAbility.getInstance()); + + // Megamorph {5}{R}{R} + this.addAbility(new MorphAbility(this, new ManaCostsImpl("{5}{R}{R}"), true)); + + // When Stormwing Dragon is turned face up, put a +1/+1 counter on each other Dragon creature you control. + this.addAbility(new TurnedFaceUpSourceTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), filter), false, false)); + } + + public StormwingDragon(final StormwingDragon card) { + super(card); + } + + @Override + public StormwingDragon copy() { + return new StormwingDragon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java b/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java index f487de9e396..b623bea79a1 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java +++ b/Mage.Sets/src/mage/sets/fatereforged/JeskaiInfiltrator.java @@ -1,153 +1,150 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ -package mage.sets.fatereforged; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.UUID; -import mage.MageInt; -import mage.MageObjectReference; -import mage.abilities.Ability; -import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; -import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.condition.common.OneControlledCreatureCondition; -import mage.abilities.costs.mana.ManaCost; -import mage.abilities.costs.mana.ManaCosts; -import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalRestrictionEffect; -import mage.abilities.effects.ContinuousEffect; -import mage.abilities.effects.Effect; -import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.combat.UnblockableSourceEffect; -import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect; -import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect.FaceDownType; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.targetpointer.FixedTarget; - -/** - * - * @author emerald000 - */ -public class JeskaiInfiltrator extends CardImpl { - - public JeskaiInfiltrator(UUID ownerId) { - super(ownerId, 36, "Jeskai Infiltrator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}"); - this.expansionSetCode = "FRF"; - this.subtype.add("Human"); - this.subtype.add("Monk"); - this.power = new MageInt(2); - this.toughness = new MageInt(3); - - // Jeskai Infiltrator can't be blocked as long as you control no other creatures. - Effect effect = new ConditionalRestrictionEffect(new UnblockableSourceEffect(), new OneControlledCreatureCondition()); - effect.setText("{this} can't be blocked as long as you control no other creatures"); - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); - - // Whenever Jeskai Infiltrator deals combat damage to a player, exile it and the top card of your library in a face-down pile, shuffle that pile, then manifest those cards. - this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new JeskaiInfiltratorEffect(), false)); - } - - public JeskaiInfiltrator(final JeskaiInfiltrator card) { - super(card); - } - - @Override - public JeskaiInfiltrator copy() { - return new JeskaiInfiltrator(this); - } -} - -class JeskaiInfiltratorEffect extends OneShotEffect { - - JeskaiInfiltratorEffect() { - super(Outcome.PutCreatureInPlay); - this.staticText = "exile it and the top card of your library in a face-down pile, shuffle that pile, then manifest those cards"; - } - - JeskaiInfiltratorEffect(final JeskaiInfiltratorEffect effect) { - super(effect); - } - - @Override - public JeskaiInfiltratorEffect copy() { - return new JeskaiInfiltratorEffect(this); - } - - @Override - public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player != null) { - List cardsToManifest = new ArrayList<>(2); - Permanent sourcePermanent = game.getPermanent(source.getSourceId()); - Card sourceCard = game.getCard(source.getSourceId()); - if (sourcePermanent != null && sourceCard != null) { - player.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD); - sourceCard.setFaceDown(true); - cardsToManifest.add(sourceCard); - } - if (sourcePermanent!= null && player.getLibrary().size() > 0) { - Card cardFromLibrary = player.getLibrary().removeFromTop(game); - cardFromLibrary.setFaceDown(true); - player.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.LIBRARY); - cardsToManifest.add(cardFromLibrary); - } - Collections.shuffle(cardsToManifest); - game.fireUpdatePlayersEvent(); // removes Jeskai from Battlefield, so he returns as a fresh permanent to the battlefield with new position - Ability newSource = source.copy(); - newSource.setWorksFaceDown(true); - for (Card card : cardsToManifest) { - card.setFaceDown(true); - ManaCosts manaCosts = null; - if (card.getCardType().contains(CardType.CREATURE)) { - manaCosts = card.getSpellAbility().getManaCosts(); - if (manaCosts == null) { - manaCosts = new ManaCostsImpl("{0}"); - } - } - MageObjectReference objectReference= new MageObjectReference(card.getId(), card.getZoneChangeCounter() +1, game); - game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource); - if (card.moveToZone(Zone.BATTLEFIELD, newSource.getSourceId(), game, false)) { - game.informPlayers(new StringBuilder(player.getName()) - .append(" puts facedown card from exile onto the battlefield").toString()); - } - } - return true; - } - return false; - } -} +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.fatereforged; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.UUID; +import mage.MageInt; +import mage.MageObjectReference; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.OneControlledCreatureCondition; +import mage.abilities.costs.mana.ManaCosts; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.decorator.ConditionalRestrictionEffect; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.combat.UnblockableSourceEffect; +import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect; +import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect.FaceDownType; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author emerald000 + */ +public class JeskaiInfiltrator extends CardImpl { + + public JeskaiInfiltrator(UUID ownerId) { + super(ownerId, 36, "Jeskai Infiltrator", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}"); + this.expansionSetCode = "FRF"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // Jeskai Infiltrator can't be blocked as long as you control no other creatures. + Effect effect = new ConditionalRestrictionEffect(new UnblockableSourceEffect(), new OneControlledCreatureCondition()); + effect.setText("{this} can't be blocked as long as you control no other creatures"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + + // Whenever Jeskai Infiltrator deals combat damage to a player, exile it and the top card of your library in a face-down pile, shuffle that pile, then manifest those cards. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new JeskaiInfiltratorEffect(), false)); + } + + public JeskaiInfiltrator(final JeskaiInfiltrator card) { + super(card); + } + + @Override + public JeskaiInfiltrator copy() { + return new JeskaiInfiltrator(this); + } +} + +class JeskaiInfiltratorEffect extends OneShotEffect { + + JeskaiInfiltratorEffect() { + super(Outcome.PutCreatureInPlay); + this.staticText = "exile it and the top card of your library in a face-down pile, shuffle that pile, then manifest those cards"; + } + + JeskaiInfiltratorEffect(final JeskaiInfiltratorEffect effect) { + super(effect); + } + + @Override + public JeskaiInfiltratorEffect copy() { + return new JeskaiInfiltratorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + List cardsToManifest = new ArrayList<>(2); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + Card sourceCard = game.getCard(source.getSourceId()); + if (sourcePermanent != null && sourceCard != null) { + player.moveCardToExileWithInfo(sourcePermanent, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.BATTLEFIELD); + sourceCard.setFaceDown(true); + cardsToManifest.add(sourceCard); + } + if (sourcePermanent!= null && player.getLibrary().size() > 0) { + Card cardFromLibrary = player.getLibrary().removeFromTop(game); + cardFromLibrary.setFaceDown(true); + player.moveCardToExileWithInfo(cardFromLibrary, sourcePermanent.getId(), sourcePermanent.getName(), source.getSourceId(), game, Zone.LIBRARY); + cardsToManifest.add(cardFromLibrary); + } + Collections.shuffle(cardsToManifest); + game.fireUpdatePlayersEvent(); // removes Jeskai from Battlefield, so he returns as a fresh permanent to the battlefield with new position + Ability newSource = source.copy(); + newSource.setWorksFaceDown(true); + for (Card card : cardsToManifest) { + card.setFaceDown(true); + ManaCosts manaCosts = null; + if (card.getCardType().contains(CardType.CREATURE)) { + manaCosts = card.getSpellAbility().getManaCosts(); + if (manaCosts == null) { + manaCosts = new ManaCostsImpl("{0}"); + } + } + MageObjectReference objectReference= new MageObjectReference(card.getId(), card.getZoneChangeCounter() +1, game); + game.addEffect(new BecomesFaceDownCreatureEffect(manaCosts, objectReference, Duration.Custom, FaceDownType.MANIFESTED), newSource); + if (card.moveToZone(Zone.BATTLEFIELD, newSource.getSourceId(), game, false)) { + game.informPlayers(new StringBuilder(player.getName()) + .append(" puts facedown card from exile onto the battlefield").toString()); + } + } + return true; + } + return false; + } +} diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt index b8a4bebd8f1..457186c6935 100644 --- a/Utils/mtg-cards-data.txt +++ b/Utils/mtg-cards-data.txt @@ -25716,7 +25716,8 @@ Sunbringer's Touch|Dragons of Tarkir|209|R|{2}{G}{G}|Sorcery|||Bolster X, where Arashin Sovereign|Dragons of Tarkir|212|R|{5}{G}{W}|Creature - Dragon|6|6|Flying$When Arashin Sovereign dies, you may put it on the top or bottom of its owner's library.| Atarka's Command|Dragons of Tarkir|213|R|{R}{G}|Instant|||Choose two - Your opponents can't gain life this turn; or Atarka's Command deals 3 damage to each opponent; or You may put a land card from your hand onto the battlefield; or Creatures you control get +1/+1 and gain reach until the end of turn.| Boltwing Marauder|Dragons of Tarkir|214|R|{3}{B}{R}|Creature - Dragon|5|4|Flying$Whenever another creature enters the battlefield under your control, target creature gets +2/+0 until end of turn.| -Dragonlord Atarka|Dragons of Tarkir|216|M|{5}{R}{G}|Legendary Creature - Elder Dragon|8|8|Flying, trample$When Dragonlord Atarka enters the battlefield, it deals 5 damage divided as you choose among any number of target creatures and/or planeswalkers you opponents control.| +Cunning Breezedancer|Dragons of Tarkir|215|U|{4}{W}{U}|Creature - Dragon|4|4|Flying$Whenever you cast a noncreature spell, Cunning Breezedancer gets +2/+2 until end of turn.| +Dragonlord Atarka|Dragons of Tarkir|216|M|{5}{R}{G}|Legendary Creature - Elder Dragon|8|8|Flying, trample$When Dragonlord Atarka enters the battlefield, it deals 5 damage divided as you choose among any number of target creatures and/or planeswalkers your opponents control.| Dragonlord Dromoka|Dragons of Tarkir|217|M|{4}{G}{W}|Legendary Creature - Elder Dragon|5|7|Dragonlord Dromoka can't be countered$Flying, lifelink$Your opponents can't cast spells during your turn.| Dragonlord Kolaghan|Dragons of Tarkir|218|{4}{B}{R}|Legendary Creature - Elder Dragon|6|5|Flying$Haste$Other creatures you control have haste.$Whenever an opponent casts a creature or planeswalker spell with the same name as a card in their graveyard, that player loses 10 life.| Dragonlord Ojutai|Dragons of Tarkir|219|M|{3}{W}{U}|Legendary Creature - Elder Dragon|5|4|Flying$Dragonlord Ojutai has hexproof as long as it's untapped.$Whenever Dragonlord Ojutai deals combat damage to a player, look at the top three cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.|