diff --git a/Mage.Sets/src/mage/sets/gatecrash/BorborygmosEnraged.java b/Mage.Sets/src/mage/sets/gatecrash/BorborygmosEnraged.java new file mode 100644 index 0000000000..23a4445be2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/BorborygmosEnraged.java @@ -0,0 +1,135 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardTargetCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.common.FilterLandCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author Plopman + */ +public class BorborygmosEnraged extends CardImpl { + + public BorborygmosEnraged(UUID ownerId) { + super(ownerId, 147, "Borborygmos Enraged", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{R}{R}{G}{G}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Cyclops"); + + this.supertype.add("Legendary"); + + this.color.setGreen(true); + this.color.setRed(true); + + this.power = new MageInt(7); + this.toughness = new MageInt(6); + + //Trample + this.addAbility(TrampleAbility.getInstance()); + + //Whenever Borborygmous Enraged deals combat damage to a player, reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new BorborygmosEnragedEffect(), false, false)); + + //Discard a land card: Borborygmos Enraged deals 3 damage to target creature or player + Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new DamageTargetEffect(3), new DiscardTargetCost(new TargetCardInHand(new FilterLandCard()))); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public BorborygmosEnraged(final BorborygmosEnraged card) { + super(card); + } + + @Override + public BorborygmosEnraged copy() { + return new BorborygmosEnraged(this); + } +} + +class BorborygmosEnragedEffect extends OneShotEffect { + + public BorborygmosEnragedEffect() { + super(Constants.Outcome.DrawCard); + this.staticText = "reveal the top three cards of your library. Put all land cards revealed this way into your hand and the rest into your graveyard"; + } + + public BorborygmosEnragedEffect(final BorborygmosEnragedEffect effect) { + super(effect); + } + + @Override + public BorborygmosEnragedEffect copy() { + return new BorborygmosEnragedEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Cards cards = new CardsImpl(Constants.Zone.PICK); + int count = Math.min(player.getLibrary().size(), 3); + for (int i = 0; i < count; i++) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + game.setZone(card.getId(), Constants.Zone.PICK); + if (card.getCardType().contains(CardType.LAND)) { + card.moveToZone(Constants.Zone.HAND, source.getId(), game, true); + } else { + card.moveToZone(Constants.Zone.GRAVEYARD, source.getId(), game, false); + } + } + } + + if (!cards.isEmpty()) { + player.revealCards("Borborygmous Enraged", cards, game); + return true; + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/BorosCharm.java b/Mage.Sets/src/mage/sets/gatecrash/BorosCharm.java new file mode 100644 index 0000000000..e1e7d41987 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/BorosCharm.java @@ -0,0 +1,82 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import javax.xml.datatype.Duration; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Mode; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.IndestructibleAllEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.DoubleStrikeAbility; +import mage.abilities.keyword.IndestructibleAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledPermanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class BorosCharm extends CardImpl { + + public BorosCharm (UUID ownerId) { + super(ownerId, 148, "Boros Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}{W}"); + this.expansionSetCode = "GTC"; + + this.color.setBlue(true); + this.color.setGreen(true); + + //Choose one - Boros Charm deals 4 damage to target player + this.getSpellAbility().addEffect(new DamageTargetEffect(4)); + this.getSpellAbility().addTarget(new TargetPlayer()); + //or permanents you control are indestructible this turn + Mode mode = new Mode(); + mode.getEffects().add(new IndestructibleAllEffect(new FilterControlledPermanent(), Constants.Duration.EndOfTurn)); + this.getSpellAbility().addMode(mode); + //or target creature gains double strike until end of turn. + Mode mode2 = new Mode(); + mode2.getEffects().add(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Constants.Duration.EndOfTurn)); + mode2.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode2); + } + + public BorosCharm(final BorosCharm card) { + super(card); + } + + @Override + public BorosCharm copy() { + return new BorosCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/HandsOfBinding.java b/Mage.Sets/src/mage/sets/gatecrash/HandsOfBinding.java new file mode 100644 index 0000000000..1b81cb4818 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/HandsOfBinding.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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.effects.common.CipherEffect; +import mage.abilities.effects.common.SkipNextUntapTargetEffect; +import mage.abilities.effects.common.TapTargetEffect; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class HandsOfBinding extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + static{ + filter.add(new ControllerPredicate(Constants.TargetController.OPPONENT)); + } + + public HandsOfBinding (UUID ownerId) { + super(ownerId, 37, "Hands of Binding", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{U}"); + this.expansionSetCode = "GTC"; + + this.color.setBlue(true); + + //Tap target creature an opponent controls. That creature doesn't untap during its controller's next untap step. + this.getSpellAbility().addEffect(new TapTargetEffect()); + this.getSpellAbility().addEffect(new SkipNextUntapTargetEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + //Cipher + this.getSpellAbility().addEffect(new CipherEffect()); + + + } + + public HandsOfBinding(final HandsOfBinding card) { + super(card); + } + + @Override + public HandsOfBinding copy() { + return new HandsOfBinding(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/LegionLoyalist.java b/Mage.Sets/src/mage/sets/gatecrash/LegionLoyalist.java new file mode 100644 index 0000000000..50153013ca --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/LegionLoyalist.java @@ -0,0 +1,126 @@ +/* +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.abilities.keyword.BattalionAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.HasteAbility; +import mage.abilities.keyword.TrampleAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentToken; + +/** + * + * @author Plopman + */ +public class LegionLoyalist extends CardImpl { + + public LegionLoyalist(UUID ownerId) { + super(ownerId, 97, "Legion Loyalist", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Goblin"); + this.subtype.add("Soldier"); + + this.color.setRed(true); + + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + //Haste + this.addAbility(HasteAbility.getInstance()); + //Battalion - Whenever Legion Loyalist and at least two other creatures attack, + //creatures you control gain first strike and trample until end of turn and can't be blocked by tokens this turn. + Ability ability = new BattalionAbility(new GainAbilityAllEffect(FirstStrikeAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterControlledCreaturePermanent())); + ability.addEffect(new GainAbilityAllEffect(TrampleAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterControlledCreaturePermanent())); + ability.addEffect(new CantBeBlockedByTokenEffect()); + this.addAbility(ability); + } + + public LegionLoyalist(final LegionLoyalist card) { + super(card); + } + + @Override + public LegionLoyalist copy() { + return new LegionLoyalist(this); + } +} + +class CantBeBlockedByTokenEffect extends RestrictionEffect { + + public CantBeBlockedByTokenEffect() { + super(Constants.Duration.EndOfTurn); + staticText = "Creatures you control can't be blocked by tokens this turn"; + } + + public CantBeBlockedByTokenEffect(final CantBeBlockedByTokenEffect effect) { + super(effect); + } + + @Override + public void init(Ability source, Game game) { + affectedObjectsSet = true; + for (Permanent perm: game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) { + objects.add(perm.getId()); + } + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (objects.contains(permanent.getId())) { + return true; + } + return false; + } + + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + if (blocker instanceof PermanentToken) { + return false; + } + return true; + } + + @Override + public CantBeBlockedByTokenEffect copy() { + return new CantBeBlockedByTokenEffect(this); + } +} + diff --git a/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java b/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java new file mode 100644 index 0000000000..1330f29afb --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java @@ -0,0 +1,106 @@ +/* +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.DamagedEvent; +import mage.game.events.GameEvent; +import mage.target.common.TargetNonlandPermanent; + +/** + * + * @author Plopman + */ +public class LeylinePhantom extends CardImpl { + + public LeylinePhantom(UUID ownerId) { + super(ownerId, 41, "Leyline Phantom", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Illusion"); + + this.color.setBlue(true); + + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + //Whenever Leyline Phantom deals combat damage, return it to its owner's hand. + this.addAbility(new LeylinePhantomTriggeredAbility()); + } + + public LeylinePhantom(final LeylinePhantom card) { + super(card); + } + + @Override + public LeylinePhantom copy() { + return new LeylinePhantom(this); + } +} + + +class LeylinePhantomTriggeredAbility extends TriggeredAbilityImpl { + + + public LeylinePhantomTriggeredAbility() { + super(Constants.Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), false); + } + + public LeylinePhantomTriggeredAbility(final LeylinePhantomTriggeredAbility ability) { + super(ability); + } + + @Override + public LeylinePhantomTriggeredAbility copy() { + return new LeylinePhantomTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER || event.getType() == GameEvent.EventType.DAMAGED_PLAYER) { + if(((DamagedEvent) event).isCombatDamage() && event.getSourceId().equals(this.getSourceId())){ + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever {this} deals combat damage, " + super.getRule(); + } + +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/LordOfTheVoid.java b/Mage.Sets/src/mage/sets/gatecrash/LordOfTheVoid.java new file mode 100644 index 0000000000..e759f0b797 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/LordOfTheVoid.java @@ -0,0 +1,129 @@ +/* +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetCard; + +/** + * + * @author Plopman + */ +public class LordOfTheVoid extends CardImpl { + + public LordOfTheVoid(UUID ownerId) { + super(ownerId, 74, "Lord of the Void", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{B}{B}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Demon"); + + this.color.setBlack(true); + + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + //Flying + this.addAbility(FlyingAbility.getInstance()); + + //Whenever Lord of the Void deals combat damage to a player, exile the top seven cards of that player's library, then put a creature card from among them onto the battlefield under your control. + this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LordOfTheVoidEffect(), false, true)); + } + + public LordOfTheVoid(final LordOfTheVoid card) { + super(card); + } + + @Override + public LordOfTheVoid copy() { + return new LordOfTheVoid(this); + } +} + + +class LordOfTheVoidEffect extends OneShotEffect { + + public LordOfTheVoidEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "exile the top seven cards of that player's library, then put a creature card from among them onto the battlefield under your control"; + } + + public LordOfTheVoidEffect(final LordOfTheVoidEffect effect) { + super(effect); + } + + @Override + public LordOfTheVoidEffect copy() { + return new LordOfTheVoidEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); + Player controller = game.getPlayer(source.getControllerId()); + if (player == null || controller == null) { + return false; + } + + Cards cards = new CardsImpl(); + int max = Math.min(player.getLibrary().size(), 7); + for(int i = 0; i < max; i++){ + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + card.moveToExile(null, "", source.getId(), game); + cards.add(card); + } + } + if(cards.getCards(new FilterCreatureCard(), game).size() > 0){ + TargetCard target = new TargetCard(Zone.EXILED, new FilterCreatureCard()); + target.setRequired(true); + if(controller.chooseTarget(Outcome.PutCreatureInPlay, cards, target, source, game)){ + Card card = cards.get(target.getFirstTarget(), game); + if(card != null){ + card.putOntoBattlefield(game, Zone.EXILED, source.getId(), source.getControllerId()); + } + } + } + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/SimicCharm.java b/Mage.Sets/src/mage/sets/gatecrash/SimicCharm.java new file mode 100644 index 0000000000..2525d89046 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/SimicCharm.java @@ -0,0 +1,79 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Mode; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.abilities.keyword.HexproofAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Plopman + */ +public class SimicCharm extends CardImpl { + + public SimicCharm (UUID ownerId) { + super(ownerId, 195, "Simic Charm", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{B}{U}"); + this.expansionSetCode = "GTC"; + + this.color.setBlue(true); + this.color.setGreen(true); + + //Choose one - Target creature gets +3/+3 until end of turn + this.getSpellAbility().addEffect(new BoostTargetEffect(3, 3, Constants.Duration.EndOfTurn)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + //permanents you control gain hexproof until end of turn + Mode mode = new Mode(); + mode.getEffects().add(new GainAbilityAllEffect(HexproofAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterControlledPermanent())); + this.getSpellAbility().addMode(mode); + //return target creature to its owner's hand. + Mode mode2 = new Mode(); + mode2.getEffects().add(new ReturnToHandTargetEffect()); + mode2.getTargets().add(new TargetCreaturePermanent()); + this.getSpellAbility().addMode(mode2); + + } + + public SimicCharm(final SimicCharm card) { + super(card); + } + + @Override + public SimicCharm copy() { + return new SimicCharm(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/UndercityInformer.java b/Mage.Sets/src/mage/sets/gatecrash/UndercityInformer.java new file mode 100644 index 0000000000..812174773e --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/UndercityInformer.java @@ -0,0 +1,128 @@ +/* +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author Plopman + */ +public class UndercityInformer extends CardImpl { + + public UndercityInformer(UUID ownerId) { + super(ownerId, 82, "Undercity Informer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "GTC"; + + this.subtype.add("Human"); + this.subtype.add("Rogue"); + + this.color.setBlack(true); + + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + //{1}, Sacrifice a creature: Target player reveals the top card of his or her library until he or she reveals a land card, then puts those cards into his or her graveyard. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new UndercityInformerEffect(), new ManaCostsImpl("{1}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledCreaturePermanent())); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public UndercityInformer(final UndercityInformer card) { + super(card); + } + + @Override + public UndercityInformer copy() { + return new UndercityInformer(this); + } +} + + +class UndercityInformerEffect extends OneShotEffect { + + public UndercityInformerEffect() { + super(Outcome.PutCardInPlay); + this.staticText = "Target player reveals the top card of his or her library until he or she reveals a land card, then puts those cards into his or her graveyard"; + } + + public UndercityInformerEffect(final UndercityInformerEffect effect) { + super(effect); + } + + @Override + public UndercityInformerEffect copy() { + return new UndercityInformerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(this.getTargetPointer().getFirst(game, source)); + if (player == null) { + return false; + } + + Cards cards = new CardsImpl(); + while(player.getLibrary().size() > 0){ + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + cards.add(card); + if(card.getCardType().contains(CardType.LAND)){ + break; + } + } + } + player.revealCards("Undercity Informer", cards, game); + for(Card card : cards.getCards(game)){ + if(card != null){ + card.moveToZone(Zone.GRAVEYARD, id, game, true); + } + } + return true; + } +}