Merge pull request #1785 from drmDev/master

EquippedCondition and EnchantedCondition refactoring fixes - missed c…
This commit is contained in:
Derek M 2016-04-05 14:13:25 -04:00
commit c45e597f5d
6 changed files with 20 additions and 22 deletions

View file

@ -29,9 +29,8 @@ package mage.sets.bornofthegods;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.EnchantedCondition;
import mage.abilities.condition.common.EnchantedSourceCondition;
import mage.abilities.decorator.ConditionalAsThoughEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.combat.CanAttackAsThoughItDidntHaveDefenderSourceEffect;
@ -61,7 +60,7 @@ public class PillarOfWar extends CardImpl {
// As long as Pillar of War is enchanted, it can attack as though it didn't have defender.
Effect effect = new ConditionalAsThoughEffect(
new CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration.WhileOnBattlefield),
new EnchantedCondition());
new EnchantedSourceCondition());
effect.setText("As long as {this} is enchanted, it can attack as though it didn't have defender");
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));

View file

@ -32,7 +32,7 @@ import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.OnEventTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.common.EnchantedCondition;
import mage.abilities.condition.common.EnchantedSourceCondition;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -72,7 +72,7 @@ public class KitsuneMystic extends CardImpl {
// At the beginning of the end step, if Kitsune Mystic is enchanted by two or more Auras, flip it.
this.addAbility(new ConditionalTriggeredAbility(
new OnEventTriggeredAbility(GameEvent.EventType.END_TURN_STEP_PRE, "beginning of the end step", true, new FlipSourceEffect(new AutumnTailKitsuneSage())),
new EnchantedCondition(2), "At the beginning of the end step, if {this} is enchanted by two or more Auras, flip it."));
new EnchantedSourceCondition(2), "At the beginning of the end step, if {this} is enchanted by two or more Auras, flip it."));
}
public KitsuneMystic(final KitsuneMystic card) {

View file

@ -31,7 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.EquippedCondition;
import mage.abilities.condition.common.EquippedSourceCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
@ -74,12 +74,12 @@ public class RakshaGoldenCub extends CardImpl {
// As long as Raksha Golden Cub is equipped, Cat creatures you control get +2/+2 and have double strike.
Effect effect1 = new ConditionalContinuousEffect(
new BoostAllEffect(2, 2, Duration.WhileOnBattlefield, filter, false),
EquippedCondition.getInstance(),
EquippedSourceCondition.getInstance(),
"As long as {this} is equipped, Cat creatures you control get +2/+2");
Effect effect2 = new ConditionalContinuousEffect(
new GainAbilityAllEffect(DoubleStrikeAbility.getInstance(), Duration.WhileOnBattlefield, filter, false),
EquippedCondition.getInstance(),
EquippedSourceCondition.getInstance(),
"As long as {this} is equipped, Cat creatures you control have double strike");
effect2.setText("and have double strike");

View file

@ -28,17 +28,17 @@
package mage.sets.guildpact;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.EnchantedCondition;
import mage.abilities.condition.common.EnchantedSourceCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
*
@ -58,7 +58,7 @@ public class SkyriderTrainee extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new ConditionalContinuousEffect(
new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.WhileOnBattlefield),
new EnchantedCondition(),
new EnchantedSourceCondition(),
"{this} has flying as long as it's enchanted")));
}

View file

@ -28,18 +28,17 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
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.condition.common.EquippedSourceCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
/**
@ -59,10 +58,10 @@ public class SunspearShikari extends CardImpl {
// As long as Sunspear Shikari is equipped, it has first strike and lifelink.
ConditionalContinuousEffect effect1 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(FirstStrikeAbility.getInstance()),
EquippedCondition.getInstance(), "As long as {this} is equipped, it has first strike");
EquippedSourceCondition.getInstance(), "As long as {this} is equipped, it has first strike");
Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect1);
ConditionalContinuousEffect effect2 = new ConditionalContinuousEffect(new GainAbilitySourceEffect(LifelinkAbility.getInstance()),
EquippedCondition.getInstance(), "and lifelink");
EquippedSourceCondition.getInstance(), "and lifelink");
ability.addEffect(effect2);
this.addAbility(ability);
}

View file

@ -34,7 +34,7 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
import mage.abilities.condition.common.EquippedCondition;
import mage.abilities.condition.common.EquippedSourceCondition;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
@ -71,7 +71,7 @@ public class AvacynianMissionaries extends CardImpl {
// At the beginning of your end step, if Avacynian Missionaries is equipped, transform it.
this.addAbility(new TransformAbility());
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), TargetController.YOU, new EquippedCondition(), false));
this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new TransformSourceEffect(true), TargetController.YOU, new EquippedSourceCondition(), false));
// When this creature transforms into Lunarch Inquisitors, you may exile another target creature until Lunarch Inquisitors leaves the battlefield.
Ability ability = new LunarchInquisitorsAbility();