Included duration for BecomesChosenCreatureTypeSourceEffect
@@ -3,6 +3,7 @@ package mage.abilities.effects.common.continuous;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
+import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -10,17 +11,28 @@ import mage.target.targetpointer.FixedTarget;
public class BecomesChosenCreatureTypeSourceEffect extends OneShotEffect {
+ private final boolean nonWall;
+ private final Duration duration;
+
public BecomesChosenCreatureTypeSourceEffect() {
- this(false);
+ this(false, Duration.EndOfTurn);
}
public BecomesChosenCreatureTypeSourceEffect(boolean nonWall) {
+ this(nonWall, Duration.EndOfTurn);
+ }
+
+ public BecomesChosenCreatureTypeSourceEffect(boolean nonWall, Duration duration) {
super(Outcome.BoostCreature);
- staticText = "{this} becomes the creature type of your choice until end of turn.";
+ this.nonWall = nonWall;
+ this.duration = duration;
+ staticText = "{this} becomes the creature type of your choice" + (duration == Duration.EndOfTurn ? " until end of turn." : "");
}
public BecomesChosenCreatureTypeSourceEffect(final BecomesChosenCreatureTypeSourceEffect effect) {
super(effect);
+ this.nonWall = effect.nonWall;
+ this.duration = effect.duration;
}
@Override
@@ -29,7 +41,7 @@ public class BecomesChosenCreatureTypeSourceEffect extends OneShotEffect {
if (sourcePerm == null) {
return false;
}
- Effect effect = new BecomesChosenCreatureTypeTargetEffect();
+ Effect effect = new BecomesChosenCreatureTypeTargetEffect(nonWall, duration);
effect.setTargetPointer(new FixedTarget(sourcePerm, game));
return effect.apply(game, source);
}
