mirror of
https://github.com/correl/mage.git
synced 2025-03-17 17:00:08 -09:00
* Fixed some creatures with singleton evasion abilities that sometimes faiedl to work correctly (e.g. Orchard Spirit).
This commit is contained in:
parent
e708061c5a
commit
4a0d118b7f
7 changed files with 110 additions and 467 deletions
Mage.Sets/src/mage/sets
avacynrestored
championsofkamigawa
innistrad
masterseditioniv
mirrodinbesieged
riseoftheeldrazi
timespiral
|
@ -27,18 +27,14 @@
|
|||
*/
|
||||
package mage.sets.avacynrestored;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBlockCreaturesSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
|
@ -54,7 +50,7 @@ public class HuntedGhoul extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Hunted Ghoul can't block Humans.
|
||||
this.addAbility(HuntedGhoulAbility.getInstance());
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBlockCreaturesSourceEffect(new FilterCreaturePermanent("Human", "Humans"))));
|
||||
}
|
||||
|
||||
public HuntedGhoul(final HuntedGhoul card) {
|
||||
|
@ -66,61 +62,3 @@ public class HuntedGhoul extends CardImpl {
|
|||
return new HuntedGhoul(this);
|
||||
}
|
||||
}
|
||||
|
||||
class HuntedGhoulAbility extends EvasionAbility {
|
||||
|
||||
private static HuntedGhoulAbility instance;
|
||||
|
||||
public static HuntedGhoulAbility getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new HuntedGhoulAbility();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private HuntedGhoulAbility() {
|
||||
this.addEffect(new HuntedGhoulEffect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't block Humans.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public HuntedGhoulAbility copy() {
|
||||
return getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class HuntedGhoulEffect extends RestrictionEffect {
|
||||
|
||||
public HuntedGhoulEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public HuntedGhoulEffect(final HuntedGhoulEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAbilities().containsKey(HuntedGhoulAbility.getInstance().getId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (attacker != null && attacker.hasSubtype("Human")) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HuntedGhoulEffect copy() {
|
||||
return new HuntedGhoulEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,30 +25,24 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.sets.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.combat.CantBlockSourceEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
|
@ -62,13 +56,15 @@ public class FieldOfReality extends CardImpl {
|
|||
this.expansionSetCode = "CHK";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
|
||||
// Enchanted creature can't be blocked by Spirits.
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
||||
this.addAbility(new EnchantAbility(auraTarget.getTargetName()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(new FieldOfRealityEvasionAbility(), AttachmentType.AURA )));
|
||||
|
||||
// Enchanted creature can't be blocked by Spirits.
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesAttachedEffect(
|
||||
Duration.WhileOnBattlefield, new FilterCreaturePermanent("Spirit", "Spirits"), AttachmentType.AURA)));
|
||||
// {1}{U}: Return Field of Reality to its owner's hand.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), new ManaCostsImpl("{1}{U}")));
|
||||
}
|
||||
|
@ -83,45 +79,3 @@ public class FieldOfReality extends CardImpl {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
class FieldOfRealityEvasionAbility extends EvasionAbility {
|
||||
|
||||
public FieldOfRealityEvasionAbility() {
|
||||
this.addEffect(new FieldOfRealityEvasionEffect());
|
||||
}
|
||||
|
||||
public FieldOfRealityEvasionAbility(final FieldOfRealityEvasionAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "can't be blocked by Spirits";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldOfRealityEvasionAbility copy() {
|
||||
return new FieldOfRealityEvasionAbility(this);
|
||||
}
|
||||
}
|
||||
|
||||
class FieldOfRealityEvasionEffect extends CantBlockSourceEffect {
|
||||
|
||||
public FieldOfRealityEvasionEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public FieldOfRealityEvasionEffect(final FieldOfRealityEvasionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return !blocker.hasSubtype("Spirit") ;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FieldOfRealityEvasionEffect copy() {
|
||||
return new FieldOfRealityEvasionEffect(this);
|
||||
}
|
||||
}
|
|
@ -28,18 +28,18 @@
|
|||
package mage.sets.innistrad;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -47,6 +47,17 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class OrchardSpirit extends CardImpl {
|
||||
|
||||
private final static FilterCreaturePermanent notFlyingorReachCreatures = new FilterCreaturePermanent("except by creatures with flying or reach");
|
||||
|
||||
static {
|
||||
notFlyingorReachCreatures.add(Predicates.not(
|
||||
Predicates.or(
|
||||
new AbilityPredicate(FlyingAbility.class),
|
||||
new AbilityPredicate(ReachAbility.class)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public OrchardSpirit(UUID ownerId) {
|
||||
super(ownerId, 198, "Orchard Spirit", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
this.expansionSetCode = "ISD";
|
||||
|
@ -56,7 +67,7 @@ public class OrchardSpirit extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Orchard Spirit can't be blocked except by creatures with flying or reach.
|
||||
this.addAbility(OrchardSpiritAbility.getInstance());
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(notFlyingorReachCreatures, Duration.WhileOnBattlefield)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -69,61 +80,3 @@ public class OrchardSpirit extends CardImpl {
|
|||
return new OrchardSpirit(this);
|
||||
}
|
||||
}
|
||||
|
||||
class OrchardSpiritAbility extends EvasionAbility {
|
||||
|
||||
private static OrchardSpiritAbility instance;
|
||||
|
||||
public static OrchardSpiritAbility getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new OrchardSpiritAbility();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private OrchardSpiritAbility() {
|
||||
this.addEffect(new OrchardSpiritEffect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't be blocked except by creatures with flying or reach.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrchardSpiritAbility copy() {
|
||||
return getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class OrchardSpiritEffect extends RestrictionEffect {
|
||||
|
||||
public OrchardSpiritEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public OrchardSpiritEffect(final OrchardSpiritEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAbilities().containsKey(OrchardSpiritAbility.getInstance().getId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrchardSpiritEffect copy() {
|
||||
return new OrchardSpiritEffect(this);
|
||||
}
|
||||
}
|
|
@ -29,15 +29,16 @@ package mage.sets.masterseditioniv;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -45,6 +46,12 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class ProwlingNightstalker extends CardImpl {
|
||||
|
||||
private final static FilterCreaturePermanent notBlackCreatures = new FilterCreaturePermanent("except by black creatures");
|
||||
|
||||
static {
|
||||
notBlackCreatures.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
||||
}
|
||||
|
||||
public ProwlingNightstalker(UUID ownerId) {
|
||||
super(ownerId, 93, "Prowling Nightstalker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
|
||||
this.expansionSetCode = "ME4";
|
||||
|
@ -53,7 +60,7 @@ public class ProwlingNightstalker extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Prowling Nightstalker can't be blocked except by black creatures.
|
||||
this.addAbility(ProwlingNightstalkerAbility.getInstance());
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(notBlackCreatures, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public ProwlingNightstalker(final ProwlingNightstalker card) {
|
||||
|
@ -65,61 +72,3 @@ public class ProwlingNightstalker extends CardImpl {
|
|||
return new ProwlingNightstalker(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ProwlingNightstalkerAbility extends EvasionAbility {
|
||||
|
||||
private static ProwlingNightstalkerAbility instance;
|
||||
|
||||
public static ProwlingNightstalkerAbility getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ProwlingNightstalkerAbility();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private ProwlingNightstalkerAbility() {
|
||||
this.addEffect(new ProwlingNightstalkerEffect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't be blocked except by black creatures.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProwlingNightstalkerAbility copy() {
|
||||
return getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class ProwlingNightstalkerEffect extends RestrictionEffect {
|
||||
|
||||
public ProwlingNightstalkerEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public ProwlingNightstalkerEffect(final ProwlingNightstalkerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAbilities().containsKey(ProwlingNightstalkerAbility.getInstance().getId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (blocker.getColor(game).isBlack()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProwlingNightstalkerEffect copy() {
|
||||
return new ProwlingNightstalkerEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,13 +27,10 @@
|
|||
*/
|
||||
package mage.sets.mirrodinbesieged;
|
||||
|
||||
import java.io.ObjectStreamException;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.abilities.keyword.BattleCryAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
|
@ -41,8 +38,9 @@ import mage.cards.CardImpl;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -50,6 +48,17 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class SignalPest extends CardImpl {
|
||||
|
||||
private final static FilterCreaturePermanent notFlyingorReachCreatures = new FilterCreaturePermanent("except by creatures with flying or reach");
|
||||
|
||||
static {
|
||||
notFlyingorReachCreatures.add(Predicates.not(
|
||||
Predicates.or(
|
||||
new AbilityPredicate(FlyingAbility.class),
|
||||
new AbilityPredicate(ReachAbility.class)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public SignalPest(UUID ownerId) {
|
||||
super(ownerId, 131, "Signal Pest", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}");
|
||||
this.expansionSetCode = "MBS";
|
||||
|
@ -58,8 +67,11 @@ public class SignalPest extends CardImpl {
|
|||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)
|
||||
this.addAbility(new BattleCryAbility());
|
||||
this.addAbility(SignalPestAbility.getInstance());
|
||||
|
||||
// Signal Pest can't be blocked except by creatures with flying or reach.
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(notFlyingorReachCreatures, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public SignalPest(final SignalPest card) {
|
||||
|
@ -71,65 +83,3 @@ public class SignalPest extends CardImpl {
|
|||
return new SignalPest(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SignalPestAbility extends EvasionAbility implements MageSingleton {
|
||||
|
||||
private static SignalPestAbility instance;
|
||||
|
||||
private Object readResolve() throws ObjectStreamException {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static SignalPestAbility getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new SignalPestAbility();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private SignalPestAbility() {
|
||||
this.addEffect(new SignalPestEffect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't be blocked except by creatures with flying or reach";
|
||||
}
|
||||
|
||||
@Override
|
||||
public SignalPestAbility copy() {
|
||||
return getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class SignalPestEffect extends RestrictionEffect {
|
||||
|
||||
public SignalPestEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public SignalPestEffect(final SignalPestEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAbilities().containsKey(SignalPestAbility.getInstance().getId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (blocker.getAbilities().contains(FlyingAbility.getInstance()) || blocker.getAbilities().contains(ReachAbility.getInstance())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SignalPestEffect copy() {
|
||||
return new SignalPestEffect(this);
|
||||
}
|
||||
}
|
|
@ -27,23 +27,24 @@
|
|||
*/
|
||||
package mage.sets.riseoftheeldrazi;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
import mage.abilities.AbilitiesImpl;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.abilities.keyword.LevelUpAbility;
|
||||
import mage.abilities.keyword.LevelerCardBuilder;
|
||||
import mage.cards.LevelerCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -51,6 +52,12 @@ import java.util.UUID;
|
|||
*/
|
||||
public class ZulaportEnforcer extends LevelerCard {
|
||||
|
||||
private final static FilterCreaturePermanent notBlackCreatures = new FilterCreaturePermanent("except by black creatures");
|
||||
|
||||
static {
|
||||
notBlackCreatures.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
||||
}
|
||||
|
||||
public ZulaportEnforcer(UUID ownerId) {
|
||||
super(ownerId, 133, "Zulaport Enforcer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}");
|
||||
this.expansionSetCode = "ROE";
|
||||
|
@ -64,14 +71,13 @@ public class ZulaportEnforcer extends LevelerCard {
|
|||
this.addAbility(new LevelUpAbility(new ManaCostsImpl("{4}")));
|
||||
|
||||
// LEVEL 1-2: 3/3
|
||||
|
||||
// LEVEL 3+: 5/5
|
||||
// Zulaport Enforcer can't be blocked except by black creatures.
|
||||
Abilities<Ability> levelAbilities = new AbilitiesImpl<Ability>();
|
||||
levelAbilities.add(ZulaportEnforcerAbility.getInstance());
|
||||
Abilities<Ability> levelAbilities = new AbilitiesImpl<>();
|
||||
levelAbilities.add(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(notBlackCreatures, Duration.WhileOnBattlefield)));
|
||||
|
||||
this.addAbilities(LevelerCardBuilder.construct(
|
||||
new LevelerCardBuilder.LevelAbility(1, 2, new AbilitiesImpl<Ability>(), 3, 3),
|
||||
new LevelerCardBuilder.LevelAbility(1, 2, new AbilitiesImpl<>(), 3, 3),
|
||||
new LevelerCardBuilder.LevelAbility(3, -1, levelAbilities, 5, 5)
|
||||
));
|
||||
setMaxLevelCounters(3);
|
||||
|
@ -86,61 +92,3 @@ public class ZulaportEnforcer extends LevelerCard {
|
|||
return new ZulaportEnforcer(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ZulaportEnforcerAbility extends EvasionAbility {
|
||||
|
||||
private static ZulaportEnforcerAbility instance;
|
||||
|
||||
public static ZulaportEnforcerAbility getInstance() {
|
||||
if (instance == null) {
|
||||
instance = new ZulaportEnforcerAbility();
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
private ZulaportEnforcerAbility() {
|
||||
this.addEffect(new ZulaportEnforcerEffect());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "{this} can't be blocked except by black creatures.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZulaportEnforcerAbility copy() {
|
||||
return getInstance();
|
||||
}
|
||||
}
|
||||
|
||||
class ZulaportEnforcerEffect extends RestrictionEffect {
|
||||
|
||||
public ZulaportEnforcerEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public ZulaportEnforcerEffect(final ZulaportEnforcerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAbilities().containsKey(ZulaportEnforcerAbility.getInstance().getId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (blocker.getColor(game).isBlack()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ZulaportEnforcerEffect copy() {
|
||||
return new ZulaportEnforcerEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,24 +28,18 @@
|
|||
package mage.sets.timespiral;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.EvasionAbility;
|
||||
import mage.abilities.MageSingleton;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.keyword.IntimidateAbility;
|
||||
import mage.abilities.common.SimpleEvasionAbility;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -53,6 +47,17 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class AmrouSeekers extends CardImpl {
|
||||
|
||||
private final static FilterCreaturePermanent notArtificatOrWhite = new FilterCreaturePermanent("except by artifact creatures and/or white creatures");
|
||||
|
||||
static {
|
||||
notArtificatOrWhite.add(Predicates.not(
|
||||
Predicates.or(
|
||||
new CardTypePredicate(CardType.ARTIFACT),
|
||||
new ColorPredicate(ObjectColor.WHITE)
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public AmrouSeekers(UUID ownerId) {
|
||||
super(ownerId, 2, "Amrou Seekers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
this.expansionSetCode = "TSP";
|
||||
|
@ -63,7 +68,7 @@ public class AmrouSeekers extends CardImpl {
|
|||
this.toughness = new MageInt(2);
|
||||
|
||||
// Amrou Seekers can't be blocked except by artifact creatures and/or white creatures.
|
||||
this.addAbility(new AmrouSeekersEvasionAbility());
|
||||
this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(notArtificatOrWhite, Duration.WhileOnBattlefield)));
|
||||
|
||||
}
|
||||
|
||||
|
@ -76,57 +81,3 @@ public class AmrouSeekers extends CardImpl {
|
|||
return new AmrouSeekers(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AmrouSeekersEvasionAbility extends EvasionAbility implements MageSingleton {
|
||||
|
||||
public AmrouSeekersEvasionAbility() {
|
||||
super();
|
||||
this.addEffect(new AmrouSeekersRestrictionEffect());
|
||||
}
|
||||
|
||||
public AmrouSeekersEvasionAbility(final AmrouSeekersEvasionAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Amrou Seekers can't be blocked except by artifact creatures and/or white creatures.";
|
||||
}
|
||||
|
||||
@Override
|
||||
public AmrouSeekersEvasionAbility copy() {
|
||||
return new AmrouSeekersEvasionAbility(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class AmrouSeekersRestrictionEffect extends RestrictionEffect {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("artifact creatures and/or white creatures");
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new ColorPredicate(ObjectColor.WHITE)));
|
||||
}
|
||||
|
||||
public AmrouSeekersRestrictionEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
}
|
||||
|
||||
public AmrouSeekersRestrictionEffect(final AmrouSeekersRestrictionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
return filter.match(blocker, source.getSourceId(), source.getControllerId(), game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AmrouSeekersRestrictionEffect copy() {
|
||||
return new AmrouSeekersRestrictionEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue