mirror of
https://github.com/correl/mage.git
synced 2024-12-29 11:09:17 +00:00
Implemented Roots of Life
This commit is contained in:
parent
11e1d9df38
commit
771396ee78
1 changed files with 71 additions and 0 deletions
71
Mage.Sets/src/mage/cards/r/RootsOfLife.java
Normal file
71
Mage.Sets/src/mage/cards/r/RootsOfLife.java
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
package mage.cards.r;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.BecomesTappedTriggeredAbility;
|
||||||
|
import mage.abilities.effects.common.GainLifeEffect;
|
||||||
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
|
import mage.abilities.effects.common.ChooseModeEffect;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.constants.TargetController;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||||
|
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||||
|
import mage.abilities.condition.common.ModeChoiceSourceCondition;
|
||||||
|
import mage.abilities.decorator.ConditionalTriggeredAbility;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author fubs
|
||||||
|
*/
|
||||||
|
public final class RootsOfLife extends CardImpl {
|
||||||
|
|
||||||
|
private final static String ruleTrigger1 = "&bull Island — Whenever an Island an opponent controls becomes tapped, you gain 1 life";
|
||||||
|
private final static String ruleTrigger2 = "&bull Swamp — Whenever a Swamp an opponent controls becomes tapped, you gain 1 life";
|
||||||
|
|
||||||
|
private static final FilterPermanent islandFilter = new FilterPermanent("an Island an opponent controls");
|
||||||
|
private static final FilterPermanent swampFilter = new FilterPermanent("a Swamp an opponent controls");
|
||||||
|
|
||||||
|
static {
|
||||||
|
islandFilter.add(new SubtypePredicate(SubType.ISLAND));
|
||||||
|
islandFilter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||||
|
swampFilter.add(new SubtypePredicate(SubType.SWAMP));
|
||||||
|
swampFilter.add(new ControllerPredicate(TargetController.OPPONENT));
|
||||||
|
}
|
||||||
|
|
||||||
|
public RootsOfLife(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}");
|
||||||
|
|
||||||
|
// As Roots of Life enters the battlefield, choose Island or Swamp.
|
||||||
|
this.addAbility(new EntersBattlefieldAbility(new ChooseModeEffect("Island or Swamp?","Island", "Swamp"),null,
|
||||||
|
"As {this} enters the battlefield, choose Island or Swamp.",""));
|
||||||
|
|
||||||
|
|
||||||
|
// Whenever a land of the chosen type an opponent controls becomes tapped, you gain 1 life.
|
||||||
|
|
||||||
|
// * Island chosen
|
||||||
|
this.addAbility(new ConditionalTriggeredAbility(
|
||||||
|
new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, islandFilter),
|
||||||
|
new ModeChoiceSourceCondition("Island"),
|
||||||
|
ruleTrigger1));
|
||||||
|
|
||||||
|
// * Swamp chosen
|
||||||
|
this.addAbility(new ConditionalTriggeredAbility(
|
||||||
|
new BecomesTappedTriggeredAbility(new GainLifeEffect(1), false, swampFilter),
|
||||||
|
new ModeChoiceSourceCondition("Swamp"),
|
||||||
|
ruleTrigger2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public RootsOfLife(final RootsOfLife card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RootsOfLife copy() {
|
||||||
|
return new RootsOfLife(this);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue