diff --git a/Mage.Sets/src/mage/cards/u/UnlicensedDisintegration.java b/Mage.Sets/src/mage/cards/u/UnlicensedDisintegration.java index 58ea7b83895..712139157a5 100644 --- a/Mage.Sets/src/mage/cards/u/UnlicensedDisintegration.java +++ b/Mage.Sets/src/mage/cards/u/UnlicensedDisintegration.java @@ -27,7 +27,7 @@ public final class UnlicensedDisintegration extends CardImpl { this.getSpellAbility().addEffect(new ConditionalOneShotEffect( new DamageTargetControllerEffect(3), new PermanentsOnTheBattlefieldCondition(new FilterControlledArtifactPermanent()), - "If you control an artifact, Unlicensed Disintegration deals 3 damage to that creature's controller")); + "If you control an artifact, {this} deals 3 damage to that creature's controller")); } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/ConditionalOneShotEffectTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/ConditionalOneShotEffectTest.java new file mode 100644 index 00000000000..3d1b8dca14e --- /dev/null +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/ConditionalOneShotEffectTest.java @@ -0,0 +1,78 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.mage.test.cards.abilities.oneshot; + +import mage.constants.PhaseStep; +import mage.constants.Zone; +import org.junit.Test; +import org.mage.test.serverside.base.CardTestPlayerBase; + +/** + * + * @author LevelX2 + */ +public class ConditionalOneShotEffectTest extends CardTestPlayerBase { + + @Test + public void testDisintegrationWithoutArtifact() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + // Destroy target creature. If you control an artifact, Unlicensed Disintegration deals 3 damage to that creature's controller. + addCard(Zone.HAND, playerA, "Unlicensed Disintegration", 1); // Instant {1}{B}{R} + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unlicensed Disintegration", "Silvercoat Lion"); + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); + + assertGraveyardCount(playerA, "Unlicensed Disintegration", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + + assertLife(playerA, 20); + assertLife(playerB, 20); + } + + /** + * Noticed that everytime that i succesfully cast Unlicensed Disintigration + * with an artifact on the board the opponent wont lose 3 life. The creature + * dies but the last piece of text does not work + */ + @Test + public void testDisintegrationWithArtifact() { + addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2); + addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1); + + // Whenever a player casts a red spell, you may gain 1 life. + addCard(Zone.BATTLEFIELD, playerA, "Dragon's Claw", 1); + + // Destroy target creature. If you control an artifact, Unlicensed Disintegration deals 3 damage to that creature's controller. + addCard(Zone.HAND, playerA, "Unlicensed Disintegration", 1); // Instant {1}{B}{R} + + addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1); + + castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unlicensed Disintegration", "Silvercoat Lion"); + + setChoice(playerA, "Yes"); // Get life from Dragon's Claw + + setStopAt(1, PhaseStep.BEGIN_COMBAT); + + setStrictChooseMode(true); + execute(); + assertAllCommandsUsed(); + + assertGraveyardCount(playerA, "Unlicensed Disintegration", 1); + assertGraveyardCount(playerB, "Silvercoat Lion", 1); + + assertLife(playerA, 21); + assertLife(playerB, 17); + } + +}