forked from External/mage
55 lines
2 KiB
Java
55 lines
2 KiB
Java
|
|
package mage.cards.f;
|
|
|
|
import java.util.UUID;
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
|
import mage.abilities.common.SimpleStaticAbility;
|
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
|
import mage.abilities.effects.Effect;
|
|
import mage.abilities.effects.common.AttachEffect;
|
|
import mage.abilities.effects.common.DoIfCostPaid;
|
|
import mage.abilities.effects.common.GainLifeEffect;
|
|
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
|
import mage.abilities.keyword.EnchantAbility;
|
|
import mage.cards.CardImpl;
|
|
import mage.cards.CardSetInfo;
|
|
import mage.constants.*;
|
|
import mage.target.TargetPermanent;
|
|
import mage.target.common.TargetLandPermanent;
|
|
|
|
/**
|
|
*
|
|
* @author fireshoes
|
|
*/
|
|
public final class Farmstead extends CardImpl {
|
|
|
|
public Farmstead(UUID ownerId, CardSetInfo setInfo) {
|
|
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{W}{W}{W}");
|
|
this.subtype.add(SubType.AURA);
|
|
|
|
// Enchant land
|
|
TargetPermanent auraTarget = new TargetLandPermanent();
|
|
this.getSpellAbility().addTarget(auraTarget);
|
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
|
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
|
this.addAbility(ability);
|
|
|
|
// Enchanted land has "At the beginning of your upkeep, you may pay {W}{W}. If you do, you gain 1 life."
|
|
ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,
|
|
new DoIfCostPaid(new GainLifeEffect(1), new ManaCostsImpl("{W}{W}")),
|
|
TargetController.YOU, true);
|
|
Effect effect = new GainAbilityAttachedEffect(ability, AttachmentType.AURA);
|
|
effect.setText("Enchanted land has \"At the beginning of your upkeep, you may pay {W}{W}. If you do, you gain 1 life.\"");
|
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
|
}
|
|
|
|
public Farmstead(final Farmstead card) {
|
|
super(card);
|
|
}
|
|
|
|
@Override
|
|
public Farmstead copy() {
|
|
return new Farmstead(this);
|
|
}
|
|
}
|