forked from External/mage
Updated Hakim, Loreweaver(untested)
This commit is contained in:
parent
0b574dd6f2
commit
e36d6d1ac7
2 changed files with 12 additions and 86 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue