forked from External/mage
55 lines
1.8 KiB
Java
55 lines
1.8 KiB
Java
|
|
package mage.cards.d;
|
|
|
|
import java.util.UUID;
|
|
import mage.constants.SubType;
|
|
import mage.target.common.TargetCreaturePermanent;
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.common.DiesAttachedTriggeredAbility;
|
|
import mage.abilities.common.SimpleStaticAbility;
|
|
import mage.abilities.effects.common.AttachEffect;
|
|
import mage.abilities.effects.common.ReturnToHandAttachedEffect;
|
|
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
|
import mage.constants.Outcome;
|
|
import mage.target.TargetPermanent;
|
|
import mage.abilities.keyword.EnchantAbility;
|
|
import mage.cards.CardImpl;
|
|
import mage.cards.CardSetInfo;
|
|
import mage.constants.CardType;
|
|
import mage.constants.Duration;
|
|
import mage.constants.Zone;
|
|
|
|
/**
|
|
*
|
|
* @author TheElk801
|
|
*/
|
|
public final class DemonicVigor extends CardImpl {
|
|
|
|
public DemonicVigor(UUID ownerId, CardSetInfo setInfo) {
|
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
|
|
|
this.subtype.add(SubType.AURA);
|
|
|
|
// Enchant creature
|
|
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
|
this.getSpellAbility().addTarget(auraTarget);
|
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
|
Ability ability = new EnchantAbility(auraTarget);
|
|
this.addAbility(ability);
|
|
|
|
// Enchanted creature gets +1/+1.
|
|
this.addAbility(new SimpleStaticAbility(new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)));
|
|
|
|
// When enchanted creature dies, return that card to its owner's hand.
|
|
this.addAbility(new DiesAttachedTriggeredAbility(new ReturnToHandAttachedEffect(), "enchanted creature"));
|
|
}
|
|
|
|
private DemonicVigor(final DemonicVigor card) {
|
|
super(card);
|
|
}
|
|
|
|
@Override
|
|
public DemonicVigor copy() {
|
|
return new DemonicVigor(this);
|
|
}
|
|
}
|