diff --git a/Mage.Sets/src/mage/sets/chronicles/LivingArmor.java b/Mage.Sets/src/mage/sets/chronicles/LivingArmor.java new file mode 100644 index 0000000000..5567e3a84e --- /dev/null +++ b/Mage.Sets/src/mage/sets/chronicles/LivingArmor.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.chronicles; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.common.SacrificeSourceCost; +import mage.abilities.costs.common.TapSourceCost; +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.counters.BoostCounter; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Derpthemeus + */ +public class LivingArmor extends CardImpl { + + public LivingArmor(UUID ownerId) { + super(ownerId, 83, "Living Armor", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}"); + this.expansionSetCode = "CHR"; + + // {tap}, Sacrifice Living Armor: Put X +0/+1 counters on target creature, where X is that creature's converted mana cost. + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new LivingArmorEffect(), new TapSourceCost()); + ability.addCost(new SacrificeSourceCost()); + ability.addTarget(new TargetCreaturePermanent()); + this.addAbility(ability); + } + + public LivingArmor(final LivingArmor card) { + super(card); + } + + @Override + public LivingArmor copy() { + return new LivingArmor(this); + } + + class LivingArmorEffect extends OneShotEffect { + + public LivingArmorEffect() { + super(Outcome.BoostCreature); + this.staticText = "Put X +0/+1 counters on target creature, where X is that creature's converted mana cost"; + } + + public LivingArmorEffect(final LivingArmorEffect effect) { + super(effect); + } + + @Override + public LivingArmorEffect copy() { + return new LivingArmorEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(source.getTargets().getFirstTarget()); + if (creature != null) { + int amount = creature.getConvertedManaCost(); + creature.addCounters(new BoostCounter(0, 1, amount), game); + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/CyclopeanMummy.java b/Mage.Sets/src/mage/sets/fourthedition/CyclopeanMummy.java new file mode 100644 index 0000000000..26703142ac --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/CyclopeanMummy.java @@ -0,0 +1,52 @@ +/* + * 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.fourthedition; + +import java.util.UUID; + +/** + * + * @author Derpthemeus + */ +public class CyclopeanMummy extends mage.sets.legends.CyclopeanMummy { + + public CyclopeanMummy(UUID ownerId) { + super(ownerId); + this.cardNumber = "12"; + this.expansionSetCode = "4ED"; + } + + public CyclopeanMummy(final CyclopeanMummy card) { + super(card); + } + + @Override + public CyclopeanMummy copy() { + return new CyclopeanMummy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/futuresight/MinionsMurmurs.java b/Mage.Sets/src/mage/sets/futuresight/MinionsMurmurs.java new file mode 100644 index 0000000000..cc280927c3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/futuresight/MinionsMurmurs.java @@ -0,0 +1,92 @@ +/* + * 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.futuresight; + +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.common.FilterCreaturePermanent; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author Derpthemeus + */ +public class MinionsMurmurs extends CardImpl { + + public MinionsMurmurs(UUID ownerId) { + super(ownerId, 71, "Minions' Murmurs", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{B}{B}"); + this.expansionSetCode = "FUT"; + + // You draw X cards and you lose X life, where X is the number of creatures you control. + this.getSpellAbility().addEffect(new MinionsMurmursEffect()); + } + + public MinionsMurmurs(final MinionsMurmurs card) { + super(card); + } + + @Override + public MinionsMurmurs copy() { + return new MinionsMurmurs(this); + } + + class MinionsMurmursEffect extends OneShotEffect { + + public MinionsMurmursEffect() { + super(Outcome.DrawCard); + this.staticText = "You draw X cards and you lose X life, where X is the number of creatures you control"; + } + + public MinionsMurmursEffect(final MinionsMurmursEffect effect) { + super(effect); + } + + @Override + public MinionsMurmursEffect copy() { + return new MinionsMurmursEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + int creaturesControlled = game.getBattlefield().countAll(new FilterCreaturePermanent(), controller.getId(), game); + controller.drawCards(creaturesControlled, game); + controller.loseLife(creaturesControlled, game); + return true; + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/DefilingTears.java b/Mage.Sets/src/mage/sets/invasion/DefilingTears.java new file mode 100644 index 0000000000..48e83daa97 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/DefilingTears.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.invasion; + +import java.util.UUID; +import mage.ObjectColor; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.Effect; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.abilities.effects.common.continuous.BecomesColorTargetEffect; +import mage.abilities.effects.common.continuous.BoostTargetEffect; +import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Derpthemeus + */ +public class DefilingTears extends CardImpl { + + public DefilingTears(UUID ownerId) { + super(ownerId, 99, "Defiling Tears", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{B}"); + this.expansionSetCode = "INV"; + + // Until end of turn, target creature becomes black, gets +1/-1, and gains "{B}: Regenerate this creature." + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + + Effect effect = new BecomesColorTargetEffect(ObjectColor.BLACK, Duration.EndOfTurn); + effect.setText("Until end of turn, target creature becomes black"); + this.getSpellAbility().addEffect(effect); + + effect = new BoostTargetEffect(1, -1, Duration.EndOfTurn); + effect.setText(", gets +1/-1"); + this.getSpellAbility().addEffect(effect); + + effect = new GainAbilityTargetEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")), Duration.EndOfTurn); + effect.setText(", and gains \"{B}: Regenerate this creature.\""); + this.getSpellAbility().addEffect(effect); + } + + public DefilingTears(final DefilingTears card) { + super(card); + } + + @Override + public DefilingTears copy() { + return new DefilingTears(this); + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/RootingKavu.java b/Mage.Sets/src/mage/sets/invasion/RootingKavu.java new file mode 100644 index 0000000000..a896e66273 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/RootingKavu.java @@ -0,0 +1,102 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.costs.common.ExileSourceFromGraveCost; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.CardImpl; +import mage.cards.Cards; +import mage.cards.CardsImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.common.FilterCreatureCard; +import mage.game.Game; +import mage.players.Player; + +/** + * + * @author Derpthemeus + */ +public class RootingKavu extends CardImpl { + + public RootingKavu(UUID ownerId) { + super(ownerId, 207, "Rooting Kavu", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}"); + this.expansionSetCode = "INV"; + this.subtype.add("Kavu"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // When Rooting Kavu dies, you may exile it. If you do, shuffle all creature cards from your graveyard into your library. + this.addAbility(new DiesTriggeredAbility(new DoIfCostPaid(new RootingKavuEffect(), new ExileSourceFromGraveCost()))); + } + + public RootingKavu(final RootingKavu card) { + super(card); + } + + @Override + public RootingKavu copy() { + return new RootingKavu(this); + } + + class RootingKavuEffect extends OneShotEffect { + + public RootingKavuEffect() { + super(Outcome.Benefit); + this.staticText = "shuffle all creature cards from your graveyard into your library."; + } + + public RootingKavuEffect(final RootingKavuEffect effect) { + super(effect); + } + + @Override + public RootingKavuEffect copy() { + return new RootingKavuEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller != null) { + Cards cards = new CardsImpl(); + cards.addAll(controller.getGraveyard().getCards(new FilterCreatureCard(), game)); + controller.putCardsOnTopOfLibrary(cards, game, source, false); + controller.shuffleLibrary(source, game); + return true; + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/sets/invasion/ScarredPuma.java b/Mage.Sets/src/mage/sets/invasion/ScarredPuma.java new file mode 100644 index 0000000000..d956aa3142 --- /dev/null +++ b/Mage.Sets/src/mage/sets/invasion/ScarredPuma.java @@ -0,0 +1,111 @@ +/* + * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of BetaSteward_at_googlemail.com. + */ +package mage.sets.invasion; + +import java.util.UUID; +import mage.MageInt; +import mage.ObjectColor; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterAttackingCreature; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author Derpthemeus + */ +public class ScarredPuma extends CardImpl { + + public ScarredPuma(UUID ownerId) { + super(ownerId, 163, "Scarred Puma", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{R}"); + this.expansionSetCode = "INV"; + this.subtype.add("Cat"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // Scarred Puma can't attack unless a black or green creature also attacks. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ScarredPumaEffect())); + } + + public ScarredPuma(final ScarredPuma card) { + super(card); + } + + @Override + public ScarredPuma copy() { + return new ScarredPuma(this); + } + + class ScarredPumaEffect extends RestrictionEffect { + + private final FilterAttackingCreature filter = new FilterAttackingCreature(); + + public ScarredPumaEffect() { + super(Duration.WhileOnBattlefield); + staticText = "{this} can't attack unless a black or green creature also attacks"; + } + + public ScarredPumaEffect(final ScarredPumaEffect effect) { + super(effect); + } + + @Override + public ScarredPumaEffect copy() { + return new ScarredPumaEffect(this); + } + + @Override + public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game) { + return false; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + for (Permanent creature : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) { + //excludes itself (http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=23067) + if (creature.getId() != source.getSourceId()) { + ObjectColor color = creature.getColor(game); + if (color.isBlack() || color.isGreen()) { + return false; + } + } + } + return true; + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/sets/legends/CyclopeanMummy.java b/Mage.Sets/src/mage/sets/legends/CyclopeanMummy.java new file mode 100644 index 0000000000..ce89843d2e --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/CyclopeanMummy.java @@ -0,0 +1,63 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.DiesTriggeredAbility; +import mage.abilities.effects.common.ExileSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; + +/** + * + * @author Derpthemeus + */ +public class CyclopeanMummy extends CardImpl { + + public CyclopeanMummy(UUID ownerId) { + super(ownerId, 7, "Cyclopean Mummy", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Zombie"); + this.power = new MageInt(2); + this.toughness = new MageInt(1); + + // When Cyclopean Mummy dies, exile it. + this.addAbility(new DiesTriggeredAbility(new ExileSourceEffect())); + } + + public CyclopeanMummy(final CyclopeanMummy card) { + super(card); + } + + @Override + public CyclopeanMummy copy() { + return new CyclopeanMummy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/legends/WalkingDead.java b/Mage.Sets/src/mage/sets/legends/WalkingDead.java new file mode 100644 index 0000000000..082c6aa0d7 --- /dev/null +++ b/Mage.Sets/src/mage/sets/legends/WalkingDead.java @@ -0,0 +1,65 @@ +/* + * 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.legends; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.RegenerateSourceEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Rarity; +import mage.constants.Zone; + +/** + * + * @author Derpthemeus + */ +public class WalkingDead extends CardImpl { + + public WalkingDead(UUID ownerId) { + super(ownerId, 40, "Walking Dead", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}"); + this.expansionSetCode = "LEG"; + this.subtype.add("Zombie"); + this.power = new MageInt(1); + this.toughness = new MageInt(1); + + // {B}: Regenerate Walking Dead. + this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}"))); + } + + public WalkingDead(final WalkingDead card) { + super(card); + } + + @Override + public WalkingDead copy() { + return new WalkingDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CyclopeanMummy.java b/Mage.Sets/src/mage/sets/masterseditioniv/CyclopeanMummy.java new file mode 100644 index 0000000000..479d9420f9 --- /dev/null +++ b/Mage.Sets/src/mage/sets/masterseditioniv/CyclopeanMummy.java @@ -0,0 +1,52 @@ +/* + * 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.masterseditioniv; + +import java.util.UUID; + +/** + * + * @author Derpthemeus + */ +public class CyclopeanMummy extends mage.sets.legends.CyclopeanMummy { + + public CyclopeanMummy(UUID ownerId) { + super(ownerId); + this.cardNumber = "72"; + this.expansionSetCode = "ME4"; + } + + public CyclopeanMummy(final CyclopeanMummy card) { + super(card); + } + + @Override + public CyclopeanMummy copy() { + return new CyclopeanMummy(this); + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/Disarm.java b/Mage.Sets/src/mage/sets/mirrodin/Disarm.java new file mode 100644 index 0000000000..e73dd79aaa --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/Disarm.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.mirrodin; + +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.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.filter.predicate.permanent.AttachedToPredicate; +import mage.filter.predicate.permanent.PermanentIdPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author Derpthemeus + */ +public class Disarm extends CardImpl { + + public Disarm(UUID ownerId) { + super(ownerId, 32, "Disarm", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}"); + this.expansionSetCode = "MRD"; + + // Unattach all Equipment from target creature. + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + this.getSpellAbility().addEffect(new DisarmEffect()); + } + + public Disarm(final Disarm card) { + super(card); + } + + @java.lang.Override + public Disarm copy() { + return new Disarm(this); + } + + class DisarmEffect extends OneShotEffect { + + public DisarmEffect() { + super(Outcome.UnboostCreature); + this.staticText = "Unattach all Equipment from target creature"; + } + + public DisarmEffect(final DisarmEffect effect) { + super(effect); + } + + @java.lang.Override + public DisarmEffect copy() { + return new DisarmEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Permanent creature = game.getPermanent(targetPointer.getFirst(game, source)); + if (creature != null) { + FilterPermanent creatureFilter = new FilterPermanent(); + creatureFilter.add(new PermanentIdPredicate(creature.getId())); + + FilterPermanent equipmentFilter = new FilterPermanent(); + equipmentFilter.add(new AttachedToPredicate(creatureFilter)); + equipmentFilter.add(new SubtypePredicate("Equipment")); + + for (Permanent equipment : game.getBattlefield().getAllActivePermanents(equipmentFilter, game)) { + creature.removeAttachment(equipment.getId(), game); + } + return true; + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/sets/mirrodin/VulshokBattlemaster.java b/Mage.Sets/src/mage/sets/mirrodin/VulshokBattlemaster.java new file mode 100644 index 0000000000..bd5ea4e431 --- /dev/null +++ b/Mage.Sets/src/mage/sets/mirrodin/VulshokBattlemaster.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.mirrodin; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.keyword.HasteAbility; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.filter.FilterPermanent; +import mage.filter.predicate.mageobject.SubtypePredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author Derpthemeus + */ +public class VulshokBattlemaster extends CardImpl { + + public VulshokBattlemaster(UUID ownerId) { + super(ownerId, 110, "Vulshok Battlemaster", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{R}"); + this.expansionSetCode = "MRD"; + this.subtype.add("Human"); + this.subtype.add("Warrior"); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // Haste + this.addAbility(HasteAbility.getInstance()); + // When Vulshok Battlemaster enters the battlefield, attach all Equipment on the battlefield to it. + this.addAbility(new EntersBattlefieldTriggeredAbility(new VulshokBattlemasterEffect())); + } + + public VulshokBattlemaster(final VulshokBattlemaster card) { + super(card); + } + + @java.lang.Override + public VulshokBattlemaster copy() { + return new VulshokBattlemaster(this); + } + + class VulshokBattlemasterEffect extends OneShotEffect { + + public VulshokBattlemasterEffect() { + super(Outcome.Benefit); + this.staticText = "attach all Equipment on the battlefield to it"; + } + + public VulshokBattlemasterEffect(final VulshokBattlemasterEffect effect) { + super(effect); + } + + @java.lang.Override + public VulshokBattlemasterEffect copy() { + return new VulshokBattlemasterEffect(this); + } + + @java.lang.Override + public boolean apply(Game game, Ability source) { + Permanent battlemaster = game.getPermanent(source.getSourceId()); + if (battlemaster != null) { + FilterPermanent filter = new FilterPermanent(); + filter.add(new SubtypePredicate("Equipment")); + for (Permanent equipment : game.getBattlefield().getAllActivePermanents(filter, game)) { + if (equipment != null) { + //If an Equipment can’t equip Vulshok Battlemaster, it isn’t attached to the Battlemaster, and it doesn’t become unattached (if it’s attached to a creature). (http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=48125) + if (!battlemaster.cantBeAttachedBy(equipment, game)) { + battlemaster.addAttachment(equipment.getId(), game); + } + } + } + return true; + } + return false; + } + } +} diff --git a/Mage.Sets/src/mage/sets/thedark/LivingArmor.java b/Mage.Sets/src/mage/sets/thedark/LivingArmor.java new file mode 100644 index 0000000000..5a17b0441e --- /dev/null +++ b/Mage.Sets/src/mage/sets/thedark/LivingArmor.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.thedark; + +import java.util.UUID; +import mage.constants.Rarity; + +/** + * + * @author Derpthemeus + */ +public class LivingArmor extends mage.sets.chronicles.LivingArmor { + + public LivingArmor(UUID ownerId) { + super(ownerId); + this.cardNumber = "101"; + this.expansionSetCode = "DRK"; + this.rarity = Rarity.UNCOMMON; + } + + public LivingArmor(final LivingArmor card) { + super(card); + } + + @Override + public LivingArmor copy() { + return new LivingArmor(this); + } +} diff --git a/Mage.Sets/src/mage/sets/urzassaga/Wirecat.java b/Mage.Sets/src/mage/sets/urzassaga/Wirecat.java new file mode 100644 index 0000000000..d69736110f --- /dev/null +++ b/Mage.Sets/src/mage/sets/urzassaga/Wirecat.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.urzassaga; + +import java.util.UUID; +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.effects.RestrictionEffect; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.common.FilterEnchantmentPermanent; +import mage.game.Game; +import mage.game.permanent.Permanent; + +/** + * + * @author Derpthemeus + */ +public class Wirecat extends CardImpl { + + public Wirecat(UUID ownerId) { + super(ownerId, 317, "Wirecat", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}"); + this.expansionSetCode = "USG"; + this.subtype.add("Cat"); + this.power = new MageInt(4); + this.toughness = new MageInt(3); + + // Wirecat can't attack or block if an enchantment is on the battlefield. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new WirecatEffect())); + } + + public Wirecat(final Wirecat card) { + super(card); + } + + @Override + public Wirecat copy() { + return new Wirecat(this); + } + + class WirecatEffect extends RestrictionEffect { + + public WirecatEffect() { + super(Duration.WhileOnBattlefield); + staticText = "{this} can't attack or block if an enchantment is on the battlefield"; + } + + public WirecatEffect(final WirecatEffect effect) { + super(effect); + } + + @Override + public WirecatEffect copy() { + return new WirecatEffect(this); + } + + @Override + public boolean canAttackCheckAfter(int numberOfAttackers, Ability source, Game game) { + return false; + } + + @Override + public boolean canBlockCheckAfter(Ability source, Game game) { + return false; + } + + @Override + public boolean applies(Permanent permanent, Ability source, Game game) { + if (permanent.getId().equals(source.getSourceId())) { + FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent(); + return game.getBattlefield().contains(filter, 1, game); + } + return false; + } + } +}