From 169835dbeae7acd2682e1305daaf9db5d2e26a0e Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 5 Nov 2014 18:04:56 +0100 Subject: [PATCH] * Added Animate Dead (not finished yet). --- .../mage/sets/fifthedition/AnimateDead.java | 52 ++++ .../mage/sets/fourthedition/AnimateDead.java | 52 ++++ .../mage/sets/limitedalpha/AnimateDead.java | 227 ++++++++++++++++++ .../mage/sets/limitedbeta/AnimateDead.java | 52 ++++ .../sets/magic2014/GuardianOfTheAges.java | 7 +- .../mage/sets/revisededition/AnimateDead.java | 52 ++++ .../sets/unlimitededition/AnimateDead.java | 52 ++++ .../mage/sets/vintagemasters/AnimateDead.java | 52 ++++ Mage/src/mage/abilities/Abilities.java | 1 - .../continious/LoseAbilitySourceEffect.java | 13 +- 10 files changed, 550 insertions(+), 10 deletions(-) create mode 100644 Mage.Sets/src/mage/sets/fifthedition/AnimateDead.java create mode 100644 Mage.Sets/src/mage/sets/fourthedition/AnimateDead.java create mode 100644 Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java create mode 100644 Mage.Sets/src/mage/sets/limitedbeta/AnimateDead.java create mode 100644 Mage.Sets/src/mage/sets/revisededition/AnimateDead.java create mode 100644 Mage.Sets/src/mage/sets/unlimitededition/AnimateDead.java create mode 100644 Mage.Sets/src/mage/sets/vintagemasters/AnimateDead.java diff --git a/Mage.Sets/src/mage/sets/fifthedition/AnimateDead.java b/Mage.Sets/src/mage/sets/fifthedition/AnimateDead.java new file mode 100644 index 00000000000..6868ebbd6f8 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fifthedition/AnimateDead.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.fifthedition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AnimateDead extends mage.sets.limitedalpha.AnimateDead { + + public AnimateDead(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "5ED"; + } + + public AnimateDead(final AnimateDead card) { + super(card); + } + + @Override + public AnimateDead copy() { + return new AnimateDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/fourthedition/AnimateDead.java b/Mage.Sets/src/mage/sets/fourthedition/AnimateDead.java new file mode 100644 index 00000000000..09cc4ba4f43 --- /dev/null +++ b/Mage.Sets/src/mage/sets/fourthedition/AnimateDead.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 LevelX2 + */ +public class AnimateDead extends mage.sets.limitedalpha.AnimateDead { + + public AnimateDead(UUID ownerId) { + super(ownerId); + this.cardNumber = 2; + this.expansionSetCode = "4ED"; + } + + public AnimateDead(final AnimateDead card) { + super(card); + } + + @Override + public AnimateDead copy() { + return new AnimateDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java b/Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java new file mode 100644 index 00000000000..fa946116d7b --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedalpha/AnimateDead.java @@ -0,0 +1,227 @@ +/* + * 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.limitedalpha; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.common.LeavesBattlefieldTriggeredAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.SourceOnBattelfieldCondition; +import mage.abilities.decorator.ConditionalTriggeredAbility; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.effects.common.continious.LoseAbilitySourceEffect; +import mage.abilities.keyword.EnchantAbility; +import mage.cards.Card; +import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.Rarity; +import mage.constants.Zone; +import mage.filter.Filter; +import mage.filter.common.FilterCreatureCard; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.other.AuraPermanentCanAttachToPermanentId; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCardInGraveyard; + +/** + * + * @author LevelX2 + */ +public class AnimateDead extends CardImpl { + + public AnimateDead(UUID ownerId) { + super(ownerId, 1, "Animate Dead", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}"); + this.expansionSetCode = "LEA"; + this.subtype.add("Aura"); + + this.color.setBlack(true); + + // Enchant creature card in a graveyard + TargetCardInGraveyard auraTarget = new TargetCardInGraveyard(new FilterCreatureCard("creature card in a graveyard")); + this.getSpellAbility().addTarget(auraTarget); + this.getSpellAbility().addEffect(new AnimateDeadAttachEffect(Outcome.PutCreatureInPlay)); + Ability enchantAbility = new EnchantAbility(auraTarget.getTargetName()); + this.addAbility(enchantAbility); + // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" + // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield + // under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it. + this.addAbility(new ConditionalTriggeredAbility( + new EntersBattlefieldTriggeredAbility(new AnimateDeadReAttachEffect(), false), + SourceOnBattelfieldCondition.getInstance(), + "When Animate Dead enters the battlefield, if it's on the battlefield, it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with Animate Dead.\" Return enchanted creature card to the battlefield under your control and attach Animate Dead to it.")); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new AnimateDeadLeavesBattlefieldTriggeredEffect(), false)); + + // Enchanted creature gets -1/-0. + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(-1, 0, Duration.WhileOnBattlefield))); + + } + + public AnimateDead(final AnimateDead card) { + super(card); + } + + @Override + public AnimateDead copy() { + return new AnimateDead(this); + } +} + +class AnimateDeadReAttachEffect extends OneShotEffect { + + public AnimateDeadReAttachEffect() { + super(Outcome.Benefit); + this.staticText = "if it's on the battlefield, it loses \"enchant creature card in a graveyard\" and gains \"enchant creature put onto the battlefield with Animate Dead.\" Return enchanted creature card to the battlefield under your control and attach Animate Dead to it"; + } + + public AnimateDeadReAttachEffect(final AnimateDeadReAttachEffect effect) { + super(effect); + } + + @Override + public AnimateDeadReAttachEffect copy() { + return new AnimateDeadReAttachEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent enchantment = game.getPermanent(source.getSourceId()); + + if (controller != null && enchantment != null) { + Card cardInGraveyard = game.getCard(enchantment.getAttachedTo()); + if (cardInGraveyard == null) { + return true; + } + + // put card into play + controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId()); + Ability abilityToLose = null; + for (Ability ability : enchantment.getAbilities()) { + if (ability instanceof EnchantAbility) { + abilityToLose = ability; + break; + } + } + if (abilityToLose == null) { + return false; + } + Filter filter = new FilterCreaturePermanent(); + filter.add(new AuraPermanentCanAttachToPermanentId(cardInGraveyard.getId())); + + Ability newEnchantAbility = new EnchantAbility("enchant creature put onto the battlefield with Animate Dead"); + GainAbilitySourceEffect gainAbilitySourceEffect = new GainAbilitySourceEffect(newEnchantAbility, Duration.WhileOnBattlefield); + game.addEffect(gainAbilitySourceEffect, source); + + enchantment.attachTo(cardInGraveyard.getId(), game); + + // remove enchant card in graveyard + LoseAbilitySourceEffect loseAbilitySourceEffect = new LoseAbilitySourceEffect(abilityToLose, Duration.WhileOnBattlefield); + game.addEffect(loseAbilitySourceEffect, source); + + return true; + } + + return false; + } +} + +class AnimateDeadLeavesBattlefieldTriggeredEffect extends OneShotEffect { + + public AnimateDeadLeavesBattlefieldTriggeredEffect() { + super(Outcome.Benefit); + this.staticText = "enchanted creature's controller sacrifices it"; + } + + public AnimateDeadLeavesBattlefieldTriggeredEffect(final AnimateDeadLeavesBattlefieldTriggeredEffect effect) { + super(effect); + } + + @Override + public AnimateDeadLeavesBattlefieldTriggeredEffect copy() { + return new AnimateDeadLeavesBattlefieldTriggeredEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Player controller = game.getPlayer(source.getControllerId()); + Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); + if (controller != null && sourcePermanent != null) { + if (sourcePermanent.getAttachedTo() != null) { + Permanent attachedTo = game.getPermanent(sourcePermanent.getAttachedTo()); + if (attachedTo != null) { + attachedTo.sacrifice(source.getSourceId(), game); + } + } + return true; + } + return false; + } +} + +class AnimateDeadAttachEffect extends OneShotEffect { + + public AnimateDeadAttachEffect(Outcome outcome) { + super(outcome); + } + + public AnimateDeadAttachEffect(Outcome outcome, String rule) { + super(outcome); + staticText = rule; + } + + public AnimateDeadAttachEffect(final AnimateDeadAttachEffect effect) { + super(effect); + } + + @Override + public AnimateDeadAttachEffect copy() { + return new AnimateDeadAttachEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Card card = game.getCard(source.getFirstTarget()); + if (card != null && game.getState().getZone(source.getFirstTarget()).equals(Zone.GRAVEYARD)) { + // Card have no attachedTo attribute yet so write ref only to enchantment now + Permanent enchantment = game.getPermanent(source.getSourceId()); + if (enchantment != null) { + enchantment.attachTo(card.getId(), game); + } + return true; + } + return false; + } + +} diff --git a/Mage.Sets/src/mage/sets/limitedbeta/AnimateDead.java b/Mage.Sets/src/mage/sets/limitedbeta/AnimateDead.java new file mode 100644 index 00000000000..ebbe4a73a49 --- /dev/null +++ b/Mage.Sets/src/mage/sets/limitedbeta/AnimateDead.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.limitedbeta; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AnimateDead extends mage.sets.limitedalpha.AnimateDead { + + public AnimateDead(UUID ownerId) { + super(ownerId); + this.cardNumber = 1; + this.expansionSetCode = "LEB"; + } + + public AnimateDead(final AnimateDead card) { + super(card); + } + + @Override + public AnimateDead copy() { + return new AnimateDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java b/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java index ce7c7f3e522..2abd9413f2b 100644 --- a/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java +++ b/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java @@ -91,10 +91,11 @@ class GuardianOfTheAgesTriggerAbility extends TriggeredAbilityImpl { public boolean checkTrigger(GameEvent event, Game game){ if(event.getType() == GameEvent.EventType.ATTACKER_DECLARED){ Permanent creature = game.getPermanent(event.getSourceId()); - if(creature != null && filter.match(creature, game) + if(creature != null && filter.match(creature, game) && game.getOpponents(this.getControllerId()).contains(creature.getControllerId()) - && game.getPermanent(this.getSourceId()).getAbilities().contains(DefenderAbility.getInstance())) - return true; + && game.getPermanent(this.getSourceId()).getAbilities().contains(DefenderAbility.getInstance())) { + return true; + } } return false; } diff --git a/Mage.Sets/src/mage/sets/revisededition/AnimateDead.java b/Mage.Sets/src/mage/sets/revisededition/AnimateDead.java new file mode 100644 index 00000000000..113395c43aa --- /dev/null +++ b/Mage.Sets/src/mage/sets/revisededition/AnimateDead.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.revisededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AnimateDead extends mage.sets.limitedalpha.AnimateDead { + + public AnimateDead(UUID ownerId) { + super(ownerId); + this.cardNumber = 1; + this.expansionSetCode = "3ED"; + } + + public AnimateDead(final AnimateDead card) { + super(card); + } + + @Override + public AnimateDead copy() { + return new AnimateDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/unlimitededition/AnimateDead.java b/Mage.Sets/src/mage/sets/unlimitededition/AnimateDead.java new file mode 100644 index 00000000000..c80a80d1a34 --- /dev/null +++ b/Mage.Sets/src/mage/sets/unlimitededition/AnimateDead.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.unlimitededition; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AnimateDead extends mage.sets.limitedalpha.AnimateDead { + + public AnimateDead(UUID ownerId) { + super(ownerId); + this.cardNumber = 1; + this.expansionSetCode = "2ED"; + } + + public AnimateDead(final AnimateDead card) { + super(card); + } + + @Override + public AnimateDead copy() { + return new AnimateDead(this); + } +} diff --git a/Mage.Sets/src/mage/sets/vintagemasters/AnimateDead.java b/Mage.Sets/src/mage/sets/vintagemasters/AnimateDead.java new file mode 100644 index 00000000000..fb04db156e3 --- /dev/null +++ b/Mage.Sets/src/mage/sets/vintagemasters/AnimateDead.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.vintagemasters; + +import java.util.UUID; + +/** + * + * @author LevelX2 + */ +public class AnimateDead extends mage.sets.limitedalpha.AnimateDead { + + public AnimateDead(UUID ownerId) { + super(ownerId); + this.cardNumber = 104; + this.expansionSetCode = "VMA"; + } + + public AnimateDead(final AnimateDead card) { + super(card); + } + + @Override + public AnimateDead copy() { + return new AnimateDead(this); + } +} diff --git a/Mage/src/mage/abilities/Abilities.java b/Mage/src/mage/abilities/Abilities.java index 0120a0dca55..7768d0c535e 100644 --- a/Mage/src/mage/abilities/Abilities.java +++ b/Mage/src/mage/abilities/Abilities.java @@ -35,7 +35,6 @@ import mage.constants.Zone; import mage.abilities.keyword.ProtectionAbility; import mage.abilities.mana.ManaAbility; import mage.game.Game; -import mage.players.Player; /** * Represents a collection of {@link Ability Abilities}. This is the top most diff --git a/Mage/src/mage/abilities/effects/common/continious/LoseAbilitySourceEffect.java b/Mage/src/mage/abilities/effects/common/continious/LoseAbilitySourceEffect.java index a319adeb779..3fcd139ebfb 100644 --- a/Mage/src/mage/abilities/effects/common/continious/LoseAbilitySourceEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/LoseAbilitySourceEffect.java @@ -45,12 +45,13 @@ public class LoseAbilitySourceEffect extends ContinuousEffectImpl{ @Override public boolean apply(Game game, Ability source){ Permanent permanent = game.getPermanent(source.getSourceId()); - if(permanent != null){ - while(permanent.getAbilities().contains(ability)){ - if (!permanent.getAbilities().remove(ability)) { - logger.warn("ability" + ability.getRule() + "couldn't be removed."); - } - } + if (permanent != null){ + permanent.getAbilities().remove(ability); +// while(permanent.getAbilities().contains(ability)){ +// if (!permanent.getAbilities().remove(ability)) { +// logger.warn("ability " + ability.getRule() + " couldn't be removed."); +// } +// } } return true; }