From e5ef66a3cff7ed8a4c2d6554ec4eef0fd6b99b18 Mon Sep 17 00:00:00 2001 From: Marshall Date: Sun, 14 Jun 2015 19:24:31 -0400 Subject: [PATCH] Added an additional parameter to BecomesBasicLandTargetEffect to allow it to keep it's other land types; Updated Aquitect's Will to actually make the card an island, not just granting it the mana ability --- .../src/mage/sets/lorwyn/AquitectsWill.java | 18 ++++++++---------- .../BecomesBasicLandTargetEffect.java | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java index fa895875945..ab30e1e44f1 100644 --- a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java +++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java @@ -33,6 +33,7 @@ import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition; import mage.abilities.decorator.ConditionalOneShotEffect; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; import mage.abilities.mana.BlueManaAbility; @@ -64,10 +65,7 @@ public class AquitectsWill extends CardImpl { this.getSpellAbility().addTarget(new TargetLandPermanent()); // Add the Flood counter effect - Effect effect = new AquitectsWillGainAbilityEffect( - new BlueManaAbility(), - Duration.Custom, rule); - this.getSpellAbility().addEffect(effect); + this.getSpellAbility().addEffect(new AquitectsWillEffect(Duration.Custom, false, false, "Island")); // Draw if you control a Merfolk this.getSpellAbility().addEffect(new ConditionalOneShotEffect( @@ -86,13 +84,13 @@ public class AquitectsWill extends CardImpl { } } -class AquitectsWillGainAbilityEffect extends GainAbilityTargetEffect { +class AquitectsWillEffect extends BecomesBasicLandTargetEffect { - public AquitectsWillGainAbilityEffect(Ability ability, Duration duration, String rule) { - super(ability, duration, rule); + public AquitectsWillEffect(Duration duration, boolean chooseLandType, boolean loseType, String... landNames) { + super(duration, chooseLandType, loseType, landNames); } - public AquitectsWillGainAbilityEffect(final AquitectsWillGainAbilityEffect effect) { + public AquitectsWillEffect(final AquitectsWillEffect effect) { super(effect); } @@ -106,7 +104,7 @@ class AquitectsWillGainAbilityEffect extends GainAbilityTargetEffect { } @Override - public AquitectsWillGainAbilityEffect copy() { - return new AquitectsWillGainAbilityEffect(this); + public AquitectsWillEffect copy() { + return new AquitectsWillEffect(this); } } \ No newline at end of file diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java index 134bae46168..3cd7a1f11cd 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java @@ -59,6 +59,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { protected boolean chooseLandType; protected ArrayList landTypes = new ArrayList(); + protected boolean loseOther; // loses all other abilities, card types, and creature types public BecomesBasicLandTargetEffect(Duration duration) { this(duration, true, new String[0]); @@ -69,10 +70,15 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { } public BecomesBasicLandTargetEffect(Duration duration, boolean chooseLandType, String... landNames) { + this(duration, chooseLandType, true, landNames); + } + + public BecomesBasicLandTargetEffect(Duration duration, boolean chooseLandType, boolean loseOther, String... landNames) { super(duration, Outcome.Detriment); this.landTypes.addAll(Arrays.asList(landNames)); this.chooseLandType = chooseLandType; this.staticText = setText(); + this.loseOther = loseOther; } @@ -105,6 +111,19 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl { this.discard(); } } + + if(!loseOther) { + for (UUID targetPermanent : targetPointer.getTargets(game, source)) { + Permanent land = game.getPermanent(targetPermanent); + if (land != null) { + for(String type : land.getSubtype()) { + if(!landTypes.contains(type)) { + landTypes.add(type); + } + } + } + } + } } @Override