Added a LockedInCondition and renamend UnlessCondition to InvertCondition.

This commit is contained in:
LevelX2 2013-07-22 13:33:57 +02:00
parent 61f2b3a4aa
commit 0953b1477f
23 changed files with 103 additions and 44 deletions

View file

@ -33,7 +33,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.RedManaAbility; import mage.abilities.mana.RedManaAbility;
@ -60,7 +60,7 @@ public class ClifftopRetreat extends CardImpl<ClifftopRetreat> {
super(ownerId, 238, "Clifftop Retreat", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 238, "Clifftop Retreat", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "ISD"; this.expansionSetCode = "ISD";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Mountain or a Plains"; String abilityText = "tap it unless you control a Mountain or a Plains";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new RedManaAbility()); this.addAbility(new RedManaAbility());

View file

@ -33,7 +33,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.BlueManaAbility;
@ -60,7 +60,7 @@ public class HinterlandHarbor extends CardImpl<HinterlandHarbor> {
super(ownerId, 241, "Hinterland Harbor", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 241, "Hinterland Harbor", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "ISD"; this.expansionSetCode = "ISD";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tapped unless you control a Forest or an Island"; String abilityText = "tapped unless you control a Forest or an Island";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new GreenManaAbility()); this.addAbility(new GreenManaAbility());

View file

@ -33,7 +33,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlackManaAbility;
@ -60,7 +60,7 @@ public class IsolatedChapel extends CardImpl<IsolatedChapel> {
super(ownerId, 242, "Isolated Chapel", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 242, "Isolated Chapel", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "ISD"; this.expansionSetCode = "ISD";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Plains or a Swamp"; String abilityText = "tap it unless you control a Plains or a Swamp";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new WhiteManaAbility()); this.addAbility(new WhiteManaAbility());

View file

@ -45,7 +45,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate; import mage.filter.predicate.mageobject.SubtypePredicate;
import java.util.UUID; import java.util.UUID;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
/** /**
* *
@ -76,7 +76,7 @@ public class MayorOfAvabruck extends CardImpl<MayorOfAvabruck> {
this.toughness = new MageInt(1); this.toughness = new MageInt(1);
// Other Human creatures you control get +1/+1. // Other Human creatures you control get +1/+1.
Effect effect = new ConditionalContinousEffect(new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true), new UnlessCondition(new TransformedCondition()), ruleText); Effect effect = new ConditionalContinousEffect(new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true), new InvertCondition(new TransformedCondition()), ruleText);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
// At the beginning of each upkeep, if no spells were cast last turn, transform Mayor of Avabruck. // At the beginning of each upkeep, if no spells were cast last turn, transform Mayor of Avabruck.

View file

@ -33,7 +33,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.BlueManaAbility;
@ -60,7 +60,7 @@ public class SulfurFalls extends CardImpl<SulfurFalls> {
super(ownerId, 248, "Sulfur Falls", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 248, "Sulfur Falls", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "ISD"; this.expansionSetCode = "ISD";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Island or a Mountain"; String abilityText = "tap it unless you control a Island or a Mountain";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new BlueManaAbility()); this.addAbility(new BlueManaAbility());

View file

@ -33,7 +33,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlackManaAbility;
@ -60,7 +60,7 @@ public class WoodlandCemetery extends CardImpl<WoodlandCemetery> {
super(ownerId, 249, "Woodland Cemetery", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 249, "Woodland Cemetery", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "ISD"; this.expansionSetCode = "ISD";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Swamp or a Forest"; String abilityText = "tap it unless you control a Swamp or a Forest";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new BlackManaAbility()); this.addAbility(new BlackManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlackManaAbility;
@ -60,7 +60,7 @@ public class DragonskullSummit extends CardImpl<DragonskullSummit> {
super(ownerId, 223, "Dragonskull Summit", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 223, "Dragonskull Summit", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "M10"; this.expansionSetCode = "M10";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Swamp or a Mountain"; String abilityText = "tap it unless you control a Swamp or a Mountain";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new BlackManaAbility()); this.addAbility(new BlackManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlackManaAbility;
@ -60,7 +60,7 @@ public class DrownedCatacomb extends CardImpl<DrownedCatacomb> {
super(ownerId, 224, "Drowned Catacomb", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 224, "Drowned Catacomb", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "M10"; this.expansionSetCode = "M10";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Island or a Swamp"; String abilityText = "tap it unless you control a Island or a Swamp";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new BlackManaAbility()); this.addAbility(new BlackManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.BlueManaAbility;
@ -60,7 +60,7 @@ public class GlacialFortress extends CardImpl<GlacialFortress> {
super(ownerId, 226, "Glacial Fortress", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 226, "Glacial Fortress", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "M10"; this.expansionSetCode = "M10";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Plains or an Island"; String abilityText = "tap it unless you control a Plains or an Island";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new BlueManaAbility()); this.addAbility(new BlueManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.GreenManaAbility;
@ -60,7 +60,7 @@ public class RootboundCrag extends CardImpl<RootboundCrag> {
super(ownerId, 227, "Rootbound Crag", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 227, "Rootbound Crag", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "M10"; this.expansionSetCode = "M10";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Mountain or a Forest"; String abilityText = "tap it unless you control a Mountain or a Forest";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new RedManaAbility()); this.addAbility(new RedManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.GreenManaAbility;
@ -60,7 +60,7 @@ public class SunpetalGrove extends CardImpl<SunpetalGrove> {
super(ownerId, 228, "Sunpetal Grove", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 228, "Sunpetal Grove", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "M10"; this.expansionSetCode = "M10";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.MORE_THAN, 0));
String abilityText = "tap it unless you control a Forest or a Plains"; String abilityText = "tap it unless you control a Forest or a Plains";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new GreenManaAbility()); this.addAbility(new GreenManaAbility());

View file

@ -34,7 +34,7 @@ import mage.abilities.TriggeredAbility;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalTriggeredAbility; import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.DestroyTargetEffect; import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.SacrificeTargetEffect; import mage.abilities.effects.common.SacrificeTargetEffect;
@ -88,7 +88,7 @@ public class ShadowbornDemon extends CardImpl<ShadowbornDemon> {
triggeredAbility.addTarget(target); triggeredAbility.addTarget(target);
this.addAbility(new ConditionalTriggeredAbility( this.addAbility(new ConditionalTriggeredAbility(
triggeredAbility, triggeredAbility,
new UnlessCondition(new CreatureCardsInControllerGraveCondition(6)), new InvertCondition(new CreatureCardsInControllerGraveCondition(6)),
"At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature")); "At the beginning of your upkeep, if there are fewer than six creature cards in your graveyard, sacrifice a creature"));
} }

View file

@ -33,7 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.common.DiesTriggeredAbility; import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.common.CastFromHandCondition; import mage.abilities.condition.common.CastFromHandCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.ExileSourceEffect; import mage.abilities.effects.common.ExileSourceEffect;
import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect;
@ -65,7 +65,7 @@ public class Epochrasite extends CardImpl<Epochrasite> {
// Epochrasite enters the battlefield with three +1/+1 counters on it if you didn't cast it from your hand. // Epochrasite enters the battlefield with three +1/+1 counters on it if you didn't cast it from your hand.
this.addAbility(new EntersBattlefieldAbility( this.addAbility(new EntersBattlefieldAbility(
new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)), new AddCountersSourceEffect(CounterType.P1P1.createInstance(3)),
new UnlessCondition(new CastFromHandCondition()), true, new InvertCondition(new CastFromHandCondition()), true,
"{this} enters the battlefield with three +1/+1 counters on it if you didn't cast it from your hand","")); "{this} enters the battlefield with three +1/+1 counters on it if you didn't cast it from your hand",""));
// When Epochrasite dies, exile it with three time counters on it and it gains suspend. // When Epochrasite dies, exile it with three time counters on it and it gains suspend.

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlackManaAbility;
@ -54,7 +54,7 @@ public class BlackcleaveCliffs extends CardImpl<BlackcleaveCliffs> {
super(ownerId, 224, "Blackcleave Cliffs", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 224, "Blackcleave Cliffs", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
String abilityText = "tapped unless you control fewer than 3 lands"; String abilityText = "tapped unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new BlackManaAbility()); this.addAbility(new BlackManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.GreenManaAbility;
@ -55,7 +55,7 @@ public class CopperlineGorge extends CardImpl<CopperlineGorge> {
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
// Copperline Gorge enters the battlefield tapped unless you control two or fewer other lands. // Copperline Gorge enters the battlefield tapped unless you control two or fewer other lands.
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
String abilityText = "tapped unless you control two or fewer other lands"; String abilityText = "tapped unless you control two or fewer other lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new RedManaAbility()); this.addAbility(new RedManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlackManaAbility; import mage.abilities.mana.BlackManaAbility;
@ -54,7 +54,7 @@ public class DarkslickShores extends CardImpl<DarkslickShores> {
super(ownerId, 226, "Darkslick Shores", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 226, "Darkslick Shores", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
String abilityText = "tap it unless you control fewer than 3 lands"; String abilityText = "tap it unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new BlueManaAbility()); this.addAbility(new BlueManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.GreenManaAbility;
@ -54,7 +54,7 @@ public class RazorvergeThicket extends CardImpl<RazorvergeThicket> {
super(ownerId, 228, "Razorverge Thicket", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 228, "Razorverge Thicket", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
String abilityText = "tap it unless you control fewer than 3 lands"; String abilityText = "tap it unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new GreenManaAbility()); this.addAbility(new GreenManaAbility());

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.condition.Condition; import mage.abilities.condition.Condition;
import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.condition.common.ControlsPermanentCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.TapSourceEffect; import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.BlueManaAbility;
@ -54,7 +54,7 @@ public class SeachromeCoast extends CardImpl<SeachromeCoast> {
super(ownerId, 229, "Seachrome Coast", Rarity.RARE, new CardType[]{CardType.LAND}, null); super(ownerId, 229, "Seachrome Coast", Rarity.RARE, new CardType[]{CardType.LAND}, null);
this.expansionSetCode = "SOM"; this.expansionSetCode = "SOM";
Condition controls = new UnlessCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4)); Condition controls = new InvertCondition(new ControlsPermanentCondition(filter, ControlsPermanentCondition.CountType.FEWER_THAN, 4));
String abilityText = "tap it unless you control fewer than 3 lands"; String abilityText = "tap it unless you control fewer than 3 lands";
this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText)); this.addAbility(new EntersBattlefieldAbility(new ConditionalOneShotEffect(new TapSourceEffect(), controls, abilityText), abilityText));
this.addAbility(new WhiteManaAbility()); this.addAbility(new WhiteManaAbility());

View file

@ -34,7 +34,7 @@ import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.common.KickedCondition; import mage.abilities.condition.common.KickedCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.DiscardControllerEffect; import mage.abilities.effects.common.DiscardControllerEffect;
import mage.abilities.effects.common.DrawCardControllerEffect; import mage.abilities.effects.common.DrawCardControllerEffect;
@ -65,7 +65,7 @@ public class SphinxOfLostTruths extends CardImpl<SphinxOfLostTruths> {
// When Sphinx of Lost Truths enters the battlefield, draw three cards. Then if it wasn't kicked, discard three cards. // When Sphinx of Lost Truths enters the battlefield, draw three cards. Then if it wasn't kicked, discard three cards.
Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(3)); Ability ability = new EntersBattlefieldTriggeredAbility(new DrawCardControllerEffect(3));
ability.addEffect(new ConditionalOneShotEffect(new DiscardControllerEffect(3), new UnlessCondition(KickedCondition.getInstance()), ability.addEffect(new ConditionalOneShotEffect(new DiscardControllerEffect(3), new InvertCondition(KickedCondition.getInstance()),
"Then if it wasn't kicked, discard three cards")); "Then if it wasn't kicked, discard three cards"));
this.addAbility(ability); this.addAbility(ability);
} }

View file

@ -34,7 +34,7 @@ import mage.constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.condition.common.TenOrLessLifeCondition; import mage.abilities.condition.common.TenOrLessLifeCondition;
import mage.abilities.condition.UnlessCondition; import mage.abilities.condition.InvertCondition;
import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.common.LoseLifeSourceEffect; import mage.abilities.effects.common.LoseLifeSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -58,7 +58,7 @@ public class VampireLacerator extends CardImpl<VampireLacerator> {
this.addAbility(new BeginningOfUpkeepTriggeredAbility( this.addAbility(new BeginningOfUpkeepTriggeredAbility(
new ConditionalOneShotEffect( new ConditionalOneShotEffect(
new LoseLifeSourceEffect(1), new LoseLifeSourceEffect(1),
new UnlessCondition( new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT) ), new InvertCondition( new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT) ),
"you lose 1 life unless an opponent has 10 or less life"), TargetController.YOU, false)); "you lose 1 life unless an opponent has 10 or less life"), TargetController.YOU, false));
} }

View file

@ -29,7 +29,6 @@
package mage.abilities.condition; package mage.abilities.condition;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game; import mage.game.Game;
/** /**

View file

@ -28,7 +28,6 @@
package mage.abilities.condition; package mage.abilities.condition;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.game.Game; import mage.game.Game;
/** /**
@ -38,11 +37,11 @@ import mage.game.Game;
* *
* @author maurer.it_at_gmail.com * @author maurer.it_at_gmail.com
*/ */
public class UnlessCondition implements Condition { public class InvertCondition implements Condition {
private Condition condition; private Condition condition;
public UnlessCondition ( Condition condition ) { public InvertCondition ( Condition condition ) {
this.condition = condition; this.condition = condition;
} }

View file

@ -0,0 +1,61 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.condition;
import mage.abilities.Ability;
import mage.game.Game;
/**
* A simple {@link Condition} to check the condition only one time at the start (result locked in).
* All subsequent checks return the first result.
*
* @author LevelX2
*/
public class LockedInCondition implements Condition {
private boolean conditionChecked = false;
private boolean result;
private Condition condition;
public LockedInCondition ( Condition condition ) {
this.condition = condition;
}
/*
* {@inheritDoc}
*/
@Override
public boolean apply(Game game, Ability source) {
if(!conditionChecked) {
result = !condition.apply(game, source);
conditionChecked = true;
}
return result;
}
}