From 726c98666f0792bc8c5a75db198cbbf85fb5f92a Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Mon, 10 Jul 2017 09:37:18 -0400 Subject: [PATCH 01/17] Implement Song of Serenity --- .../src/mage/cards/s/SongOfSerenity.java | 67 +++++++++++++++++++ Mage.Sets/src/mage/sets/Exodus.java | 1 + 2 files changed, 68 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/SongOfSerenity.java diff --git a/Mage.Sets/src/mage/cards/s/SongOfSerenity.java b/Mage.Sets/src/mage/cards/s/SongOfSerenity.java new file mode 100644 index 00000000000..c3b372250b8 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/SongOfSerenity.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.s; + +import java.util.UUID; + +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantAttackBlockAllEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.permanent.EnchantedPredicate; + +/** + * + * @author ciaccona007 + */ +public class SongOfSerenity extends CardImpl { + + public SongOfSerenity(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); + + // Creatures that are enchanted can't attack or block. + FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures that are enchanted"); + filter.add(new EnchantedPredicate()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockAllEffect(Duration.WhileOnBattlefield, filter))); + } + + public SongOfSerenity(final SongOfSerenity card) { + super(card); + } + + @Override + public SongOfSerenity copy() { + return new SongOfSerenity(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Exodus.java b/Mage.Sets/src/mage/sets/Exodus.java index b651b60bfcc..87c65ccd3ec 100644 --- a/Mage.Sets/src/mage/sets/Exodus.java +++ b/Mage.Sets/src/mage/sets/Exodus.java @@ -139,6 +139,7 @@ public class Exodus extends ExpansionSet { cards.add(new SetCardInfo("Skyshroud Elite", 123, Rarity.UNCOMMON, mage.cards.s.SkyshroudElite.class)); cards.add(new SetCardInfo("Slaughter", 74, Rarity.UNCOMMON, mage.cards.s.Slaughter.class)); cards.add(new SetCardInfo("Soltari Visionary", 20, Rarity.COMMON, mage.cards.s.SoltariVisionary.class)); + cards.add(new SetCardInfo("Song of Serenity", 125, Rarity.UNCOMMON, mage.cards.s.SongOfSerenity.class)); cards.add(new SetCardInfo("Sonic Burst", 103, Rarity.COMMON, mage.cards.s.SonicBurst.class)); cards.add(new SetCardInfo("Soul Warden", 21, Rarity.COMMON, mage.cards.s.SoulWarden.class)); cards.add(new SetCardInfo("Spellbook", 138, Rarity.UNCOMMON, mage.cards.s.Spellbook.class)); From d803ebc21a4dd7b4034d4122d10d0f0db3e4c4c7 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Mon, 10 Jul 2017 09:58:32 -0400 Subject: [PATCH 02/17] Remove imports from Song of Serenity --- Mage.Sets/src/mage/cards/s/SongOfSerenity.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/SongOfSerenity.java b/Mage.Sets/src/mage/cards/s/SongOfSerenity.java index c3b372250b8..22e0096e5d8 100644 --- a/Mage.Sets/src/mage/cards/s/SongOfSerenity.java +++ b/Mage.Sets/src/mage/cards/s/SongOfSerenity.java @@ -27,8 +27,6 @@ */ package mage.cards.s; -import java.util.UUID; - import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.combat.CantAttackBlockAllEffect; import mage.cards.CardImpl; @@ -36,11 +34,11 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Zone; -import mage.filter.Filter; -import mage.filter.StaticFilters; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.EnchantedPredicate; +import java.util.UUID; + /** * * @author ciaccona007 From 81ac455fabae7619b7b3536215995256fdee9500 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Mon, 10 Jul 2017 10:42:51 -0400 Subject: [PATCH 03/17] Implement Festering Wound --- .../src/mage/cards/f/FesteringWound.java | 118 ++++++++++++++++++ Mage.Sets/src/mage/sets/UrzasDestiny.java | 1 + .../main/java/mage/counters/CounterType.java | 1 + 3 files changed, 120 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/f/FesteringWound.java diff --git a/Mage.Sets/src/mage/cards/f/FesteringWound.java b/Mage.Sets/src/mage/cards/f/FesteringWound.java new file mode 100644 index 00000000000..6b87fb6e8c7 --- /dev/null +++ b/Mage.Sets/src/mage/cards/f/FesteringWound.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.cards.f; + +import java.util.UUID; + +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ChooseOpponentEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.counter.AddCountersSourceEffect; +import mage.cards.Card; +import mage.constants.*; +import mage.counters.Counter; +import mage.counters.CounterType; +import mage.filter.common.FilterCreatureCard; +import mage.filter.predicate.mageobject.ConvertedManaCostPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInHand; +import mage.target.common.TargetCreaturePermanent; +import mage.abilities.Ability; +import mage.abilities.effects.common.AttachEffect; +import mage.target.TargetPermanent; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; + +/** + * + * @author anonymous + */ +public class FesteringWound extends CardImpl { + + public FesteringWound(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{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); + + // At the beginning of your upkeep, you may put an infection counter on Festering Wound. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.INFECTION.createInstance(), true), TargetController.YOU, true)); + // At the beginning of the upkeep of enchanted creature's controller, Festering Wound deals X damage to that player, where X is the number of infection counters on Festering Wound. + this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new FesteringWoundEffect(), TargetController.CONTROLLER_ATTACHED_TO, false, true)); + } + + public FesteringWound(final FesteringWound card) { + super(card); + } + + @Override + public FesteringWound copy() { + return new FesteringWound(this); + } +} +class FesteringWoundEffect extends OneShotEffect { + + public FesteringWoundEffect() { + super(Outcome.Detriment); + this.staticText = "{this} deals X damage to that player, where X is the number of infection counters on {this}"; + } + + public FesteringWoundEffect(final FesteringWoundEffect effect) { + super(effect); + } + + @Override + public FesteringWoundEffect copy() { + return new FesteringWoundEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + UUID sourceId = source.getSourceId(); + int amount = game.getPermanent(sourceId).getCounters(game).getCount(CounterType.INFECTION); + UUID id = this.getTargetPointer().getFirst(game, source); + Player player = game.getPlayer(id); + if(player != null) { + player.damage(amount, source.getSourceId(), game, false, true); + return true; + } + return false; + } +} diff --git a/Mage.Sets/src/mage/sets/UrzasDestiny.java b/Mage.Sets/src/mage/sets/UrzasDestiny.java index 0ccf844f029..42e434817a1 100644 --- a/Mage.Sets/src/mage/sets/UrzasDestiny.java +++ b/Mage.Sets/src/mage/sets/UrzasDestiny.java @@ -86,6 +86,7 @@ public class UrzasDestiny extends ExpansionSet { cards.add(new SetCardInfo("Eradicate", 60, Rarity.UNCOMMON, mage.cards.e.Eradicate.class)); cards.add(new SetCardInfo("Extruder", 130, Rarity.UNCOMMON, mage.cards.e.Extruder.class)); cards.add(new SetCardInfo("False Prophet", 6, Rarity.RARE, mage.cards.f.FalseProphet.class)); + cards.add(new SetCardInfo("Festering Wound", 61, Rarity.UNCOMMON, mage.cards.f.FesteringWound.class)); cards.add(new SetCardInfo("Field Surgeon", 8, Rarity.COMMON, mage.cards.f.FieldSurgeon.class)); cards.add(new SetCardInfo("Flame Jet", 81, Rarity.COMMON, mage.cards.f.FlameJet.class)); cards.add(new SetCardInfo("Fledgling Osprey", 33, Rarity.COMMON, mage.cards.f.FledglingOsprey.class)); diff --git a/Mage/src/main/java/mage/counters/CounterType.java b/Mage/src/main/java/mage/counters/CounterType.java index 915d1452580..24fcd178b21 100644 --- a/Mage/src/main/java/mage/counters/CounterType.java +++ b/Mage/src/main/java/mage/counters/CounterType.java @@ -72,6 +72,7 @@ public enum CounterType { HOOFPRINT("hoofprint"), HOUR("hour"), ICE("ice"), + INFECTION("infection"), INTERVENTION("intervention"), JAVELIN("javelin"), KI("ki"), From c7c58ead8e009a8deba651e8323e1d653383a41f Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Mon, 10 Jul 2017 11:17:37 -0400 Subject: [PATCH 04/17] Add author for Festering Wound --- Mage.Sets/src/mage/cards/f/FesteringWound.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/cards/f/FesteringWound.java b/Mage.Sets/src/mage/cards/f/FesteringWound.java index 6b87fb6e8c7..0317ee92559 100644 --- a/Mage.Sets/src/mage/cards/f/FesteringWound.java +++ b/Mage.Sets/src/mage/cards/f/FesteringWound.java @@ -56,7 +56,7 @@ import mage.cards.CardSetInfo; /** * - * @author anonymous + * @author ciaccona007 */ public class FesteringWound extends CardImpl { From 3cab9814bd3bd6ab7d3050073e8f79167a86c454 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Thu, 13 Jul 2017 20:31:06 -0400 Subject: [PATCH 05/17] Implement Daru Spiritualist --- .../src/mage/cards/d/DaruSpiritualist.java | 117 ++++++++++++++++++ Mage.Sets/src/mage/sets/Scourge.java | 1 + 2 files changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/d/DaruSpiritualist.java diff --git a/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java b/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java new file mode 100644 index 00000000000..fddb2a70425 --- /dev/null +++ b/Mage.Sets/src/mage/cards/d/DaruSpiritualist.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.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.List; +import java.util.UUID; + +/** + * + * @author ciaccona007 + */ +public class DaruSpiritualist extends CardImpl { + + public DaruSpiritualist(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{W}"); + + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Whenever a Cleric creature you control becomes the target of a spell or ability, it gets +0/+2 until end of turn. + this.addAbility(new DaruSpiritualistAbility(new BoostTargetEffect(0,2, Duration.EndOfTurn))); + } + + public DaruSpiritualist(final DaruSpiritualist card) { + super(card); + } + + @Override + public DaruSpiritualist copy() { + return new DaruSpiritualist(this); + } +} + +class DaruSpiritualistAbility extends TriggeredAbilityImpl { + + public DaruSpiritualistAbility(Effect effect) { + super(Zone.BATTLEFIELD, effect); + } + + public DaruSpiritualistAbility(final DaruSpiritualistAbility ability) { + super(ability); + } + + @Override + public DaruSpiritualistAbility copy() { + return new DaruSpiritualistAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.TARGETED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + Permanent creature = game.getPermanent(event.getTargetId()); + game.informPlayers("name:" + creature.getName()); + List list = creature.getSubtype(game); + for(String s : list) { + game.informPlayers(s); + } + game.informPlayers("has cleric: " + creature.hasSubtype("Cleric", game)); + game.informPlayers("ids match: " + (creature.getControllerId() == this.getControllerId())); + if (creature != null && creature.isCreature() && creature.hasSubtype("Cleric", game) && creature.getControllerId() == this.getControllerId()) { + getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); + return true; + } + game.informPlayers("returning false"); + return false; + } + + @Override + public String getRule() { + return "Whenever a Cleric creature you control becomes the target of a spell or ability, it gets +0/+2 until end of turn."; + } +} diff --git a/Mage.Sets/src/mage/sets/Scourge.java b/Mage.Sets/src/mage/sets/Scourge.java index 6d76b96d950..4f7bc033476 100644 --- a/Mage.Sets/src/mage/sets/Scourge.java +++ b/Mage.Sets/src/mage/sets/Scourge.java @@ -77,6 +77,7 @@ public class Scourge extends ExpansionSet { cards.add(new SetCardInfo("Clutch of Undeath", 61, Rarity.COMMON, mage.cards.c.ClutchOfUndeath.class)); cards.add(new SetCardInfo("Coast Watcher", 30, Rarity.COMMON, mage.cards.c.CoastWatcher.class)); cards.add(new SetCardInfo("Consumptive Goo", 62, Rarity.RARE, mage.cards.c.ConsumptiveGoo.class)); + cards.add(new SetCardInfo("Daru Spiritualist", 5, Rarity.COMMON, mage.cards.d.DaruSpiritualist.class)); cards.add(new SetCardInfo("Daru Warchief", 6, Rarity.UNCOMMON, mage.cards.d.DaruWarchief.class)); cards.add(new SetCardInfo("Dawn Elemental", 7, Rarity.RARE, mage.cards.d.DawnElemental.class)); cards.add(new SetCardInfo("Day of the Dragons", 31, Rarity.RARE, mage.cards.d.DayOfTheDragons.class)); From 58fa1305d4ad8c198ce6474e38125bf6f2001914 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Thu, 13 Jul 2017 22:23:07 -0400 Subject: [PATCH 06/17] Remove debug code from Daru Spiritualist --- Mage.Sets/src/mage/cards/d/DaruSpiritualist.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java b/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java index fddb2a70425..a3dd6d24684 100644 --- a/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java +++ b/Mage.Sets/src/mage/cards/d/DaruSpiritualist.java @@ -95,18 +95,10 @@ class DaruSpiritualistAbility extends TriggeredAbilityImpl { @Override public boolean checkTrigger(GameEvent event, Game game) { Permanent creature = game.getPermanent(event.getTargetId()); - game.informPlayers("name:" + creature.getName()); - List list = creature.getSubtype(game); - for(String s : list) { - game.informPlayers(s); - } - game.informPlayers("has cleric: " + creature.hasSubtype("Cleric", game)); - game.informPlayers("ids match: " + (creature.getControllerId() == this.getControllerId())); if (creature != null && creature.isCreature() && creature.hasSubtype("Cleric", game) && creature.getControllerId() == this.getControllerId()) { getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId())); return true; } - game.informPlayers("returning false"); return false; } From 895839477972b027f435f84e88a642d6e4d91269 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Sun, 16 Jul 2017 16:04:51 -0400 Subject: [PATCH 07/17] Implement Kindle the Carnage --- .../src/mage/cards/k/KindleTheCarnage.java | 106 ++++++++++++++++++ Mage.Sets/src/mage/sets/Dissension.java | 1 + 2 files changed, 107 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/k/KindleTheCarnage.java diff --git a/Mage.Sets/src/mage/cards/k/KindleTheCarnage.java b/Mage.Sets/src/mage/cards/k/KindleTheCarnage.java new file mode 100644 index 00000000000..66e117e7283 --- /dev/null +++ b/Mage.Sets/src/mage/cards/k/KindleTheCarnage.java @@ -0,0 +1,106 @@ +/* + * 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.k; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.effects.common.DamageEverythingEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.StaticFilters; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author anonymous + */ +public class KindleTheCarnage extends CardImpl { + + public KindleTheCarnage(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{1}{R}{R}"); + + + // Discard a card at random. If you do, Kindle the Carnage deals damage equal to that card's converted mana cost to each creature. You may repeat this process any number of times. + this.getSpellAbility().addEffect(new KindleTheCarnageEffect()); + } + + public KindleTheCarnage(final KindleTheCarnage card) { + super(card); + } + + @Override + public KindleTheCarnage copy() { + return new KindleTheCarnage(this); + } +} +class KindleTheCarnageEffect extends OneShotEffect { + + public KindleTheCarnageEffect() { + super(Outcome.Neutral); + this.staticText = "discard a card at random. {this} deals damage equal to that card's converted mana cost to each creature. You may repeat this process any number of times"; + } + + public KindleTheCarnageEffect(final KindleTheCarnageEffect effect) { + super(effect); + } + + @Override + public KindleTheCarnageEffect copy() { + return new KindleTheCarnageEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + String message = "Discard another card at random to deal damage to each creature?"; + boolean cont = true; + while(cont) { + if(controller != null) { + Card discardedCard = controller.discardOne(true, source, game); + if (discardedCard != null) { + int damage = discardedCard.getConvertedManaCost(); + boolean damaged = new DamageAllEffect(damage, StaticFilters.FILTER_PERMANENT_CREATURE).apply(game, source); + if (!damaged) + return false; + } + cont = controller.getHand().size() > 0 && controller.chooseUse(outcome, message, source, game); + } else { + return false; + } + } + return true; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Dissension.java b/Mage.Sets/src/mage/sets/Dissension.java index f1d9450fbf1..8944fd48bc3 100644 --- a/Mage.Sets/src/mage/sets/Dissension.java +++ b/Mage.Sets/src/mage/sets/Dissension.java @@ -115,6 +115,7 @@ public class Dissension extends ExpansionSet { cards.add(new SetCardInfo("Infernal Tutor", 46, Rarity.RARE, mage.cards.i.InfernalTutor.class)); cards.add(new SetCardInfo("Isperia the Inscrutable", 114, Rarity.RARE, mage.cards.i.IsperiaTheInscrutable.class)); cards.add(new SetCardInfo("Kill-Suit Cultist", 65, Rarity.COMMON, mage.cards.k.KillSuitCultist.class)); + cards.add(new SetCardInfo("Kindle the Carnage", 66, Rarity.UNCOMMON, mage.cards.k.KindleTheCarnage.class)); cards.add(new SetCardInfo("Leafdrake Roost", 116, Rarity.UNCOMMON, mage.cards.l.LeafdrakeRoost.class)); cards.add(new SetCardInfo("Loaming Shaman", 87, Rarity.RARE, mage.cards.l.LoamingShaman.class)); cards.add(new SetCardInfo("Lyzolda, the Blood Witch", 117, Rarity.RARE, mage.cards.l.LyzoldaTheBloodWitch.class)); From 659c0270445e2198a1c34273d087c737a0c2910e Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Sun, 16 Jul 2017 16:13:04 -0400 Subject: [PATCH 08/17] Remove imports from Kindle the Carnage --- Mage.Sets/src/mage/cards/k/KindleTheCarnage.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Mage.Sets/src/mage/cards/k/KindleTheCarnage.java b/Mage.Sets/src/mage/cards/k/KindleTheCarnage.java index 66e117e7283..1916d79abf4 100644 --- a/Mage.Sets/src/mage/cards/k/KindleTheCarnage.java +++ b/Mage.Sets/src/mage/cards/k/KindleTheCarnage.java @@ -27,25 +27,23 @@ */ package mage.cards.k; -import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.DamageAllEffect; -import mage.abilities.effects.common.DamageEverythingEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; import mage.filter.StaticFilters; -import mage.filter.common.FilterCreaturePermanent; import mage.game.Game; import mage.players.Player; +import java.util.UUID; + /** * - * @author anonymous + * @author ciaccona007 */ public class KindleTheCarnage extends CardImpl { From a76d1f20978c39dc206e1ca70c68c2018abfb690 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Mon, 17 Jul 2017 00:14:11 -0400 Subject: [PATCH 09/17] Begin implementation of Seedtime --- Mage.Sets/src/mage/cards/s/Seedtime.java | 143 +++++++++++++++++++++++ Mage.Sets/src/mage/sets/Judgment.java | 1 + 2 files changed, 144 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/s/Seedtime.java diff --git a/Mage.Sets/src/mage/cards/s/Seedtime.java b/Mage.Sets/src/mage/cards/s/Seedtime.java new file mode 100644 index 00000000000..3254ef1a367 --- /dev/null +++ b/Mage.Sets/src/mage/cards/s/Seedtime.java @@ -0,0 +1,143 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.s; + +import java.util.List; +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.*; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.watchers.common.SpellsCastWatcher; + +/** + * + * @author ciaccona007 + */ +public class Seedtime extends CardImpl { + + public Seedtime(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}"); + + + // Cast Seedtime only during your turn. + this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastOnlyDuringYourTurnEffect())); + // Take an extra turn after this one if an opponent cast a blue spell this turn. + this.getSpellAbility().addEffect(new SeedtimeEffect()); + } + + public Seedtime(final Seedtime card) { + super(card); + } + + @Override + public Seedtime copy() { + return new Seedtime(this); + } +} + +class SeedtimeEffect extends OneShotEffect { + + public SeedtimeEffect() { + super(Outcome.Benefit); + this.staticText = "Take an extra turn after this one if an opponent cast a blue spell this turn."; + } + + public SeedtimeEffect(final SeedtimeEffect effect) { + super(effect); + } + + @Override + public SeedtimeEffect copy() { + return new SeedtimeEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + boolean condition = false; + SpellsCastWatcher watcher = (SpellsCastWatcher) game.getState().getWatchers().get(SpellsCastWatcher.class.getSimpleName()); + if (watcher != null) { + for (UUID opponentId : game.getOpponents(source.getControllerId())) { + List spells = watcher.getSpellsCastThisTurn(opponentId); + if (spells != null) { + for (Spell spell : spells) { + if (spell.getColor(game).isBlue()) { + condition = true; + } + } + } + } + } + if(condition && game.getPlayer(source.getControllerId()) != null) { + return new AddExtraTurnControllerEffect().apply(game, source); + } + return false; + } +} +class CastOnlyDuringYourTurnEffect extends ContinuousRuleModifyingEffectImpl { + + public CastOnlyDuringYourTurnEffect() { + super(Duration.EndOfGame, Outcome.Detriment); + staticText = "cast {this} only during your turn"; + } + + private CastOnlyDuringYourTurnEffect(final CastOnlyDuringYourTurnEffect effect) { + super(effect); + } + + @Override + public boolean checksEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.CAST_SPELL; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + // has to return true, if the spell cannot be cast in the current phase / step + UUID activePlayerId = game.getActivePlayerId(); + if (activePlayerId != null && event.getPlayerId().equals(source.getControllerId())) { + if(source.getControllerId().equals(activePlayerId)) { + return true; + } + } + return false; // cast not prevented by this effect + } + + @Override + public CastOnlyDuringYourTurnEffect copy() { + return new CastOnlyDuringYourTurnEffect(this); + } +} diff --git a/Mage.Sets/src/mage/sets/Judgment.java b/Mage.Sets/src/mage/sets/Judgment.java index 0d2fa87a1ad..b1cb49a0261 100644 --- a/Mage.Sets/src/mage/sets/Judgment.java +++ b/Mage.Sets/src/mage/sets/Judgment.java @@ -142,6 +142,7 @@ public class Judgment extends ExpansionSet { cards.add(new SetCardInfo("Ray of Revelation", 20, Rarity.COMMON, mage.cards.r.RayOfRevelation.class)); cards.add(new SetCardInfo("Riftstone Portal", 143, Rarity.UNCOMMON, mage.cards.r.RiftstonePortal.class)); cards.add(new SetCardInfo("Scalpelexis", 50, Rarity.RARE, mage.cards.s.Scalpelexis.class)); + cards.add(new SetCardInfo("Seedtime", 130, Rarity.RARE, mage.cards.s.Seedtime.class)); cards.add(new SetCardInfo("Silver Seraph", 23, Rarity.RARE, mage.cards.s.SilverSeraph.class)); cards.add(new SetCardInfo("Solitary Confinement", 24, Rarity.RARE, mage.cards.s.SolitaryConfinement.class)); cards.add(new SetCardInfo("Soulcatchers' Aerie", 25, Rarity.UNCOMMON, mage.cards.s.SoulcatchersAerie.class)); From db0d39479832eb2cb633bd1598f2a5f3b23b2b9e Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Mon, 17 Jul 2017 23:22:29 -0400 Subject: [PATCH 10/17] Implement Seedtime --- Mage.Sets/src/mage/cards/s/Seedtime.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Mage.Sets/src/mage/cards/s/Seedtime.java b/Mage.Sets/src/mage/cards/s/Seedtime.java index 3254ef1a367..dca8232a357 100644 --- a/Mage.Sets/src/mage/cards/s/Seedtime.java +++ b/Mage.Sets/src/mage/cards/s/Seedtime.java @@ -27,9 +27,6 @@ */ package mage.cards.s; -import java.util.List; -import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.ContinuousRuleModifyingEffectImpl; @@ -37,13 +34,18 @@ import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.stack.Spell; -import mage.players.Player; import mage.watchers.common.SpellsCastWatcher; +import java.util.List; +import java.util.UUID; + /** * * @author ciaccona007 @@ -56,8 +58,10 @@ public class Seedtime extends CardImpl { // Cast Seedtime only during your turn. this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastOnlyDuringYourTurnEffect())); + // Take an extra turn after this one if an opponent cast a blue spell this turn. this.getSpellAbility().addEffect(new SeedtimeEffect()); + this.getSpellAbility().addWatcher(new SpellsCastWatcher()); } public Seedtime(final Seedtime card) { @@ -128,10 +132,8 @@ class CastOnlyDuringYourTurnEffect extends ContinuousRuleModifyingEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { // has to return true, if the spell cannot be cast in the current phase / step UUID activePlayerId = game.getActivePlayerId(); - if (activePlayerId != null && event.getPlayerId().equals(source.getControllerId())) { - if(source.getControllerId().equals(activePlayerId)) { + if(activePlayerId != null && event.getSourceId().equals(source.getSourceId()) && !event.getPlayerId().equals(activePlayerId)) { return true; - } } return false; // cast not prevented by this effect } From a99da3d78fb75f8f2638036cc5f13c3e050c2410 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Tue, 18 Jul 2017 00:27:23 -0400 Subject: [PATCH 11/17] Implement Noble Benefactor --- .../src/mage/cards/n/NobleBenefactor.java | 116 ++++++++++++++++++ Mage.Sets/src/mage/sets/Weatherlight.java | 1 + 2 files changed, 117 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/n/NobleBenefactor.java diff --git a/Mage.Sets/src/mage/cards/n/NobleBenefactor.java b/Mage.Sets/src/mage/cards/n/NobleBenefactor.java new file mode 100644 index 00000000000..0892b9b3a49 --- /dev/null +++ b/Mage.Sets/src/mage/cards/n/NobleBenefactor.java @@ -0,0 +1,116 @@ +/* + * 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.n; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +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 mage.target.common.TargetCardInLibrary; + +import java.util.UUID; + +/** + * + * @author ciaccona007 + */ +public class NobleBenefactor extends CardImpl { + + public NobleBenefactor(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{U}"); + + this.subtype.add("Human"); + this.subtype.add("Cleric"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // When Noble Benefactor dies, each player may search his or her library for a card and put that card into his or her hand. Then each player who searched his or her library this way shuffles it. + this.addAbility(new DiesTriggeredAbility(new NobleBenefactorEffect())); + } + + public NobleBenefactor(final NobleBenefactor card) { + super(card); + } + + @Override + public NobleBenefactor copy() { + return new NobleBenefactor(this); + } +} + +class NobleBenefactorEffect extends OneShotEffect { + + public NobleBenefactorEffect() { + super(Outcome.Benefit); + this.staticText = "each player may search his or her library for a card and put that card into his or her hand. Then each player who searched his or her library this way shuffles it"; + } + + public NobleBenefactorEffect(final NobleBenefactorEffect effect) { + super(effect); + } + + @Override + public NobleBenefactorEffect copy() { + return new NobleBenefactorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) { + Player player = game.getPlayer(playerId); + if (player != null) { + TargetCardInLibrary target = new TargetCardInLibrary(); + if (player.chooseUse(Outcome.Benefit, "Search your library for a card to put into your hand?", source, game)) { + player.searchLibrary(target, game); + for (UUID cardId : target.getTargets()) { + Card card = player.getLibrary().getCard(cardId, game); + if (card != null) { + player.moveCards(card, Zone.HAND, source, game); + } + } + player.shuffleLibrary(source, game); + } + } + } + // prevent undo + controller.resetStoredBookmark(game); + return true; + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Weatherlight.java b/Mage.Sets/src/mage/sets/Weatherlight.java index 741d85df345..1db6ab52f35 100644 --- a/Mage.Sets/src/mage/sets/Weatherlight.java +++ b/Mage.Sets/src/mage/sets/Weatherlight.java @@ -145,6 +145,7 @@ public class Weatherlight extends ExpansionSet { cards.add(new SetCardInfo("Nature's Kiss", 78, Rarity.COMMON, mage.cards.n.NaturesKiss.class)); cards.add(new SetCardInfo("Nature's Resurgence", 79, Rarity.RARE, mage.cards.n.NaturesResurgence.class)); cards.add(new SetCardInfo("Necratog", 18, Rarity.UNCOMMON, mage.cards.n.Necratog.class)); + cards.add(new SetCardInfo("Noble Benefactor", 44, Rarity.UNCOMMON, mage.cards.n.NobleBenefactor.class)); cards.add(new SetCardInfo("Null Rod", 154, Rarity.RARE, mage.cards.n.NullRod.class)); cards.add(new SetCardInfo("Odylic Wraith", 19, Rarity.UNCOMMON, mage.cards.o.OdylicWraith.class)); cards.add(new SetCardInfo("Ophidian", 45, Rarity.COMMON, mage.cards.o.Ophidian.class)); From 01929de1dc11737b86b595f3a6272b08a900f784 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Tue, 18 Jul 2017 00:55:12 -0400 Subject: [PATCH 12/17] Implement Rites of Refusal --- .../src/mage/cards/r/RitesOfRefusal.java | 111 ++++++++++++++++++ Mage.Sets/src/mage/sets/Odyssey.java | 1 + 2 files changed, 112 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/r/RitesOfRefusal.java diff --git a/Mage.Sets/src/mage/cards/r/RitesOfRefusal.java b/Mage.Sets/src/mage/cards/r/RitesOfRefusal.java new file mode 100644 index 00000000000..321b0d1bfa5 --- /dev/null +++ b/Mage.Sets/src/mage/cards/r/RitesOfRefusal.java @@ -0,0 +1,111 @@ +/* + * 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.r; + +import java.util.UUID; + +import mage.abilities.Ability; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.CounterUnlessPaysEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.Target; +import mage.target.TargetSpell; +import mage.target.common.TargetCardInHand; + +/** + * + * @author ciaccona007 + */ +public class RitesOfRefusal extends CardImpl { + + public RitesOfRefusal(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); + + + // Discard any number of cards. Counter target spell unless its controller pays {3} for each card discarded this way. + this.getSpellAbility().addTarget(new TargetSpell()); + this.getSpellAbility().addEffect(new RitesOfRefusalEffect()); + } + + public RitesOfRefusal(final RitesOfRefusal card) { + super(card); + } + + @Override + public RitesOfRefusal copy() { + return new RitesOfRefusal(this); + } +} + +class RitesOfRefusalEffect extends OneShotEffect { + + public RitesOfRefusalEffect() { + super(Outcome.Benefit); + this.staticText = "Discard any number of cards. Counter target spell unless its controller pays {3} for each card discarded this way"; + } + + public RitesOfRefusalEffect(final RitesOfRefusalEffect effect) { + super(effect); + } + + @Override + public RitesOfRefusalEffect copy() { + return new RitesOfRefusalEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + if (player != null) { + Target target = new TargetCardInHand(0, Integer.MAX_VALUE, new FilterCard("cards to discard")); + while (player.canRespond() && !target.isChosen()) { + target.choose(Outcome.BoostCreature, player.getId(), source.getSourceId(), game); + } + int numDiscarded = 0; + for (UUID targetId : target.getTargets()) { + Card card = player.getHand().get(targetId, game); + if (player.discard(card, source, game)) { + numDiscarded++; + } + } + for (int i = 0; i < numDiscarded; i++) { + if(!new CounterUnlessPaysEffect(new GenericManaCost(3)).apply(game, source)) + return false; + } + } + return false; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/Odyssey.java b/Mage.Sets/src/mage/sets/Odyssey.java index ca9b9e16242..61d38d367c3 100644 --- a/Mage.Sets/src/mage/sets/Odyssey.java +++ b/Mage.Sets/src/mage/sets/Odyssey.java @@ -281,6 +281,7 @@ public class Odyssey extends ExpansionSet { cards.add(new SetCardInfo("Repentant Vampire", 157, Rarity.RARE, mage.cards.r.RepentantVampire.class)); cards.add(new SetCardInfo("Resilient Wanderer", 43, Rarity.UNCOMMON, mage.cards.r.ResilientWanderer.class)); cards.add(new SetCardInfo("Rites of Initiation", 217, Rarity.COMMON, mage.cards.r.RitesOfInitiation.class)); + cards.add(new SetCardInfo("Rites of Refusal", 99, Rarity.COMMON, mage.cards.r.RitesOfRefusal.class)); cards.add(new SetCardInfo("Roar of the Wurm", 266, Rarity.UNCOMMON, mage.cards.r.RoarOfTheWurm.class)); cards.add(new SetCardInfo("Rotting Giant", 158, Rarity.UNCOMMON, mage.cards.r.RottingGiant.class)); cards.add(new SetCardInfo("Sacred Rites", 44, Rarity.COMMON, mage.cards.s.SacredRites.class)); From c49311112ebd4764ee33d8f6ba8c324bc5d01cb7 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Tue, 18 Jul 2017 00:57:03 -0400 Subject: [PATCH 13/17] Format Rites of Refusal --- Mage.Sets/src/mage/cards/r/RitesOfRefusal.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/cards/r/RitesOfRefusal.java b/Mage.Sets/src/mage/cards/r/RitesOfRefusal.java index 321b0d1bfa5..7e18d5a7dea 100644 --- a/Mage.Sets/src/mage/cards/r/RitesOfRefusal.java +++ b/Mage.Sets/src/mage/cards/r/RitesOfRefusal.java @@ -27,8 +27,6 @@ */ package mage.cards.r; -import java.util.UUID; - import mage.abilities.Ability; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.OneShotEffect; @@ -45,6 +43,8 @@ import mage.target.Target; import mage.target.TargetSpell; import mage.target.common.TargetCardInHand; +import java.util.UUID; + /** * * @author ciaccona007 @@ -53,7 +53,6 @@ public class RitesOfRefusal extends CardImpl { public RitesOfRefusal(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}"); - // Discard any number of cards. Counter target spell unless its controller pays {3} for each card discarded this way. this.getSpellAbility().addTarget(new TargetSpell()); From e18bd6f363fcf0ce984cf98e20e0c116f3126e05 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Wed, 19 Jul 2017 01:27:33 -0400 Subject: [PATCH 14/17] Implement Bifurcate --- Mage.Sets/src/mage/cards/b/Bifurcate.java | 102 ++++++++++++++++++ Mage.Sets/src/mage/sets/MercadianMasques.java | 1 + 2 files changed, 103 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/b/Bifurcate.java diff --git a/Mage.Sets/src/mage/cards/b/Bifurcate.java b/Mage.Sets/src/mage/cards/b/Bifurcate.java new file mode 100644 index 00000000000..26710436348 --- /dev/null +++ b/Mage.Sets/src/mage/cards/b/Bifurcate.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.cards.b; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.filter.predicate.permanent.TokenPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * + * @author ciaccona007 + */ +public class Bifurcate extends CardImpl { + private static FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creatures"); + + static { + filter.add(Predicates.not(new TokenPredicate())); + } + + public Bifurcate(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + // Search your library for a permanent card with the same name as target nontoken creature and put that card onto the battlefield. Then shuffle your library. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new BifurcateEffect()); + } + + public Bifurcate(final Bifurcate card) { + super(card); + } + + @Override + public Bifurcate copy() { + return new Bifurcate(this); + } +} + +class BifurcateEffect extends OneShotEffect { + + public BifurcateEffect() { + super(Outcome.Benefit); + this.staticText = "Search your library for a permanent card with the same name as target nontoken creature and put that card onto the battlefield. Then shuffle your library"; + } + + public BifurcateEffect(final BifurcateEffect effect) { + super(effect); + } + + @Override + public BifurcateEffect copy() { + return new BifurcateEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + FilterCard filter = new FilterPermanentCard(); + filter.add(new NamePredicate(permanent.getName())); + return new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/MercadianMasques.java b/Mage.Sets/src/mage/sets/MercadianMasques.java index b504288d704..cc1131be170 100644 --- a/Mage.Sets/src/mage/sets/MercadianMasques.java +++ b/Mage.Sets/src/mage/sets/MercadianMasques.java @@ -63,6 +63,7 @@ public class MercadianMasques extends ExpansionSet { cards.add(new SetCardInfo("Balloon Peddler", 59, Rarity.COMMON, mage.cards.b.BalloonPeddler.class)); cards.add(new SetCardInfo("Battle Rampart", 173, Rarity.COMMON, mage.cards.b.BattleRampart.class)); cards.add(new SetCardInfo("Battle Squadron", 174, Rarity.RARE, mage.cards.b.BattleSquadron.class)); + cards.add(new SetCardInfo("Bifurcate", 230, Rarity.RARE, mage.cards.b.Bifurcate.class)); cards.add(new SetCardInfo("Black Market", 116, Rarity.RARE, mage.cards.b.BlackMarket.class)); cards.add(new SetCardInfo("Blaster Mage", 175, Rarity.COMMON, mage.cards.b.BlasterMage.class)); cards.add(new SetCardInfo("Blockade Runner", 60, Rarity.COMMON, mage.cards.b.BlockadeRunner.class)); From 51e6da563de14111af83ac7d3eb1e107ea9bcb26 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Wed, 19 Jul 2017 01:41:53 -0400 Subject: [PATCH 15/17] Implement Pack Hunt --- Mage.Sets/src/mage/cards/p/PackHunt.java | 93 ++++++++++++++++++++++++ Mage.Sets/src/mage/sets/Nemesis.java | 1 + 2 files changed, 94 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/p/PackHunt.java diff --git a/Mage.Sets/src/mage/cards/p/PackHunt.java b/Mage.Sets/src/mage/cards/p/PackHunt.java new file mode 100644 index 00000000000..5425daadfb6 --- /dev/null +++ b/Mage.Sets/src/mage/cards/p/PackHunt.java @@ -0,0 +1,93 @@ +/* + * 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.p; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.FilterCard; +import mage.filter.common.FilterPermanentCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCardInLibrary; +import mage.target.common.TargetCreaturePermanent; + +import java.util.UUID; + +/** + * + * @author ciaccona007 + */ +public class PackHunt extends CardImpl { + + public PackHunt(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{G}"); + + // Search your library for up to three cards with the same name as target creature, reveal them, and put them into your hand. Then shuffle your library. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new PackHuntEffect()); + } + + public PackHunt(final PackHunt card) { + super(card); + } + + @Override + public PackHunt copy() { + return new PackHunt(this); + } +} +class PackHuntEffect extends OneShotEffect { + + public PackHuntEffect() { + super(Outcome.Benefit); + this.staticText = "Search your library for up to three cards with the same name as target creature, reveal them, and put them into your hand. Then shuffle your library"; + } + + public PackHuntEffect(final PackHuntEffect effect) { + super(effect); + } + + @Override + public PackHuntEffect copy() { + return new PackHuntEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + FilterCard filter = new FilterPermanentCard(); + filter.add(new NamePredicate(permanent.getName())); + return new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0,3, filter), true).apply(game, source); + } +} diff --git a/Mage.Sets/src/mage/sets/Nemesis.java b/Mage.Sets/src/mage/sets/Nemesis.java index 1a84b91e6eb..61a7be980b3 100644 --- a/Mage.Sets/src/mage/sets/Nemesis.java +++ b/Mage.Sets/src/mage/sets/Nemesis.java @@ -103,6 +103,7 @@ public class Nemesis extends ExpansionSet { cards.add(new SetCardInfo("Oracle's Attendants", 16, Rarity.RARE, mage.cards.o.OraclesAttendants.class)); cards.add(new SetCardInfo("Oraxid", 35, Rarity.COMMON, mage.cards.o.Oraxid.class)); cards.add(new SetCardInfo("Overlaid Terrain", 108, Rarity.RARE, mage.cards.o.OverlaidTerrain.class)); + cards.add(new SetCardInfo("Pack Hunt", 109, Rarity.RARE, mage.cards.p.PackHunt.class)); cards.add(new SetCardInfo("Parallax Dementia", 62, Rarity.COMMON, mage.cards.p.ParallaxDementia.class)); cards.add(new SetCardInfo("Parallax Inhibitor", 134, Rarity.RARE, mage.cards.p.ParallaxInhibitor.class)); cards.add(new SetCardInfo("Parallax Nexus", 63, Rarity.RARE, mage.cards.p.ParallaxNexus.class)); From efa974127901420fc173ef0430fae63d711935b2 Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Thu, 27 Jul 2017 15:56:10 -0400 Subject: [PATCH 16/17] Merge remote-tracking branch 'remotes/upstream/master' --- Mage.Sets/src/mage/sets/MastersEditionIII.java | 1 + 1 file changed, 1 insertion(+) diff --git a/Mage.Sets/src/mage/sets/MastersEditionIII.java b/Mage.Sets/src/mage/sets/MastersEditionIII.java index f28348cbe37..7968bd2d4f0 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionIII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionIII.java @@ -126,6 +126,7 @@ public class MastersEditionIII extends ExpansionSet { cards.add(new SetCardInfo("Guan Yu's 1,000-Li March", 13, Rarity.RARE, mage.cards.g.GuanYus1000LiMarch.class)); cards.add(new SetCardInfo("Guan Yu, Sainted Warrior", 12, Rarity.UNCOMMON, mage.cards.g.GuanYuSaintedWarrior.class)); cards.add(new SetCardInfo("Gwendlyn Di Corci", 149, Rarity.RARE, mage.cards.g.GwendlynDiCorci.class)); + cards.add(new SetCardInfo("Halfdane", 150, Rarity.RARE, mage.cards.h.Halfdane.class)); cards.add(new SetCardInfo("Hazezon Tamar", 151, Rarity.RARE, mage.cards.h.HazezonTamar.class)); cards.add(new SetCardInfo("Heal", 14, Rarity.COMMON, mage.cards.h.Heal.class)); cards.add(new SetCardInfo("Hellfire", 70, Rarity.RARE, mage.cards.h.Hellfire.class)); From c771e203cf0d6b5eb078f8f5990d1a15c763689a Mon Sep 17 00:00:00 2001 From: ciaccona007 Date: Thu, 27 Jul 2017 15:56:39 -0400 Subject: [PATCH 17/17] Merge remote-tracking branch 'remotes/upstream/master' --- Mage.Sets/src/mage/sets/MastersEditionIII.java | 1 - 1 file changed, 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/MastersEditionIII.java b/Mage.Sets/src/mage/sets/MastersEditionIII.java index 7968bd2d4f0..f28348cbe37 100644 --- a/Mage.Sets/src/mage/sets/MastersEditionIII.java +++ b/Mage.Sets/src/mage/sets/MastersEditionIII.java @@ -126,7 +126,6 @@ public class MastersEditionIII extends ExpansionSet { cards.add(new SetCardInfo("Guan Yu's 1,000-Li March", 13, Rarity.RARE, mage.cards.g.GuanYus1000LiMarch.class)); cards.add(new SetCardInfo("Guan Yu, Sainted Warrior", 12, Rarity.UNCOMMON, mage.cards.g.GuanYuSaintedWarrior.class)); cards.add(new SetCardInfo("Gwendlyn Di Corci", 149, Rarity.RARE, mage.cards.g.GwendlynDiCorci.class)); - cards.add(new SetCardInfo("Halfdane", 150, Rarity.RARE, mage.cards.h.Halfdane.class)); cards.add(new SetCardInfo("Hazezon Tamar", 151, Rarity.RARE, mage.cards.h.HazezonTamar.class)); cards.add(new SetCardInfo("Heal", 14, Rarity.COMMON, mage.cards.h.Heal.class)); cards.add(new SetCardInfo("Hellfire", 70, Rarity.RARE, mage.cards.h.Hellfire.class));