mirror of
https://github.com/correl/mage.git
synced 2025-04-11 01:01:05 -09:00
Distorting Lens: various fixes by LevelX2
* TargetPermanent() instead of TargetCreaturePermanent() * BecomesColorTargetEffect with setColor = null * use permanent.getLogName() and player.getLogName()
This commit is contained in:
parent
f203d799ec
commit
8d0619b356
1 changed files with 104 additions and 109 deletions
|
@ -35,7 +35,6 @@ import mage.abilities.effects.ContinuousEffect;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BecomesColorTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
|
@ -44,7 +43,7 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
|
@ -59,7 +58,7 @@ public class DistortingLens extends CardImpl {
|
|||
|
||||
// {tap}: Target permanent becomes the color of your choice until end of turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ChangeColorEffect(), new TapSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
ability.addTarget(new TargetPermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
@ -90,15 +89,11 @@ class ChangeColorEffect extends OneShotEffect {
|
|||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
Permanent chosen = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (player != null && permanent != null) {
|
||||
ChoiceColor colorChoice = new ChoiceColor();
|
||||
if (player.choose(Outcome.Neutral, colorChoice, game)) {
|
||||
game.informPlayers(permanent.getName() + ": " + player.getName() + " has chosen " + colorChoice.getChoice());
|
||||
ContinuousEffect effect = new BecomesColorTargetEffect(colorChoice.getColor(), Duration.EndOfTurn, "is " + colorChoice.getChoice());
|
||||
ContinuousEffect effect = new BecomesColorTargetEffect(null, Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(chosen.getId()));
|
||||
game.addEffect(effect, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue