From 710cd3ade2da2de109624d95195d62498ba505c7 Mon Sep 17 00:00:00 2001 From: spjspj Date: Sun, 17 Dec 2017 17:14:04 +1100 Subject: [PATCH 1/2] Add 2 UST cards --- Mage.Sets/src/mage/cards/g/GOTOJAIL.java | 193 ++++++++++++++++++ .../src/mage/cards/s/SnickeringSquirrel.java | 2 +- Mage.Sets/src/mage/cards/t/TimeOut.java | 134 ++++++++++++ Mage.Sets/src/mage/sets/Unstable.java | 2 + 4 files changed, 330 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/g/GOTOJAIL.java create mode 100644 Mage.Sets/src/mage/cards/t/TimeOut.java diff --git a/Mage.Sets/src/mage/cards/g/GOTOJAIL.java b/Mage.Sets/src/mage/cards/g/GOTOJAIL.java new file mode 100644 index 0000000000..24f03f27b6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/g/GOTOJAIL.java @@ -0,0 +1,193 @@ +/* + * 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.cards.g; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.ControllerPredicate; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; +import mage.util.CardUtil; + +/** + * + * @author spjspj + */ +public class GOTOJAIL extends CardImpl { + + private final static FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls"); + + static { + filter.add(new ControllerPredicate(TargetController.OPPONENT)); + } + + public GOTOJAIL(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + + // When GO TO JAIL enters the battlefield, exile target creature an opponent controls until GO TO JAIL leaves the battlefield. + Ability ability = new EntersBattlefieldTriggeredAbility(new GoToJailExileEffect()); + ability.addTarget(new TargetCreaturePermanent(filter)); + ability.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility())); + this.addAbility(ability); + + // At the beginning of the upkeep of the exiled card's owner, that player rolls two six-sided dice. If he or she rolls doubles, sacrifice GO TO JAIL. + this.addAbility(new GoToJailTriggeredAbility()); + } + + public GOTOJAIL(final GOTOJAIL card) { + super(card); + } + + @Override + public GOTOJAIL copy() { + return new GOTOJAIL(this); + } +} + +class GoToJailExileEffect extends OneShotEffect { + + public GoToJailExileEffect() { + super(Outcome.Benefit); + this.staticText = "exile target creature an opponent controls until {this} leaves the battlefield."; + } + + public GoToJailExileEffect(final GoToJailExileEffect effect) { + super(effect); + } + + @Override + public GoToJailExileEffect copy() { + return new GoToJailExileEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); + Permanent targetPermanent = game.getPermanent(targetPointer.getFirst(game, source)); + + // If GO TO JAIL leaves the battlefield before its triggered ability resolves, + // the target creature won't be exiled. + if (permanent != null && targetPermanent != null) { + Player controller = game.getPlayer(targetPermanent.getControllerId()); + if (controller != null) { + game.getState().setValue(permanent.getId() + ChooseOpponentEffect.VALUE_KEY, controller.getId()); + return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()).apply(game, source); + } + } + return false; + } +} + +class GoToJailTriggeredAbility extends TriggeredAbilityImpl { + + public GoToJailTriggeredAbility() { + super(Zone.BATTLEFIELD, new GoToJailUpkeepEffect(), false); + } + + public GoToJailTriggeredAbility(final GoToJailTriggeredAbility ability) { + super(ability); + } + + @Override + public GoToJailTriggeredAbility copy() { + return new GoToJailTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.UPKEEP_STEP_PRE; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getPlayerId().equals((UUID) game.getState().getValue(this.getSourceId().toString() + ChooseOpponentEffect.VALUE_KEY)); + } + + @Override + public String getRule() { + return "At the beginning of the chosen player's upkeep, " + super.getRule(); + } +} + +class GoToJailUpkeepEffect extends OneShotEffect { + + public GoToJailUpkeepEffect() { + super(Outcome.Sacrifice); + this.staticText = "that player rolls two six-sided dice. If he or she rolls doubles, sacrifice {this}"; + } + + public GoToJailUpkeepEffect(final GoToJailUpkeepEffect effect) { + super(effect); + } + + @Override + public GoToJailUpkeepEffect copy() { + return new GoToJailUpkeepEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + MageObject sourceObject = source.getSourceObjectIfItStillExists(game); + Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game); + + + if (sourceObject != null && sourceObject instanceof Permanent && permanent != null) { + UUID opponentId = (UUID) game.getState().getValue(sourceObject.getId().toString() + ChooseOpponentEffect.VALUE_KEY); + Player opponent = game.getPlayer(opponentId); + + if (opponent != null) { + int thisRoll = opponent.rollDice(game, 6); + int thatRoll = opponent.rollDice(game, 6); + if (thisRoll == thatRoll) { + return permanent.sacrifice(source.getSourceId(), game); + } + } + } + return false; + } +} diff --git a/Mage.Sets/src/mage/cards/s/SnickeringSquirrel.java b/Mage.Sets/src/mage/cards/s/SnickeringSquirrel.java index e0ff21a6e8..7022dc9c0b 100644 --- a/Mage.Sets/src/mage/cards/s/SnickeringSquirrel.java +++ b/Mage.Sets/src/mage/cards/s/SnickeringSquirrel.java @@ -105,7 +105,7 @@ class SnickeringSquirrelEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { - return source.getControllerId().equals(event.getPlayerId()); + return true; } @Override diff --git a/Mage.Sets/src/mage/cards/t/TimeOut.java b/Mage.Sets/src/mage/cards/t/TimeOut.java new file mode 100644 index 0000000000..2907d764fc --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TimeOut.java @@ -0,0 +1,134 @@ +/* + * 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.cards.t; + +import java.util.Deque; +import java.util.LinkedList; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; + +/** + * + * @author spjspj + */ +public class TimeOut extends CardImpl { + + private static final FilterPermanent filter = new FilterPermanent("nonland permanent"); + + static { + filter.add(Predicates.not(new CardTypePredicate(CardType.LAND))); + } + + public TimeOut(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{4}{U}"); + + // Roll a six-sided die. Put target nonland permanent into its owner's library just beneath the top X cards of that library, where X is the result. + this.getSpellAbility().addEffect(new TimeOutEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + + } + + public TimeOut(final TimeOut card) { + super(card); + } + + @Override + public TimeOut copy() { + return new TimeOut(this); + } +} + +class TimeOutEffect extends OneShotEffect { + + public TimeOutEffect() { + super(Outcome.Benefit); + this.staticText = "Roll a six-sided die. Put target nonland permanent into its owner's library just beneath the top X cards of that library, where X is the result"; + } + + public TimeOutEffect(final TimeOutEffect effect) { + super(effect); + } + + @Override + public TimeOutEffect copy() { + return new TimeOutEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source)); + if (permanent != null) { + Player owner = game.getPlayer(permanent.getOwnerId()); + if (owner != null) { + int amount = controller.rollDice(game, 6); + Cards cards = new CardsImpl(); + Deque cardIds = new LinkedList<>(); + for (int i = 0; i < amount; i++) { + Card card = owner.getLibrary().removeFromTop(game); + cards.add(card); + cardIds.push(card.getId()); + } + // return cards back to library + game.informPlayers(new StringBuilder(controller.getLogName()) + .append(" puts ").append(permanent.getName()) + .append(" beneath the top ").append(amount) + .append(" cards of ").append(owner.getLogName()).append("'s library").toString()); + permanent.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + while (!cardIds.isEmpty()) { + UUID cardId = cardIds.poll(); + Card card = cards.get(cardId, game); + if (card != null) { + card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true); + } + } + return true; + } + } + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Unstable.java b/Mage.Sets/src/mage/sets/Unstable.java index 4285aabfc4..4f6b6fc5ba 100644 --- a/Mage.Sets/src/mage/sets/Unstable.java +++ b/Mage.Sets/src/mage/sets/Unstable.java @@ -68,6 +68,8 @@ public class Unstable extends ExpansionSet { cards.add(new SetCardInfo("Mad Science Fair Project", 154, Rarity.COMMON, mage.cards.m.MadScienceFairProject.class)); cards.add(new SetCardInfo("Mountain", 215, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Painiac", 91, Rarity.COMMON, mage.cards.p.Painiac.class)); + cards.add(new SetCardInfo("GO TO JAIL", 8, Rarity.COMMON, mage.cards.g.GOTOJAIL.class)); + cards.add(new SetCardInfo("Time Out", 48, Rarity.COMMON, mage.cards.t.TimeOut.class)); cards.add(new SetCardInfo("Plains", 212, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Snickering Squirrel", 68, Rarity.COMMON, mage.cards.s.SnickeringSquirrel.class)); cards.add(new SetCardInfo("Squirrel-Powered Scheme", 70, Rarity.UNCOMMON, mage.cards.s.SquirrelPoweredScheme.class)); From 578ea668bbccb1520296ebaea33fb2d6d473ebc8 Mon Sep 17 00:00:00 2001 From: spjspj Date: Mon, 18 Dec 2017 00:28:37 +1100 Subject: [PATCH 2/2] Add Summon The Pack (modification - needs the creatures to be zombies (done) but not black) --- Mage.Sets/src/mage/cards/s/SummonThePack.java | 139 ++++++++++++++++++ Mage.Sets/src/mage/sets/Unstable.java | 5 +- .../common/ChooseExpansionSetEffect.java | 102 +++++++++++++ Mage/src/main/java/mage/cards/CardImpl.java | 3 + 4 files changed, 247 insertions(+), 2 deletions(-) create mode 100644 Mage.Sets/src/mage/cards/s/SummonThePack.java create mode 100644 Mage/src/main/java/mage/abilities/effects/common/ChooseExpansionSetEffect.java diff --git a/Mage.Sets/src/mage/cards/s/SummonThePack.java b/Mage.Sets/src/mage/cards/s/SummonThePack.java new file mode 100644 index 0000000000..445e3dc47d --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SummonThePack.java @@ -0,0 +1,139 @@ +/* + * 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.cards.s; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.ContinuousEffect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseExpansionSetEffect; +import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.cards.ExpansionSet; +import mage.cards.Sets; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author spjspj + */ +public class SummonThePack extends CardImpl { + + public SummonThePack(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{7}{B}"); + + // Open a sealed Magic booster pack, reveal the cards, and put all creature cards revealed this way onto the battlefield under your control. They're Zombies in addition to their other types. (Remove those cards from your deck before beginning a new game) + this.getSpellAbility().addEffect(new SummonThePackEffect()); + } + + public SummonThePack(final SummonThePack card) { + super(card); + } + + @Override + public SummonThePack copy() { + return new SummonThePack(this); + } +} + +class SummonThePackEffect extends OneShotEffect { + + public SummonThePackEffect() { + super(Outcome.DestroyPermanent); + this.staticText = "Open a sealed Magic booster pack, reveal the cards, and put all creature cards revealed this way onto the battlefield under your control. They're Zombies in addition to their other types"; + } + + public SummonThePackEffect(final SummonThePackEffect effect) { + super(effect); + } + + @Override + public SummonThePackEffect copy() { + return new SummonThePackEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + ChooseExpansionSetEffect effect = new ChooseExpansionSetEffect(Outcome.UnboostCreature); + effect.apply(game, source); + Player controller = game.getPlayer(source.getControllerId()); + + String setChosen = null; + if (effect.getValue("setchosen") != null) { + setChosen = (String) effect.getValue("setchosen"); + } else if (game.getState().getValue(this.getId() + "_set") != null) { + setChosen = (String) game.getState().getValue(this.getId() + "_set"); + } + + if (setChosen != null && controller != null) { + //ExpansionInfo set = ExpansionRepository.instance.getSetByName(setChosen); + ExpansionSet expansionSet = Sets.findSet(setChosen); + if (expansionSet != null) { + List boosterPack = expansionSet.create15CardBooster(); + List creatureCards = new ArrayList<>(); + + if (boosterPack != null) { + StringBuilder message = new StringBuilder(controller.getLogName()).append(" opened: "); + + for (Card c : boosterPack) { + message.append(c.getName()).append(" "); + if (c != null && c.isCreature()) { + message.append(" (creature card) "); + ContinuousEffect effect2 = new BecomesBlackZombieAdditionEffect(); + effect2.setTargetPointer(new FixedTarget(c.getId())); + game.addEffect(effect2, source); + creatureCards.add(c); + c.setZone(Zone.OUTSIDE, game); + } + } + + if (creatureCards.size() > 0) { + Set ccs = new HashSet(creatureCards); + game.loadCards(ccs, controller.getId()); + controller.moveCards(ccs, Zone.BATTLEFIELD, source, game); + } + + game.informPlayers(message.toString()); + } + } + } + + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/Unstable.java b/Mage.Sets/src/mage/sets/Unstable.java index 4f6b6fc5ba..8c7a1aa28c 100644 --- a/Mage.Sets/src/mage/sets/Unstable.java +++ b/Mage.Sets/src/mage/sets/Unstable.java @@ -57,6 +57,7 @@ public class Unstable extends ExpansionSet { cards.add(new SetCardInfo("Curious Killbot", 145, Rarity.COMMON, mage.cards.c.CuriousKillbot.class)); cards.add(new SetCardInfo("Earl of Squirrel", 108, Rarity.RARE, mage.cards.e.EarlOfSquirrel.class)); cards.add(new SetCardInfo("Forest", 216, Rarity.LAND, mage.cards.basiclands.Forest.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); + cards.add(new SetCardInfo("GO TO JAIL", 8, Rarity.COMMON, mage.cards.g.GOTOJAIL.class)); cards.add(new SetCardInfo("Garbage Elemental", 82, Rarity.UNCOMMON, mage.cards.g.GarbageElemental.class)); cards.add(new SetCardInfo("Ground Pounder", 110, Rarity.COMMON, mage.cards.g.GroundPounder.class)); cards.add(new SetCardInfo("Hammer Helper", 85, Rarity.COMMON, mage.cards.h.HammerHelper.class)); @@ -68,15 +69,15 @@ public class Unstable extends ExpansionSet { cards.add(new SetCardInfo("Mad Science Fair Project", 154, Rarity.COMMON, mage.cards.m.MadScienceFairProject.class)); cards.add(new SetCardInfo("Mountain", 215, Rarity.LAND, mage.cards.basiclands.Mountain.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Painiac", 91, Rarity.COMMON, mage.cards.p.Painiac.class)); - cards.add(new SetCardInfo("GO TO JAIL", 8, Rarity.COMMON, mage.cards.g.GOTOJAIL.class)); - cards.add(new SetCardInfo("Time Out", 48, Rarity.COMMON, mage.cards.t.TimeOut.class)); cards.add(new SetCardInfo("Plains", 212, Rarity.LAND, mage.cards.basiclands.Plains.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Snickering Squirrel", 68, Rarity.COMMON, mage.cards.s.SnickeringSquirrel.class)); cards.add(new SetCardInfo("Squirrel-Powered Scheme", 70, Rarity.UNCOMMON, mage.cards.s.SquirrelPoweredScheme.class)); cards.add(new SetCardInfo("Steel Squirrel", 162, Rarity.UNCOMMON, mage.cards.s.SteelSquirrel.class)); + cards.add(new SetCardInfo("Summon the Pack", 74, Rarity.MYTHIC, mage.cards.s.SummonThePack.class)); cards.add(new SetCardInfo("Swamp", 214, Rarity.LAND, mage.cards.basiclands.Swamp.class, new CardGraphicInfo(FrameStyle.UNH_FULL_ART_BASIC, false))); cards.add(new SetCardInfo("Sword of Dungeons and Dragons", 1, Rarity.MYTHIC, mage.cards.s.SwordOfDungeonsAndDragons.class)); cards.add(new SetCardInfo("Target Minotaur", 98, Rarity.COMMON, mage.cards.t.TargetMinotaur.class)); + cards.add(new SetCardInfo("Time Out", 48, Rarity.COMMON, mage.cards.t.TimeOut.class)); cards.add(new SetCardInfo("Willing Test Subject", 126, Rarity.COMMON, mage.cards.w.WillingTestSubject.class)); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/ChooseExpansionSetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ChooseExpansionSetEffect.java new file mode 100644 index 0000000000..ba2a223a87 --- /dev/null +++ b/Mage/src/main/java/mage/abilities/effects/common/ChooseExpansionSetEffect.java @@ -0,0 +1,102 @@ +/* + * 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.abilities.effects.common; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.repository.ExpansionRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.util.CardUtil; + +/** + * @author LevelX2 (spjspj) + */ +public class ChooseExpansionSetEffect extends OneShotEffect { + + public ChooseExpansionSetEffect(Outcome outcome) { + super(outcome); + staticText = "choose an expansion set"; + } + + public ChooseExpansionSetEffect(final ChooseExpansionSetEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + + MageObject mageObject = game.getPermanentEntering(source.getSourceId()); + if (mageObject == null) { + mageObject = game.getObject(source.getSourceId()); + } + + if (controller != null) { + Choice setChoice = new ChoiceImpl(true); + setChoice.setMessage("Choose expansion set"); + List setCodes = ExpansionRepository.instance.getSetCodes(); + Set sets = new HashSet(setCodes); + + setChoice.setChoices(sets); + + while (!controller.choose(outcome, setChoice, game)) { + if (!controller.canRespond()) { + return false; + } + } + if (setChoice.getChoice() == null) { + return false; + } + if (!game.isSimulation()) { + game.informPlayers(controller.getLogName() + " has chosen set " + setChoice.getChoice()); + } + game.getState().setValue(mageObject.getId() + "_set", setChoice.getChoice()); + this.setValue("setchosen", setChoice.getChoice()); + if (mageObject instanceof Permanent) { + ((Permanent) mageObject).addInfo("chosen set", CardUtil.addToolTipMarkTags("Chosen set: " + setChoice.getChoice()), game); + } + } + return false; + } + + @Override + public ChooseExpansionSetEffect copy() { + return new ChooseExpansionSetEffect(this); + } + +} diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index 22361e38d8..d2f8d1a230 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -594,6 +594,9 @@ public abstract class CardImpl extends MageObjectImpl implements Card { } else if (game.getPhase() == null) { // E.g. Commander of commander game removed = true; + } else { + // Unstable - Summon the Pack + removed = true; } break; case BATTLEFIELD: // for sacrificing permanents or putting to library