From 6a118d2bfa703816e71d204cca42b56192c285eb Mon Sep 17 00:00:00 2001 From: myersn024 Date: Wed, 18 Feb 2015 08:57:50 -0600 Subject: [PATCH 1/3] Create SkyshipWeatherlight.java --- .../sets/planeshift/SkyshipWeatherlight.java | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java diff --git a/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java b/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java new file mode 100644 index 0000000000..f303fa12a7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java @@ -0,0 +1,136 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.planeshift; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.SearchEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.ExileZone; +import mage.game.Game; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; +import mage.util.CardUtil; + +/** + * + * @author nick.myers + */ +public class SkyshipWeatherlight extends CardImpl { + + public SkyshipWeatherlight(UUID ownerId) { + super(ownerId, 133, "Skyship Weatherlight", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "PLS"; + + // When Skyship Weatherlight enters the battlefield, search your library for any number of artifact and/or creature cards and exile them. Then shuffle your library. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SkyshipWeatherlightEffect(), false)); + + // {4}, {tap}, Choose a card at random that was removed from the game with Skyship Weatherlight. Put that card into your hand. + SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SkyshipWeatherlightEffect2(), new GenericManaCost(4)); + ability.addCost(new TapSourceCost()); + this.addAbility(ability); + } + + public SkyshipWeatherlight(final SkyshipWeatherlight card) { + super(card); + } + + @Override + public SkyshipWeatherlight copy() { + return new SkyshipWeatherlight(this); + } + +} + +class SkyshipWeatherlightEffect extends SearchEffect { + + private static final FilterCard filter = new FilterCard("artifact and/or creature card"); + + + static { + filter.add(Predicates.or( + new CardTypePredicate(CardType.ARTIFACT), + new CardTypePredicate(CardType.CREATURE))); + } + + public SkyshipWeatherlightEffect() { + + super(new TargetCardInLibrary(0, Integer.MAX_VALUE, filter), Outcome.Neutral); + this.staticText = "search your library for any number of artifact and/or creature cards and remove them from the game. Then shuffle your library."; + + } + + public SkyshipWeatherlightEffect(final SkyshipWeatherlightEffect effect) { + super(effect); + } + + @Override + public SkyshipWeatherlightEffect copy() { + return new SkyshipWeatherlightEffect(this); + } + + @Override + public boolean apply (Game game, Ability source) { + Player you = game.getPlayer(source.getControllerId()); + if (you != null) { + if (you.searchLibrary(target, game)) { + UUID exileZone = CardUtil.getCardExileZoneId(game, source); + if (target.getTargets().size() > 0) { + for (UUID cardID : target.getTargets()) { + Card card = you.getLibrary().getCard(cardID, game); + if (card != null) { + card.moveToExile(exileZone, "Skyship Weatherlight", source.getSourceId(), game); + } + } + } + } + you.shuffleLibrary(game); + } + return false; + } + +} + +class SkyshipWeatherlightEffect2 extends OneShotEffect { + + public SkyshipWeatherlightEffect2() { + super(Outcome.ReturnToHand); + this.staticText = "Choose a card at random that was removed from the game with Skyship Weatherlight. Put that card into your hand."; + } + + public SkyshipWeatherlightEffect2(final SkyshipWeatherlightEffect2 effect) { + super(effect); + } + + @Override + public SkyshipWeatherlightEffect2 copy() { + return new SkyshipWeatherlightEffect2(this); + } + + @Override + public boolean apply(Game game, Ability source) { + ExileZone exZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)); + if (exZone != null) { + Card card = exZone.getRandom(game); + card.moveToZone(Zone.HAND, source.getSourceId(), game, false); + } + return true; + } + +} From 6566b0a75573ac11a4d032003367e9deedf3cff4 Mon Sep 17 00:00:00 2001 From: myersn024 Date: Wed, 18 Feb 2015 09:14:12 -0600 Subject: [PATCH 2/3] Update SkyshipWeatherlight.java Added legendary supertype attribute --- Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java b/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java index f303fa12a7..f9bbcb53de 100644 --- a/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java +++ b/Mage.Sets/src/mage/sets/planeshift/SkyshipWeatherlight.java @@ -37,6 +37,7 @@ public class SkyshipWeatherlight extends CardImpl { public SkyshipWeatherlight(UUID ownerId) { super(ownerId, 133, "Skyship Weatherlight", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); this.expansionSetCode = "PLS"; + this.supertype.add("Legendary"); // When Skyship Weatherlight enters the battlefield, search your library for any number of artifact and/or creature cards and exile them. Then shuffle your library. this.addAbility(new EntersBattlefieldTriggeredAbility(new SkyshipWeatherlightEffect(), false)); From 43d1bf899c17a285916744530c54f8c5fec6e63d Mon Sep 17 00:00:00 2001 From: myersn024 Date: Wed, 18 Feb 2015 12:08:09 -0600 Subject: [PATCH 3/3] Implemented EonHub.java Fully tested and working --- Mage.Sets/src/mage/sets/fifthdawn/EonHub.java | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/fifthdawn/EonHub.java diff --git a/Mage.Sets/src/mage/sets/fifthdawn/EonHub.java b/Mage.Sets/src/mage/sets/fifthdawn/EonHub.java new file mode 100644 index 0000000000..658b6b9e1a --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthdawn/EonHub.java @@ -0,0 +1,80 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package mage.sets.fifthdawn; + +import java.util.UUID; +import mage.constants.*; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author nick.myers + */ +public class EonHub extends CardImpl { + + public EonHub(UUID ownerId) { + super(ownerId, 120, "Eon Hub", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "5DN"; + + // Players skip their upkeep steps. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipUpkeepStepEffect())); + } + + public EonHub(final EonHub card) { + super(card); + } + + @Override + public EonHub copy() { + return new EonHub(this); + } + +} + +class SkipUpkeepStepEffect extends ReplacementEffectImpl { + + public SkipUpkeepStepEffect() { + super(Duration.WhileOnBattlefield, Outcome.Neutral); + staticText = "Players skip their upkeep steps"; + } + + public SkipUpkeepStepEffect(final SkipUpkeepStepEffect effect) { + super(effect); + } + + @Override + public SkipUpkeepStepEffect copy() { + return new SkipUpkeepStepEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.UPKEEP_STEP; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + Player controller = game.getPlayer(source.getControllerId()); + return controller != null && controller.getInRange().contains(event.getPlayerId()); + } + +}