* Fixed a problem of becomes ColorTargetEffect that causes objects to not always reset to original color.

This commit is contained in:
LevelX2 2018-04-24 11:35:33 +02:00
parent 229cad7330
commit 6bd8f52b66
2 changed files with 8 additions and 4 deletions

View file

@ -31,7 +31,6 @@ import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.game.permanent.Permanent;
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@ -73,7 +72,6 @@ public class EightAndAHalfTailsTest extends CardTestPlayerBase {
* recast he was still white.
*/
@Test
@Ignore
public void testColorChangeIsReset() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);

View file

@ -41,6 +41,8 @@ import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
/**
@ -106,8 +108,12 @@ public class BecomesColorTargetEffect extends ContinuousEffectImpl {
for (UUID targetId : targetPointer.getTargets(game, source)) {
MageObject targetObject = game.getObject(targetId);
if (targetObject != null) {
objectFound = true;
targetObject.getColor(game).setColor(setColor);
if (targetObject instanceof Spell || targetObject instanceof Permanent) {
objectFound = true;
targetObject.getColor(game).setColor(setColor);
} else {
objectFound = false;
}
}
}
if (!objectFound && this.getDuration() == Duration.Custom) {