From 06f61ce616e8ed11f4751a45fc46a79125313d95 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 7 Oct 2015 12:25:31 +0300 Subject: [PATCH 1/6] Implement cards: Caribou Range, Fatespinner, Hibernation's End, and Safe Haven --- .../mage/sets/coldsnap/HibernationsEnd.java | 141 +++++++++++++++ .../mage/sets/fifthedition/CaribouRange.java | 114 ++++++++++++ .../src/mage/sets/iceage/CaribouRange.java | 52 ++++++ .../sets/masterseditionii/CaribouRange.java | 52 ++++++ .../src/mage/sets/mirrodin/Fatespinner.java | 168 ++++++++++++++++++ .../src/mage/sets/thedark/SafeHaven.java | 78 ++++++++ .../src/mage/sets/timeshifted/SafeHaven.java | 54 ++++++ .../keyword/CumulativeUpkeepAbility.java | 2 + Mage/src/mage/game/events/GameEvent.java | 1 + 9 files changed, 662 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/coldsnap/HibernationsEnd.java create mode 100644 Mage.Sets/src/mage/sets/fifthedition/CaribouRange.java create mode 100644 Mage.Sets/src/mage/sets/iceage/CaribouRange.java create mode 100644 Mage.Sets/src/mage/sets/masterseditionii/CaribouRange.java create mode 100644 Mage.Sets/src/mage/sets/mirrodin/Fatespinner.java create mode 100644 Mage.Sets/src/mage/sets/thedark/SafeHaven.java create mode 100644 Mage.Sets/src/mage/sets/timeshifted/SafeHaven.java diff --git a/Mage.Sets/src/mage/sets/coldsnap/HibernationsEnd.java b/Mage.Sets/src/mage/sets/coldsnap/HibernationsEnd.java new file mode 100644 index 0000000000..e62a91d9b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/coldsnap/HibernationsEnd.java @@ -0,0 +1,141 @@ +/* + * 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.coldsnap; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.keyword.CumulativeUpkeepAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author LoneFox + */ +public class HibernationsEnd extends CardImpl { + + public HibernationsEnd(UUID ownerId) { + super(ownerId, 110, "Hibernation's End", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{4}{G}"); + this.expansionSetCode = "CSP"; + + // Cumulative upkeep {1} + this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}"))); + // Whenever you pay Hibernation's End's cumulative upkeep, you may search your library for a creature card with converted mana cost equal to the number of age counters on Hibernation's End and put it onto the battlefield. If you do, shuffle your library. + this.addAbility(new HibernationsEndAbility()); + } + + public HibernationsEnd(final HibernationsEnd card) { + super(card); + } + + @Override + public HibernationsEnd copy() { + return new HibernationsEnd(this); + } +} + +class HibernationsEndAbility extends TriggeredAbilityImpl { + + public HibernationsEndAbility() { + super(Zone.BATTLEFIELD, new HibernationsEndEffect(), true); + } + + public HibernationsEndAbility(final HibernationsEndAbility ability) { + super(ability); + } + + @Override + public HibernationsEndAbility copy() { + return new HibernationsEndAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == EventType.PAID_CUMULATIVE_UPKEEP; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return event.getSourceId() == this.getSourceId(); + } + + @Override + public String getRule() { + return "Whenever you pay {this}'s cumulative upkeep, " + super.getRule(); + } +} + +class HibernationsEndEffect extends OneShotEffect { + + public HibernationsEndEffect() { + super(Outcome.Benefit); + this.staticText = "search your library for a creature card with converted mana cost equal to the number of age counters on {this} and put it onto the battlefield. If you do, shuffle your library."; + } + + public HibernationsEndEffect(final HibernationsEndEffect effect) { + super(effect); + } + + @Override + public HibernationsEndEffect copy() { + return new HibernationsEndEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if(sourcePermanent != null && player != null) { + int newConvertedCost = sourcePermanent.getCounters().getCount("age"); + FilterCard filter = new FilterCard("creature card with converted mana cost " + newConvertedCost); + filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, newConvertedCost)); + filter.add(new CardTypePredicate(CardType.CREATURE)); + TargetCardInLibrary target = new TargetCardInLibrary(filter); + return new SearchLibraryPutInPlayEffect(target).apply(game, source); + } + return false; + } +} + diff --git a/Mage.Sets/src/mage/sets/fifthedition/CaribouRange.java b/Mage.Sets/src/mage/sets/fifthedition/CaribouRange.java new file mode 100644 index 0000000000..d107abb295 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/CaribouRange.java @@ -0,0 +1,114 @@ +/* + * 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.fifthedition; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.GainLifeEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.permanent.token.Token; +import mage.target.TargetPermanent; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class CaribouRange extends CardImpl { + + static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("a Caribou token"); + + static { + filter.add(new TokenPredicate()); + filter.add(new SubtypePredicate("Caribou")); + } + + public CaribouRange(UUID ownerId) { + super(ownerId, 290, "Caribou Range", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}{W}"); + this.expansionSetCode = "5ED"; + this.subtype.add("Aura"); + + // Enchant land you control + TargetPermanent auraTarget = new TargetControlledPermanent(new FilterControlledLandPermanent("land you control")); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted land has "{W}{W}, {T}: Put a 0/1 white Caribou creature token onto the battlefield." + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new CaribouToken()), new ManaCostsImpl("{W}{W}")); + ability.addCost(new TapSourceCost()); + Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA); + effect.setText("Enchanted land has \"{W}{W}, {T}: Put a 0/1 white Caribou creature token onto the battlefield.\""); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); + // Sacrifice a Caribou token: You gain 1 life. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), + new SacrificeTargetCost(new TargetControlledCreaturePermanent(filter)))); + } + + public CaribouRange(final CaribouRange card) { + super(card); + } + + @Override + public CaribouRange copy() { + return new CaribouRange(this); + } +} + +class CaribouToken extends Token { + + public CaribouToken() { + super("Caribou", "0/1 white Caribou creature token"); + cardType.add(CardType.CREATURE); + color.setWhite(true); + subtype.add("Caribou"); + power = new MageInt(0); + toughness = new MageInt(1); + } +} diff --git a/Mage.Sets/src/mage/sets/iceage/CaribouRange.java b/Mage.Sets/src/mage/sets/iceage/CaribouRange.java new file mode 100644 index 0000000000..e9452f4c5f --- /dev/null +++ b/Mage.Sets/src/mage/sets/iceage/CaribouRange.java @@ -0,0 +1,52 @@ +/* + * 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.iceage; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CaribouRange extends mage.sets.fifthedition.CaribouRange { + + public CaribouRange(UUID ownerId) { + super(ownerId); + this.cardNumber = 235; + this.expansionSetCode = "ICE"; + } + + public CaribouRange(final CaribouRange card) { + super(card); + } + + @Override + public CaribouRange copy() { + return new CaribouRange(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditionii/CaribouRange.java b/Mage.Sets/src/mage/sets/masterseditionii/CaribouRange.java new file mode 100644 index 0000000000..e5099cbf06 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditionii/CaribouRange.java @@ -0,0 +1,52 @@ +/* + * 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.masterseditionii; + +import java.util.UUID; + +/** + * + * @author LoneFox + */ +public class CaribouRange extends mage.sets.fifthedition.CaribouRange { + + public CaribouRange(UUID ownerId) { + super(ownerId); + this.cardNumber = 8; + this.expansionSetCode = "ME2"; + } + + public CaribouRange(final CaribouRange card) { + super(card); + } + + @Override + public CaribouRange copy() { + return new CaribouRange(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/Fatespinner.java b/Mage.Sets/src/mage/sets/mirrodin/Fatespinner.java new file mode 100644 index 0000000000..344f8ac9b3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/Fatespinner.java @@ -0,0 +1,168 @@ +/* + * 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.mirrodin; + +import java.util.HashSet; +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent.EventType; +import mage.game.events.GameEvent; +import mage.players.Player; + +/** + * + * @author LoneFox + */ +public class Fatespinner extends CardImpl { + + public Fatespinner(UUID ownerId) { + super(ownerId, 36, "Fatespinner", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + this.power = new MageInt(1); + this.toughness = new MageInt(2); + + // At the beginning of each opponent's upkeep, that player chooses draw step, main phase, or combat phase. The player skips each instance of the chosen step or phase this turn. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new FatespinnerChooseEffect(), + TargetController.OPPONENT, false, true)); + } + + public Fatespinner(final Fatespinner card) { + super(card); + } + + @java.lang.Override + public Fatespinner copy() { + return new Fatespinner(this); + } +} + +class FatespinnerChooseEffect extends OneShotEffect { + + private static final HashSet choices = new HashSet<>(); + + static { + choices.add("Draw step"); + choices.add("Main phase"); + choices.add("Combat phase"); + } + + public FatespinnerChooseEffect() { + super(Outcome.Detriment); + staticText = "At the beginning of each opponent's upkeep, that player chooses draw step, main phase, or combat phase. The player skips each instance of the chosen step or phase this turn."; + } + + public FatespinnerChooseEffect(final FatespinnerChooseEffect effect) { + super(effect); + } + + @java.lang.Override + public FatespinnerChooseEffect copy() { + return new FatespinnerChooseEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(getTargetPointer().getFirst(game, source)); + if(player != null) { + Choice choice = new ChoiceImpl(true); + choice.setMessage("Choose phase or step to skip"); + choice.setChoices(choices); + while(!player.choose(outcome, choice, game)) { + if(player.canRespond()) { + return false; + } + } + String chosenPhase = choice.getChoice(); + game.informPlayers(player.getLogName() + " has chosen to skip " + chosenPhase.toLowerCase() + "."); + game.addEffect(new FatespinnerSkipEffect(chosenPhase), source); + return true; + } + return false; + } +} + +class FatespinnerSkipEffect extends ReplacementEffectImpl { + + private final String phase; + + public FatespinnerSkipEffect(String phase) { + super(Duration.EndOfTurn, Outcome.Detriment); + this.phase = phase; + } + + public FatespinnerSkipEffect(final FatespinnerSkipEffect effect) { + super(effect); + this.phase = effect.phase; + } + + @java.lang.Override + public FatespinnerSkipEffect copy() { + return new FatespinnerSkipEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + return true; + } + + @java.lang.Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + EventType type = event.getType(); + return ((phase.equals("Draw step") && type == EventType.DRAW_STEP) + || (phase.equals("Main phase") && (type == EventType.PRECOMBAT_MAIN_PHASE || type == EventType.POSTCOMBAT_MAIN_PHASE)) + || (phase.equals("Combat phase") && type == EventType.COMBAT_PHASE)); + } + + @java.lang.Override + public boolean checksEventType(GameEvent event, Game game) { + EventType type = event.getType(); + return (type == EventType.DRAW_STEP || type == EventType.PRECOMBAT_MAIN_PHASE + || type == EventType.POSTCOMBAT_MAIN_PHASE || type == EventType.COMBAT_PHASE); + } + + @java.lang.Override + public boolean applies(GameEvent event, Ability source, Game game) { + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/SafeHaven.java b/Mage.Sets/src/mage/sets/thedark/SafeHaven.java new file mode 100644 index 0000000000..d9e0dd30cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/SafeHaven.java @@ -0,0 +1,78 @@ +/* + * 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.thedark; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.ReturnFromExileEffect; +import mage.abilities.effects.common.SacrificeSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.common.TargetControlledCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class SafeHaven extends CardImpl { + + public SafeHaven(UUID ownerId) { + super(ownerId, 115, "Safe Haven", Rarity.RARE, new CardType[]{CardType.LAND}, ""); + this.expansionSetCode = "DRK"; + + // {2}, {tap}: Exile target creature you control. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(this.getId(), + this.getIdName()), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetControlledCreaturePermanent()); + this.addAbility(ability); + // At the beginning of your upkeep, you may sacrifice Safe Haven. If you do, return each card exiled with Safe Haven to the battlefield under its owner's control. + ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), + TargetController.YOU, true); + ability.addEffect(new ReturnFromExileEffect(this.getId(), Zone.BATTLEFIELD, + "If you do, return each card exiled with {this} to the battlefield under its owner's control")); + this.addAbility(ability); + } + + public SafeHaven(final SafeHaven card) { + super(card); + } + + @Override + public SafeHaven copy() { + return new SafeHaven(this); + } +} diff --git a/Mage.Sets/src/mage/sets/timeshifted/SafeHaven.java b/Mage.Sets/src/mage/sets/timeshifted/SafeHaven.java new file mode 100644 index 0000000000..30cbfa71d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/SafeHaven.java @@ -0,0 +1,54 @@ +/* + * 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.timeshifted; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class SafeHaven extends mage.sets.thedark.SafeHaven { + + public SafeHaven(UUID ownerId) { + super(ownerId); + this.cardNumber = 121; + this.expansionSetCode = "TSB"; + this.rarity = Rarity.SPECIAL; + } + + public SafeHaven(final SafeHaven card) { + super(card); + } + + @Override + public SafeHaven copy() { + return new SafeHaven(this); + } +} diff --git a/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java b/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java index 4077074fa7..2e6c6d83fc 100644 --- a/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java +++ b/Mage/src/mage/abilities/keyword/CumulativeUpkeepAbility.java @@ -107,6 +107,7 @@ class CumulativeUpkeepEffect extends OneShotEffect { if (player.chooseUse(Outcome.Benefit, "Pay " + totalCost.getText() + "?", source, game)) { totalCost.clearPaid(); if (totalCost.payOrRollback(source, game, source.getSourceId(), source.getControllerId())) { + game.fireEvent(new GameEvent(EventType.PAID_CUMULATIVE_UPKEEP, permanent.getId(), permanent.getId(), player.getId(), ageCounter, false)); return true; } } @@ -122,6 +123,7 @@ class CumulativeUpkeepEffect extends OneShotEffect { totalCost.clearPaid(); int bookmark = game.bookmarkState(); if (totalCost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) { + game.fireEvent(new GameEvent(EventType.PAID_CUMULATIVE_UPKEEP, permanent.getId(), permanent.getId(), player.getId(), ageCounter, false)); return true; } else { game.restoreState(bookmark, source.getRule()); diff --git a/Mage/src/mage/game/events/GameEvent.java b/Mage/src/mage/game/events/GameEvent.java index a6909fe729..38e9ebeefe 100644 --- a/Mage/src/mage/game/events/GameEvent.java +++ b/Mage/src/mage/game/events/GameEvent.java @@ -185,6 +185,7 @@ public class GameEvent implements Serializable { ENCHANT_PLAYER, ENCHANTED_PLAYER, CAN_TAKE_MULLIGAN, FLIP_COIN, COIN_FLIPPED, SCRY, FATESEAL, + PAID_CUMULATIVE_UPKEEP, DIDNT_PAY_CUMULATIVE_UPKEEP, //permanent events ENTERS_THE_BATTLEFIELD, From d3c8e25db480330b2e910d4f081f876c9dffd3e7 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Wed, 7 Oct 2015 19:34:16 +0300 Subject: [PATCH 2/6] Implement cards: Hulking Ogre, Marker Beetles, Metathran Soldier, and Rescue --- .../mage/sets/starter1999/HulkingOgre.java | 62 +++++++++++++++ .../mage/sets/urzasdestiny/HulkingOgre.java | 54 +++++++++++++ .../mage/sets/urzasdestiny/MarkerBeetles.java | 77 +++++++++++++++++++ .../sets/urzasdestiny/MetathranSoldier.java | 63 +++++++++++++++ .../src/mage/sets/urzasdestiny/Rescue.java | 60 +++++++++++++++ 5 files changed, 316 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/starter1999/HulkingOgre.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/HulkingOgre.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/MarkerBeetles.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/MetathranSoldier.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/Rescue.java diff --git a/Mage.Sets/src/mage/sets/starter1999/HulkingOgre.java b/Mage.Sets/src/mage/sets/starter1999/HulkingOgre.java new file mode 100644 index 0000000000..f80a7b480c --- /dev/null +++ b/Mage.Sets/src/mage/sets/starter1999/HulkingOgre.java @@ -0,0 +1,62 @@ +/* + * 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.starter1999; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.CantBlockAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HulkingOgre extends CardImpl { + + public HulkingOgre(UUID ownerId) { + super(ownerId, 108, "Hulking Ogre", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "S99"; + this.subtype.add("Ogre"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Hulking Ogre can't block. + this.addAbility(new CantBlockAbility()); + } + + public HulkingOgre(final HulkingOgre card) { + super(card); + } + + @Override + public HulkingOgre copy() { + return new HulkingOgre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/HulkingOgre.java b/Mage.Sets/src/mage/sets/urzasdestiny/HulkingOgre.java new file mode 100644 index 0000000000..ca75ebcb2c --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/HulkingOgre.java @@ -0,0 +1,54 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class HulkingOgre extends mage.sets.starter1999.HulkingOgre { + + public HulkingOgre(UUID ownerId) { + super(ownerId); + this.cardNumber = 87; + this.expansionSetCode = "UDS"; + this.rarity = Rarity.COMMON; + } + + public HulkingOgre(final HulkingOgre card) { + super(card); + } + + @Override + public HulkingOgre copy() { + return new HulkingOgre(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MarkerBeetles.java b/Mage.Sets/src/mage/sets/urzasdestiny/MarkerBeetles.java new file mode 100644 index 0000000000..bae7f80390 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MarkerBeetles.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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MarkerBeetles extends CardImpl { + + public MarkerBeetles(UUID ownerId) { + super(ownerId, 112, "Marker Beetles", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{G}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Insect"); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // When Marker Beetles dies, target creature gets +1/+1 until end of turn. + Ability ability = new DiesTriggeredAbility(new BoostTargetEffect(1, 1, Duration.EndOfTurn), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + // {2}, Sacrifice Marker Beetles: Draw a card. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public MarkerBeetles(final MarkerBeetles card) { + super(card); + } + + @Override + public MarkerBeetles copy() { + return new MarkerBeetles(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MetathranSoldier.java b/Mage.Sets/src/mage/sets/urzasdestiny/MetathranSoldier.java new file mode 100644 index 0000000000..db7a06eac8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MetathranSoldier.java @@ -0,0 +1,63 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.keyword.CantBeBlockedSourceAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class MetathranSoldier extends CardImpl { + + public MetathranSoldier(UUID ownerId) { + super(ownerId, 39, "Metathran Soldier", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Metathran"); + this.subtype.add("Soldier"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Metathran Soldier is unblockable. + this.addAbility(new CantBeBlockedSourceAbility()); + } + + public MetathranSoldier(final MetathranSoldier card) { + super(card); + } + + @Override + public MetathranSoldier copy() { + return new MetathranSoldier(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Rescue.java b/Mage.Sets/src/mage/sets/urzasdestiny/Rescue.java new file mode 100644 index 0000000000..dfa985e378 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Rescue.java @@ -0,0 +1,60 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author LoneFox + */ +public class Rescue extends CardImpl { + + public Rescue(UUID ownerId) { + super(ownerId, 44, "Rescue", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "UDS"; + + // Return target permanent you control to its owner's hand. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetControlledPermanent()); + } + + public Rescue(final Rescue card) { + super(card); + } + + @Override + public Rescue copy() { + return new Rescue(this); + } +} From d78f6af412909f77a3b861b73281193ee28913c2 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 8 Oct 2015 10:27:25 +0300 Subject: [PATCH 3/6] Implement cards: Disease Carriers, Flame Jet, Kingfisher, and Phyrexian Monitor --- .../sets/urzasdestiny/DiseaseCarriers.java | 68 +++++++++++++++++++ .../src/mage/sets/urzasdestiny/FlameJet.java | 64 +++++++++++++++++ .../mage/sets/urzasdestiny/Kingfisher.java | 66 ++++++++++++++++++ .../sets/urzasdestiny/PhyrexianMonitor.java | 65 ++++++++++++++++++ 4 files changed, 263 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/DiseaseCarriers.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/FlameJet.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/Kingfisher.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianMonitor.java diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/DiseaseCarriers.java b/Mage.Sets/src/mage/sets/urzasdestiny/DiseaseCarriers.java new file mode 100644 index 0000000000..e72bac6b43 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/DiseaseCarriers.java @@ -0,0 +1,68 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DiseaseCarriers extends CardImpl { + + public DiseaseCarriers(UUID ownerId) { + super(ownerId, 57, "Disease Carriers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{B}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Rat"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Disease Carriers dies, target creature gets -2/-2 until end of turn. + Ability ability = new DiesTriggeredAbility(new BoostTargetEffect(-2, -2, Duration.EndOfTurn), false); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public DiseaseCarriers(final DiseaseCarriers card) { + super(card); + } + + @Override + public DiseaseCarriers copy() { + return new DiseaseCarriers(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/FlameJet.java b/Mage.Sets/src/mage/sets/urzasdestiny/FlameJet.java new file mode 100644 index 0000000000..617fb0ad9d --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/FlameJet.java @@ -0,0 +1,64 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.CyclingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.TargetPlayer; + +/** + * + * @author LoneFox + */ +public class FlameJet extends CardImpl { + + public FlameJet(UUID ownerId) { + super(ownerId, 81, "Flame Jet", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}"); + this.expansionSetCode = "UDS"; + + // Flame Jet deals 3 damage to target player. + this.getSpellAbility().addEffect(new DamageTargetEffect(3)); + this.getSpellAbility().addTarget(new TargetPlayer()); + // Cycling {2} + this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); + } + + public FlameJet(final FlameJet card) { + super(card); + } + + @Override + public FlameJet copy() { + return new FlameJet(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Kingfisher.java b/Mage.Sets/src/mage/sets/urzasdestiny/Kingfisher.java new file mode 100644 index 0000000000..8b8ca58982 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Kingfisher.java @@ -0,0 +1,66 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Kingfisher extends CardImpl { + + public Kingfisher(UUID ownerId) { + super(ownerId, 36, "Kingfisher", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Bird"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // When Kingfisher dies, draw a card. + this.addAbility(new DiesTriggeredAbility(new DrawCardSourceControllerEffect(1), false)); + } + + public Kingfisher(final Kingfisher card) { + super(card); + } + + @Override + public Kingfisher copy() { + return new Kingfisher(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianMonitor.java b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianMonitor.java new file mode 100644 index 0000000000..c025a391e6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianMonitor.java @@ -0,0 +1,65 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PhyrexianMonitor extends CardImpl { + + public PhyrexianMonitor(UUID ownerId) { + super(ownerId, 64, "Phyrexian Monitor", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Skeleton"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {B}: Regenerate Phyrexian Monitor. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public PhyrexianMonitor(final PhyrexianMonitor card) { + super(card); + } + + @Override + public PhyrexianMonitor copy() { + return new PhyrexianMonitor(this); + } +} From fdf8ad7a1d637b8355a3099c6597be8691e5e25e Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 8 Oct 2015 11:05:54 +0300 Subject: [PATCH 4/6] Implement cards: Capashen Standard, Mental Discipline, Reliquary Monk, and Slinking Skirge --- .../sets/urzasdestiny/CapashenStandard.java | 82 +++++++++++++++++++ .../sets/urzasdestiny/MentalDiscipline.java | 65 +++++++++++++++ .../mage/sets/urzasdestiny/ReliquaryMonk.java | 70 ++++++++++++++++ .../sets/urzasdestiny/SlinkingSkirge.java | 72 ++++++++++++++++ 4 files changed, 289 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/CapashenStandard.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/MentalDiscipline.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/ReliquaryMonk.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/SlinkingSkirge.java diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/CapashenStandard.java b/Mage.Sets/src/mage/sets/urzasdestiny/CapashenStandard.java new file mode 100644 index 0000000000..5e23a8041c --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/CapashenStandard.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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostEnchantedEffect; +import mage.abilities.keyword.EnchantAbility; +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.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class CapashenStandard extends CardImpl { + + public CapashenStandard(UUID ownerId) { + super(ownerId, 4, "Capashen Standard", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature gets +1/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield))); + // {2}, Sacrifice Capashen Standard: Draw a card. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public CapashenStandard(final CapashenStandard card) { + super(card); + } + + @Override + public CapashenStandard copy() { + return new CapashenStandard(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MentalDiscipline.java b/Mage.Sets/src/mage/sets/urzasdestiny/MentalDiscipline.java new file mode 100644 index 0000000000..d6cd85c3cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MentalDiscipline.java @@ -0,0 +1,65 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class MentalDiscipline extends CardImpl { + + public MentalDiscipline(UUID ownerId) { + super(ownerId, 37, "Mental Discipline", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); + this.expansionSetCode = "UDS"; + + // {1}{U}, Discard a card: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{1}{U}")); + ability.addCost(new DiscardCardCost()); + this.addAbility(ability); + } + + public MentalDiscipline(final MentalDiscipline card) { + super(card); + } + + @Override + public MentalDiscipline copy() { + return new MentalDiscipline(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/ReliquaryMonk.java b/Mage.Sets/src/mage/sets/urzasdestiny/ReliquaryMonk.java new file mode 100644 index 0000000000..dd5ebf7730 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/ReliquaryMonk.java @@ -0,0 +1,70 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.common.FilterArtifactOrEnchantmentPermanent; +import mage.target.TargetPermanent; + +/** + * + * @author LoneFox + */ +public class ReliquaryMonk extends CardImpl { + + public ReliquaryMonk(UUID ownerId) { + super(ownerId, 14, "Reliquary Monk", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Human"); + this.subtype.add("Monk"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Reliquary Monk dies, destroy target artifact or enchantment. + Ability ability = new DiesTriggeredAbility(new DestroyTargetEffect(), false); + ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent())); + this.addAbility(ability); + } + + public ReliquaryMonk(final ReliquaryMonk card) { + super(card); + } + + @Override + public ReliquaryMonk copy() { + return new ReliquaryMonk(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/SlinkingSkirge.java b/Mage.Sets/src/mage/sets/urzasdestiny/SlinkingSkirge.java new file mode 100644 index 0000000000..2c47c40928 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/SlinkingSkirge.java @@ -0,0 +1,72 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class SlinkingSkirge extends CardImpl { + + public SlinkingSkirge(UUID ownerId) { + super(ownerId, 71, "Slinking Skirge", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Imp"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Flying + this.addAbility(FlyingAbility.getInstance()); + // {2}, Sacrifice Slinking Skirge: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public SlinkingSkirge(final SlinkingSkirge card) { + super(card); + } + + @Override + public SlinkingSkirge copy() { + return new SlinkingSkirge(this); + } +} From d5856d10ccd13b5d9881c020ea3648487ebeff1d Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 8 Oct 2015 11:44:56 +0300 Subject: [PATCH 5/6] Implement cards: Encroach, Field Surgeon, Illuminated Wings, and Magnify --- .../src/mage/sets/urzasdestiny/Encroach.java | 71 ++++++++++++++++ .../mage/sets/urzasdestiny/FieldSurgeon.java | 82 ++++++++++++++++++ .../sets/urzasdestiny/IlluminatedWings.java | 84 +++++++++++++++++++ .../src/mage/sets/urzasdestiny/Magnify.java | 59 +++++++++++++ 4 files changed, 296 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/Encroach.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/FieldSurgeon.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/IlluminatedWings.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/Magnify.java diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Encroach.java b/Mage.Sets/src/mage/sets/urzasdestiny/Encroach.java new file mode 100644 index 0000000000..08ea3ed41b --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Encroach.java @@ -0,0 +1,71 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.filter.predicate.mageobject.SupertypePredicate; +import mage.target.common.TargetOpponent; + +/** + * + * @author LoneFox + */ +public class Encroach extends CardImpl { + + private static final FilterCard filter = new FilterCard("a nonbasic land card"); + + static { + filter.add(Predicates.not(new SupertypePredicate("Basic"))); + filter.add(new CardTypePredicate(CardType.LAND)); + } + + public Encroach(UUID ownerId) { + super(ownerId, 59, "Encroach", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "UDS"; + + // Target player reveals his or her hand. You choose a nonbasic land card from it. That player discards that card. + this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(filter)); + this.getSpellAbility().addTarget(new TargetOpponent()); + } + + public Encroach(final Encroach card) { + super(card); + } + + @Override + public Encroach copy() { + return new Encroach(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/FieldSurgeon.java b/Mage.Sets/src/mage/sets/urzasdestiny/FieldSurgeon.java new file mode 100644 index 0000000000..bfc228d342 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/FieldSurgeon.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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapTargetCost; +import mage.abilities.effects.common.PreventDamageToTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.TappedPredicate; +import mage.target.common.TargetControlledCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class FieldSurgeon extends CardImpl { + + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("an untapped creature you control"); + + static { + filter.add(Predicates.not(new TappedPredicate())); + } + + public FieldSurgeon(UUID ownerId) { + super(ownerId, 8, "Field Surgeon", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Tap an untapped creature you control: Prevent the next 1 damage that would be dealt to target creature this turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, 1), + new TapTargetCost(new TapTargetCost(new TargetControlledCreaturePermanent(filter)))); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public FieldSurgeon(final FieldSurgeon card) { + super(card); + } + + @Override + public FieldSurgeon copy() { + return new FieldSurgeon(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/IlluminatedWings.java b/Mage.Sets/src/mage/sets/urzasdestiny/IlluminatedWings.java new file mode 100644 index 0000000000..248051c64e --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/IlluminatedWings.java @@ -0,0 +1,84 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class IlluminatedWings extends CardImpl { + + public IlluminatedWings(UUID ownerId) { + super(ownerId, 34, "Illuminated Wings", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has flying. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA))); + // {2}, Sacrifice Illuminated Wings: Draw a card. + ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public IlluminatedWings(final IlluminatedWings card) { + super(card); + } + + @Override + public IlluminatedWings copy() { + return new IlluminatedWings(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/Magnify.java b/Mage.Sets/src/mage/sets/urzasdestiny/Magnify.java new file mode 100644 index 0000000000..2a1171cca5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/Magnify.java @@ -0,0 +1,59 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; + +/** + * + * @author LoneFox + */ +public class Magnify extends CardImpl { + + public Magnify(UUID ownerId) { + super(ownerId, 111, "Magnify", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G}"); + this.expansionSetCode = "UDS"; + + // All creatures get +1/+1 until end of turn. + this.getSpellAbility().addEffect(new BoostAllEffect(1, 1, Duration.EndOfTurn)); + } + + public Magnify(final Magnify card) { + super(card); + } + + @Override + public Magnify copy() { + return new Magnify(this); + } +} From 7b6bdd0a0b544efbd10562745014a34ca1ddc209 Mon Sep 17 00:00:00 2001 From: LoneFox Date: Thu, 8 Oct 2015 12:37:06 +0300 Subject: [PATCH 6/6] Implement cards: Dying Wail, Mark of Fury, Plague Dogs, and Urza's Incubator --- .../src/mage/sets/urzasdestiny/DyingWail.java | 75 +++++++++++++++++ .../mage/sets/urzasdestiny/MarkOfFury.java | 80 +++++++++++++++++++ .../mage/sets/urzasdestiny/PlagueDogs.java | 75 +++++++++++++++++ .../sets/urzasdestiny/UrzasIncubator.java | 69 ++++++++++++++++ 4 files changed, 299 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/DyingWail.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/MarkOfFury.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/PlagueDogs.java create mode 100644 Mage.Sets/src/mage/sets/urzasdestiny/UrzasIncubator.java diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/DyingWail.java b/Mage.Sets/src/mage/sets/urzasdestiny/DyingWail.java new file mode 100644 index 0000000000..b3a9815c52 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/DyingWail.java @@ -0,0 +1,75 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.DiesAttachedTriggeredAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.discard.DiscardTargetEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.target.TargetPermanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class DyingWail extends CardImpl { + + public DyingWail(UUID ownerId) { + super(ownerId, 58, "Dying Wail", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // When enchanted creature dies, target player discards two cards. + ability = new DiesAttachedTriggeredAbility(new DiscardTargetEffect(2), "enchanted creature"); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public DyingWail(final DyingWail card) { + super(card); + } + + @Override + public DyingWail copy() { + return new DyingWail(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/MarkOfFury.java b/Mage.Sets/src/mage/sets/urzasdestiny/MarkOfFury.java new file mode 100644 index 0000000000..1323172005 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/MarkOfFury.java @@ -0,0 +1,80 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.BeginningOfEndStepTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author LoneFox + */ +public class MarkOfFury extends CardImpl { + + public MarkOfFury(UUID ownerId) { + super(ownerId, 93, "Mark of Fury", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{R}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Aura"); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + // Enchanted creature has haste. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.AURA))); + // At the beginning of the end step, return Mark of Fury to its owner's hand. + this.addAbility(new BeginningOfEndStepTriggeredAbility(new ReturnToHandSourceEffect(true), TargetController.YOU, false)); + } + + public MarkOfFury(final MarkOfFury card) { + super(card); + } + + @Override + public MarkOfFury copy() { + return new MarkOfFury(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/PlagueDogs.java b/Mage.Sets/src/mage/sets/urzasdestiny/PlagueDogs.java new file mode 100644 index 0000000000..533484e968 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/PlagueDogs.java @@ -0,0 +1,75 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author LoneFox + */ +public class PlagueDogs extends CardImpl { + + public PlagueDogs(UUID ownerId) { + super(ownerId, 66, "Plague Dogs", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "UDS"; + this.subtype.add("Zombie"); + this.subtype.add("Hound"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Plague Dogs dies, all creatures get -1/-1 until end of turn. + this.addAbility(new DiesTriggeredAbility(new BoostAllEffect(-1, -1, Duration.EndOfTurn), false)); + // {2}, Sacrifice Plague Dogs: Draw a card. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{2}")); + ability.addCost(new SacrificeSourceCost()); + this.addAbility(ability); + } + + public PlagueDogs(final PlagueDogs card) { + super(card); + } + + @Override + public PlagueDogs copy() { + return new PlagueDogs(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/UrzasIncubator.java b/Mage.Sets/src/mage/sets/urzasdestiny/UrzasIncubator.java new file mode 100644 index 0000000000..e91445dce3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzasdestiny/UrzasIncubator.java @@ -0,0 +1,69 @@ +/* + * 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.urzasdestiny; + +import java.util.UUID; +import mage.abilities.common.AsEntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.ChooseCreatureTypeEffect; +import mage.abilities.effects.common.cost.SpellsCostReductionAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ChosenSubtypePredicate; + +/** + * + * @author LoneFox + */ +public class UrzasIncubator extends CardImpl { + + public UrzasIncubator(UUID ownerId) { + super(ownerId, 142, "Urza's Incubator", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "UDS"; + + // As Urza's Incubator enters the battlefield, choose a creature type. + this.addAbility(new AsEntersBattlefieldAbility(new ChooseCreatureTypeEffect(Outcome.BoostCreature))); + // Creature spells of the chosen type cost {2} less to cast. + FilterCreatureCard filter = new FilterCreatureCard("creature spells of the chosen type"); + filter.add(new ChosenSubtypePredicate(this.getId())); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionAllEffect(filter, 2))); + } + + public UrzasIncubator(final UrzasIncubator card) { + super(card); + } + + @Override + public UrzasIncubator copy() { + return new UrzasIncubator(this); + } +}