diff --git a/Mage.Sets/src/mage/sets/magic2014/HauntedPlateMail.java b/Mage.Sets/src/mage/sets/magic2014/HauntedPlateMail.java new file mode 100644 index 0000000000..bc661b8b25 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/HauntedPlateMail.java @@ -0,0 +1,117 @@ +/* + * 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.magic2014; + +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.CostImpl; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BecomesCreatureSourceEffect; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.keyword.EquipAbility; +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.filter.common.FilterControlledCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.token.Token; + +/** + * + * @author Plopman + */ +public class HauntedPlateMail extends CardImpl { + + public HauntedPlateMail(UUID ownerId) { + super(ownerId, 212, "Haunted Plate Mail", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "M14"; + this.subtype.add("Equipment"); + + // Equipped creature gets +4/+4. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2))); + // {0}: Until end of turn, Haunted Plate Mail becomes a 4/4 Spirit artifact creature that's no longer an Equipment. Activate this ability only if you control no creatures. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new HauntedPlateMailToken(), "", Duration.Custom), new HauntedPlateMailCost()); + this.addAbility(ability); + // Equip {4} + this.addAbility(new EquipAbility(Outcome.BoostCreature, new ManaCostsImpl("{4}"))); + } + + public HauntedPlateMail(final HauntedPlateMail card) { + super(card); + } + + @Override + public HauntedPlateMail copy() { + return new HauntedPlateMail(this); + } +} + +class HauntedPlateMailCost extends CostImpl { + + public HauntedPlateMailCost() { + this.text = "Activate this ability only if you control no creatures"; + } + + public HauntedPlateMailCost(final HauntedPlateMailCost cost) { + super(cost); + } + + @Override + public boolean canPay(UUID sourceId, UUID controllerId, Game game) { + return !game.getBattlefield().contains(new FilterControlledCreaturePermanent(), controllerId, 1, game); + } + + @Override + public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { + this.paid = true; + return paid; + } + + @Override + public HauntedPlateMailCost copy() { + return new HauntedPlateMailCost(this); + } +} + +class HauntedPlateMailToken extends Token { + + public HauntedPlateMailToken() { + super("Spirit", "4/4 Spirit artifact creature that's no longer an Equipment"); + cardType.add(CardType.ARTIFACT); + cardType.add(CardType.CREATURE); + subtype.add("Spirit"); + power = new MageInt(4); + toughness = new MageInt(4); + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/magic2014/PyromancersGauntlet.java b/Mage.Sets/src/mage/sets/magic2014/PyromancersGauntlet.java new file mode 100644 index 0000000000..8884485db4 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/PyromancersGauntlet.java @@ -0,0 +1,118 @@ +/* + * 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.magic2014; + +import java.util.UUID; +import mage.MageObject; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.game.stack.Spell; + +/** + * + * @author Plopman + */ +public class PyromancersGauntlet extends CardImpl { + + public PyromancersGauntlet(UUID ownerId) { + super(ownerId, 214, "Pyromancer's Gauntlet", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{5}"); + this.expansionSetCode = "M14"; + + // If a red instant or sorcery spell you control or a red planeswalker you control would deal damage to a permanent or player, it deals that much damage plus 2 to that permanent or player instead. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PyromancersGauntletReplacementEffect())); + } + + public PyromancersGauntlet(final PyromancersGauntlet card) { + super(card); + } + + @Override + public PyromancersGauntlet copy() { + return new PyromancersGauntlet(this); + } +} + +class PyromancersGauntletReplacementEffect extends ReplacementEffectImpl { + + PyromancersGauntletReplacementEffect() { + super(Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "If a red instant or sorcery spell you control or a red planeswalker you control would deal damage to a permanent or player, it deals that much damage plus 2 to that permanent or player instead"; + } + + PyromancersGauntletReplacementEffect(final PyromancersGauntletReplacementEffect effect) { + super(effect); + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER) + || event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE) + || event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER)) { + MageObject object = game.getObject(event.getSourceId()); + if (object != null && object instanceof Spell) { + if (((Spell) object).getControllerId().equals(source.getControllerId()) + && (object.getCardType().contains(CardType.INSTANT) + || object.getCardType().contains(CardType.SORCERY))){ + return true; + } + } + Permanent permanent = game.getBattlefield().getPermanent(event.getSourceId()); + if(permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER)){ + return true; + } + } + return false; + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + event.setAmount(event.getAmount() + 2); + return false; + } + + @Override + public PyromancersGauntletReplacementEffect copy() { + return new PyromancersGauntletReplacementEffect(this); + } + +} diff --git a/Mage.Sets/src/mage/sets/magic2014/StaffOfTheDeathMagus.java b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheDeathMagus.java new file mode 100644 index 0000000000..a54384b9d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheDeathMagus.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.magic2014; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.SpellCastTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author Plopman + */ +public class StaffOfTheDeathMagus extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a black spell"); + private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Swamp"); + + static { + filterSpell.add(new ColorPredicate(ObjectColor.BLACK)); + filterLand.add(new SubtypePredicate("Swamp")); + } + + public StaffOfTheDeathMagus(UUID ownerId) { + super(ownerId, 219, "Staff of the Death Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M14"; + + // Whenever you cast a black spell or a Swamp enters the battlefield under your control, you gain 1 life. + this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false)); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false)); + } + + public StaffOfTheDeathMagus(final StaffOfTheDeathMagus card) { + super(card); + } + + @Override + public StaffOfTheDeathMagus copy() { + return new StaffOfTheDeathMagus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2014/StaffOfTheFlameMagus.java b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheFlameMagus.java new file mode 100644 index 0000000000..70fda7bac6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheFlameMagus.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.magic2014; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.SpellCastTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author Plopman + */ +public class StaffOfTheFlameMagus extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a red spell"); + private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Mountain"); + + static { + filterSpell.add(new ColorPredicate(ObjectColor.RED)); + filterLand.add(new SubtypePredicate("Mountain")); + } + + public StaffOfTheFlameMagus(UUID ownerId) { + super(ownerId, 220, "Staff of the Flame Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M14"; + + // Whenever you cast a red spell or a Mountain enters the battlefield under your control, you gain 1 life. + this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false)); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false)); + } + + public StaffOfTheFlameMagus(final StaffOfTheFlameMagus card) { + super(card); + } + + @Override + public StaffOfTheFlameMagus copy() { + return new StaffOfTheFlameMagus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2014/StaffOfTheMindMagus.java b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheMindMagus.java new file mode 100644 index 0000000000..3d3c5e8bf7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheMindMagus.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.magic2014; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.SpellCastTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author Plopman + */ +public class StaffOfTheMindMagus extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a blue spell"); + private static final FilterLandPermanent filterLand = new FilterLandPermanent("an Island"); + + static { + filterSpell.add(new ColorPredicate(ObjectColor.BLUE)); + filterLand.add(new SubtypePredicate("Island")); + } + + public StaffOfTheMindMagus(UUID ownerId) { + super(ownerId, 221, "Staff of the Mind Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M14"; + + // Whenever you cast a blue spell or an Island enters the battlefield under your control, you gain 1 life. + this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false)); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false)); + } + + public StaffOfTheMindMagus(final StaffOfTheMindMagus card) { + super(card); + } + + @Override + public StaffOfTheMindMagus copy() { + return new StaffOfTheMindMagus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2014/StaffOfTheSunMagus.java b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheSunMagus.java new file mode 100644 index 0000000000..b25cae43cb --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheSunMagus.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.magic2014; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.SpellCastTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author Plopman + */ +public class StaffOfTheSunMagus extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a white spell"); + private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Plains"); + + static { + filterSpell.add(new ColorPredicate(ObjectColor.WHITE)); + filterLand.add(new SubtypePredicate("Plains")); + } + + public StaffOfTheSunMagus(UUID ownerId) { + super(ownerId, 222, "Staff of the Sun Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M14"; + + // Whenever you cast a white spell or a Plains enters the battlefield under your control, you gain 1 life. + this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false)); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false)); + } + + public StaffOfTheSunMagus(final StaffOfTheSunMagus card) { + super(card); + } + + @Override + public StaffOfTheSunMagus copy() { + return new StaffOfTheSunMagus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2014/StaffOfTheWildMagus.java b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheWildMagus.java new file mode 100644 index 0000000000..2c2b5801f1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/StaffOfTheWildMagus.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.magic2014; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; +import mage.abilities.common.SpellCastTriggeredAbility; +import mage.abilities.effects.common.GainLifeEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterSpell; +import mage.filter.common.FilterLandPermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author Plopman + */ +public class StaffOfTheWildMagus extends CardImpl { + + private static final FilterSpell filterSpell = new FilterSpell("a green spell"); + private static final FilterLandPermanent filterLand = new FilterLandPermanent("a Forest"); + + static { + filterSpell.add(new ColorPredicate(ObjectColor.GREEN)); + filterLand.add(new SubtypePredicate("Forest")); + } + + public StaffOfTheWildMagus(UUID ownerId) { + super(ownerId, 223, "Staff of the Wild Magus", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{3}"); + this.expansionSetCode = "M14"; + + // Whenever you cast a green spell or a Forest enters the battlefield under your control, you may gain 1 life. + this.addAbility(new SpellCastTriggeredAbility(new GainLifeEffect(1), filterSpell,false)); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new GainLifeEffect(1), filterLand, false)); + } + + public StaffOfTheWildMagus(final StaffOfTheWildMagus card) { + super(card); + } + + @Override + public StaffOfTheWildMagus copy() { + return new StaffOfTheWildMagus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2014/StrionicResonator.java b/Mage.Sets/src/mage/sets/magic2014/StrionicResonator.java new file mode 100644 index 0000000000..0847cc72a9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/magic2014/StrionicResonator.java @@ -0,0 +1,201 @@ +/* + * 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.magic2014; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.TriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +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.FilterAbility; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.stack.StackAbility; +import mage.game.stack.StackObject; +import mage.players.Player; +import mage.target.TargetObject; + +/** + * + * @author Plopman + */ +public class StrionicResonator extends CardImpl { + + + + public StrionicResonator(UUID ownerId) { + super(ownerId, 224, "Strionic Resonator", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}"); + this.expansionSetCode = "M14"; + + // {2}, {T}: Copy target triggered ability you control. You may choose new targets for the copy. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new StrionicResonatorEffect(), new ManaCostsImpl("{2}")); + ability.addCost(new TapSourceCost()); + ability.addTarget(new TargetTriggeredAbility()); + this.addAbility(ability); + } + + public StrionicResonator(final StrionicResonator card) { + super(card); + } + + @Override + public StrionicResonator copy() { + return new StrionicResonator(this); + } +} + +class StrionicResonatorEffect extends OneShotEffect { + + public StrionicResonatorEffect() { + super(Outcome.Copy); + } + + public StrionicResonatorEffect(final StrionicResonatorEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + StackAbility stackAbility = (StackAbility)game.getStack().getStackObject(targetPointer.getFirst(game, source)); + if(stackAbility != null){ + Ability ability = (Ability) stackAbility.getStackAbility(); + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (ability != null && controller != null && sourcePermanent != null) { + Ability newAbility = ability.copy(); + newAbility.newId(); + game.getStack().push(new StackAbility(newAbility, source.getControllerId())); + if (newAbility.getTargets().size() > 0) { + if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) { + newAbility.getTargets().clearChosen(); + if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) { + return false; + } + } + } + game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(controller.getName()).append(" copied activated ability").toString()); + return true; + } + } + return false; + + } + + @Override + public StrionicResonatorEffect copy() { + return new StrionicResonatorEffect(this); + } + + @Override + public String getText(Mode mode) { + StringBuilder sb = new StringBuilder(); + sb.append("Copy target ").append(mode.getTargets().get(0).getTargetName()).append(". You may choose new targets for the copy"); + return sb.toString(); + } +} + +class TargetTriggeredAbility extends TargetObject { + + public TargetTriggeredAbility() { + this.minNumberOfTargets = 1; + this.maxNumberOfTargets = 1; + this.zone = Zone.STACK; + this.targetName = "target triggered ability"; + } + + public TargetTriggeredAbility(final TargetTriggeredAbility target) { + super(target); + } + + + @Override + public boolean canTarget(UUID id, Ability source, Game game) { + if (source != null && source.getId().equals(id)) { + return false; + } + + StackObject stackObject = game.getStack().getStackObject(id); + if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility) { + return true; + } + return false; + } + + @Override + public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { + return canChoose(sourceControllerId, game); + } + + @Override + public boolean canChoose(UUID sourceControllerId, Game game) { + for (StackObject stackObject : game.getStack()) { + if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) { + return true; + } + } + return false; + } + + @Override + public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { + return possibleTargets(sourceControllerId, game); + } + + @Override + public Set possibleTargets(UUID sourceControllerId, Game game) { + Set possibleTargets = new HashSet(); + for (StackObject stackObject : game.getStack()) { + if (stackObject.getStackAbility() != null && stackObject.getStackAbility() instanceof TriggeredAbility && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) { + possibleTargets.add(stackObject.getStackAbility().getId()); + } + } + return possibleTargets; + } + + @Override + public TargetTriggeredAbility copy() { + return new TargetTriggeredAbility(this); + } + + @Override + public Filter getFilter() { + return new FilterAbility(); + } + +}