From b209d71ecbd30d9532452c1495e4646e44a40d40 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:03:51 -0400 Subject: [PATCH 01/62] Create NeedForSpeed.java --- .../src/mage/sets/odyssey/NeedForSpeed.java | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java diff --git a/Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java b/Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java new file mode 100644 index 00000000000..2c084448cdb --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.effects.common.continious.GainAbilityTargetEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class NeedForSpeed extends CardImpl { + + private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); + + static { + filter.add(new CardTypePredicate(CardType.LAND)); + } + + public NeedForSpeed(UUID ownerId) { + super(ownerId, 209, "Need for Speed", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Sacrifice a land: Target creature gains haste until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, + new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), + new SacrificeTargetCost(new TargetControlledPermanent(filter))); + ability.addTarget(new TargetCreaturePermanent(true)); + this.addAbility(ability); + } + + public NeedForSpeed(final NeedForSpeed card) { + super(card); + } + + @Override + public NeedForSpeed copy() { + return new NeedForSpeed(this); + } +} From 3cf4f904fc46e0ceb814638e177326d6b162baf3 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:04:53 -0400 Subject: [PATCH 02/62] Create Tombfire.java --- Mage.Sets/src/mage/sets/odyssey/Tombfire.java | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/Tombfire.java diff --git a/Mage.Sets/src/mage/sets/odyssey/Tombfire.java b/Mage.Sets/src/mage/sets/odyssey/Tombfire.java new file mode 100644 index 00000000000..4d419458367 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/Tombfire.java @@ -0,0 +1,105 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author cbt33, Cloudthresher (LevelX2), Cranial Extraction (BetaSteward) + */ +public class Tombfire extends CardImpl { + + public Tombfire(UUID ownerId) { + super(ownerId, 165, "Tombfire", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}"); + this.expansionSetCode = "ODY"; + + this.color.setBlack(true); + + // Target player exiles all cards with flashback from his or her graveyard. + this.getSpellAbility().addTarget(new TargetPlayer(true)); + this.getSpellAbility().addEffect(new TombfireEffect()); + + } + + public Tombfire(final Tombfire card) { + super(card); + } + + @Override + public Tombfire copy() { + return new Tombfire(this); + } +} + +class TombfireEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterCard("flashback"); + + static{ + filter.add(new AbilityPredicate(FlashbackAbility.class)); + } + + public TombfireEffect() { + super(Outcome.Exile); + staticText = "Target player exiles all cards with flashback from his or her graveyard."; + } + + public TombfireEffect(final TombfireEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { + card.moveToExile(null, "", source.getId(), game); + } + return false; + } + + @Override + public TombfireEffect copy() { + return new TombfireEffect(this); + } + +} + From bdf00d8a4daeb98af8825bb172f527641e67948c Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:06:54 -0400 Subject: [PATCH 03/62] Create BlazingSalvo.java --- .../src/mage/sets/odyssey/BlazingSalvo.java | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java diff --git a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java new file mode 100644 index 00000000000..d6f165903bb --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java @@ -0,0 +1,100 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class BlazingSalvo extends CardImpl { + + public BlazingSalvo(UUID ownerId) { + super(ownerId, 178, "Blazing Salvo", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); + this.getSpellAbility().addEffect(new BlazingSalvoEffect()); + } + + public BlazingSalvo(final BlazingSalvo card) { + super(card); + } + + @Override + public BlazingSalvo copy() { + return new BlazingSalvo(this); + } +} + +class BlazingSalvoEffect extends OneShotEffect { + + public BlazingSalvoEffect() { + super(Outcome.Damage); + this.staticText = "Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her."; + } + + public BlazingSalvoEffect(final BlazingSalvoEffect effect){ + super(effect); + } + + @Override + public BlazingSalvoEffect copy() { + return new BlazingSalvoEffect(this); + } + +@Override +public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent!=null) { + Player player = game.getPlayer(permanent.getOwnerId()); + String message = "Have Blazing Salvo do 5 damage to you?"; + if (player.chooseUse(Outcome.Damage, message, game)){ + player.damage(5, source.getSourceId(), game, false, true); + } else { + permanent.damage(3, source.getSourceId(), game, false, true); + } + } + return false; +} + +} From b9a5132775b52e88c852529f9504dab154d36314 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:07:26 -0400 Subject: [PATCH 04/62] Delete BlazingSalvo.java --- .../src/mage/sets/odyssey/BlazingSalvo.java | 100 ------------------ 1 file changed, 100 deletions(-) delete mode 100644 Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java diff --git a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java deleted file mode 100644 index d6f165903bb..00000000000 --- a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.odyssey; - -import java.util.UUID; -import mage.abilities.Ability; -import mage.abilities.effects.OneShotEffect; -import mage.cards.CardImpl; -import mage.constants.CardType; -import mage.constants.Outcome; -import mage.constants.Rarity; -import mage.game.Game; -import mage.game.permanent.Permanent; -import mage.players.Player; -import mage.target.common.TargetCreaturePermanent; - -/** - * - * @author cbt33 - */ -public class BlazingSalvo extends CardImpl { - - public BlazingSalvo(UUID ownerId) { - super(ownerId, 178, "Blazing Salvo", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); - this.expansionSetCode = "ODY"; - - this.color.setRed(true); - - // Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her. - this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); - this.getSpellAbility().addEffect(new BlazingSalvoEffect()); - } - - public BlazingSalvo(final BlazingSalvo card) { - super(card); - } - - @Override - public BlazingSalvo copy() { - return new BlazingSalvo(this); - } -} - -class BlazingSalvoEffect extends OneShotEffect { - - public BlazingSalvoEffect() { - super(Outcome.Damage); - this.staticText = "Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her."; - } - - public BlazingSalvoEffect(final BlazingSalvoEffect effect){ - super(effect); - } - - @Override - public BlazingSalvoEffect copy() { - return new BlazingSalvoEffect(this); - } - -@Override -public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent!=null) { - Player player = game.getPlayer(permanent.getOwnerId()); - String message = "Have Blazing Salvo do 5 damage to you?"; - if (player.chooseUse(Outcome.Damage, message, game)){ - player.damage(5, source.getSourceId(), game, false, true); - } else { - permanent.damage(3, source.getSourceId(), game, false, true); - } - } - return false; -} - -} From 332e441dc181c35a3210b49b3af2c0b81faf2566 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:09:04 -0400 Subject: [PATCH 05/62] Create DwarvenStrikeForce.java --- .../mage/sets/odyssey/DwarvenStrikeForce.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java diff --git a/Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java b/Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java new file mode 100644 index 00000000000..3be26e66e60 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java @@ -0,0 +1,74 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author cbt33 + */ +public class DwarvenStrikeForce extends CardImpl { + + public DwarvenStrikeForce(UUID ownerId) { + super(ownerId, 188, "Dwarven Strike Force", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Dwarf"); + this.subtype.add("Berserker"); + + this.color.setRed(true); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Discard a card at random: Dwarven Strike Force gains first strike and haste until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new DiscardCardCost(true)); + ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(),Duration.EndOfTurn)); + this.addAbility(ability); + } + + public DwarvenStrikeForce(final DwarvenStrikeForce card) { + super(card); + } + + @Override + public DwarvenStrikeForce copy() { + return new DwarvenStrikeForce(this); + } +} From 38b00cbf0943beb199642e20445fe9831b8b216d Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:10:12 -0400 Subject: [PATCH 06/62] Create EngulfingFlames.java --- .../mage/sets/odyssey/EngulfingFlames.java | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java diff --git a/Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java b/Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java new file mode 100644 index 00000000000..040b735eed0 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java @@ -0,0 +1,115 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.ReplacementEffectImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreaturePermanent; +import mage.watchers.common.DamagedByWatcher; + +/** + * + * @author cbt33, North (Incinerate) + */ +public class EngulfingFlames extends CardImpl { + + public EngulfingFlames(UUID ownerId) { + super(ownerId, 191, "Engulfing Flames", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Engulfing Flames deals 1 damage to target creature. It can't be regenerated this turn. + this.getSpellAbility().addEffect(new DamageTargetEffect(1)); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); + this.getSpellAbility().addEffect(new EngulfingFlamesEffect()); + this.addWatcher(new DamagedByWatcher()); + // Flashback {3}{R} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.SORCERY)); + } + + public EngulfingFlames(final EngulfingFlames card) { + super(card); + } + + @Override + public EngulfingFlames copy() { + return new EngulfingFlames(this); + } +} + + +class EngulfingFlamesEffect extends ReplacementEffectImpl { + + public EngulfingFlamesEffect() { + super(Duration.EndOfTurn, Outcome.Detriment); + staticText = "A creature dealt damage this way can't be regenerated this turn"; + } + + public EngulfingFlamesEffect(final EngulfingFlamesEffect effect) { + super(effect); + } + + @Override + public EngulfingFlamesEffect copy() { + return new EngulfingFlamesEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public boolean replaceEvent(GameEvent event, Ability source, Game game) { + return true; + } + + @Override + public boolean applies(GameEvent event, Ability source, Game game) { + if (event.getType() == GameEvent.EventType.REGENERATE) { + DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); + if (watcher != null) + return watcher.damagedCreatures.contains(event.getTargetId()); + } + return false; + } + +} From af56495ae9502ef7275eeb5e4680d81c11d03545 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:11:01 -0400 Subject: [PATCH 07/62] Create Firebolt.java --- Mage.Sets/src/mage/sets/odyssey/Firebolt.java | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/Firebolt.java diff --git a/Mage.Sets/src/mage/sets/odyssey/Firebolt.java b/Mage.Sets/src/mage/sets/odyssey/Firebolt.java new file mode 100644 index 00000000000..7e9326b7b30 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/Firebolt.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.sets.odyssey; + +import java.util.UUID; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlashbackAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.TimingRule; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author cbt33 + */ +public class Firebolt extends CardImpl { + + public Firebolt(UUID ownerId) { + super(ownerId, 193, "Firebolt", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Firebolt deals 2 damage to target creature or player. + this.getSpellAbility().addEffect(new DamageTargetEffect(2)); + this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true)); + // Flashback {4}{R} + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{4}{R}"), TimingRule.SORCERY)); + } + + public Firebolt(final Firebolt card) { + super(card); + } + + @Override + public Firebolt copy() { + return new Firebolt(this); + } +} From 9c7e7303b0daeac4f832e90e9ded9e53add5010d Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:12:33 -0400 Subject: [PATCH 08/62] Create FreneticOgre.java --- .../src/mage/sets/odyssey/FreneticOgre.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/FreneticOgre.java diff --git a/Mage.Sets/src/mage/sets/odyssey/FreneticOgre.java b/Mage.Sets/src/mage/sets/odyssey/FreneticOgre.java new file mode 100644 index 00000000000..aaf089a0ad6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/FreneticOgre.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author cbt33 + */ +public class FreneticOgre extends CardImpl { + + public FreneticOgre(UUID ownerId) { + super(ownerId, 195, "Frenetic Ogre", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Ogre"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(3); + + // {R}, Discard a card at random: Frenetic Ogre gets +3/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addCost(new DiscardCardCost(true)); + this.addAbility(ability); + } + + public FreneticOgre(final FreneticOgre card) { + super(card); + } + + @Override + public FreneticOgre copy() { + return new FreneticOgre(this); + } +} From 1e2f5cf9d2d74009f38031594bef4358c2d82bba Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:14:41 -0400 Subject: [PATCH 09/62] Create KamahlsDesire.java --- .../src/mage/sets/odyssey/KamahlsDesire.java | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java diff --git a/Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java b/Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java new file mode 100644 index 00000000000..cb46921e00f --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java @@ -0,0 +1,85 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.decorator.ConditionalContinousEffect; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.abilities.keyword.FirstStrikeAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.target.TargetPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class KamahlsDesire extends CardImpl { + + public KamahlsDesire(UUID ownerId) { + super(ownerId, 199, "Kamahl's Desire", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Aura"); + + this.color.setRed(true); + + // Enchant creature + TargetPermanent auraTarget = new TargetCreaturePermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted creature has first strike. + ability.addEffect(new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield)); + + // Threshold - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard. + ability.addEffect(new ConditionalContinousEffect(new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield), + new CardsInControllerGraveCondition(7), + "

Threshold - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard.")); + } + + public KamahlsDesire(final KamahlsDesire card) { + super(card); + } + + @Override + public KamahlsDesire copy() { + return new KamahlsDesire(this); + } +} From 31c085dd57b04ffd48175e88480ee39c767dbef5 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:15:49 -0400 Subject: [PATCH 10/62] Create MinotaurExplorer.java --- .../mage/sets/odyssey/MinotaurExplorer.java | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/MinotaurExplorer.java diff --git a/Mage.Sets/src/mage/sets/odyssey/MinotaurExplorer.java b/Mage.Sets/src/mage/sets/odyssey/MinotaurExplorer.java new file mode 100644 index 00000000000..76532c44dd1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/MinotaurExplorer.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.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author cbt33 + */ +public class MinotaurExplorer extends CardImpl { + + public MinotaurExplorer(UUID ownerId) { + super(ownerId, 206, "Minotaur Explorer", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Minotaur"); + this.subtype.add("Scout"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // When Minotaur Explorer enters the battlefield, sacrifice it unless you discard a card at random. + this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardCardCost(true)))); + } + + public MinotaurExplorer(final MinotaurExplorer card) { + super(card); + } + + @Override + public MinotaurExplorer copy() { + return new MinotaurExplorer(this); + } +} From 419a81a6870e922fe8e6a4be5a4031dd0e8dbffb Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:16:41 -0400 Subject: [PATCH 11/62] Create Mudhole.java --- Mage.Sets/src/mage/sets/odyssey/Mudhole.java | 98 ++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/Mudhole.java diff --git a/Mage.Sets/src/mage/sets/odyssey/Mudhole.java b/Mage.Sets/src/mage/sets/odyssey/Mudhole.java new file mode 100644 index 00000000000..b2fa871a808 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/Mudhole.java @@ -0,0 +1,98 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterLandCard; +import mage.game.Game; +import mage.players.Player; +import mage.target.TargetPlayer; + +/** + * + * @author cbt33 + */ +public class Mudhole extends CardImpl { + + public Mudhole(UUID ownerId) { + super(ownerId, 208, "Mudhole", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{2}{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Target player exiles all land cards from his or her graveyard. + this.getSpellAbility().addTarget(new TargetPlayer(true)); + this.getSpellAbility().addEffect(new MudholeEffect()); + } + + public Mudhole(final Mudhole card) { + super(card); + } + + @Override + public Mudhole copy() { + return new Mudhole(this); + } +} + +class MudholeEffect extends OneShotEffect { + + private static final FilterCard filter = new FilterLandCard(); + + public MudholeEffect() { + super(Outcome.Exile); + staticText = "Target player exiles all land cards from his or her graveyard."; + } + + public MudholeEffect(final MudholeEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player targetPlayer = game.getPlayer(source.getFirstTarget()); + for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { + card.moveToExile(null, "", source.getId(), game); + } + return false; + } + + @Override + public MudholeEffect copy() { + return new MudholeEffect(this); + } + +} From 2338297a87aa1b4b119d57a405ded064c922d88d Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:18:20 -0400 Subject: [PATCH 12/62] Create PardicSwordsmith.java --- .../mage/sets/odyssey/PardicSwordsmith.java | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/PardicSwordsmith.java diff --git a/Mage.Sets/src/mage/sets/odyssey/PardicSwordsmith.java b/Mage.Sets/src/mage/sets/odyssey/PardicSwordsmith.java new file mode 100644 index 00000000000..3e944be2c5b --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/PardicSwordsmith.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author cbt33 + */ +public class PardicSwordsmith extends CardImpl { + + public PardicSwordsmith(UUID ownerId) { + super(ownerId, 213, "Pardic Swordsmith", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Dwarf"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {R}, Discard a card at random: Pardic Swordsmith gets +2/+0 until end of turn. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); + ability.addCost(new DiscardCardCost(true)); + this.addAbility(ability); + } + + public PardicSwordsmith(final PardicSwordsmith card) { + super(card); + } + + @Override + public PardicSwordsmith copy() { + return new PardicSwordsmith(this); + } +} From bcf9714cd99c81d7bffbde0816123f6ad9443863 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:20:07 -0400 Subject: [PATCH 13/62] Create CausticTar.java Works but effect says "Enchanted creature has" because of the string builder for GainAbilityAttachedEffect(). --- .../src/mage/sets/odyssey/CausticTar.java | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/CausticTar.java diff --git a/Mage.Sets/src/mage/sets/odyssey/CausticTar.java b/Mage.Sets/src/mage/sets/odyssey/CausticTar.java new file mode 100644 index 00000000000..e5fc050decb --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/CausticTar.java @@ -0,0 +1,85 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.AttachEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.CardImpl; +import mage.constants.AttachmentType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.TargetPermanent; +import mage.target.TargetPlayer; +import mage.target.common.TargetLandPermanent; + +/** + * + * @author cbt33, LevelX2 (Sea's Claim), LevelX2 (Pollenbright Wings) + */ +public class CausticTar extends CardImpl { + + public CausticTar(UUID ownerId) { + super(ownerId, 122, "Caustic Tar", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{B}{B}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Aura"); + + this.color.setBlack(true); + + // Enchant land + TargetPermanent auraTarget = new TargetLandPermanent(); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility)); + Ability ability = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(ability); + + // Enchanted land has "{tap}: Target player loses 3 life." + Ability tarAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(3), new TapSourceCost()); + tarAbility.addTarget(new TargetPlayer()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(tarAbility, AttachmentType.AURA, Duration.WhileOnBattlefield))); + + } + + public CausticTar(final CausticTar card) { + super(card); + } + + @Override + public CausticTar copy() { + return new CausticTar(this); + } +} From 7431b416072ae4f98c22339bd37cef07e0bd14be Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:22:37 -0400 Subject: [PATCH 14/62] Create MagmaVein.java tooltip may or may not be correct --- .../src/mage/sets/odyssey/MagmaVein.java | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/MagmaVein.java diff --git a/Mage.Sets/src/mage/sets/odyssey/MagmaVein.java b/Mage.Sets/src/mage/sets/odyssey/MagmaVein.java new file mode 100644 index 00000000000..d81012de32f --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/MagmaVein.java @@ -0,0 +1,83 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.DamageAllEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.target.common.TargetControlledPermanent; + +/** + * + * @author cbt33 + */ +public class MagmaVein extends CardImpl { + + private static final FilterPermanent filter1 = new FilterPermanent("creature without flying"); + private static final FilterControlledPermanent filter2 = new FilterControlledPermanent("land"); + + static { + filter1.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + filter2.add(new CardTypePredicate(CardType.LAND)); + } + + public MagmaVein(UUID ownerId) { + super(ownerId, 203, "Magma Vein", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // {R}, Sacrifice a land: Magma Vein deals 1 damage to each creature without flying. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(1, filter1), new ManaCostsImpl("{R}")); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(filter2))); + this.addAbility(ability); + + } + + public MagmaVein(final MagmaVein card) { + super(card); + } + + @Override + public MagmaVein copy() { + return new MagmaVein(this); + } +} From 7cb450373d27c6367bcd987fb2a77ce3d2d6c972 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:31:53 -0400 Subject: [PATCH 15/62] Create PriceOfGlory.java Works but doesn't prompt when lands are sacrificed --- .../src/mage/sets/odyssey/PriceOfGlory.java | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java diff --git a/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java new file mode 100644 index 00000000000..1d49738cff6 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java @@ -0,0 +1,131 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.common.ManaEffect; +import mage.abilities.mana.TriggeredManaAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.Permanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author cbt33, Loki (Heartbeat of Spring) + */ +public class PriceOfGlory extends CardImpl { + + public PriceOfGlory(UUID ownerId) { + super(ownerId, 214, "Price of Glory", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Whenever a player taps a land for mana, if it's not that player's turn, destroy that land. + this.addAbility(new PriceOfGloryAbility()); + } + + public PriceOfGlory(final PriceOfGlory card) { + super(card); + } + + @Override + public PriceOfGlory copy() { + return new PriceOfGlory(this); + } +} + +class PriceOfGloryAbility extends TriggeredManaAbility { + + private static final String staticText = "Whenever a player taps a land for mana, if it's not that player's turn, destroy that land."; + + public PriceOfGloryAbility() { + super(Zone.BATTLEFIELD, new PriceOfGloryEffect()); + } + + public PriceOfGloryAbility(PriceOfGloryAbility ability) { + super(ability); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) { + Permanent permanent = game.getPermanent(event.getSourceId()); + if (permanent == null) { + permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD); + } + if (permanent != null && permanent.getCardType().contains(CardType.LAND)) { + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; + } + } + return false; + } + + @Override + public PriceOfGloryAbility copy() { + return new PriceOfGloryAbility(this); + } + + @Override + public String getRule() { + return staticText; + } +} + +class PriceOfGloryEffect extends ManaEffect { + + public PriceOfGloryEffect() { + super(); + staticText = "if it's not that player's turn, destroy that land."; + } + + public PriceOfGloryEffect(final PriceOfGloryEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); + if (!land.getControllerId().equals(game.getActivePlayerId())) { + land.destroy(source.getSourceId(), game, false); + } + return true; + } + + @Override + public PriceOfGloryEffect copy() { + return new PriceOfGloryEffect(this); + } +} From be24e12a890e8c789f4c2089bcd86877ac8b7743 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:33:45 -0400 Subject: [PATCH 16/62] Create CabalPatriarch.java --- .../src/mage/sets/odyssey/CabalPatriarch.java | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/CabalPatriarch.java diff --git a/Mage.Sets/src/mage/sets/odyssey/CabalPatriarch.java b/Mage.Sets/src/mage/sets/odyssey/CabalPatriarch.java new file mode 100644 index 00000000000..2012c3eb8c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/CabalPatriarch.java @@ -0,0 +1,89 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.common.SacrificeTargetCost; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.common.FilterCreatureCard; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetControlledPermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33, LevelX2 + */ +public class CabalPatriarch extends CardImpl { + + public CabalPatriarch(UUID ownerId) { + super(ownerId, 120, "Cabal Patriarch", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}{B}"); + this.expansionSetCode = "ODY"; + this.supertype.add("Legendary"); + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setBlack(true); + this.power = new MageInt(5); + this.toughness = new MageInt(5); + + // {2}{B}, Sacrifice a creature: Target creature gets -2/-2 until end of turn. + Ability ability1 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}")); + TargetControlledPermanent target = new TargetControlledPermanent(new FilterControlledCreaturePermanent("")); + target.setRequired(true); + ability1.addCost(new SacrificeTargetCost(target)); + ability1.addTarget(new TargetCreaturePermanent(true)); + this.addAbility(ability1); + + // {2}{B}, Exile a creature card from your graveyard: Target creature gets -2/-2 until end of turn. + Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, -2, Duration.EndOfTurn), new ManaCostsImpl("{2}{B}")); + ability2.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("a creature card")))); + ability2.addTarget(new TargetCreaturePermanent(true)); + this.addAbility(ability2); + } + + public CabalPatriarch(final CabalPatriarch card) { + super(card); + } + + @Override + public CabalPatriarch copy() { + return new CabalPatriarch(this); + } +} From a5438e59cdbaee1e039ed5f570bbbe721ee17493 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:35:19 -0400 Subject: [PATCH 17/62] Create MoltenInfluence.java Works but rules text does not show --- .../mage/sets/odyssey/MoltenInfluence.java | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/MoltenInfluence.java diff --git a/Mage.Sets/src/mage/sets/odyssey/MoltenInfluence.java b/Mage.Sets/src/mage/sets/odyssey/MoltenInfluence.java new file mode 100644 index 00000000000..49dd1f67dd2 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/MoltenInfluence.java @@ -0,0 +1,114 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterSpell; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.CardTypePredicate; +import mage.game.Game; +import mage.game.stack.Spell; +import mage.players.Player; +import mage.target.TargetSpell; + +/** + * + * @author cbt33, LevelX2 (Quash) + */ +public class MoltenInfluence extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("instant or sorcery spell"); + + static { + Predicates.or( + new CardTypePredicate(CardType.INSTANT), + new CardTypePredicate(CardType.SORCERY)); + } + + + public MoltenInfluence(UUID ownerId) { + super(ownerId, 207, "Molten Influence", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Counter target instant or sorcery spell unless its controller has Molten Influence deal 4 damage to him or her. + this.getSpellAbility().addTarget(new TargetSpell(filter)); + this.getSpellAbility().addEffect(new MoltenInfluenceEffect()); + + } + + public MoltenInfluence(final MoltenInfluence card) { + super(card); + } + + @Override + public MoltenInfluence copy() { + return new MoltenInfluence(this); + } +} + + +class MoltenInfluenceEffect extends OneShotEffect { + + public MoltenInfluenceEffect() { + super(Outcome.Detriment); + this.staticText = "Counter target instant or sorcery spell unless its controller has Molten Influence deal 4 damage to him or her."; + } + + public MoltenInfluenceEffect(final MoltenInfluenceEffect effect){ + super(effect); + } + + @Override + public MoltenInfluenceEffect copy() { + return new MoltenInfluenceEffect(this); + } + +@Override +public boolean apply(Game game, Ability source) { + Spell spell = game.getStack().getSpell(source.getFirstTarget()); + if (spell!=null) { + Player player = game.getPlayer(spell.getOwnerId()); + String message = "Have Molten Influence do 4 damage to you?"; + if (player.chooseUse(Outcome.Damage, message, game)){ + player.damage(4, source.getSourceId(), game, false, true); + } else { + spell.counter(source.getId(), game); + } + } + return false; +} + +} From 1397787ea886972b3fc5b652a95da66072371b35 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:36:33 -0400 Subject: [PATCH 18/62] Create ZombieAssassin.java --- .../src/mage/sets/odyssey/ZombieAssassin.java | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java diff --git a/Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java b/Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java new file mode 100644 index 00000000000..bf1cf1348c8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java @@ -0,0 +1,90 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.costs.common.ExileSourceCost; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class ZombieAssassin extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature"); + + static { + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + + + public ZombieAssassin(UUID ownerId) { + super(ownerId, 168, "Zombie Assassin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{B}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Zombie"); + this.subtype.add("Assassin"); + + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(2); + + // {tap}, Exile two cards from your graveyard and Zombie Assassin: Destroy target nonblack creature. It can't be regenerated. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); + ability.addTarget(new TargetCreaturePermanent(filter)); + ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2,2,new FilterCard()))); + ability.addCost(new ExileSourceCost()); + this.addAbility(ability); + } + + public ZombieAssassin(final ZombieAssassin card) { + super(card); + } + + @Override + public ZombieAssassin copy() { + return new ZombieAssassin(this); + } +} From cfb9848322bd915b925db9b31b4dd12cd927778b Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:37:41 -0400 Subject: [PATCH 19/62] Create TaintedPact.java the duplicate card exiled part works, putting into hand is untested --- .../src/mage/sets/odyssey/TaintedPact.java | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/TaintedPact.java diff --git a/Mage.Sets/src/mage/sets/odyssey/TaintedPact.java b/Mage.Sets/src/mage/sets/odyssey/TaintedPact.java new file mode 100644 index 00000000000..7833eeffdae --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/TaintedPact.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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.predicate.mageobject.NamePredicate; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author cbt33, Ad Nauseum (North), Izzet Staticaster (LevelX2), Bane Alley Broker (LevelX2) + */ +public class TaintedPact extends CardImpl { + + public TaintedPact(UUID ownerId) { + super(ownerId, 164, "Tainted Pact", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "ODY"; + + this.color.setBlack(true); + + // Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first. + this.getSpellAbility().addEffect(new TaintedPactEffect()); + } + + public TaintedPact(final TaintedPact card) { + super(card); + } + + @Override + public TaintedPact copy() { + return new TaintedPact(this); + } +} + +class TaintedPactEffect extends OneShotEffect{ + + public TaintedPactEffect() { + super(Outcome.DrawCard); + this.staticText = "Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first."; + } + + public TaintedPactEffect(final TaintedPactEffect effect) { + super(effect); + } + + @Override + public TaintedPactEffect copy() { + return new TaintedPactEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + String message = "Add the exiled card to your hand?"; + Card sourceCard = game.getCard(source.getSourceId()); + Player player = game.getPlayer(source.getControllerId()); + if (player == null || sourceCard == null) { + return false; + } + game.getExile().createZone(source.getSourceId(), "Tainted Pact"); + while (player.getLibrary().size() > 0) { + Card card = player.getLibrary().removeFromTop(game); + if (card != null) { + FilterCard filter = new FilterCard(); + filter.add(new NamePredicate(card.getName())); + card.moveToExile(source.getSourceId(), message, source.getSourceId(), game); + if(game.getExile().getExileZone(source.getSourceId()).count(filter, game) > 1) { //Checks if there is more than one card in cards with the name as current card + + break; + } + + if (player.chooseUse(outcome, message, game)) { //Adds the current card to hand if it is chosen. + card.moveToZone(Zone.HAND, source.getSourceId(), game, true); + break; + } + + } + + } + + + return false; + } + } From 0d5e3649ba62b5b6ce7a099d9813aa3d44d836a5 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:41:33 -0400 Subject: [PATCH 20/62] Create DecayingSoil.java This one wasn't requiring a sacrifice target but i think with target.setRequired(true) it should --- .../src/mage/sets/odyssey/DecayingSoil.java | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java diff --git a/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java new file mode 100644 index 00000000000..86747512412 --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java @@ -0,0 +1,194 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; +import mage.abilities.condition.Condition; +import mage.abilities.condition.common.CardsInControllerGraveCondition; +import mage.abilities.costs.Cost; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ExileTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.TargetController; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; +import mage.game.permanent.PermanentToken; +import mage.players.Player; +import mage.target.common.TargetCardInYourGraveyard; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author cbt33, Nantuko (Nim Deathmantle) + */ +public class DecayingSoil extends CardImpl { + + public DecayingSoil(UUID ownerId) { + super(ownerId, 127, "Decaying Soil", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{B}"); + this.expansionSetCode = "ODY"; + + this.color.setBlack(true); + + // At the beginning of your upkeep, exile a card from your graveyard. + Ability ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), TargetController.YOU, false); + TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); + + // Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand." + this.addAbility(new DecayingSoilTriggeredAbility()); + } + + public DecayingSoil(final DecayingSoil card) { + super(card); + } + + @Override + public DecayingSoil copy() { + return new DecayingSoil(this); + } +} + +class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl { + + Condition condition = new CardsInControllerGraveCondition(7); + + DecayingSoilTriggeredAbility() { + super(Zone.BATTLEFIELD, new DecayingSoilEffect(), true); + + } + + DecayingSoilTriggeredAbility(DecayingSoilTriggeredAbility ability) { + super(ability); + } + + @Override + public DecayingSoilTriggeredAbility copy() { + return new DecayingSoilTriggeredAbility(this); + } + + @Override + public boolean checkInterveningIfClause(Game game) { + return condition.apply(game, this); + } + + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.ZONE_CHANGE) { + + // make sure card is on battlefield + UUID sourceId = getSourceId(); + if (game.getPermanent(sourceId) == null) { + // or it is being removed + if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) { + return false; + } + } + + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + Permanent permanent = zEvent.getTarget(); + + if (permanent != null && + permanent.getControllerId().equals(this.controllerId) && + zEvent.getToZone() == Zone.GRAVEYARD && + zEvent.getFromZone() == Zone.BATTLEFIELD && + !(permanent instanceof PermanentToken) && + permanent.getCardType().contains(CardType.CREATURE)) { + + getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId())); + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "

Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."; + } +} + +class DecayingSoilEffect extends OneShotEffect { + + private final Cost cost = new GenericManaCost(2); + + public DecayingSoilEffect() { + super(Outcome.Benefit); + + } + + public DecayingSoilEffect(DecayingSoilEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + //Permanent equipment = game.getPermanent(source.getSourceId()); + if (player != null) { + if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + "?", game)) { + cost.clearPaid(); + if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { + UUID target = targetPointer.getFirst(game, source); + // if (target != null && equipment != null) { + if (target != null) { + Card card = game.getCard(target); + // check if it's still in graveyard + if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { + //Player owner = game.getPlayer(card.getOwnerId()); + // owner.getHand().add(card); + card.moveToZone(Zone.HAND, source.getSourceId(), game, true); + return true; + } + } + } + } + } + + return false; + } + + @Override + public DecayingSoilEffect copy() { + return new DecayingSoilEffect(this); + } + +} From 0d39a19f8884f8f22de2fd3ff292681d7994289b Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:42:10 -0400 Subject: [PATCH 21/62] Create RottingGiant.java same deal here as with Decaying Soil --- .../src/mage/sets/odyssey/RottingGiant.java | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/RottingGiant.java diff --git a/Mage.Sets/src/mage/sets/odyssey/RottingGiant.java b/Mage.Sets/src/mage/sets/odyssey/RottingGiant.java new file mode 100644 index 00000000000..4073ceeb66d --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/RottingGiant.java @@ -0,0 +1,70 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.odyssey; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.AttacksOrBlocksTriggeredAbility; +import mage.abilities.costs.common.ExileFromGraveCost; +import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.target.common.TargetCardInYourGraveyard; + +/** + * + * @author cbt33 + */ +public class RottingGiant extends CardImpl { + + public RottingGiant(UUID ownerId) { + super(ownerId, 158, "Rotting Giant", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "ODY"; + this.subtype.add("Zombie"); + this.subtype.add("Giant"); + + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever Rotting Giant attacks or blocks, sacrifice it unless you exile a card from your graveyard. + TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(); + target.setRequired(true); + this.addAbility(new AttacksOrBlocksTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ExileFromGraveCost(target)), false)); + } + + public RottingGiant(final RottingGiant card) { + super(card); + } + + @Override + public RottingGiant copy() { + return new RottingGiant(this); + } +} From 09f59982d907744cc628c8aaf5c94ddce63f44c1 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 10 Oct 2013 21:43:20 -0400 Subject: [PATCH 22/62] Create GhastlyDemise.java Problem here with tooltip and prompt. --- .../src/mage/sets/odyssey/GhastlyDemise.java | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/GhastlyDemise.java diff --git a/Mage.Sets/src/mage/sets/odyssey/GhastlyDemise.java b/Mage.Sets/src/mage/sets/odyssey/GhastlyDemise.java new file mode 100644 index 00000000000..d47e0b6d99f --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/GhastlyDemise.java @@ -0,0 +1,140 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.Mode; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; +import mage.target.targetpointer.FirstTargetPointer; + +/** + * + * @author cbt33 + */ +public class GhastlyDemise extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature if its tougness is less than the number of cards in your graveyard"); + + + static{ + filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK))); + } + + public GhastlyDemise(UUID ownerId) { + super(ownerId, 139, "Ghastly Demise", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}"); + this.expansionSetCode = "ODY"; + + this.color.setBlack(true); + + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + this.getSpellAbility().addEffect(new GhastlyDemiseEffect(false)); + } + + public GhastlyDemise(final GhastlyDemise card) { + super(card); + } + + @Override + public GhastlyDemise copy() { + return new GhastlyDemise(this); + } +} + +class GhastlyDemiseEffect extends OneShotEffect { + +protected boolean noRegen; + + public GhastlyDemiseEffect(String ruleText) { + this(false); + ruleText = "Destroy target nonblack creature if its toughness is less than or equal to the number of cards in your graveyard."; + staticText = ruleText; + } + + public GhastlyDemiseEffect(boolean noRegen) { + super(Outcome.DestroyPermanent); + this.noRegen = noRegen; + } + + public GhastlyDemiseEffect(final GhastlyDemiseEffect effect) { + super(effect); + this.noRegen = effect.noRegen; + } + + @Override + public GhastlyDemiseEffect copy() { + return new GhastlyDemiseEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + int affectedTargets = 0; + if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // for Rain of Thorns + for (Target target : source.getTargets()) { + for (UUID permanentId : target.getTargets()) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().count(new FilterCard(), game)) { + permanent.destroy(source.getId(), game, noRegen); + affectedTargets++; + } + } + } + } + else if (targetPointer.getTargets(game, source).size() > 0) { + for (UUID permanentId : targetPointer.getTargets(game, source)) { + Permanent permanent = game.getPermanent(permanentId); + if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().count(new FilterCard(), game)) { + permanent.destroy(source.getId(), game, noRegen); + affectedTargets++; + } + } + } + return affectedTargets > 0; + } + + @Override + public String getText(Mode mode) { + return staticText; +} + + + +} From 02a3c774cce3a3585f478a64eb27b9860bd2638b Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:28:14 -0400 Subject: [PATCH 23/62] Update NeedForSpeed.java --- Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java b/Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java index 2c084448cdb..65d9f5c2da0 100644 --- a/Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java +++ b/Mage.Sets/src/mage/sets/odyssey/NeedForSpeed.java @@ -49,11 +49,7 @@ import mage.target.common.TargetCreaturePermanent; */ public class NeedForSpeed extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("land"); - - static { - filter.add(new CardTypePredicate(CardType.LAND)); - } + public NeedForSpeed(UUID ownerId) { super(ownerId, 209, "Need for Speed", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{R}"); @@ -64,7 +60,7 @@ public class NeedForSpeed extends CardImpl { // Sacrifice a land: Target creature gains haste until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), - new SacrificeTargetCost(new TargetControlledPermanent(filter))); + new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledPermanent("land")))); ability.addTarget(new TargetCreaturePermanent(true)); this.addAbility(ability); } From 6be2b907c7cef43afb0c7191e8121cd365386627 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:29:18 -0400 Subject: [PATCH 24/62] Update Tombfire.java --- Mage.Sets/src/mage/sets/odyssey/Tombfire.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/Tombfire.java b/Mage.Sets/src/mage/sets/odyssey/Tombfire.java index 4d419458367..9b04ad5990c 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Tombfire.java +++ b/Mage.Sets/src/mage/sets/odyssey/Tombfire.java @@ -72,13 +72,13 @@ public class Tombfire extends CardImpl { class TombfireEffect extends OneShotEffect { - private static final FilterCard filter = new FilterCard("flashback"); +private static final FilterCard filter = new FilterCard("flashback"); static{ filter.add(new AbilityPredicate(FlashbackAbility.class)); } - public TombfireEffect() { + public TombfireEffect() { super(Outcome.Exile); staticText = "Target player exiles all cards with flashback from his or her graveyard."; } @@ -89,11 +89,15 @@ class TombfireEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player targetPlayer = game.getPlayer(source.getFirstTarget()); - for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { - card.moveToExile(null, "", source.getId(), game); - } - return false; + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer != null) { + for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { + card.moveToExile(null, "", source.getSourceId(), game); + } + return true; + } else { + return false; + } } @Override From f09a3860969fe3b03908a8682e6045927491d01e Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:31:05 -0400 Subject: [PATCH 25/62] Create BlazingSalvo.java --- .../src/mage/sets/odyssey/BlazingSalvo.java | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java diff --git a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java new file mode 100644 index 00000000000..18accb150ee --- /dev/null +++ b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java @@ -0,0 +1,104 @@ +/* + * 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.odyssey; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class BlazingSalvo extends CardImpl { + + public BlazingSalvo(UUID ownerId) { + super(ownerId, 178, "Blazing Salvo", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{R}"); + this.expansionSetCode = "ODY"; + + this.color.setRed(true); + + // Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her. + this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); + this.getSpellAbility().addEffect(new BlazingSalvoEffect()); + } + + public BlazingSalvo(final BlazingSalvo card) { + super(card); + } + + @Override + public BlazingSalvo copy() { + return new BlazingSalvo(this); + } +} + +class BlazingSalvoEffect extends OneShotEffect { + + public BlazingSalvoEffect() { + super(Outcome.Damage); + this.staticText = "Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her."; + } + + public BlazingSalvoEffect(final BlazingSalvoEffect effect){ + super(effect); + } + + @Override + public BlazingSalvoEffect copy() { + return new BlazingSalvoEffect(this); + } + +@Override +public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(source.getFirstTarget()); + if (permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + String message = "Have Blazing Salvo do 5 damage to you?"; + if (player.chooseUse(Outcome.Damage, message, game)){ + player.damage(5, source.getSourceId(), game, true, false); + } else { + permanent.damage(3, source.getSourceId(), game, true, false); + } + return true; + } + } + return false; + } + +} + From 2d76ad3f78388cbe940f021b67266c0b184a8ce9 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:31:51 -0400 Subject: [PATCH 26/62] Update DwarvenStrikeForce.java --- Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java b/Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java index 3be26e66e60..6be06d331fe 100644 --- a/Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java +++ b/Mage.Sets/src/mage/sets/odyssey/DwarvenStrikeForce.java @@ -32,6 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.DiscardCardCost; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.HasteAbility; @@ -59,7 +60,9 @@ public class DwarvenStrikeForce extends CardImpl { // Discard a card at random: Dwarven Strike Force gains first strike and haste until end of turn. Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(HasteAbility.getInstance(), Duration.EndOfTurn), new DiscardCardCost(true)); - ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(),Duration.EndOfTurn)); + Effect effect = new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(),Duration.EndOfTurn); + effect.setText("and haste until end of turn"); + ability.addEffect(effect); this.addAbility(ability); } From 4511ca64c14f4edefc1d204416679181426dc2a9 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:32:43 -0400 Subject: [PATCH 27/62] Update EngulfingFlames.java --- Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java b/Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java index 040b735eed0..91eebb030d9 100644 --- a/Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java +++ b/Mage.Sets/src/mage/sets/odyssey/EngulfingFlames.java @@ -62,7 +62,7 @@ public class EngulfingFlames extends CardImpl { this.getSpellAbility().addEffect(new EngulfingFlamesEffect()); this.addWatcher(new DamagedByWatcher()); // Flashback {3}{R} - this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.SORCERY)); + this.addAbility(new FlashbackAbility(new ManaCostsImpl("{3}{R}"), TimingRule.INSTANT)); } public EngulfingFlames(final EngulfingFlames card) { @@ -106,10 +106,12 @@ class EngulfingFlamesEffect extends ReplacementEffectImpl public boolean applies(GameEvent event, Ability source, Game game) { if (event.getType() == GameEvent.EventType.REGENERATE) { DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", source.getSourceId()); - if (watcher != null) + if (watcher != null) { return watcher.damagedCreatures.contains(event.getTargetId()); + } } return false; } } + From 5d71f3491d60472e9e74230f3c23b9c61f4bddd8 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:34:20 -0400 Subject: [PATCH 28/62] Update KamahlsDesire.java --- Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java b/Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java index cb46921e00f..96a1444d2ed 100644 --- a/Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java +++ b/Mage.Sets/src/mage/sets/odyssey/KamahlsDesire.java @@ -29,6 +29,7 @@ package mage.sets.odyssey; import java.util.UUID; import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.CardsInControllerGraveCondition; import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.AttachEffect; @@ -42,6 +43,7 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Outcome; import mage.constants.Rarity; +import mage.constants.Zone; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; @@ -66,12 +68,12 @@ public class KamahlsDesire extends CardImpl { this.addAbility(ability); // Enchanted creature has first strike. - ability.addEffect(new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield)); - + ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.AURA, Duration.WhileOnBattlefield)); // Threshold - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard. ability.addEffect(new ConditionalContinousEffect(new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield), new CardsInControllerGraveCondition(7), "

Threshold - Enchanted creature gets +3/+0 as long as seven or more cards are in your graveyard.")); + this.addAbility(ability); } public KamahlsDesire(final KamahlsDesire card) { From a2a2a40dac75756da49eb043f123ff5fa94368f3 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:35:12 -0400 Subject: [PATCH 29/62] Update Mudhole.java --- Mage.Sets/src/mage/sets/odyssey/Mudhole.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/Mudhole.java b/Mage.Sets/src/mage/sets/odyssey/Mudhole.java index b2fa871a808..e2be1a8d053 100644 --- a/Mage.Sets/src/mage/sets/odyssey/Mudhole.java +++ b/Mage.Sets/src/mage/sets/odyssey/Mudhole.java @@ -83,10 +83,13 @@ class MudholeEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player targetPlayer = game.getPlayer(source.getFirstTarget()); - for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { - card.moveToExile(null, "", source.getId(), game); - } + Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source)); + if (targetPlayer != null) { + for (Card card: targetPlayer.getGraveyard().getCards(filter, game)) { + card.moveToExile(null, "", source.getSourceId(), game); + } + return true; + } return false; } From 2363931250c4ef61558b80db1743bbc48d70aa19 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:36:01 -0400 Subject: [PATCH 30/62] Update CausticTar.java --- Mage.Sets/src/mage/sets/odyssey/CausticTar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/CausticTar.java b/Mage.Sets/src/mage/sets/odyssey/CausticTar.java index e5fc050decb..df2b18915e1 100644 --- a/Mage.Sets/src/mage/sets/odyssey/CausticTar.java +++ b/Mage.Sets/src/mage/sets/odyssey/CausticTar.java @@ -69,7 +69,7 @@ public class CausticTar extends CardImpl { // Enchanted land has "{tap}: Target player loses 3 life." Ability tarAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LoseLifeTargetEffect(3), new TapSourceCost()); - tarAbility.addTarget(new TargetPlayer()); + tarAbility.addTarget(new TargetPlayer(true)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(tarAbility, AttachmentType.AURA, Duration.WhileOnBattlefield))); } From 9f90a8a2a0550cb504483ec8fd033fd2bbd508be Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:36:29 -0400 Subject: [PATCH 31/62] Update PriceOfGlory.java --- .../src/mage/sets/odyssey/PriceOfGlory.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java index 1d49738cff6..87bd279529f 100644 --- a/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java +++ b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java @@ -29,10 +29,11 @@ package mage.sets.odyssey; import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.effects.common.ManaEffect; -import mage.abilities.mana.TriggeredManaAbility; +import mage.abilities.TriggeredAbilityImpl; +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.game.Game; @@ -66,7 +67,7 @@ public class PriceOfGlory extends CardImpl { } } -class PriceOfGloryAbility extends TriggeredManaAbility { +class PriceOfGloryAbility extends TriggeredAbilityImpl { private static final String staticText = "Whenever a player taps a land for mana, if it's not that player's turn, destroy that land."; @@ -104,10 +105,10 @@ class PriceOfGloryAbility extends TriggeredManaAbility { } } -class PriceOfGloryEffect extends ManaEffect { +class PriceOfGloryEffect extends OneShotEffect { public PriceOfGloryEffect() { - super(); + super(Outcome.DestroyPermanent); staticText = "if it's not that player's turn, destroy that land."; } @@ -118,10 +119,11 @@ class PriceOfGloryEffect extends ManaEffect { @Override public boolean apply(Game game, Ability source) { Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source)); - if (!land.getControllerId().equals(game.getActivePlayerId())) { + if (land != null && !land.getControllerId().equals(game.getActivePlayerId())) { land.destroy(source.getSourceId(), game, false); + return true; } - return true; + return false; } @Override From c267acb1b9ccfaca213aef122269f57b5c7a13f5 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:37:04 -0400 Subject: [PATCH 32/62] Update MoltenInfluence.java From 4dc328387caf12e5cf236a5f2dcbb4736771c0ec Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:37:25 -0400 Subject: [PATCH 33/62] Update ZombieAssassin.java --- Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java b/Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java index bf1cf1348c8..e58a9a5ad19 100644 --- a/Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java +++ b/Mage.Sets/src/mage/sets/odyssey/ZombieAssassin.java @@ -44,6 +44,7 @@ import mage.filter.FilterCard; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.ColorPredicate; +import mage.target.Target; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetCreaturePermanent; @@ -72,9 +73,10 @@ public class ZombieAssassin extends CardImpl { this.toughness = new MageInt(2); // {tap}, Exile two cards from your graveyard and Zombie Assassin: Destroy target nonblack creature. It can't be regenerated. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new TapSourceCost()); - ability.addTarget(new TargetCreaturePermanent(filter)); - ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2,2,new FilterCard()))); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(true), new TapSourceCost()); + Target target = new TargetCreaturePermanent(filter); + target.setRequired(true); + ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(2,2,new FilterCard("two cards from your graveyard")))); ability.addCost(new ExileSourceCost()); this.addAbility(ability); } From df311533f53ccc467b8a8bbb9c5e4c8fa0aaa502 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:38:10 -0400 Subject: [PATCH 34/62] Update DecayingSoil.java --- .../src/mage/sets/odyssey/DecayingSoil.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java index 86747512412..e4c3a2e1202 100644 --- a/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java +++ b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java @@ -31,12 +31,14 @@ import java.util.UUID; import mage.abilities.Ability; import mage.abilities.TriggeredAbilityImpl; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; -import mage.abilities.condition.Condition; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.CardsInControllerGraveCondition; import mage.abilities.costs.Cost; import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.ExileTargetEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.cards.Card; import mage.cards.CardImpl; import mage.constants.CardType; @@ -73,7 +75,10 @@ public class DecayingSoil extends CardImpl { this.addAbility(ability); // Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand." - this.addAbility(new DecayingSoilTriggeredAbility()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, + new ConditionalContinousEffect(new GainAbilitySourceEffect(new DecayingSoilTriggeredAbility()), + new CardsInControllerGraveCondition(7), + "

Threshold - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."))); } public DecayingSoil(final DecayingSoil card) { @@ -87,8 +92,6 @@ public class DecayingSoil extends CardImpl { } class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl { - - Condition condition = new CardsInControllerGraveCondition(7); DecayingSoilTriggeredAbility() { super(Zone.BATTLEFIELD, new DecayingSoilEffect(), true); @@ -106,7 +109,7 @@ class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl
Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."; + return "

Threshold - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."; } } @@ -162,19 +165,15 @@ class DecayingSoilEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); - //Permanent equipment = game.getPermanent(source.getSourceId()); if (player != null) { if (player.chooseUse(Outcome.Benefit, " - Pay " + cost.getText() + "?", game)) { cost.clearPaid(); if (cost.pay(source, game, source.getId(), source.getControllerId(), false)) { UUID target = targetPointer.getFirst(game, source); - // if (target != null && equipment != null) { if (target != null) { Card card = game.getCard(target); // check if it's still in graveyard if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) { - //Player owner = game.getPlayer(card.getOwnerId()); - // owner.getHand().add(card); card.moveToZone(Zone.HAND, source.getSourceId(), game, true); return true; } From de310862a03f04fd73bca7805ecf8a4f3c5a2709 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:39:23 -0400 Subject: [PATCH 35/62] Create WardSliver.java --- .../src/mage/sets/legions/WardSliver.java | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/WardSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/WardSliver.java b/Mage.Sets/src/mage/sets/legions/WardSliver.java new file mode 100644 index 00000000000..9bcefea4881 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/WardSliver.java @@ -0,0 +1,115 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.GainAbilityControlledEffect; +import mage.abilities.keyword.ProtectionAbility; +import mage.cards.CardImpl; +import mage.choices.ChoiceColor; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorPredicate; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; + +/** + * + * @author cbt33, BetaSteward (Brave the Elements) + */ +public class WardSliver extends CardImpl { + + public WardSliver(UUID ownerId) { + super(ownerId, 25, "Ward Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setWhite(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // As Ward Sliver enters the battlefield, choose a color. + // All Slivers have protection from the chosen color. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new WardSliverEffect()); + ability.addChoice(new ChoiceColor()); + this.addAbility(ability); + } + + public WardSliver(final WardSliver card) { + super(card); + } + + @Override + public WardSliver copy() { + return new WardSliver(this); + } +} + +class WardSliverEffect extends GainAbilityControlledEffect { + + private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("sliver"); + + static { + filter1.add(new SubtypePredicate("Sliver")); + } + + private FilterCard filter2; + + public WardSliverEffect() { + super(new ProtectionAbility(new FilterCard()), Duration.WhileOnBattlefield, filter1); + filter2 = (FilterCard)((ProtectionAbility)getFirstAbility()).getFilter(); + staticText = "Choose a color. All Sliver creatures gain protection from the chosen color"; + } + + public WardSliverEffect(final WardSliverEffect effect) { + super(effect); + this.filter2 = effect.filter2.copy(); + } + + @Override + public WardSliverEffect copy() { + return new WardSliverEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + ChoiceColor choice = (ChoiceColor) source.getChoices().get(0); + filter2.add(new ColorPredicate(choice.getColor())); + filter2.setMessage(choice.getChoice()); + setAbility(new ProtectionAbility(new FilterCard(filter2))); + return super.apply(game, source); + } + +} From e2612cc542a4ac332e59e710f98ac0f2530f54f8 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:42:55 -0400 Subject: [PATCH 36/62] Create SynapseSliver.java --- .../src/mage/sets/legions/SynapseSliver.java | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/SynapseSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/SynapseSliver.java b/Mage.Sets/src/mage/sets/legions/SynapseSliver.java new file mode 100644 index 00000000000..7e4b18708e5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/SynapseSliver.java @@ -0,0 +1,74 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.DrawCardControllerEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class SynapseSliver extends CardImpl { + + public SynapseSliver(UUID ownerId) { + super(ownerId, 53, "Synapse Sliver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setBlue(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever a Sliver deals combat damage to a player, its controller may draw a card. + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardControllerEffect(1), true); + ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public SynapseSliver(final SynapseSliver card) { + super(card); + } + + @Override + public SynapseSliver copy() { + return new SynapseSliver(this); + } +} From 34456e938ad8e79824627aa71c054ae06e1af007 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:43:16 -0400 Subject: [PATCH 37/62] Create SpectralSliver.java --- .../src/mage/sets/legions/SpectralSliver.java | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/SpectralSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/SpectralSliver.java b/Mage.Sets/src/mage/sets/legions/SpectralSliver.java new file mode 100644 index 00000000000..220127898d1 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/SpectralSliver.java @@ -0,0 +1,76 @@ +/* + * 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.legions; + +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.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.BoostSourceEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.abilities.keyword.DeathtouchAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author cbt33 + */ + +public class SpectralSliver extends CardImpl { + + public SpectralSliver(UUID ownerId) { + super(ownerId, 83, "Spectral Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + this.subtype.add("Spirit"); + + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // All Sliver creatures have "{2}: This creature gets +1/+1 until end of turn." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,1,Duration.EndOfTurn), new ManaCostsImpl("{2}")); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public SpectralSliver(final SpectralSliver card) { + super(card); + } + + @Override + public SpectralSliver copy() { + return new SpectralSliver(this); + } +} From 93ab3c318316309513ed4d042face3afacb0733b Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:44:54 -0400 Subject: [PATCH 38/62] Create ShiftingSliver.java --- .../src/mage/sets/legions/ShiftingSliver.java | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/ShiftingSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java b/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java new file mode 100644 index 00000000000..b643a7d1252 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java @@ -0,0 +1,79 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.SubtypePredicate; + +/** + * + * @author cbt33 + */ +public class ShiftingSliver extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by Slivers"); + + static { + filter.add(Predicates.not(new SubtypePredicate("Sliver"))); + } + + public ShiftingSliver(UUID ownerId) { + super(ownerId, 52, "Shifting Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setBlue(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Slivers can't be blocked except by Slivers. + Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public ShiftingSliver(final ShiftingSliver card) { + super(card); + } + + @Override + public ShiftingSliver copy() { + return new ShiftingSliver(this); + } +} From 448228a40fff056c5f3e37f86dfa7892479723e0 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:45:23 -0400 Subject: [PATCH 39/62] Create RootSliver.java --- .../src/mage/sets/legions/RootSliver.java | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/RootSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/RootSliver.java b/Mage.Sets/src/mage/sets/legions/RootSliver.java new file mode 100644 index 00000000000..605774c4615 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/RootSliver.java @@ -0,0 +1,73 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.CantCounterSourceEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author cbt33, BetaSteward (Combust) + */ +public class RootSliver extends CardImpl { + + public RootSliver(UUID ownerId) { + super(ownerId, 137, "Root Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setGreen(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Root Sliver can't be countered. + Ability ability = new SimpleStaticAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); + this.addAbility(ability); + // Sliver spells can't be countered by spells or abilities. + this.addAbility(new SimpleStaticAbility(Zone.STACK, new GainAbilityAllEffect(ability, Duration.WhileOnStack, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public RootSliver(final RootSliver card) { + super(card); + } + + @Override + public RootSliver copy() { + return new RootSliver(this); + } +} From bc2ff2a835168b97df139469f3aaf2a5c71e69d7 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:46:15 -0400 Subject: [PATCH 40/62] Create QuickSliver.java --- .../src/mage/sets/legions/QuickSliver.java | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/QuickSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/QuickSliver.java b/Mage.Sets/src/mage/sets/legions/QuickSliver.java new file mode 100644 index 00000000000..b34414b7c1c --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/QuickSliver.java @@ -0,0 +1,109 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.AsThoughEffectImpl; +import mage.abilities.keyword.FlashAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.AsThoughEffectType; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; + +/** + * + * @author cbt33, Loki (Shimmer Myr) + */ +public class QuickSliver extends CardImpl { + + public QuickSliver(UUID ownerId) { + super(ownerId, 136, "Quick Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Flash + this.addAbility(FlashAbility.getInstance()); + // Any player may play Sliver cards as though they had flash. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new QuickSliverEffect())); + } + + public QuickSliver(final QuickSliver card) { + super(card); + } + + @Override + public QuickSliver copy() { + return new QuickSliver(this); + } +} + +class QuickSliverEffect extends AsThoughEffectImpl { + + public QuickSliverEffect() { + super(AsThoughEffectType.CAST, Duration.WhileOnBattlefield, Outcome.Benefit); + staticText = "Any player may play Sliver cards as though they had flash"; + } + + public QuickSliverEffect(final QuickSliverEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + return true; + } + + @Override + public QuickSliverEffect copy() { + return new QuickSliverEffect(this); + } + + @Override + public boolean applies(UUID sourceId, Ability source, Game game) { + Card card = game.getCard(sourceId); + if (card != null) { + if (card.getSubtype().contains("Sliver")) { + return true; + } + } + return false; + } + +} From 2c45f32e342e5f7abd0a18d41d29858e3b9c68b9 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:46:34 -0400 Subject: [PATCH 41/62] Create PlatedSliver.java --- .../src/mage/sets/legions/PlatedSliver.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/PlatedSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/PlatedSliver.java b/Mage.Sets/src/mage/sets/legions/PlatedSliver.java new file mode 100644 index 00000000000..8a45d9f9b2c --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/PlatedSliver.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class PlatedSliver extends CardImpl { + + public PlatedSliver(UUID ownerId) { + super(ownerId, 19, "Plated Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setWhite(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // All Sliver creatures get +0/+1. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(0, 1, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures"), false))); + } + + public PlatedSliver(final PlatedSliver card) { + super(card); + } + + @Override + public PlatedSliver copy() { + return new PlatedSliver(this); + } +} From e7c508c59c21e076f1f2c508bb7d6f9a5f3d9d0c Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:46:59 -0400 Subject: [PATCH 42/62] Create MistformSliver.java --- .../src/mage/sets/legions/MistformSliver.java | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/MistformSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/MistformSliver.java b/Mage.Sets/src/mage/sets/legions/MistformSliver.java new file mode 100644 index 00000000000..e8bbf49ef3b --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/MistformSliver.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.legions; + +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.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.cards.repository.CardRepository; +import mage.choices.Choice; +import mage.choices.ChoiceImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; + +/** + * + * @author cbt33, Plopman (Engineered Plague) + */ +public class MistformSliver extends CardImpl { + + public MistformSliver(UUID ownerId) { + super(ownerId, 46, "Mistform Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Illusion"); + this.subtype.add("Sliver"); + + this.color.setBlue(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // All Slivers have "{1}: This permanent becomes the creature type of your choice in addition to its other types until end of turn." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new MistformSliverEffect(), new ManaCostsImpl("{1}")); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public MistformSliver(final MistformSliver card) { + super(card); + } + + @Override + public MistformSliver copy() { + return new MistformSliver(this); + } +} + + class MistformSliverEffect extends OneShotEffect { + + public MistformSliverEffect() { + super(Outcome.Benefit); + staticText = "This permanent becomes the creature type of your choice in addition to its other types until end of turn"; + } + + public MistformSliverEffect(final MistformSliverEffect effect) { + super(effect); + } + + @Override + public boolean apply(Game game, Ability source) { + Player player = game.getPlayer(source.getControllerId()); + Permanent permanent = game.getPermanent(source.getSourceId()); + if (player != null && permanent != null) { + Choice typeChoice = new ChoiceImpl(true); + typeChoice.setMessage("Choose creature type"); + typeChoice.setChoices(CardRepository.instance.getCreatureTypes()); + while (!player.choose(Outcome.Detriment, typeChoice, game) && player.isInGame()) { + game.debugMessage("player canceled choosing type. retrying."); + } + game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + typeChoice.getChoice()); + game.getState().setValue(permanent.getId() + "_type", typeChoice.getChoice().toString()); + permanent.addInfo("chosen type", "Chosen type: " + typeChoice.getChoice() + ""); + permanent.getSubtype().add(typeChoice.getChoice()); + } + return false; + } + + @Override + public MistformSliverEffect copy() { + return new MistformSliverEffect(this); + } + + } From 5cf42147126687f13a67dabd3d9390489f5db740 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:47:13 -0400 Subject: [PATCH 43/62] Create MagmaSliver.java --- .../src/mage/sets/legions/MagmaSliver.java | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/MagmaSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/MagmaSliver.java b/Mage.Sets/src/mage/sets/legions/MagmaSliver.java new file mode 100644 index 00000000000..866b5c50366 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/MagmaSliver.java @@ -0,0 +1,80 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.costs.common.TapSourceCost; +import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount; +import mage.abilities.dynamicvalue.common.StaticValue; +import mage.abilities.effects.common.continious.BoostTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.Target; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class MagmaSliver extends CardImpl { + + public MagmaSliver(UUID ownerId) { + super(ownerId, 107, "Magma Sliver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setRed(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // All Slivers have "{tap}: Target Sliver creature gets +X/+0 until end of turn, where X is the number of Slivers on the battlefield." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Sliver", "Sliver creatures")), new StaticValue(0), Duration.EndOfTurn), new TapSourceCost()); + Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver creatures")); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public MagmaSliver(final MagmaSliver card) { + super(card); + } + + @Override + public MagmaSliver copy() { + return new MagmaSliver(this); + } +} From 4ac55ec9ff753df8513ed309b2fecc004edf4625 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:47:32 -0400 Subject: [PATCH 44/62] Create HunterSliver.java --- .../src/mage/sets/legions/HunterSliver.java | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/HunterSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/HunterSliver.java b/Mage.Sets/src/mage/sets/legions/HunterSliver.java new file mode 100644 index 00000000000..64b62955b23 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/HunterSliver.java @@ -0,0 +1,126 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.AttacksTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.abilities.effects.RequirementEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class HunterSliver extends CardImpl { + + public HunterSliver(UUID ownerId) { + super(ownerId, 102, "Hunter Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setRed(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // All Sliver creatures have provoke. + Ability ability = new AttacksTriggeredAbility(new ProvokeEffect(), true, "may have target creature untap and block if able"); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public HunterSliver(final HunterSliver card) { + super(card); + } + + @Override + public HunterSliver copy() { + return new HunterSliver(this); + } +} + +class ProvokeEffect extends RequirementEffect { + + public ProvokeEffect() { + this(Duration.EndOfTurn); + } + + public ProvokeEffect(Duration duration) { + super(duration); + staticText = "Target creature untaps and blocks {this} this turn if able"; + } + + public ProvokeEffect(final ProvokeEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getFirstTarget())) { + Permanent blocker = game.getPermanent(source.getFirstTarget()); + if (blocker != null && blocker.isTapped()){ + blocker.untap(game); + if (blocker.canBlock(source.getSourceId(), game)) { + return true; + } + } + } + return false; + } + + + @Override + public boolean mustAttack(Game game) { + return false; + } + + @Override + public boolean mustBlock(Game game) { + return true; + } + + @Override + public UUID mustBlockAttacker(Ability source, Game game) { + return source.getSourceId(); + } + + @Override + public ProvokeEffect copy() { + return new ProvokeEffect(this); + } + +} From e14a1c0b1df68316aadc1933a525b3d9d7bf8ff0 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:47:56 -0400 Subject: [PATCH 45/62] Create CryptSliver.java --- .../src/mage/sets/legions/CryptSliver.java | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/CryptSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/CryptSliver.java b/Mage.Sets/src/mage/sets/legions/CryptSliver.java new file mode 100644 index 00000000000..b74cb0d9ef8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/CryptSliver.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.legions; + +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.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateTargetEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class CryptSliver extends CardImpl { + + public CryptSliver(UUID ownerId) { + super(ownerId, 63, "Crypt Sliver", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setBlack(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // All Slivers have "{tap}: Regenerate target Sliver." + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{2}")); + ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver"))); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public CryptSliver(final CryptSliver card) { + super(card); + } + + @Override + public CryptSliver copy() { + return new CryptSliver(this); + } +} From bfe2183085419bff1f335dc4ece442572e0c1e1a Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:48:14 -0400 Subject: [PATCH 46/62] Create BroodSliver.java --- .../src/mage/sets/legions/BroodSliver.java | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/BroodSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/BroodSliver.java b/Mage.Sets/src/mage/sets/legions/BroodSliver.java new file mode 100644 index 00000000000..d734ccb5998 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/BroodSliver.java @@ -0,0 +1,84 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.continious.GainAbilityAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; +import mage.game.permanent.token.Token; + +/** + * + * @author cbt33, LevelX2 (Ogre Slumlord) + */ +public class BroodSliver extends CardImpl { + + public BroodSliver(UUID ownerId) { + super(ownerId, 120, "Brood Sliver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{G}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setGreen(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever a Sliver deals combat damage to a player, its controller may put a 1/1 colorless Sliver creature token onto the battlefield. + Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new CreateTokenEffect(new SliverToken()), true); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + } + + public BroodSliver(final BroodSliver card) { + super(card); + } + + @Override + public BroodSliver copy() { + return new BroodSliver(this); + } +} + +class SliverToken extends Token { + + public SliverToken() { + super("Sliver", "1/1 colorless Sliver creature token"); + cardType.add(CardType.CREATURE); + subtype.add("Sliver"); + power = new MageInt(1); + toughness = new MageInt(1); + } +} From fc64e01100007a0d52dc093fa910fbeec7289f22 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:48:30 -0400 Subject: [PATCH 47/62] Create BladeSliver.java --- .../src/mage/sets/legions/BladeSliver.java | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/BladeSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/BladeSliver.java b/Mage.Sets/src/mage/sets/legions/BladeSliver.java new file mode 100644 index 00000000000..40f675d3afa --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/BladeSliver.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.continious.BoostAllEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterCreaturePermanent; + +/** + * + * @author cbt33 + */ +public class BladeSliver extends CardImpl { + + public BladeSliver(UUID ownerId) { + super(ownerId, 88, "Blade Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setRed(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // All Sliver creatures get +1/+0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures"), false))); + } + + public BladeSliver(final BladeSliver card) { + super(card); + } + + @Override + public BladeSliver copy() { + return new BladeSliver(this); + } +} From e3cc44a27f65def60584eb39c35ac01b3a78f7a2 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:49:26 -0400 Subject: [PATCH 48/62] Create SliverOverlord.java --- .../src/mage/sets/scourge/SliverOverlord.java | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/scourge/SliverOverlord.java diff --git a/Mage.Sets/src/mage/sets/scourge/SliverOverlord.java b/Mage.Sets/src/mage/sets/scourge/SliverOverlord.java new file mode 100644 index 00000000000..3315f97d133 --- /dev/null +++ b/Mage.Sets/src/mage/sets/scourge/SliverOverlord.java @@ -0,0 +1,94 @@ +/* + * 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.scourge; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.continious.GainControlTargetEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.FilterCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.target.Target; +import mage.target.TargetPermanent; +import mage.target.common.TargetCardInLibrary; + +/** + * + * @author cbt33 + */ +public class SliverOverlord extends CardImpl { + + private static final FilterCard filter = new FilterCard("Sliver card"); + + static{ + filter.add(new SubtypePredicate("Sliver")); + } + + public SliverOverlord(UUID ownerId) { + super(ownerId, 139, "Sliver Overlord", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{W}{U}{B}{R}{G}"); + this.expansionSetCode = "SCG"; + this.supertype.add("Legendary"); + this.subtype.add("Sliver"); + this.subtype.add("Mutant"); + + this.color.setRed(true); + this.color.setBlue(true); + this.color.setGreen(true); + this.color.setBlack(true); + this.color.setWhite(true); + this.power = new MageInt(7); + this.toughness = new MageInt(7); + + // {3}: Search your library for a Sliver card, reveal that card, and put it into your hand. Then shuffle your library. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new ManaCostsImpl("{3}"))); + // {3}: Gain control of target Sliver. + Ability ability = (new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame), new ManaCostsImpl("{3}"))); + Target target = new TargetPermanent(new FilterCreaturePermanent("Sliver","Sliver")); + target.setRequired(true); + ability.addTarget(target); + this.addAbility(ability); + } + + public SliverOverlord(final SliverOverlord card) { + super(card); + } + + @Override + public SliverOverlord copy() { + return new SliverOverlord(this); + } +} From 5396cd4cf098317046cf248a05add68400bd43c8 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Tue, 15 Oct 2013 21:59:58 -0400 Subject: [PATCH 49/62] Update TaintedPact.java --- .../src/mage/sets/odyssey/TaintedPact.java | 143 ++++++++++++++---- 1 file changed, 113 insertions(+), 30 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/TaintedPact.java b/Mage.Sets/src/mage/sets/odyssey/TaintedPact.java index 7833eeffdae..9ba512d894b 100644 --- a/Mage.Sets/src/mage/sets/odyssey/TaintedPact.java +++ b/Mage.Sets/src/mage/sets/odyssey/TaintedPact.java @@ -84,35 +84,118 @@ class TaintedPactEffect extends OneShotEffect{ } @Override - public boolean apply(Game game, Ability source) { - String message = "Add the exiled card to your hand?"; - Card sourceCard = game.getCard(source.getSourceId()); - Player player = game.getPlayer(source.getControllerId()); - if (player == null || sourceCard == null) { - return false; - } - game.getExile().createZone(source.getSourceId(), "Tainted Pact"); - while (player.getLibrary().size() > 0) { - Card card = player.getLibrary().removeFromTop(game); - if (card != null) { - FilterCard filter = new FilterCard(); - filter.add(new NamePredicate(card.getName())); - card.moveToExile(source.getSourceId(), message, source.getSourceId(), game); - if(game.getExile().getExileZone(source.getSourceId()).count(filter, game) > 1) { //Checks if there is more than one card in cards with the name as current card - - break; - } - - if (player.chooseUse(outcome, message, game)) { //Adds the current card to hand if it is chosen. - card.moveToZone(Zone.HAND, source.getSourceId(), game, true); - break; - } - - } - - } - - - return false; + /* + * 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.odyssey; + +import java.util.HashSet; +import java.util.Set; +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author cbt33, Ad Nauseum (North), Izzet Staticaster (LevelX2), Bane Alley Broker (LevelX2) + */ +public class TaintedPact extends CardImpl { + + public TaintedPact(UUID ownerId) { + super(ownerId, 164, "Tainted Pact", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{1}{B}"); + this.expansionSetCode = "ODY"; + + this.color.setBlack(true); + + // Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first. + this.getSpellAbility().addEffect(new TaintedPactEffect()); } + + public TaintedPact(final TaintedPact card) { + super(card); + } + + @Override + public TaintedPact copy() { + return new TaintedPact(this); + } +} + +class TaintedPactEffect extends OneShotEffect{ + + public TaintedPactEffect() { + super(Outcome.DrawCard); + this.staticText = "Exile the top card of your library. You may put that card into your hand unless it has the same name as another card exiled this way. Repeat this process until you put a card into your hand or you exile two cards with the same name, whichever comes first."; + } + + public TaintedPactEffect(final TaintedPactEffect effect) { + super(effect); + } + + @Override + public TaintedPactEffect copy() { + return new TaintedPactEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card sourceCard = game.getCard(source.getSourceId()); + Player player = game.getPlayer(source.getControllerId()); + if (player == null || sourceCard == null) { + return false; + } + Set names = new HashSet(); + while (player.getLibrary().size() > 0) { + Card card = player.getLibrary().getFromTop(game); + if (card != null) { + + card.moveToExile(null, null, source.getSourceId(), game); + // Checks if there was already exiled a card with the same name + if (names.contains(card.getName())) { + break; + } + names.add(card.getName()); + if (player.chooseUse(outcome, new StringBuilder("Put ").append(card.getName()).append("into your hand?").toString(), game)) { + //Adds the current card to hand if it is chosen. + card.moveToZone(Zone.HAND, source.getSourceId(), game, true); + break; + } + } + } + return true; + } +} + } From 8eda8b9bc37f1f7be640eee2fd55adeb0dac3651 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 13:32:49 -0400 Subject: [PATCH 50/62] Update SliverOverlord.java --- Mage.Sets/src/mage/sets/scourge/SliverOverlord.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/scourge/SliverOverlord.java b/Mage.Sets/src/mage/sets/scourge/SliverOverlord.java index 3315f97d133..c0c86b4da60 100644 --- a/Mage.Sets/src/mage/sets/scourge/SliverOverlord.java +++ b/Mage.Sets/src/mage/sets/scourge/SliverOverlord.java @@ -33,7 +33,7 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.continious.GainControlTargetEffect; -import mage.abilities.effects.common.search.SearchLibraryPutInPlayEffect; +import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; @@ -74,7 +74,7 @@ public class SliverOverlord extends CardImpl { this.toughness = new MageInt(7); // {3}: Search your library for a Sliver card, reveal that card, and put it into your hand. Then shuffle your library. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(new TargetCardInLibrary(filter)), new ManaCostsImpl("{3}"))); + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInHandEffect(new TargetCardInLibrary(filter)), new ManaCostsImpl("{3}"))); // {3}: Gain control of target Sliver. Ability ability = (new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainControlTargetEffect(Duration.EndOfGame), new ManaCostsImpl("{3}"))); Target target = new TargetPermanent(new FilterCreaturePermanent("Sliver","Sliver")); From d791988130b507227ffda94c8029ebde01cc9284 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 13:34:49 -0400 Subject: [PATCH 51/62] Update CryptSliver.java --- Mage.Sets/src/mage/sets/legions/CryptSliver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/legions/CryptSliver.java b/Mage.Sets/src/mage/sets/legions/CryptSliver.java index b74cb0d9ef8..4747a74a2ab 100644 --- a/Mage.Sets/src/mage/sets/legions/CryptSliver.java +++ b/Mage.Sets/src/mage/sets/legions/CryptSliver.java @@ -32,7 +32,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; -import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.costs.common.TapSourceCost; import mage.abilities.effects.common.RegenerateTargetEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.cards.CardImpl; @@ -59,7 +59,7 @@ public class CryptSliver extends CardImpl { this.toughness = new MageInt(1); // All Slivers have "{tap}: Regenerate target Sliver." - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{2}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new TapSourceCost()); ability.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver"))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); } From 046059db5abba634d7fe2ac248786400e58324c6 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 13:48:39 -0400 Subject: [PATCH 52/62] Update HunterSliver.java --- Mage.Sets/src/mage/sets/legions/HunterSliver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/legions/HunterSliver.java b/Mage.Sets/src/mage/sets/legions/HunterSliver.java index 64b62955b23..abe51606a1b 100644 --- a/Mage.Sets/src/mage/sets/legions/HunterSliver.java +++ b/Mage.Sets/src/mage/sets/legions/HunterSliver.java @@ -42,6 +42,7 @@ import mage.abilities.effects.RequirementEffect; import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; +import mage.target.common.TargetCreaturePermanent; /** * @@ -60,6 +61,7 @@ public class HunterSliver extends CardImpl { // All Sliver creatures have provoke. Ability ability = new AttacksTriggeredAbility(new ProvokeEffect(), true, "may have target creature untap and block if able"); + ability.addTarget(new TargetCreaturePermanent()); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); } @@ -90,7 +92,7 @@ class ProvokeEffect extends RequirementEffect { @Override public boolean applies(Permanent permanent, Ability source, Game game) { - if (permanent.getId().equals(source.getFirstTarget())) { + if (permanent.getId().equals(targetPointer.getFirst(game, source))) { Permanent blocker = game.getPermanent(source.getFirstTarget()); if (blocker != null && blocker.isTapped()){ blocker.untap(game); From c7e2e2769cdec98b2797cca1888e1a1573f76e52 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 13:49:54 -0400 Subject: [PATCH 53/62] Update MagmaSliver.java --- Mage.Sets/src/mage/sets/legions/MagmaSliver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/legions/MagmaSliver.java b/Mage.Sets/src/mage/sets/legions/MagmaSliver.java index 866b5c50366..c1e56b64ec9 100644 --- a/Mage.Sets/src/mage/sets/legions/MagmaSliver.java +++ b/Mage.Sets/src/mage/sets/legions/MagmaSliver.java @@ -63,7 +63,7 @@ public class MagmaSliver extends CardImpl { // All Slivers have "{tap}: Target Sliver creature gets +X/+0 until end of turn, where X is the number of Slivers on the battlefield." Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(new PermanentsOnBattlefieldCount(new FilterCreaturePermanent("Sliver", "Sliver creatures")), new StaticValue(0), Duration.EndOfTurn), new TapSourceCost()); - Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver creatures")); + Target target = new TargetCreaturePermanent(new FilterCreaturePermanent("Sliver", "Sliver creature")); target.setRequired(true); ability.addTarget(target); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); From 2a246523acb4a083dc656ff527b03522266b32b2 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 13:55:41 -0400 Subject: [PATCH 54/62] Update QuickSliver.java --- Mage.Sets/src/mage/sets/legions/QuickSliver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/legions/QuickSliver.java b/Mage.Sets/src/mage/sets/legions/QuickSliver.java index b34414b7c1c..31eb3c599a2 100644 --- a/Mage.Sets/src/mage/sets/legions/QuickSliver.java +++ b/Mage.Sets/src/mage/sets/legions/QuickSliver.java @@ -99,7 +99,7 @@ class QuickSliverEffect extends AsThoughEffectImpl { public boolean applies(UUID sourceId, Ability source, Game game) { Card card = game.getCard(sourceId); if (card != null) { - if (card.getSubtype().contains("Sliver")) { + if (card.hasSubtype("Sliver")) { return true; } } From 328d90ba6a083bed771b698e2bbd958dbc08be87 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 14:22:57 -0400 Subject: [PATCH 55/62] Update RootSliver.java --- .../src/mage/sets/legions/RootSliver.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Mage.Sets/src/mage/sets/legions/RootSliver.java b/Mage.Sets/src/mage/sets/legions/RootSliver.java index 605774c4615..6b95b76dca9 100644 --- a/Mage.Sets/src/mage/sets/legions/RootSliver.java +++ b/Mage.Sets/src/mage/sets/legions/RootSliver.java @@ -31,20 +31,29 @@ import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.common.CantCounterControlledEffect; import mage.abilities.effects.common.CantCounterSourceEffect; -import mage.abilities.effects.common.continious.GainAbilityAllEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.filter.FilterSpell; +import mage.filter.FilterStackObject; +import mage.filter.predicate.mageobject.SubtypePredicate; /** * - * @author cbt33, BetaSteward (Combust) + * @author cbt33, BetaSteward (Autumn's Veil, Combust) */ public class RootSliver extends CardImpl { + + private static final FilterSpell filter = new FilterSpell("Sliver spells"); + + static { + filter.add(new SubtypePredicate("Sliver")); + } + public RootSliver(UUID ownerId) { super(ownerId, 137, "Root Sliver", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}"); @@ -56,10 +65,10 @@ public class RootSliver extends CardImpl { this.toughness = new MageInt(2); // Root Sliver can't be countered. - Ability ability = new SimpleStaticAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); - this.addAbility(ability); + this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect())); // Sliver spells can't be countered by spells or abilities. - this.addAbility(new SimpleStaticAbility(Zone.STACK, new GainAbilityAllEffect(ability, Duration.WhileOnStack, new FilterCreaturePermanent("Sliver", "Sliver creatures")))); + this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterControlledEffect(filter, new FilterStackObject(), Duration.WhileOnBattlefield))); + } public RootSliver(final RootSliver card) { @@ -71,3 +80,4 @@ public class RootSliver extends CardImpl { return new RootSliver(this); } } + From 83f892926fc98d3ed04eafd1bee0412985faac41 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 14:24:52 -0400 Subject: [PATCH 56/62] Update ShiftingSliver.java --- Mage.Sets/src/mage/sets/legions/ShiftingSliver.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java b/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java index b643a7d1252..06be38f3866 100644 --- a/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java +++ b/Mage.Sets/src/mage/sets/legions/ShiftingSliver.java @@ -48,7 +48,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate; */ public class ShiftingSliver extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by Slivers"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Slivers"); static { filter.add(Predicates.not(new SubtypePredicate("Sliver"))); From 8ed1bff72c2aa63d01109aa6b4d745de08870613 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 14:27:44 -0400 Subject: [PATCH 57/62] Update WardSliver.java --- Mage.Sets/src/mage/sets/legions/WardSliver.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/legions/WardSliver.java b/Mage.Sets/src/mage/sets/legions/WardSliver.java index 9bcefea4881..af2a3a8751d 100644 --- a/Mage.Sets/src/mage/sets/legions/WardSliver.java +++ b/Mage.Sets/src/mage/sets/legions/WardSliver.java @@ -30,8 +30,10 @@ package mage.sets.legions; import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.effects.common.continious.GainAbilityControlledEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.ProtectionAbility; import mage.cards.CardImpl; import mage.choices.ChoiceColor; @@ -62,7 +64,7 @@ public class WardSliver extends CardImpl { // As Ward Sliver enters the battlefield, choose a color. // All Slivers have protection from the chosen color. - Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new WardSliverEffect()); + Ability ability = new EntersBattlefieldTriggeredAbility(new GainAbilitySourceEffect(new SimpleStaticAbility(Zone.BATTLEFIELD, new WardSliverEffect()))); ability.addChoice(new ChoiceColor()); this.addAbility(ability); } From e86f2433a1e1e4b45d8c07760c3f082fe9ad894c Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 14:36:31 -0400 Subject: [PATCH 58/62] Update BlazingSalvo.java --- .../src/mage/sets/odyssey/BlazingSalvo.java | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java index 18accb150ee..b77d5ea1777 100644 --- a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java +++ b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java @@ -52,8 +52,8 @@ public class BlazingSalvo extends CardImpl { this.color.setRed(true); // Blazing Salvo deals 3 damage to target creature unless that creature's controller has Blazing Salvo deal 5 damage to him or her. - this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); - this.getSpellAbility().addEffect(new BlazingSalvoEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(true)); + this.getSpellAbility().addEffect(new BlazingSalvoEffect()); } public BlazingSalvo(final BlazingSalvo card) { @@ -82,23 +82,23 @@ class BlazingSalvoEffect extends OneShotEffect { return new BlazingSalvoEffect(this); } -@Override -public boolean apply(Game game, Ability source) { - Permanent permanent = game.getPermanent(source.getFirstTarget()); - if (permanent != null) { - Player player = game.getPlayer(permanent.getControllerId()); - if (player != null) { - String message = "Have Blazing Salvo do 5 damage to you?"; - if (player.chooseUse(Outcome.Damage, message, game)){ - player.damage(5, source.getSourceId(), game, true, false); - } else { - permanent.damage(3, source.getSourceId(), game, true, false); - } + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); + if (permanent != null) { + Player player = game.getPlayer(permanent.getControllerId()); + if (player != null) { + String message = "Have Blazing Salvo do 5 damage to you?"; + if (player.chooseUse(Outcome.Damage, message, game)){ + player.damage(5, source.getSourceId(), game, true, false); + } else { + permanent.damage(3, source.getSourceId(), game, true, false); + } return true; + } } - } - return false; - } + return false; + } } From 84c947813ebeec437a3b946c75df8b3e1a534b7b Mon Sep 17 00:00:00 2001 From: cbt33 Date: Wed, 16 Oct 2013 14:40:54 -0400 Subject: [PATCH 59/62] Update BlazingSalvo.java --- Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java index b77d5ea1777..2fccb1808bf 100644 --- a/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java +++ b/Mage.Sets/src/mage/sets/odyssey/BlazingSalvo.java @@ -94,7 +94,7 @@ class BlazingSalvoEffect extends OneShotEffect { } else { permanent.damage(3, source.getSourceId(), game, true, false); } - return true; + return true; } } return false; From 95890fc70941a558c5a4c7924b7c6a4f57fedf17 Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 17 Oct 2013 22:33:20 -0400 Subject: [PATCH 60/62] Create ToxinSliver.java --- .../src/mage/sets/legions/ToxinSliver.java | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/ToxinSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/ToxinSliver.java b/Mage.Sets/src/mage/sets/legions/ToxinSliver.java new file mode 100644 index 00000000000..ae7dd75cc6d --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/ToxinSliver.java @@ -0,0 +1,115 @@ +/* + * 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.legions; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.DealsCombatDamageToACreatureTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.DestroyTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author cbt33 + */ +public class ToxinSliver extends CardImpl { + + public ToxinSliver(UUID ownerId) { + super(ownerId, 84, "Toxin Sliver", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}"); + this.expansionSetCode = "LGN"; + this.subtype.add("Sliver"); + + this.color.setBlack(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever a Sliver deals combat damage to a creature, destroy that creature. It can't be regenerated. + this.addAbility(new DealsCombatDamageToACreatureTriggeredAbility(new DestroyTargetEffect(false), false, true)); + + } + + public ToxinSliver(final ToxinSliver card) { + super(card); + } + + @Override + public ToxinSliver copy() { + return new ToxinSliver(this); + } +} + +class DealsDamageTriggeredAbility extends TriggeredAbilityImpl { + + private boolean setTargetPointer; + + public DealsDamageTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { + super(Zone.BATTLEFIELD, effect, optional); + this.setTargetPointer = setTargetPointer; + } + + public DealsDamageTriggeredAbility(final DealsDamageTriggeredAbility ability) { + super(ability); + this.setTargetPointer = ability.setTargetPointer; + } + + @Override + public DealsDamageTriggeredAbility copy() { + return new DealsDamageTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) { + if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) { + if (setTargetPointer) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getTargetId()))); + effect.setValue("damage", event.getAmount()); + } + } + return true; + } + + } + return false; + } + + @Override + public String getRule() { + return "Whenever a Sliver deals damage to a creature" + super.getRule(); + } + +} From 076843604cc31b0593a758f1e946f76295d11a5f Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 17 Oct 2013 22:34:01 -0400 Subject: [PATCH 61/62] Create EssenceSliver.java --- .../src/mage/sets/legions/EssenceSliver.java | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/legions/EssenceSliver.java diff --git a/Mage.Sets/src/mage/sets/legions/EssenceSliver.java b/Mage.Sets/src/mage/sets/legions/EssenceSliver.java new file mode 100644 index 00000000000..fcc4e8ef7e5 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legions/EssenceSliver.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.legions; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author cbt33 + */ +public class EssenceSliver extends mage.sets.timeshifted.EssenceSliver { + + public EssenceSliver(UUID ownerId) { + super(ownerId); + this.cardNumber = 13; + this.expansionSetCode = "LGN"; + this.rarity = Rarity.RARE; + } + + public EssenceSliver(final EssenceSliver card) { + super(card); + } + + @Override + public EssenceSliver copy() { + return new EssenceSliver(this); + } +} From 47b2dc9723698e8a013ca3bf362d2060937403dc Mon Sep 17 00:00:00 2001 From: cbt33 Date: Thu, 17 Oct 2013 22:35:20 -0400 Subject: [PATCH 62/62] Create EssenceSliver.java --- .../mage/sets/timeshifted/EssenceSliver.java | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java diff --git a/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java b/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java new file mode 100644 index 00000000000..c21228fdd96 --- /dev/null +++ b/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.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.sets.timeshifted; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.GainLifeTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author cbt33 + */ +public class EssenceSliver extends CardImpl { + + public EssenceSliver(UUID ownerId) { + super(ownerId, 8, "Essence Sliver", Rarity.SPECIAL, new CardType[]{CardType.CREATURE}, "{3}{W}"); + this.expansionSetCode = "TSB"; + this.subtype.add("Sliver"); + + this.color.setWhite(true); + this.power = new MageInt(3); + this.toughness = new MageInt(3); + + // Whenever a Sliver deals damage, its controller gains that much life. + this.addAbility(new DealsDamageTriggeredAbility(new GainLifeTargetEffect(0), false, true)); + + } + + public EssenceSliver(final EssenceSliver card) { + super(card); + } + + @Override + public EssenceSliver copy() { + return new EssenceSliver(this); + } +} + +class DealsDamageTriggeredAbility extends TriggeredAbilityImpl { + + private boolean setTargetPointer; + + public DealsDamageTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) { + super(Zone.BATTLEFIELD, effect, optional); + this.setTargetPointer = setTargetPointer; + } + + public DealsDamageTriggeredAbility(final DealsDamageTriggeredAbility ability) { + super(ability); + this.setTargetPointer = ability.setTargetPointer; + } + + @Override + public DealsDamageTriggeredAbility copy() { + return new DealsDamageTriggeredAbility(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE || + event.getType() == GameEvent.EventType.DAMAGED_PLAYER || + event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) { + if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) { + if (setTargetPointer) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getSourceId()))); + effect.setValue("damage", event.getAmount()); + } + } + return true; + } + + } + return false; + } + + @Override + public String getRule() { + return "Whenever a Sliver deals damage, its controller" + super.getRule(); + } + +}