From e36d6d1ac7ec2bf42142699c9b971e3c8f09cc8a Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 16 Sep 2017 11:02:17 -0400 Subject: [PATCH] Updated Hakim, Loreweaver(untested) --- .../src/mage/cards/h/HakimLoreweaver.java | 35 ++++------- Mage.Sets/src/mage/cards/s/SliceinTwain.java | 63 ------------------- 2 files changed, 12 insertions(+), 86 deletions(-) delete mode 100644 Mage.Sets/src/mage/cards/s/SliceinTwain.java diff --git a/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java b/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java index 1b3082b518f..2855978c7f8 100644 --- a/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java +++ b/Mage.Sets/src/mage/cards/h/HakimLoreweaver.java @@ -46,6 +46,7 @@ import mage.constants.Outcome; import mage.constants.PhaseStep; import mage.constants.SubType; import mage.constants.SuperType; +import mage.constants.TargetController; import mage.constants.Zone; import mage.filter.FilterCard; import mage.filter.FilterPermanent; @@ -53,6 +54,7 @@ import mage.filter.predicate.mageobject.CardIdPredicate; import mage.filter.predicate.mageobject.CardTypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.other.AuraCardCanAttachToPermanentId; +import mage.filter.predicate.other.OwnerPredicate; import mage.filter.predicate.permanent.AttachedToPredicate; import mage.game.Game; import mage.game.permanent.Permanent; @@ -67,7 +69,13 @@ import mage.target.common.TargetCardInYourGraveyard; public class HakimLoreweaver extends CardImpl { private final static String rule = "Return target Aura card from your graveyard to the battlefield attached to Hakim, Loreweaver. Activate this ability only during your upkeep and only if Hakim isn't enchanted."; - UUID originalId; + private static final FilterCard filter = new FilterCard("target Aura card from your graveyard"); + + static { + filter.add(new CardTypePredicate(CardType.ENCHANTMENT)); + filter.add(new SubtypePredicate(SubType.AURA)); + filter.add(new OwnerPredicate(TargetController.YOU)); + } public HakimLoreweaver(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}"); @@ -81,11 +89,9 @@ public class HakimLoreweaver extends CardImpl { // Flying this.addAbility(FlyingAbility.getInstance()); - //TODO: Make ability properly copiable // {U}{U}: Return target Aura card from your graveyard to the battlefield attached to Hakim, Loreweaver. Activate this ability only during your upkeep and only if Hakim isn't enchanted. Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new HakimLoreweaverEffect(), new ManaCostsImpl("{U}{U}"), new HakimLoreweaverCondition(), rule); - ability.addTarget(new TargetCardInYourGraveyard()); - originalId = ability.getOriginalId(); + ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); // {U}{U}, {tap}: Destroy all Auras attached to Hakim. @@ -101,26 +107,8 @@ public class HakimLoreweaver extends CardImpl { } - @Override - public void adjustTargets(Ability ability, Game game) { - if (ability.getOriginalId().equals(originalId)) { - Player controller = game.getPlayer(ability.getControllerId()); - if (controller != null) { - ability.getTargets().clear(); - FilterCard filterAuraCard = new FilterCard("target Aura card from your graveyard"); - filterAuraCard.add(new CardTypePredicate(CardType.ENCHANTMENT)); - filterAuraCard.add(new SubtypePredicate(SubType.AURA)); - filterAuraCard.add(new AuraCardCanAttachToPermanentId(ability.getSourceId())); - TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filterAuraCard); - ability.addTarget(target); - } - } - - } - public HakimLoreweaver(final HakimLoreweaver card) { super(card); - this.originalId = card.originalId; } @Override @@ -153,7 +141,8 @@ class HakimLoreweaverEffect extends OneShotEffect { if (controller != null && hakimLoreweaver != null && controller.canRespond() - && targetAuraCard != null) { + && targetAuraCard != null + && new AuraCardCanAttachToPermanentId(hakimLoreweaver.getId()).apply(targetAuraCard, game)) { Target target = targetAuraCard.getSpellAbility().getTargets().get(0); if (target != null) { game.getState().setValue("attachTo:" + targetAuraCard.getId(), hakimLoreweaver); diff --git a/Mage.Sets/src/mage/cards/s/SliceinTwain.java b/Mage.Sets/src/mage/cards/s/SliceinTwain.java deleted file mode 100644 index abb03b31160..00000000000 --- a/Mage.Sets/src/mage/cards/s/SliceinTwain.java +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are - * permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this list of - * conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright notice, this list - * of conditions and the following disclaimer in the documentation and/or other materials - * provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * The views and conclusions contained in the software and documentation are those of the - * authors and should not be interpreted as representing official policies, either expressed - * or implied, of BetaSteward_at_googlemail.com. - */ - -package mage.cards.s; - -import mage.abilities.effects.common.DestroyTargetEffect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.filter.StaticFilters; -import mage.target.TargetPermanent; - -import java.util.UUID; - -/** - * - * @author Loki - */ -public class SliceinTwain extends CardImpl { - - public SliceinTwain (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{2}{G}{G}"); - - this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); - this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.ARTIFACT_OR_ENCHANTMENT_PERMANENT)); - } - - public SliceinTwain (final SliceinTwain card) { - super(card); - } - - @Override - public SliceinTwain copy() { - return new SliceinTwain(this); - } -}