From bfc4d2592a3d8c597f97ea7e3266dcd40c96d6b6 Mon Sep 17 00:00:00 2001 From: mkalender Date: Fri, 19 Jun 2015 13:00:36 -0400 Subject: [PATCH] commiting to work on home, so far when enchantment goes into battlefiled other creatures are not allowed to attack regardless of color choice --- Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java index 7a9177e9b7..26e69265d3 100644 --- a/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java +++ b/Mage.Sets/src/mage/sets/timeshifted/TeferisMoat.java @@ -77,17 +77,25 @@ class TeferisMoatRestrictionEffect extends RestrictionEffect { super(Duration.WhileOnBattlefield, Outcome.Benefit); staticText = "Creatures of the chosen color without flying can't attack you"; } + TeferisMoatRestrictionEffect(final TeferisMoatRestrictionEffect effect) { super(effect); } - @Override + + @Override public boolean applies(Permanent permanent, Ability source, Game game) { ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color"); if (chosenColor == null) return false; return permanent.getCardType().contains(CardType.CREATURE) && !permanent.getAbilities().contains(FlyingAbility.getInstance()) && !permanent.getColor(game).shares(chosenColor); } - @Override + + @Override + public boolean canAttack(UUID defenderId, Ability source, Game game) { + return !defenderId.equals(source.getControllerId()); + } + + @Override public TeferisMoatRestrictionEffect copy() { return new TeferisMoatRestrictionEffect(this); }