mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
Included duration for BecomesChosenCreatureTypeSourceEffect
This commit is contained in:
parent
d2c39a1339
commit
5bd58ca56e
1 changed files with 15 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue