forked from External/mage
small fix Mournwillow
This commit is contained in:
parent
426583ce83
commit
aa1e2342e4
1 changed files with 10 additions and 36 deletions
|
|
@ -1,20 +1,16 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.condition.common.DeliriumCondition;
|
||||
import mage.abilities.dynamicvalue.common.CardTypesInGraveyardCount;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockAllEffect;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.AbilityWord;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -23,6 +19,11 @@ import java.util.UUID;
|
|||
*/
|
||||
public final class Mournwillow extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with power 2 or less");
|
||||
static {
|
||||
filter.add(new PowerPredicate(ComparisonType.OR_LESS, 2));
|
||||
}
|
||||
|
||||
public Mournwillow(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}{G}");
|
||||
this.subtype.add(SubType.PLANT);
|
||||
|
|
@ -35,7 +36,7 @@ public final class Mournwillow extends CardImpl {
|
|||
|
||||
// <i>Delirium</i> — When Mournwillow enters the battlefield, if there are four or more card types among cards in your graveyard,
|
||||
// creatures with power 2 or less can't block this turn.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new MournwillowEffect())
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new CantBlockAllEffect(filter, Duration.EndOfTurn))
|
||||
.withInterveningIf(DeliriumCondition.instance)
|
||||
.setAbilityWord(AbilityWord.DELIRIUM)
|
||||
.addHint(CardTypesInGraveyardCount.YOU.getHint()));
|
||||
|
|
@ -50,30 +51,3 @@ public final class Mournwillow extends CardImpl {
|
|||
return new Mournwillow(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MournwillowEffect extends RestrictionEffect {
|
||||
|
||||
MournwillowEffect() {
|
||||
super(Duration.EndOfTurn);
|
||||
staticText = "creatures with power 2 or less can't block this turn";
|
||||
}
|
||||
|
||||
private MournwillowEffect(final MournwillowEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MournwillowEffect copy() {
|
||||
return new MournwillowEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return permanent.getPower().getValue() <= 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game, boolean canUseChooseDialogs) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue