diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java index e9b604be40..062871d989 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KondasHatamoto.java @@ -28,17 +28,17 @@ package mage.sets.championsofkamigawa; import java.util.UUID; - +import mage.Constants; +import mage.Constants.CardType; import mage.Constants.Duration; import mage.Constants.Rarity; -import mage.Constants.CardType; -import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.keyword.BushidoAbility; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ControlsPermanentCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; +import mage.abilities.keyword.BushidoAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; import mage.filter.Filter; @@ -51,6 +51,8 @@ import mage.filter.common.FilterControlledPermanent; public class KondasHatamoto extends CardImpl{ private static final FilterControlledPermanent filter = new FilterControlledPermanent("Legendary Samurai"); + private static final String rule1 = "As long as you control a legendary Samurai, {this} gets +1/+2"; + private static final String rule2 = "As long as you control a legendary Samurai, {this} has vigilance"; static { filter.getSupertype().add("Legendary"); @@ -70,12 +72,10 @@ public class KondasHatamoto extends CardImpl{ this.addAbility(new BushidoAbility(1)); - ConditionalStaticAbility ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, - new BoostSourceEffect(1, 2, Duration.WhileOnBattlefield), - new ControlsPermanentCondition(filter), - "As long as you control a legendary Samurai, {this} gets +1/+2 and has vigilance."); - ability.addEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance(), Duration.WhileOnBattlefield)); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(1, 2, Duration.WhileOnBattlefield), new ControlsPermanentCondition(filter), rule1); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance()), new ControlsPermanentCondition(filter), rule2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); } diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java index d9ff72f79e..d1cd9bc2e5 100644 --- a/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java +++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TenzaGodosMaul.java @@ -38,7 +38,7 @@ import mage.Constants.Zone; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedMatchesFilterCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostEnchantedEffect; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; @@ -79,15 +79,13 @@ public class TenzaGodosMaul extends CardImpl { // Equipped creature gets +1/+1. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); // As long as it's legendary, it gets an additional +2/+2. - this.addAbility(new ConditionalStaticAbility( - Constants.Zone.BATTLEFIELD, - new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield), - new EquippedMatchesFilterCondition(legendaryFilter), rule1)); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect( + new BoostEquippedEffect(2, 2), + new EquippedMatchesFilterCondition(legendaryFilter), rule1))); // As long as it's red, it has trample. - this.addAbility(new ConditionalStaticAbility( - Constants.Zone.BATTLEFIELD, + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect( new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.EQUIPMENT), - new EquippedMatchesFilterCondition(redFilter), rule2)); + new EquippedMatchesFilterCondition(redFilter), rule2))); // Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(1), new TargetControlledCreaturePermanent())); diff --git a/Mage.Sets/src/mage/sets/darkascension/HeavyMattock.java b/Mage.Sets/src/mage/sets/darkascension/HeavyMattock.java index 67bae53f3b..778b9c0429 100644 --- a/Mage.Sets/src/mage/sets/darkascension/HeavyMattock.java +++ b/Mage.Sets/src/mage/sets/darkascension/HeavyMattock.java @@ -28,14 +28,13 @@ package mage.sets.darkascension; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedHasSubtypeCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; @@ -56,7 +55,7 @@ public class HeavyMattock extends CardImpl { // Equipped creature gets +1/+1. this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1))); // As long as equipped creature is a Human, it gets an additional +1/+1. - this.addAbility(new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1), new EquippedHasSubtypeCondition("Human"), staticText)); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEquippedEffect(1, 1), new EquippedHasSubtypeCondition("Human"), staticText))); // Equip {2} this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(2))); } diff --git a/Mage.Sets/src/mage/sets/darksteel/AuriokGlaivemaster.java b/Mage.Sets/src/mage/sets/darksteel/AuriokGlaivemaster.java index 35c885af31..637a053917 100644 --- a/Mage.Sets/src/mage/sets/darksteel/AuriokGlaivemaster.java +++ b/Mage.Sets/src/mage/sets/darksteel/AuriokGlaivemaster.java @@ -28,15 +28,14 @@ package mage.sets.darksteel; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; @@ -47,7 +46,8 @@ import mage.cards.CardImpl; * @author Loki */ public class AuriokGlaivemaster extends CardImpl { - private static final String cardRule = "As long as {this} is equipped, it gets +1/+1 and has first strike"; + private static final String rule1 = "As long as {this} is equipped, it gets +1/+1"; + private static final String rule2 = "As long as {this} is equipped, it has first strike"; public AuriokGlaivemaster(UUID ownerId) { super(ownerId, 1, "Auriok Glaivemaster", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); @@ -59,12 +59,10 @@ public class AuriokGlaivemaster extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, - new BoostSourceEffect(1, 1, Constants.Duration.WhileOnBattlefield), - EquippedCondition.getInstance(), - cardRule); - ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance())); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(1, 1, Constants.Duration.WhileOnBattlefield), EquippedCondition.getInstance(), rule1); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), EquippedCondition.getInstance(), rule2); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2)); } public AuriokGlaivemaster(final AuriokGlaivemaster card) { diff --git a/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java b/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java index 6ca0f5ff38..810631acee 100644 --- a/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java +++ b/Mage.Sets/src/mage/sets/dissension/FlaringFlameKin.java @@ -33,11 +33,11 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EnchantedCondition; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.TrampleAbility; @@ -49,7 +49,9 @@ import mage.cards.CardImpl; */ public class FlaringFlameKin extends CardImpl { - private static final String rule = "As long as {this} is enchanted, it gets +2/+2, has trample, and has \"{R}: {this} gets +1/+0 until end of turn.\""; + private static final String rule1 = "As long as {this} is enchanted, it gets +2/+2"; + private static final String rule2 = "As long as {this} is enchanted, it has trample"; + private static final String rule3 = "As long as {this} is enchanted, it has \"{R}: {this} gets +1/+0 until end of turn.\""; public FlaringFlameKin(UUID ownerId) { super(ownerId, 62, "Flaring Flame-Kin", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}"); @@ -61,13 +63,16 @@ public class FlaringFlameKin extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), EnchantedCondition.getInstance(), rule); - ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance())); SimpleActivatedAbility grantedAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")); - ability.addEffect(new GainAbilitySourceEffect(grantedAbility)); - this.addAbility(ability); + + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), EnchantedCondition.getInstance(), rule1); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), EnchantedCondition.getInstance(), rule2); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2)); + ConditionalContinousEffect effect3 = new ConditionalContinousEffect(new GainAbilitySourceEffect(grantedAbility), EnchantedCondition.getInstance(), rule3); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect3)); } public FlaringFlameKin(final FlaringFlameKin card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java b/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java index 1bb595befe..0d963501de 100644 --- a/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java +++ b/Mage.Sets/src/mage/sets/innistrad/AngelicOverseer.java @@ -28,14 +28,14 @@ package mage.sets.innistrad; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ControlsPermanentCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.*; import mage.cards.CardImpl; @@ -48,7 +48,8 @@ import mage.filter.common.FilterControlledPermanent; */ public class AngelicOverseer extends CardImpl { - private static final String rule = "As long as you control a Human, {this} has hexproof and is indestructible."; + private static final String rule1 = "As long as you control a Human, {this} has hexproof."; + private static final String rule2 = "As long as you control a Human, {this} is indestructible."; private static final FilterControlledPermanent filter = new FilterControlledPermanent("Human"); static { @@ -68,9 +69,11 @@ public class AngelicOverseer extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // As long as you control a Human, Angelic Overseer has hexproof and is indestructible. - Ability ability = new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilitySourceEffect(HexproofAbility.getInstance()), new ControlsPermanentCondition(filter), rule); - ability.addEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance())); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new GainAbilitySourceEffect(HexproofAbility.getInstance()), new ControlsPermanentCondition(filter), rule1); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), new ControlsPermanentCondition(filter), rule2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); + } public AngelicOverseer(final AngelicOverseer card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/BondsOfFaith.java b/Mage.Sets/src/mage/sets/innistrad/BondsOfFaith.java index 54caae631e..15da6a47cf 100644 --- a/Mage.Sets/src/mage/sets/innistrad/BondsOfFaith.java +++ b/Mage.Sets/src/mage/sets/innistrad/BondsOfFaith.java @@ -27,6 +27,7 @@ */ package mage.sets.innistrad; +import java.util.UUID; import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -34,10 +35,10 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; import mage.abilities.condition.common.EquippedHasSubtypeCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.RestrictionEffect; import mage.abilities.effects.common.AttachEffect; -import mage.abilities.effects.common.continious.BoostEnchantedEffect; +import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.game.Game; @@ -45,8 +46,6 @@ import mage.game.permanent.Permanent; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; -import java.util.UUID; - /** * @author nantuko */ @@ -69,7 +68,7 @@ public class BondsOfFaith extends CardImpl { this.addAbility(ability); // Enchanted creature gets +2/+2 as long as it's a Human. Otherwise, it can't attack or block. - this.addAbility(new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 2, Constants.Duration.WhileOnBattlefield), new EquippedHasSubtypeCondition("Human"), rule)); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEquippedEffect(2, 2), new EquippedHasSubtypeCondition("Human"), rule))); this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BondsOfFaithEffect())); } diff --git a/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java b/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java index a84d74001f..0917f1f078 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java +++ b/Mage.Sets/src/mage/sets/innistrad/ButchersCleaver.java @@ -28,14 +28,13 @@ package mage.sets.innistrad; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedHasSubtypeCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -59,8 +58,8 @@ public class ButchersCleaver extends CardImpl { this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(3, 0))); // As long as equipped creature is a Human, it has lifelink. - this.addAbility(new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT), new EquippedHasSubtypeCondition("Human"), staticText)); - + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT), new EquippedHasSubtypeCondition("Human"), staticText))); + // Equip {3} this.addAbility(new EquipAbility(Constants.Outcome.AddAbility, new GenericManaCost(3))); diff --git a/Mage.Sets/src/mage/sets/innistrad/ManorGargoyle.java b/Mage.Sets/src/mage/sets/innistrad/ManorGargoyle.java index e6d1cfb2dd..705e39cdcc 100644 --- a/Mage.Sets/src/mage/sets/innistrad/ManorGargoyle.java +++ b/Mage.Sets/src/mage/sets/innistrad/ManorGargoyle.java @@ -40,9 +40,10 @@ import mage.MageInt; import mage.abilities.Abilities; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.ContinuousEffectImpl; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.DefenderAbility; @@ -70,7 +71,8 @@ public class ManorGargoyle extends CardImpl { this.addAbility(DefenderAbility.getInstance()); // Manor Gargoyle is indestructible as long as it has defender. - this.addAbility(new ConditionalStaticAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), HasDefenderCondition.getInstance(), rule)); + ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance()), HasDefenderCondition.getInstance(), rule); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // {1}: Until end of turn, Manor Gargoyle loses defender and gains flying. this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GargoyleSentinelEffect(), new ManaCostsImpl("{1}"))); } diff --git a/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java b/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java index 35b08de585..5b0b38f087 100644 --- a/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java +++ b/Mage.Sets/src/mage/sets/innistrad/NightRevelers.java @@ -29,13 +29,14 @@ package mage.sets.innistrad; import java.util.Set; import java.util.UUID; +import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; @@ -60,10 +61,8 @@ public class NightRevelers extends CardImpl { this.toughness = new MageInt(4); // Night Revelers has haste as long as an opponent controls a Human. - this.addAbility(new ConditionalStaticAbility(Zone.BATTLEFIELD, - new GainAbilitySourceEffect(HasteAbility.getInstance()), - new NightRevelersCondition(), - rule)); + ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(HasteAbility.getInstance()), new NightRevelersCondition(), rule); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); } diff --git a/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java b/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java index 82d64754a9..a58d13de82 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java +++ b/Mage.Sets/src/mage/sets/innistrad/SharpenedPitchfork.java @@ -28,7 +28,6 @@ package mage.sets.innistrad; import java.util.UUID; - import mage.Constants; import mage.Constants.AttachmentType; import mage.Constants.CardType; @@ -37,7 +36,7 @@ import mage.Constants.Zone; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedHasSubtypeCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.effects.common.continious.GainAbilityAttachedEffect; import mage.abilities.keyword.EquipAbility; @@ -64,7 +63,7 @@ public class SharpenedPitchfork extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT))); // As long as equipped creature is a Human, it gets +1/+1. - this.addAbility(new ConditionalStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1), new EquippedHasSubtypeCondition("Human"), staticText)); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEquippedEffect(1, 1), new EquippedHasSubtypeCondition("Human"), staticText))); } public SharpenedPitchfork(final SharpenedPitchfork card) { diff --git a/Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java b/Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java index d71fc8a693..fddc287b5f 100644 --- a/Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java +++ b/Mage.Sets/src/mage/sets/innistrad/SilverInlaidDagger.java @@ -28,14 +28,13 @@ package mage.sets.innistrad; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedHasSubtypeCondition; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostEquippedEffect; import mage.abilities.keyword.EquipAbility; import mage.cards.CardImpl; @@ -59,7 +58,7 @@ public class SilverInlaidDagger extends CardImpl { this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(2, 0))); // As long as equipped creature is a Human, it gets an additional +1/+0 - this.addAbility(new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 0), new EquippedHasSubtypeCondition("Human"), staticText)); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEquippedEffect(1, 0), new EquippedHasSubtypeCondition("Human"), staticText))); } public SilverInlaidDagger(final SilverInlaidDagger card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java b/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java index afa2990fb9..5ec9409c03 100644 --- a/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java +++ b/Mage.Sets/src/mage/sets/magic2012/GriffinRider.java @@ -28,15 +28,14 @@ package mage.sets.magic2012; 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.MageInt; -import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ControlsPermanentCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; @@ -51,7 +50,8 @@ import mage.filter.common.FilterCreaturePermanent; */ public class GriffinRider extends CardImpl { - private static final String rule = "As long as you control a Griffin creature, {this} gets +3/+3 and has flying."; + private static final String rule1 = "As long as you control a Griffin creature, {this} gets +3/+3."; + private static final String rule2 = "As long as you control a Griffin creature, {this} has flying."; private static final FilterPermanent filterGriffinCard = new FilterCreaturePermanent(); static { @@ -70,9 +70,10 @@ public class GriffinRider extends CardImpl { this.toughness = new MageInt(1); // As long as you control a Griffin creature, Griffin Rider gets +3/+3 and has flying. - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), new ControlsPermanentCondition(filterGriffinCard), rule); - ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance())); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield), new ControlsPermanentCondition(filterGriffinCard), rule1); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), new ControlsPermanentCondition(filterGriffinCard), rule2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); } public GriffinRider(final GriffinRider card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java index 6cae91ad1c..2bada27465 100644 --- a/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java +++ b/Mage.Sets/src/mage/sets/magic2012/PrimordialHydra.java @@ -27,10 +27,8 @@ */ package mage.sets.magic2012; -import static mage.Constants.Zone; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; @@ -38,8 +36,9 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.BeginningOfUpkeepTriggeredAbility; import mage.abilities.common.EntersBattlefieldAbility; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.HasCounterCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.TrampleAbility; @@ -67,9 +66,9 @@ public class PrimordialHydra extends CardImpl { this.addAbility(new EntersBattlefieldAbility(new PrimordialHydraEntersEffect(), "{this} enters the battlefield with X +1/+1 counters on it")); this.addAbility(new BeginningOfUpkeepTriggeredAbility(new PrimordialHydraDoubleEffect(), Constants.TargetController.YOU, false)); - this.addAbility(new ConditionalStaticAbility(Zone.BATTLEFIELD, - new GainAbilitySourceEffect(TrampleAbility.getInstance(), Constants.Duration.WhileOnBattlefield), - new HasCounterCondition(CounterType.P1P1, 10), staticText)); + ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), new HasCounterCondition(CounterType.P1P1, 10), staticText); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); + } public PrimordialHydra(final PrimordialHydra card) { diff --git a/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java b/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java index be14829b41..333c655714 100644 --- a/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java +++ b/Mage.Sets/src/mage/sets/magic2012/ThranGolem.java @@ -33,9 +33,9 @@ import mage.Constants.Duration; import mage.Constants.Rarity; import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EnchantedCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; @@ -49,7 +49,10 @@ import mage.cards.CardImpl; */ public class ThranGolem extends CardImpl { - private static final String rule = "As long as {this} is enchanted, it gets +2/+2 and has flying, first strike, and trample."; + private static final String rule1 = "As long as {this} is enchanted, it gets +2/+2 "; + private static final String rule2 = "As long as {this} is enchanted, it has flying"; + private static final String rule3 = "As long as {this} is enchanted, it has first strike"; + private static final String rule4 = "As long as {this} is enchanted, it has flying trample"; public ThranGolem(UUID ownerId) { super(ownerId, 220, "Thran Golem", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); @@ -58,12 +61,15 @@ public class ThranGolem extends CardImpl { this.power = new MageInt(3); this.toughness = new MageInt(3); - - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), EnchantedCondition.getInstance(), rule); - ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance())); - ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance())); - ability.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance())); - this.addAbility(ability); + + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(2, 2, Duration.WhileOnBattlefield), EnchantedCondition.getInstance(), rule1); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), EnchantedCondition.getInstance(), rule2); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2)); + ConditionalContinousEffect effect3 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), EnchantedCondition.getInstance(), rule3); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect3)); + ConditionalContinousEffect effect4 = new ConditionalContinousEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance()), EnchantedCondition.getInstance(), rule4); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect4)); } public ThranGolem(final ThranGolem card) { diff --git a/Mage.Sets/src/mage/sets/mirrodin/LeoninDenGuard.java b/Mage.Sets/src/mage/sets/mirrodin/LeoninDenGuard.java index 6fe6d02f92..e7a5fcf9d7 100644 --- a/Mage.Sets/src/mage/sets/mirrodin/LeoninDenGuard.java +++ b/Mage.Sets/src/mage/sets/mirrodin/LeoninDenGuard.java @@ -28,17 +28,15 @@ package mage.sets.mirrodin; import java.util.UUID; - import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; -import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; -import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.VigilanceAbility; import mage.cards.CardImpl; @@ -48,6 +46,9 @@ import mage.cards.CardImpl; */ public class LeoninDenGuard extends CardImpl { + private static final String rule1 = "As long as {this} is equipped, it gets +1/+1"; + private static final String rule2 = "As long as {this} is equipped, it has vigilance"; + public LeoninDenGuard(UUID ownerId) { super(ownerId, 9, "Leonin Den-Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); this.expansionSetCode = "MRD"; @@ -58,10 +59,12 @@ public class LeoninDenGuard extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(3); - // As long as Leonin Den-Guard is equipped, it gets +1/+1 and has vigilance. - Ability ability = new ConditionalStaticAbility(Constants.Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Constants.Duration.WhileOnBattlefield), EquippedCondition.getInstance(), "As long as {this} is equipped, it gets +1/+1 and has vigilance."); - ability.addEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance())); - this.addAbility(ability); + // As long as Leonin Den-Guard is equipped, it gets +1/+1 and has vigilance. + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(1, 1, Constants.Duration.WhileOnBattlefield), EquippedCondition.getInstance(), rule1); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(VigilanceAbility.getInstance()), EquippedCondition.getInstance(), rule2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); + } public LeoninDenGuard(final LeoninDenGuard card) { diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ViridianBetrayers.java b/Mage.Sets/src/mage/sets/newphyrexia/ViridianBetrayers.java index 61973bb48b..00a27e705f 100644 --- a/Mage.Sets/src/mage/sets/newphyrexia/ViridianBetrayers.java +++ b/Mage.Sets/src/mage/sets/newphyrexia/ViridianBetrayers.java @@ -29,13 +29,14 @@ package mage.sets.newphyrexia; import java.util.Set; import java.util.UUID; +import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.Condition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.InfectAbility; import mage.cards.CardImpl; @@ -62,10 +63,8 @@ public class ViridianBetrayers extends CardImpl { this.toughness = new MageInt(1); // Viridian Betrayers has infect as long as an opponent is poisoned. - this.addAbility(new ConditionalStaticAbility(Zone.BATTLEFIELD, - new GainAbilitySourceEffect(InfectAbility.getInstance()), - PoisonedCondition.getInstance(), - rule)); + ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainAbilitySourceEffect(InfectAbility.getInstance()), PoisonedCondition.getInstance(), rule); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect)); } public ViridianBetrayers(final ViridianBetrayers card) { diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SunspearShikari.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SunspearShikari.java index 4492e07ac4..34cb652208 100644 --- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SunspearShikari.java +++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SunspearShikari.java @@ -28,14 +28,13 @@ package mage.sets.scarsofmirrodin; import java.util.UUID; - +import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; -import mage.Constants.Zone; import mage.MageInt; -import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.LifelinkAbility; @@ -47,7 +46,8 @@ import mage.cards.CardImpl; */ public class SunspearShikari extends CardImpl { - private final static String rule = "As long as {this} is equipped, it has first strike and lifelink."; + private final static String rule1 = "As long as {this} is equipped, it has first strike"; + private final static String rule2 = "As long as {this} is equipped, it has lifelink"; public SunspearShikari(UUID ownerId) { super(ownerId, 23, "Sunspear Shikari", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}"); @@ -59,9 +59,10 @@ public class SunspearShikari extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(2); - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), EquippedCondition.getInstance(), rule); - ability.addEffect(new GainAbilitySourceEffect(LifelinkAbility.getInstance())); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), EquippedCondition.getInstance(), rule1); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(LifelinkAbility.getInstance()), EquippedCondition.getInstance(), rule2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); } public SunspearShikari(final SunspearShikari card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/KitesailApprentice.java b/Mage.Sets/src/mage/sets/worldwake/KitesailApprentice.java index 11e584388b..9b661b329d 100644 --- a/Mage.Sets/src/mage/sets/worldwake/KitesailApprentice.java +++ b/Mage.Sets/src/mage/sets/worldwake/KitesailApprentice.java @@ -28,15 +28,13 @@ package mage.sets.worldwake; 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.MageInt; -import mage.abilities.Ability; +import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.EquippedCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FlyingAbility; @@ -48,7 +46,8 @@ import mage.cards.CardImpl; */ public class KitesailApprentice extends CardImpl { - private static final String rule = "As long as {this} is equipped, it gets +1/+1 and has flying."; + private static final String rule1 = "As long as {this} is equipped, it gets +1/+1"; + private static final String rule2 = "As long as {this} is equipped, it has flying"; public KitesailApprentice(UUID ownerId) { super(ownerId, 10, "Kitesail Apprentice", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}"); @@ -60,9 +59,10 @@ public class KitesailApprentice extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 1, Duration.WhileOnBattlefield), EquippedCondition.getInstance(), rule); - ability.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance())); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(1, 1, Constants.Duration.WhileOnBattlefield), EquippedCondition.getInstance(), rule1); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance()), EquippedCondition.getInstance(), rule2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); } public KitesailApprentice(final KitesailApprentice card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java b/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java index 444081d8d4..db191c8df5 100644 --- a/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java +++ b/Mage.Sets/src/mage/sets/worldwake/SejiriMerfolk.java @@ -28,7 +28,6 @@ package mage.sets.worldwake; import java.util.UUID; -import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.Constants.Zone; @@ -37,15 +36,12 @@ import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.condition.common.ControlsPermanentCondition; import mage.abilities.decorator.ConditionalContinousEffect; -import mage.abilities.decorator.ConditionalStaticAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.filter.Filter; import mage.filter.common.FilterControlledPermanent; -import mage.filter.common.FilterLandPermanent; /** * @@ -53,7 +49,8 @@ import mage.filter.common.FilterLandPermanent; */ public class SejiriMerfolk extends CardImpl { - private static final String rule = "As long as you control a Plains, {this} has first strike and lifelink."; + private static final String rule1 = "As long as you control a Plains, {this} has first strike."; + private static final String rule2 = "As long as you control a Plains, {this} has lifelink."; private static final FilterControlledPermanent filter = new FilterControlledPermanent("Plains"); static { @@ -72,9 +69,11 @@ public class SejiriMerfolk extends CardImpl { this.power = new MageInt(2); this.toughness = new MageInt(1); - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(LifelinkAbility.getInstance()), new ControlsPermanentCondition(filter), rule); - ability.addEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance())); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new GainAbilitySourceEffect(LifelinkAbility.getInstance()), new ControlsPermanentCondition(filter), rule1); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()), new ControlsPermanentCondition(filter), rule2); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect2)); + } public SejiriMerfolk(final SejiriMerfolk card) { diff --git a/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java b/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java index 6fe2c6b15b..49cf396e8d 100644 --- a/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java +++ b/Mage.Sets/src/mage/sets/zendikar/AetherFigment.java @@ -28,7 +28,7 @@ package mage.sets.zendikar; -import mage.Constants; +import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Rarity; import mage.MageInt; @@ -37,15 +37,11 @@ import mage.abilities.common.EntersBattlefieldAbility; import mage.abilities.condition.common.KickedCondition; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.decorator.ConditionalOneShotEffect; -import mage.abilities.decorator.ConditionalStaticAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.counter.AddCountersSourceEffect; import mage.abilities.keyword.UnblockableAbility; import mage.cards.CardImpl; import mage.counters.CounterType; -import java.util.UUID; - /** * @author nantuko, BetaSteward_at_googlemail.com */ diff --git a/Mage.Sets/src/mage/sets/zendikar/GuulDrazVampire.java b/Mage.Sets/src/mage/sets/zendikar/GuulDrazVampire.java index 62f2ba9569..7c7d01b1fe 100644 --- a/Mage.Sets/src/mage/sets/zendikar/GuulDrazVampire.java +++ b/Mage.Sets/src/mage/sets/zendikar/GuulDrazVampire.java @@ -28,14 +28,13 @@ package mage.sets.zendikar; 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.MageInt; -import mage.abilities.Ability; -import mage.abilities.condition.common.TenOrLessLifeCondition; -import mage.abilities.decorator.ConditionalStaticAbility; +import mage.abilities.common.SimpleStaticAbility; +import mage.abilities.condition.common.EquippedCondition; +import mage.abilities.decorator.ConditionalContinousEffect; import mage.abilities.effects.common.continious.BoostSourceEffect; import mage.abilities.effects.common.continious.GainAbilitySourceEffect; import mage.abilities.keyword.IntimidateAbility; @@ -47,7 +46,8 @@ import mage.cards.CardImpl; */ public class GuulDrazVampire extends CardImpl { - private static final String rule = "As long as an opponent has 10 or less life, {this} gets +2/+1 and has intimidate."; + private static final String rule1 = "As long as {this} is equipped, it gets +2/+1"; + private static final String rule2 = "As long as {this} is equipped, it has intimidate"; public GuulDrazVampire(UUID ownerId) { super(ownerId, 93, "Guul Draz Vampire", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}"); @@ -59,9 +59,11 @@ public class GuulDrazVampire extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); - Ability ability = new ConditionalStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 1, Duration.WhileOnBattlefield), new TenOrLessLifeCondition(TenOrLessLifeCondition.CheckType.AN_OPPONENT), rule); - ability.addEffect(new GainAbilitySourceEffect(IntimidateAbility.getInstance())); - this.addAbility(ability); + ConditionalContinousEffect effect1 = new ConditionalContinousEffect(new BoostSourceEffect(2, 1, Constants.Duration.WhileOnBattlefield), EquippedCondition.getInstance(), rule1); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect1)); + ConditionalContinousEffect effect2 = new ConditionalContinousEffect(new GainAbilitySourceEffect(IntimidateAbility.getInstance()), EquippedCondition.getInstance(), rule2); + this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, effect2)); + } public GuulDrazVampire(final GuulDrazVampire card) { diff --git a/Mage/src/mage/abilities/decorator/ConditionalStaticAbility.java b/Mage/src/mage/abilities/decorator/ConditionalStaticAbility.java deleted file mode 100644 index 5841afa1fe..0000000000 --- a/Mage/src/mage/abilities/decorator/ConditionalStaticAbility.java +++ /dev/null @@ -1,80 +0,0 @@ -/* -* 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.decorator; - -import mage.Constants; -import mage.Constants.Zone; -import mage.abilities.StaticAbility; -import mage.abilities.condition.Condition; -import mage.abilities.effects.Effect; -import mage.abilities.effects.Effects; -import mage.game.Game; - -/** - * - * @author nantuko - */ -public class ConditionalStaticAbility extends StaticAbility { - - private Condition condition; - private String staticText = ""; - - private static final Effects emptyEffects = new Effects(); - - public ConditionalStaticAbility(Zone zone, Effect effect, Condition condition, String rule) { - super(zone, effect); - this.condition = condition; - this.staticText = rule; - } - - public ConditionalStaticAbility(ConditionalStaticAbility ability) { - super(ability); - this.condition = ability.condition; - this.staticText = ability.staticText; - } - - @Override - public Effects getEffects(Game game, Constants.EffectType effectType) { - if (!condition.apply(game, this)) { - return emptyEffects; - } - return super.getEffects(game, effectType); - } - - @Override - public ConditionalStaticAbility copy() { - return new ConditionalStaticAbility(this); - } - - @Override - public String getRule() { - return staticText; - } - -}