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

This commit is contained in:
Marshall 2015-06-14 19:24:31 -04:00
parent 6d036a6085
commit e5ef66a3cf
2 changed files with 27 additions and 10 deletions

View file

@ -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);
}
}

View file

@ -59,6 +59,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
protected boolean chooseLandType;
protected ArrayList<String> 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