mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 12:19:59 -08:00
Some cleanups/remanes for attack/block restrict effects.
This commit is contained in:
parent
77673ba49f
commit
312a9fd7af
16 changed files with 183 additions and 172 deletions
|
|
@ -25,16 +25,15 @@
|
|||
* 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.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.AttacksEachTurnStaticAbility;
|
||||
import mage.abilities.keyword.BushidoAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -42,7 +41,7 @@ import mage.cards.CardImpl;
|
|||
*/
|
||||
public class BattleMadRonin extends CardImpl {
|
||||
|
||||
public BattleMadRonin (UUID ownerId) {
|
||||
public BattleMadRonin(UUID ownerId) {
|
||||
super(ownerId, 156, "Battle-Mad Ronin", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
this.expansionSetCode = "CHK";
|
||||
this.subtype.add("Human");
|
||||
|
|
@ -50,11 +49,15 @@ public class BattleMadRonin extends CardImpl {
|
|||
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Bushido 2 (When this blocks or becomes blocked, it gets +2/+2 until end of turn.)
|
||||
this.addAbility(new BushidoAbility(2));
|
||||
|
||||
// Battle-Mad Ronin attacks each turn if able.
|
||||
this.addAbility(new AttacksEachTurnStaticAbility());
|
||||
}
|
||||
|
||||
public BattleMadRonin (final BattleMadRonin card) {
|
||||
public BattleMadRonin(final BattleMadRonin card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,13 +28,12 @@
|
|||
package mage.sets.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CounterUnlessPaysEffect;
|
||||
import mage.abilities.keyword.StormAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||
|
|
@ -47,15 +46,15 @@ import mage.target.TargetSpell;
|
|||
public class Flusterstorm extends CardImpl {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("instant or sorcery spell");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
|
||||
}
|
||||
|
||||
|
||||
public Flusterstorm(UUID ownerId) {
|
||||
super(ownerId, 46, "Flusterstorm", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{U}");
|
||||
this.expansionSetCode = "CMD";
|
||||
|
||||
|
||||
// Counter target instant or sorcery spell unless its controller pays {1}.
|
||||
this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new ManaCostsImpl("{1}")));
|
||||
this.getSpellAbility().addTarget(new TargetSpell(filter));
|
||||
|
|
|
|||
|
|
@ -29,23 +29,19 @@ package mage.sets.fifthedition;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -53,12 +49,15 @@ import mage.game.permanent.Permanent;
|
|||
*/
|
||||
public class EvilEyeOfOrmsByGore extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("except by Walls");
|
||||
private static final FilterCreaturePermanent cantAttackFilter = new FilterCreaturePermanent("Non-Eye creatures you control");
|
||||
private static final FilterCreaturePermanent cantBeBlockedByFilter = new FilterCreaturePermanent("except by Walls");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new SubtypePredicate("Wall")));
|
||||
cantBeBlockedByFilter.add(Predicates.not(new SubtypePredicate("Wall")));
|
||||
cantAttackFilter.add(Predicates.not((new SubtypePredicate("Eye"))));
|
||||
cantAttackFilter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
|
||||
public EvilEyeOfOrmsByGore(UUID ownerId) {
|
||||
super(ownerId, 21, "Evil Eye of Orms-by-Gore", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{B}");
|
||||
this.expansionSetCode = "5ED";
|
||||
|
|
@ -68,10 +67,10 @@ public class EvilEyeOfOrmsByGore extends CardImpl {
|
|||
this.toughness = new MageInt(6);
|
||||
|
||||
// Non-Eye creatures you control can't attack.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new EvilEyeOfOrmsByGoreEffect()));
|
||||
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAnyPlayerAllEffect(Duration.WhileOnBattlefield, cantAttackFilter)));
|
||||
|
||||
// Evil Eye of Orms-by-Gore can't be blocked except by Walls.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByCreaturesSourceEffect(cantBeBlockedByFilter, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public EvilEyeOfOrmsByGore(final EvilEyeOfOrmsByGore card) {
|
||||
|
|
@ -83,43 +82,3 @@ public class EvilEyeOfOrmsByGore extends CardImpl {
|
|||
return new EvilEyeOfOrmsByGore(this);
|
||||
}
|
||||
}
|
||||
|
||||
class EvilEyeOfOrmsByGoreEffect extends ReplacementEffectImpl {
|
||||
|
||||
public EvilEyeOfOrmsByGoreEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "Non-Eye creatures you control can't attack";
|
||||
}
|
||||
|
||||
public EvilEyeOfOrmsByGoreEffect(final EvilEyeOfOrmsByGoreEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EvilEyeOfOrmsByGoreEffect copy() {
|
||||
return new EvilEyeOfOrmsByGoreEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DECLARE_ATTACKER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (permanent.getControllerId().equals(source.getControllerId())) {
|
||||
if (!permanent.hasSubtype("Eye")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ package mage.sets.futuresight;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAllAnyPlayerEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -62,7 +62,7 @@ public class MagusOfTheMoat extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// Creatures without flying can't attack.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAllAnyPlayerEffect(Duration.WhileOnBattlefield, filter)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAnyPlayerAllEffect(Duration.WhileOnBattlefield, filter)));
|
||||
}
|
||||
|
||||
public MagusOfTheMoat(final MagusOfTheMoat card) {
|
||||
|
|
|
|||
|
|
@ -33,14 +33,19 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.abilityword.GrandeurAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PreventDamageToTargetEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
|
@ -68,10 +73,9 @@ public class OrissSamiteGuardian extends CardImpl {
|
|||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventDamageToTargetEffect(Duration.EndOfTurn, Integer.MAX_VALUE), new TapSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
// Grandeur - Discard another card named Oriss, Samite Guardian: Target player can't cast spells this turn, and creatures that player controls can't attack this turn.
|
||||
ability = new GrandeurAbility(new OrissSamiteGuardianCantCastEffect(), "Oriss, Samite Guardian");
|
||||
ability.addEffect(new OrissSamiteGuardianCantAttackEffect());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -86,6 +90,37 @@ public class OrissSamiteGuardian extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class OrissSamiteGuardianEffect extends OneShotEffect {
|
||||
|
||||
public OrissSamiteGuardianEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Target player can't cast spells this turn, and creatures that player controls can't attack this turn";
|
||||
}
|
||||
|
||||
public OrissSamiteGuardianEffect(final OrissSamiteGuardianEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrissSamiteGuardianEffect copy() {
|
||||
return new OrissSamiteGuardianEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
game.addEffect(new OrissSamiteGuardianCantCastEffect(), source);
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures that player controls");
|
||||
filter.add(new ControllerIdPredicate(getTargetPointer().getFirst(game, source)));
|
||||
ContinuousEffect effect = new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, filter);
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class OrissSamiteGuardianCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
OrissSamiteGuardianCantCastEffect() {
|
||||
|
|
@ -106,38 +141,10 @@ class OrissSamiteGuardianCantCastEffect extends ContinuousRuleModifyingEffectImp
|
|||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.CAST_SPELL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
return player != null && player.getId().equals(event.getPlayerId());
|
||||
}
|
||||
}
|
||||
|
||||
class OrissSamiteGuardianCantAttackEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
OrissSamiteGuardianCantAttackEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Detriment);
|
||||
staticText = ", and creatures that player controls can't attack this turn";
|
||||
}
|
||||
|
||||
OrissSamiteGuardianCantAttackEffect(final OrissSamiteGuardianCantAttackEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrissSamiteGuardianCantAttackEffect copy() {
|
||||
return new OrissSamiteGuardianCantAttackEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DECLARE_ATTACKER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
return player != null && player.getId().equals(event.getPlayerId());
|
||||
}
|
||||
}
|
||||
|
|
@ -33,7 +33,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.effects.common.PreventAllDamageToControllerEffect;
|
||||
import mage.abilities.effects.common.SacrificeControllerEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAllAnyPlayerEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.abilities.keyword.CumulativeUpkeepAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -62,7 +62,7 @@ public class GlacialChasm extends CardImpl {
|
|||
// Creatures you control can't attack.
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAllAnyPlayerEffect(Duration.WhileOnBattlefield, filter)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAnyPlayerAllEffect(Duration.WhileOnBattlefield, filter)));
|
||||
// Prevent all damage that would be dealt to you.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PreventAllDamageToControllerEffect(Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAllAnyPlayerEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
|
|
@ -67,7 +67,7 @@ public class AkronLegionnaire extends CardImpl {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
// Except for creatures named Akron Legionnaire and artifact creatures, creatures you control can't attack.
|
||||
Effect effect = new CantAttackAllAnyPlayerEffect(Duration.WhileOnBattlefield, filter);
|
||||
Effect effect = new CantAttackAnyPlayerAllEffect(Duration.WhileOnBattlefield, filter);
|
||||
effect.setText("Except for creatures named Akron Legionnaire and artifact creatures, creatures you control can't attack");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ package mage.sets.legends;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.common.combat.CantAttackAllAnyPlayerEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -58,7 +58,7 @@ public class Moat extends CardImpl {
|
|||
|
||||
|
||||
// Creatures without flying can't attack.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAllAnyPlayerEffect(Duration.WhileOnBattlefield, filter)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAnyPlayerAllEffect(Duration.WhileOnBattlefield, filter)));
|
||||
}
|
||||
|
||||
public Moat(final Moat card) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.combat.CantAttackAllAnyPlayerEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.IslandwalkAbility;
|
||||
import mage.abilities.mana.BlueManaAbility;
|
||||
|
|
@ -80,7 +80,7 @@ public class StormtideLeviathan extends CardImpl {
|
|||
// All lands are Islands in addition to their other types.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StormtideLeviathanEffect()));
|
||||
// Creatures without flying or islandwalk can't attack.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAllAnyPlayerEffect(Duration.WhileOnBattlefield, filter)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackAnyPlayerAllEffect(Duration.WhileOnBattlefield, filter)));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAllAnyPlayerEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerAllEffect;
|
||||
import mage.abilities.keyword.KickerAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
|
@ -126,7 +126,7 @@ class OrimsChantEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && KickedCondition.getInstance().apply(game, source)) {
|
||||
game.addEffect(new CantAttackAllAnyPlayerEffect(Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), source);
|
||||
game.addEffect(new CantAttackAnyPlayerAllEffect(Duration.EndOfTurn, new FilterCreaturePermanent("creatures")), source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -28,20 +28,16 @@
|
|||
package mage.sets.tempest;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.combat.CantAttackBlockAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -49,13 +45,19 @@ import mage.players.Player;
|
|||
*/
|
||||
public class LightOfDay extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Black creatures");
|
||||
|
||||
static {
|
||||
filter.add(new ColorPredicate(ObjectColor.BLACK));
|
||||
}
|
||||
|
||||
public LightOfDay(UUID ownerId) {
|
||||
super(ownerId, 239, "Light of Day", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
|
||||
this.expansionSetCode = "TMP";
|
||||
|
||||
|
||||
// Black creatures can't attack or block.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new LightOfDayEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantAttackBlockAllEffect(Duration.WhileOnBattlefield, filter)));
|
||||
|
||||
}
|
||||
|
||||
public LightOfDay(final LightOfDay card) {
|
||||
|
|
@ -67,45 +69,3 @@ public class LightOfDay extends CardImpl {
|
|||
return new LightOfDay(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LightOfDayEffect extends ReplacementEffectImpl {
|
||||
|
||||
public LightOfDayEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "Black creatures can't attack or block";
|
||||
}
|
||||
|
||||
public LightOfDayEffect(final LightOfDayEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LightOfDayEffect copy() {
|
||||
return new LightOfDayEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.DECLARE_ATTACKER || event.getType() == EventType.DECLARE_BLOCKER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player.getInRange().contains(permanent.getControllerId())) {
|
||||
if (permanent.getColor(game).isBlack()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -35,7 +35,7 @@ import mage.abilities.common.SimpleStaticAbility;
|
|||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalRestrictionEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAllSourceEffect;
|
||||
import mage.abilities.effects.common.combat.CantAttackAnyPlayerSourceEffect;
|
||||
import mage.abilities.effects.common.turn.AddExtraTurnControllerEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -65,7 +65,7 @@ public class MedomaiTheAgeless extends CardImpl {
|
|||
// Whenever Medomai the Ageless deals combat damage to a player, take an extra turn after this one.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddExtraTurnControllerEffect(), false));
|
||||
// Medomai the Ageless can't attack during extra turns.
|
||||
Effect effect = new ConditionalRestrictionEffect(new CantAttackAllSourceEffect(Duration.WhileOnBattlefield), ExtraTurnCondition.getInstance());
|
||||
Effect effect = new ConditionalRestrictionEffect(new CantAttackAnyPlayerSourceEffect(Duration.WhileOnBattlefield), ExtraTurnCondition.getInstance());
|
||||
effect.setText("{this} can't attack during extra turns");
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue