diff --git a/Mage.Sets/src/mage/sets/gatecrash/ClanDefiance.java b/Mage.Sets/src/mage/sets/gatecrash/ClanDefiance.java new file mode 100644 index 0000000000..c4d7ccbc89 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/ClanDefiance.java @@ -0,0 +1,113 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Mode; +import mage.abilities.dynamicvalue.common.ManacostVariableValue; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.cards.CardImpl; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.mageobject.AbilityPredicate; +import mage.target.TargetPlayer; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author jeffwadsworth + */ +public class ClanDefiance extends CardImpl { + + static final private FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + static final private FilterCreaturePermanent filter2 = new FilterCreaturePermanent("creature without flying"); + + static { + filter.add(new AbilityPredicate(FlyingAbility.class)); + filter2.add(Predicates.not(new AbilityPredicate(FlyingAbility.class))); + } + + public ClanDefiance(UUID ownerId) { + super(ownerId, 151, "Clan Defiance", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{R}{G}"); + this.expansionSetCode = "GTC"; + + this.color.setRed(true); + this.color.setGreen(true); + + // Choose one or more - Clan Defiance deals X damage to target creature with flying; Clan Defiance deals X damage to target creature without flying; and/or Clan Defiance deals X damage to target player. + this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue())); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + + Mode mode1 = new Mode(); + mode1.getEffects().add(new DamageTargetEffect(new ManacostVariableValue())); + mode1.getTargets().add(new TargetCreaturePermanent(filter2)); + this.getSpellAbility().addMode(mode1); + + Mode mode2 = new Mode(); + mode2.getEffects().add(new DamageTargetEffect(new ManacostVariableValue())); + mode2.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode2); + + Mode mode3 = new Mode(); + mode3.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature with flying, then deals X damage to target creature without flying")); + mode3.getTargets().add(new TargetCreaturePermanent(filter)); + mode3.getTargets().add(new TargetCreaturePermanent(filter2)); + this.getSpellAbility().addMode(mode3); + + Mode mode4 = new Mode(); + mode4.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature with flying, then deals X damage to target player")); + mode4.getTargets().add(new TargetCreaturePermanent(filter)); + mode4.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode4); + + Mode mode5 = new Mode(); + mode5.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature without flying, then deals X damage to target player")); + mode5.getTargets().add(new TargetCreaturePermanent(filter2)); + mode5.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode5); + + Mode mode6 = new Mode(); + mode6.getEffects().add(new DamageTargetEffect(new ManacostVariableValue(), true, "target creature with flying, then deals X damage to target creature without flying, then deals X damage to target player")); + mode6.getTargets().add(new TargetCreaturePermanent(filter)); + mode6.getTargets().add(new TargetCreaturePermanent(filter2)); + mode6.getTargets().add(new TargetPlayer()); + this.getSpellAbility().addMode(mode6); + } + + public ClanDefiance(final ClanDefiance card) { + super(card); + } + + @Override + public ClanDefiance copy() { + return new ClanDefiance(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/DinrovaHorror.java b/Mage.Sets/src/mage/sets/gatecrash/DinrovaHorror.java new file mode 100644 index 0000000000..d22be01d10 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/DinrovaHorror.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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Outcome; +import mage.Constants.Rarity; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.Effect; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth + */ +public class DinrovaHorror extends CardImpl { + + public DinrovaHorror(UUID ownerId) { + super(ownerId, 155, "Dinrova Horror", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{U}{B}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Horror"); + + this.color.setBlue(true); + this.color.setBlack(true); + this.power = new MageInt(4); + this.toughness = new MageInt(4); + + // When Dinrova Horror enters the battlefield, return target permanent to its owner's hand, then that player discards a card. + Ability ability = new EntersBattlefieldTriggeredAbility(new DinrovaHorrorEffect(), false); + ability.addTarget(new TargetPermanent()); + this.addAbility(ability); + + } + + public DinrovaHorror(final DinrovaHorror card) { + super(card); + } + + @Override + public DinrovaHorror copy() { + return new DinrovaHorror(this); + } +} + +class DinrovaHorrorEffect extends OneShotEffect { + + public DinrovaHorrorEffect() { + super(Outcome.Detriment); + this.staticText = "return target permanent to its owner's hand, then that player discards a card"; + } + + public DinrovaHorrorEffect(final DinrovaHorrorEffect effect) { + super(effect); + } + + @Override + public DinrovaHorrorEffect copy() { + return new DinrovaHorrorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent target = game.getPermanent(source.getFirstTarget()); + Player controller = game.getPlayer(target.getControllerId()); + if (target != null && controller != null) { + target.moveToZone(Constants.Zone.HAND, id, game, true); + controller.discard(1, source, game); + return true; + } + return false; + + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java b/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java new file mode 100644 index 0000000000..1123062121 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java @@ -0,0 +1,125 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; +import mage.abilities.effects.common.LoseLifeTargetEffect; +import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.events.GameEvent.EventType; +import mage.game.events.ZoneChangeEvent; +import mage.target.TargetPlayer; +import mage.target.targetpointer.FixedTarget; + +/** + * + * @author jeffwadsworth and LevelX2 + */ +public class DuskmantleGuildmage extends CardImpl { + + public DuskmantleGuildmage(UUID ownerId) { + super(ownerId, 158, "Duskmantle Guildmage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{U}{B}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Human"); + this.subtype.add("Wizard"); + + this.color.setBlue(true); + this.color.setBlack(true); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {1}{U}{B}: Whenever a card is put into an opponent's graveyard from anywhere this turn, that player loses 1 life. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateDelayedTriggeredAbilityEffect(new CardPutIntoOpponentGraveThisTurn()), new ManaCostsImpl("{1}{U}{B}"))); + + // {2}{U}{B}: Target player puts the top two cards of his or her library into his or her graveyard. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(2), new ManaCostsImpl("{2}{U}{B}")); + ability.addTarget(new TargetPlayer()); + this.addAbility(ability); + } + + public DuskmantleGuildmage(final DuskmantleGuildmage card) { + super(card); + } + + @Override + public DuskmantleGuildmage copy() { + return new DuskmantleGuildmage(this); + } +} + +class CardPutIntoOpponentGraveThisTurn extends DelayedTriggeredAbility { + + public CardPutIntoOpponentGraveThisTurn() { + super(new LoseLifeTargetEffect(1), Duration.EndOfTurn, false); + } + + public CardPutIntoOpponentGraveThisTurn(final CardPutIntoOpponentGraveThisTurn ability) { + super(ability); + } + + @Override + public CardPutIntoOpponentGraveThisTurn copy() { + return new CardPutIntoOpponentGraveThisTurn(this); + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + if (event.getType() == EventType.ZONE_CHANGE) { + ZoneChangeEvent zEvent = (ZoneChangeEvent) event; + UUID cardId = event.getTargetId(); + Card card = game.getCard(cardId); + if (zEvent.getToZone() == Zone.GRAVEYARD + && game.getOpponents(controllerId).contains(card.getOwnerId())) { + for (Effect effect : this.getEffects()) { + effect.setTargetPointer(new FixedTarget(card.getOwnerId())); + } + return true; + } + } + return false; + } + + @Override + public String getRule() { + return "Whenever a card is put into an opponent's graveyard from anywhere this turn, that player loses 1 life"; + } +} \ No newline at end of file diff --git a/Mage.Sets/src/mage/sets/gatecrash/Hindervines.java b/Mage.Sets/src/mage/sets/gatecrash/Hindervines.java new file mode 100644 index 0000000000..0959141e90 --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/Hindervines.java @@ -0,0 +1,71 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.gatecrash; + +import java.util.UUID; +import mage.Constants.CardType; +import mage.Constants.Duration; +import mage.Constants.Rarity; +import mage.abilities.effects.common.PreventAllDamageEffect; +import mage.cards.CardImpl; +import mage.counters.CounterType; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.Predicates; +import mage.filter.predicate.permanent.CounterPredicate; + +/** + * + * @author jeffwadsworth + */ +public class Hindervines extends CardImpl { + + final static private FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with no +1/+1 counters on them"); + + static { + filter.add(Predicates.not(new CounterPredicate(CounterType.P1P1))); + } + + public Hindervines(UUID ownerId) { + super(ownerId, 124, "Hindervines", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{G}"); + this.expansionSetCode = "GTC"; + + this.color.setGreen(true); + + // Prevent all combat damage that would be dealt this turn by creatures with no +1/+1 counters on them. + this.getSpellAbility().addEffect(new PreventAllDamageEffect(filter, Duration.EndOfTurn, true)); + } + + public Hindervines(final Hindervines card) { + super(card); + } + + @Override + public Hindervines copy() { + return new Hindervines(this); + } +} diff --git a/Mage.Sets/src/mage/sets/gatecrash/SpireTracer.java b/Mage.Sets/src/mage/sets/gatecrash/SpireTracer.java new file mode 100644 index 0000000000..70397a4aee --- /dev/null +++ b/Mage.Sets/src/mage/sets/gatecrash/SpireTracer.java @@ -0,0 +1,108 @@ +/* + * 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.gatecrash; + +import java.util.UUID; +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.Constants.Zone; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.abilities.keyword.FlyingAbility; +import mage.abilities.keyword.ReachAbility; +import mage.cards.CardImpl; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author jeffwadsworth + */ +public class SpireTracer extends CardImpl { + + public SpireTracer(UUID ownerId) { + super(ownerId, 135, "Spire Tracer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}"); + this.expansionSetCode = "GTC"; + this.subtype.add("Elf"); + this.subtype.add("Scout"); + + this.color.setGreen(true); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // Spire Tracer can't be blocked except by creatures with flying or reach. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect())); + + } + + public SpireTracer(final SpireTracer card) { + super(card); + } + + @Override + public SpireTracer copy() { + return new SpireTracer(this); + } +} + +class CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect extends RestrictionEffect { + + public CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect() { + super(Constants.Duration.WhileOnBattlefield); + staticText = "Can't be blocked except by creatures with flying or reach"; + } + + public CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect(final CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect effect) { + super(effect); + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + return true; + } + return false; + } + + @Override + public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) { + if (!blocker.getAbilities().containsKey(FlyingAbility.getInstance().getId()) + || !blocker.getAbilities().containsKey(ReachAbility.getInstance().getId())) { + return false; + } + return true; + } + + @Override + public CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect copy() { + return new CantBeBlockedExceptByCreaturesWithFlyingOrReachEffect(this); + } +} diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java index 105d81e319..f35acc0b1b 100644 --- a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java @@ -1,33 +1,33 @@ /* -* 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. -*/ - + * 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.abilities.effects.common; +import java.util.UUID; import mage.Constants.Outcome; import mage.abilities.Ability; import mage.abilities.Mode; @@ -37,6 +37,7 @@ import mage.abilities.effects.OneShotEffect; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; +import mage.target.Target; /** * @@ -50,7 +51,7 @@ public class DamageTargetEffect extends OneShotEffect { protected String targetDescription; public DamageTargetEffect(int amount) { - this(new StaticValue(amount), true); + this(new StaticValue(amount), true); } public DamageTargetEffect(int amount, boolean preventable) { @@ -102,6 +103,21 @@ public class DamageTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { + if (source.getTargets().size() > 1) { + for (Target target : source.getTargets()) { + for (UUID targetId : target.getTargets()) { + Permanent permanent = game.getPermanent(targetId); + if (permanent != null) { + permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false); + } + Player player = game.getPlayer(targetId); + if (player != null) { + player.damage(amount.calculate(game, source), source.getSourceId(), game, false, preventable); + } + } + } + return true; + } Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { permanent.damage(amount.calculate(game, source), source.getSourceId(), game, preventable, false); @@ -126,8 +142,7 @@ public class DamageTargetEffect extends OneShotEffect { sb.append(" damage to "); if (targetDescription.length() > 0) { sb.append(targetDescription); - } - else { + } else { sb.append("target ").append(mode.getTargets().get(0).getTargetName()); } if (message.length() > 0) { @@ -147,5 +162,4 @@ public class DamageTargetEffect extends OneShotEffect { } return sb.toString(); } - }