forked from External/mage
55 lines
1.8 KiB
Java
55 lines
1.8 KiB
Java
|
|
package mage.cards.s;
|
|
|
|
import java.util.UUID;
|
|
import mage.MageInt;
|
|
import mage.abilities.common.ControlsPermanentsControllerTriggeredAbility;
|
|
import mage.abilities.common.SimpleStaticAbility;
|
|
import mage.abilities.effects.common.SacrificeSourceEffect;
|
|
import mage.abilities.effects.common.combat.CantAttackUnlessDefenderControllsPermanent;
|
|
import mage.cards.CardImpl;
|
|
import mage.cards.CardSetInfo;
|
|
import mage.constants.CardType;
|
|
import mage.constants.ComparisonType;
|
|
import mage.constants.SubType;
|
|
import mage.constants.Zone;
|
|
import mage.filter.common.FilterLandPermanent;
|
|
import mage.filter.predicate.mageobject.SubtypePredicate;
|
|
|
|
/**
|
|
*
|
|
* @author KholdFuzion
|
|
*
|
|
*/
|
|
public final class SeaSerpent extends CardImpl {
|
|
|
|
private static final FilterLandPermanent filter = new FilterLandPermanent("an Island");
|
|
|
|
static {
|
|
filter.add(new SubtypePredicate(SubType.ISLAND));
|
|
}
|
|
|
|
public SeaSerpent(UUID ownerId, CardSetInfo setInfo) {
|
|
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}");
|
|
this.subtype.add(SubType.SERPENT);
|
|
|
|
this.power = new MageInt(5);
|
|
this.toughness = new MageInt(5);
|
|
|
|
// Sea Serpent can't attack unless defending player controls an Island.
|
|
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackUnlessDefenderControllsPermanent(filter)));
|
|
// When you control no Islands, sacrifice Sea Serpent.
|
|
this.addAbility(new ControlsPermanentsControllerTriggeredAbility(
|
|
new FilterLandPermanent(SubType.ISLAND, "no Islands"), ComparisonType.EQUAL_TO, 0,
|
|
new SacrificeSourceEffect()));
|
|
}
|
|
|
|
public SeaSerpent(final SeaSerpent card) {
|
|
super(card);
|
|
}
|
|
|
|
@Override
|
|
public SeaSerpent copy() {
|
|
return new SeaSerpent(this);
|
|
}
|
|
}
|