Added UnblockableAllEffect and used it where necessary

This commit is contained in:
North 2012-09-06 16:58:21 +03:00
parent 41a80dcd5f
commit dbb782569b
3 changed files with 82 additions and 12 deletions

View file

@ -28,8 +28,10 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.abilities.Ability;
@ -42,9 +44,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.GetEmblemEffect;
import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.effects.common.continious.GainAbilityAllEffect;
import mage.abilities.effects.common.UnblockableAllEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.UnblockableAbility;
import mage.cards.CardImpl;
import mage.counters.CounterType;
import mage.filter.FilterSpell;
@ -59,8 +60,6 @@ import mage.target.TargetPermanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
* @author nantuko
*/
@ -79,10 +78,8 @@ public class VenserTheSojourner extends CardImpl<VenserTheSojourner> {
ability1.addTarget(new TargetControlledPermanent());
this.addAbility(ability1);
//TODO: Venser's second ability doesn't lock in what it applies to. That's because the effect states a true thing about creatures,
// but doesn't actually change the characteristics of those creatures. As a result, all creatures are unblockable that turn, including creatures you don't control, creatures that weren't on the battlefield at the time the ability resolved, and creatures that have lost all abilities.
// -1: Creatures are unblockable this turn.
this.addAbility(new LoyaltyAbility(new GainAbilityAllEffect(UnblockableAbility.getInstance(), Constants.Duration.EndOfTurn, new FilterCreaturePermanent()), -1));
this.addAbility(new LoyaltyAbility(new UnblockableAllEffect(new FilterCreaturePermanent("Creatures"), Duration.EndOfTurn), -1));
// -8: You get an emblem with "Whenever you cast a spell, exile target permanent."
LoyaltyAbility ability2 = new LoyaltyAbility(new GetEmblemEffect(new VenserTheSojournerEmblem()), -8);

View file

@ -35,10 +35,9 @@ import mage.Constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continious.GainAbilityControlledEffect;
import mage.abilities.keyword.UnblockableAbility;
import mage.abilities.effects.common.UnblockableAllEffect;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.ColorPredicate;
/**
@ -47,7 +46,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
*/
public class DeepchannelMentor extends CardImpl<DeepchannelMentor> {
private static final FilterPermanent filter = new FilterPermanent("Blue creatures");
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("Blue creatures you control");
static {
filter.add(new ColorPredicate(ObjectColor.BLUE));
@ -64,7 +63,7 @@ public class DeepchannelMentor extends CardImpl<DeepchannelMentor> {
this.toughness = new MageInt(2);
// Blue creatures you control are unblockable.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(UnblockableAbility.getInstance(), Duration.WhileOnBattlefield, filter)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UnblockableAllEffect(filter, Duration.WhileOnBattlefield)));
}
public DeepchannelMentor(final DeepchannelMentor card) {