forked from External/mage
rework Impending Disaster
This commit is contained in:
parent
f13c564ce7
commit
a0a6fe652e
1 changed files with 10 additions and 18 deletions
|
|
@ -1,21 +1,21 @@
|
|||
|
||||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
|
||||
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -23,16 +23,16 @@ import mage.game.Game;
|
|||
*/
|
||||
public final class ImpendingDisaster extends CardImpl {
|
||||
|
||||
private static final Condition condition = new PermanentsOnTheBattlefieldCondition(StaticFilters.FILTER_LAND, ComparisonType.OR_GREATER, 7, false);
|
||||
|
||||
public ImpendingDisaster(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{R}");
|
||||
|
||||
|
||||
// At the beginning of your upkeep, if there are seven or more lands on the battlefield, sacrifice Impending Disaster and destroy all lands.
|
||||
TriggeredAbility ability = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeSourceEffect(), TargetController.YOU, false);
|
||||
ability.addEffect(new DestroyAllEffect(new FilterLandPermanent()));
|
||||
ImpendingDisasterCondition contition = new ImpendingDisasterCondition();
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, contition, "At the beginning of your upkeep, if there are seven or more lands on the battlefield, sacrifice {this} and destroy all lands"));
|
||||
|
||||
ability.addEffect(new DestroyAllEffect(StaticFilters.FILTER_LANDS));
|
||||
this.addAbility(new ConditionalInterveningIfTriggeredAbility(ability, condition,
|
||||
"At the beginning of your upkeep, if there are seven or more lands on the battlefield, sacrifice {this} and destroy all lands"));
|
||||
}
|
||||
|
||||
private ImpendingDisaster(final ImpendingDisaster card) {
|
||||
|
|
@ -43,12 +43,4 @@ public final class ImpendingDisaster extends CardImpl {
|
|||
public ImpendingDisaster copy() {
|
||||
return new ImpendingDisaster(this);
|
||||
}
|
||||
|
||||
class ImpendingDisasterCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return game.getBattlefield().count(new FilterLandPermanent(), source.getControllerId(), source, game) >= 7;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue