foul-magics/Mage.Sets/src/mage/cards/e/EnthrallingHold.java
htrajan 6fa1ad3aaa
[M21] Implement more cards (#6730)
* EnthrallingHold

* ArchfiendsVessel

* ConspicuousSnoop

* HoodedBlightfang

* commit set updates

* fix text

* fix Archfiend's Vessel cast from graveyard trigger and Enthralling Hold text
2020-06-26 20:55:43 -04:00

64 lines
2.2 KiB
Java

package mage.cards.e;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.ControlEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.TappedPredicate;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author htrajan
*/
public final class EnthrallingHold extends CardImpl {
private static final FilterPermanent filter = new FilterCreaturePermanent();
static {
filter.add(TappedPredicate.instance);
}
public EnthrallingHold(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.GainControl));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// You can't choose an untapped creature as this spell's target as you cast it.
auraTarget.replaceFilter(filter);
Effect controlEnchantedEffect = new ControlEnchantedEffect();
controlEnchantedEffect.setText("You can't choose an untapped creature as this spell's target as you cast it.<br>" + controlEnchantedEffect.getText(null));
// You control enchanted creature.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, controlEnchantedEffect));
}
private EnthrallingHold(final EnthrallingHold card) {
super(card);
}
@Override
public EnthrallingHold copy() {
return new EnthrallingHold(this);
}
}