From c969283057aeaa695e2681b65a6b82b63da4a7b8 Mon Sep 17 00:00:00 2001 From: vereena42 Date: Tue, 21 Feb 2017 20:30:41 +0100 Subject: [PATCH 1/2] Adding some cards --- .../src/mage/cards/c/CoalhaulerSwine.java | 99 +++++++++++++++ Mage.Sets/src/mage/cards/d/DeathWatch.java | 117 ++++++++++++++++++ .../src/mage/cards/m/MistformUltimus.java | 64 ++++++++++ Mage.Sets/src/mage/sets/Legions.java | 1 + .../src/mage/sets/RavnicaCityOfGuilds.java | 1 + .../src/mage/sets/TimeSpiralTimeshifted.java | 1 + Mage.Sets/src/mage/sets/Visions.java | 1 + 7 files changed, 284 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/c/CoalhaulerSwine.java create mode 100644 Mage.Sets/src/mage/cards/d/DeathWatch.java create mode 100644 Mage.Sets/src/mage/cards/m/MistformUltimus.java diff --git a/Mage.Sets/src/mage/cards/c/CoalhaulerSwine.java b/Mage.Sets/src/mage/cards/c/CoalhaulerSwine.java new file mode 100644 index 00000000000..77cac8a8db3 --- /dev/null +++ b/Mage.Sets/src/mage/cards/c/CoalhaulerSwine.java @@ -0,0 +1,99 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.c; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealtDamageToSourceTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +import java.util.UUID; + +/** + * + * @author vereena42 + */ +public class CoalhaulerSwine extends CardImpl { + + public CoalhaulerSwine(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + + this.subtype.add("Boar"); + this.subtype.add("Beast"); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // Whenever Coalhauler Swine is dealt damage, it deals that much damage to each player. + this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, new CoalhaulerSwineEffect(), false)); + } + + public CoalhaulerSwine(final CoalhaulerSwine card) { + super(card); + } + + @Override + public CoalhaulerSwine copy() { + return new CoalhaulerSwine(this); + } + + class CoalhaulerSwineEffect extends OneShotEffect { + + public CoalhaulerSwineEffect() { + super(Outcome.Damage); + staticText = "it deals that much damage to each player"; + } + + public CoalhaulerSwineEffect(final CoalhaulerSwineEffect effect) { + super(effect); + } + + @Override + public CoalhaulerSwineEffect copy() { + return new CoalhaulerSwineEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + for (UUID playerId : game.getPlayers().keySet()) { + Player player = game.getPlayer(playerId); + if(player != null) { + player.damage((Integer) this.getValue("damage"), source.getSourceId(), game, false, true); + } + } + return true; + } + + } +} diff --git a/Mage.Sets/src/mage/cards/d/DeathWatch.java b/Mage.Sets/src/mage/cards/d/DeathWatch.java new file mode 100644 index 00000000000..74aa304dddc --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DeathWatch.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.cards.d; + +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.common.DiesAttachedTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * + * @author vereena42 + */ +public class DeathWatch extends CardImpl { + + public DeathWatch(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}"); + + 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); + + // When enchanted creature dies, its controller loses life equal to its power and you gain life equal to its toughness. + this.addAbility( new DiesAttachedTriggeredAbility(new DeathWatchEffect(), "enchanted creature")); + } + + public DeathWatch(final DeathWatch card) { + super(card); + } + + @Override + public DeathWatch copy() { + return new DeathWatch(this); + } + + class DeathWatchEffect extends OneShotEffect { + + public DeathWatchEffect() { + super(Outcome.LoseLife); + } + + public DeathWatchEffect(DeathWatchEffect copy) { + super(copy); + } + + @Override + public DeathWatchEffect copy() { + return new DeathWatchEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = (Permanent) getValue("attachedTo"); + if(creature != null){ + Player opponent = game.getPlayer(creature.getOwnerId()); + if (opponent != null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + controller.gainLife(creature.getToughness().getValue(), game); + opponent.loseLife(creature.getPower().getValue(), game, false); + return true; + } + } + } + return false; + } + + @Override + public String getText(Mode mode) { + return "that creature's controller loses life equal to its power and you gain life equal to its toughness."; + } + + } +} diff --git a/Mage.Sets/src/mage/cards/m/MistformUltimus.java b/Mage.Sets/src/mage/cards/m/MistformUltimus.java new file mode 100644 index 00000000000..2a0fe42642f --- /dev/null +++ b/Mage.Sets/src/mage/cards/m/MistformUltimus.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.cards.m; + +import mage.MageInt; +import mage.abilities.keyword.ChangelingAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; + +import java.util.UUID; + +/** + * + * @author vereena42 + */ +public class MistformUltimus extends CardImpl { + + public MistformUltimus(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); + + this.supertype.add("Legendary"); + this.subtype.add("Illusion"); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Mistform Ultimus is every creature type. + this.addAbility(ChangelingAbility.getInstance()); + } + + public MistformUltimus(final MistformUltimus card) { + super(card); + } + + @Override + public MistformUltimus copy() { + return new MistformUltimus(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Legions.java b/Mage.Sets/src/mage/sets/Legions.java index 7f71a2612f9..aad668e2643 100644 --- a/Mage.Sets/src/mage/sets/Legions.java +++ b/Mage.Sets/src/mage/sets/Legions.java @@ -127,6 +127,7 @@ public class Legions extends ExpansionSet { cards.add(new SetCardInfo("Magma Sliver", 107, Rarity.RARE, mage.cards.m.MagmaSliver.class)); cards.add(new SetCardInfo("Merchant of Secrets", 44, Rarity.COMMON, mage.cards.m.MerchantOfSecrets.class)); cards.add(new SetCardInfo("Mistform Sliver", 46, Rarity.COMMON, mage.cards.m.MistformSliver.class)); + cards.add(new SetCardInfo("Mistform Ultimus", 47, Rarity.RARE, mage.cards.m.MistformUltimus.class)); cards.add(new SetCardInfo("Nantuko Vigilante", 132, Rarity.COMMON, mage.cards.n.NantukoVigilante.class)); cards.add(new SetCardInfo("Needleshot Gourna", 133, Rarity.COMMON, mage.cards.n.NeedleshotGourna.class)); cards.add(new SetCardInfo("Noxious Ghoul", 77, Rarity.UNCOMMON, mage.cards.n.NoxiousGhoul.class)); diff --git a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java index 2be2711c2e1..86fe4790847 100644 --- a/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java +++ b/Mage.Sets/src/mage/sets/RavnicaCityOfGuilds.java @@ -89,6 +89,7 @@ public class RavnicaCityOfGuilds extends ExpansionSet { cards.add(new SetCardInfo("Clinging Darkness", 80, Rarity.COMMON, mage.cards.c.ClingingDarkness.class)); cards.add(new SetCardInfo("Cloudstone Curio", 257, Rarity.RARE, mage.cards.c.CloudstoneCurio.class)); cards.add(new SetCardInfo("Clutch of the Undercity", 197, Rarity.UNCOMMON, mage.cards.c.ClutchOfTheUndercity.class)); + cards.add(new SetCardInfo("Coalhauler Swine", 119, Rarity.COMMON, mage.cards.c.CoalhaulerSwine.class)); cards.add(new SetCardInfo("Compulsive Research", 40, Rarity.COMMON, mage.cards.c.CompulsiveResearch.class)); cards.add(new SetCardInfo("Concerted Effort", 8, Rarity.RARE, mage.cards.c.ConcertedEffort.class)); cards.add(new SetCardInfo("Conclave Equenaut", 9, Rarity.COMMON, mage.cards.c.ConclaveEquenaut.class)); diff --git a/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java b/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java index 17b166f29aa..deba2b69bd9 100644 --- a/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java +++ b/Mage.Sets/src/mage/sets/TimeSpiralTimeshifted.java @@ -105,6 +105,7 @@ public class TimeSpiralTimeshifted extends ExpansionSet { cards.add(new SetCardInfo("Merieke Ri Berit", 95, Rarity.SPECIAL, mage.cards.m.MeriekeRiBerit.class)); cards.add(new SetCardInfo("Mindless Automaton", 111, Rarity.SPECIAL, mage.cards.m.MindlessAutomaton.class)); cards.add(new SetCardInfo("Mirari", 112, Rarity.SPECIAL, mage.cards.m.Mirari.class)); + cards.add(new SetCardInfo("Mistform Ultimus", 26, Rarity.SPECIAL, mage.cards.m.MistformUltimus.class)); cards.add(new SetCardInfo("Moorish Cavalry", 11, Rarity.COMMON, mage.cards.m.MoorishCavalry.class)); cards.add(new SetCardInfo("Mystic Enforcer", 96, Rarity.SPECIAL, mage.cards.m.MysticEnforcer.class)); cards.add(new SetCardInfo("Mystic Snake", 97, Rarity.COMMON, mage.cards.m.MysticSnake.class)); diff --git a/Mage.Sets/src/mage/sets/Visions.java b/Mage.Sets/src/mage/sets/Visions.java index 25b49f8b709..21c171445cc 100644 --- a/Mage.Sets/src/mage/sets/Visions.java +++ b/Mage.Sets/src/mage/sets/Visions.java @@ -68,6 +68,7 @@ public class Visions extends ExpansionSet { cards.add(new SetCardInfo("Creeping Mold", 53, Rarity.UNCOMMON, mage.cards.c.CreepingMold.class)); cards.add(new SetCardInfo("Crypt Rats", 5, Rarity.COMMON, mage.cards.c.CryptRats.class)); cards.add(new SetCardInfo("Daraja Griffin", 102, Rarity.UNCOMMON, mage.cards.d.DarajaGriffin.class)); + cards.add(new SetCardInfo("Death Watch", 7, Rarity.COMMON, mage.cards.d.DeathWatch.class)); cards.add(new SetCardInfo("Desertion", 30, Rarity.RARE, mage.cards.d.Desertion.class)); cards.add(new SetCardInfo("Diamond Kaleidoscope", 143, Rarity.RARE, mage.cards.d.DiamondKaleidoscope.class)); cards.add(new SetCardInfo("Dormant Volcano", 161, Rarity.UNCOMMON, mage.cards.d.DormantVolcano.class)); From 877560d57b30b3379a14b58763cb65667287f95c Mon Sep 17 00:00:00 2001 From: vereena42 Date: Wed, 22 Feb 2017 22:58:07 +0100 Subject: [PATCH 2/2] Fix --- Mage.Sets/src/mage/cards/d/DeathWatch.java | 7 +------ Mage.Sets/src/mage/cards/m/MistformUltimus.java | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DeathWatch.java b/Mage.Sets/src/mage/cards/d/DeathWatch.java index 74aa304dddc..dccd3c92eca 100644 --- a/Mage.Sets/src/mage/cards/d/DeathWatch.java +++ b/Mage.Sets/src/mage/cards/d/DeathWatch.java @@ -28,7 +28,6 @@ package mage.cards.d; import mage.abilities.Ability; -import mage.abilities.Mode; import mage.abilities.common.DiesAttachedTriggeredAbility; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.AttachEffect; @@ -80,6 +79,7 @@ public class DeathWatch extends CardImpl { public DeathWatchEffect() { super(Outcome.LoseLife); + staticText = "that creature's controller loses life equal to its power and you gain life equal to its toughness."; } public DeathWatchEffect(DeathWatchEffect copy) { @@ -108,10 +108,5 @@ public class DeathWatch extends CardImpl { return false; } - @Override - public String getText(Mode mode) { - return "that creature's controller loses life equal to its power and you gain life equal to its toughness."; - } - } } diff --git a/Mage.Sets/src/mage/cards/m/MistformUltimus.java b/Mage.Sets/src/mage/cards/m/MistformUltimus.java index 2a0fe42642f..6e14a3d0b82 100644 --- a/Mage.Sets/src/mage/cards/m/MistformUltimus.java +++ b/Mage.Sets/src/mage/cards/m/MistformUltimus.java @@ -50,7 +50,7 @@ public class MistformUltimus extends CardImpl { this.toughness = new MageInt(3); // Mistform Ultimus is every creature type. - this.addAbility(ChangelingAbility.getInstance()); + this.subtype.add(ChangelingAbility.ALL_CREATURE_TYPE); // "All Creature Type" } public MistformUltimus(final MistformUltimus card) {