* Cost reduction effects - fixed that some cards with cost reduction can't be played (example: Price of Fame, see #6685, #6684);

This commit is contained in:
Oleg Agafonov 2020-06-27 05:40:45 +04:00
parent 2252648f01
commit 520d75dba9
7 changed files with 70 additions and 32 deletions

View file

@ -2,14 +2,13 @@ package org.mage.test.cards.cost.modification;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
import org.mage.test.serverside.base.CardTestPlayerBaseWithAIHelps;
/**
* @author JayDi85
*/
public class CostReduceWithConditionTest extends CardTestPlayerBase {
public class CostReduceWithConditionTest extends CardTestPlayerBaseWithAIHelps {
@Test
public void test_PriceOfFame_Normal() {
@ -31,9 +30,9 @@ public class CostReduceWithConditionTest extends CardTestPlayerBase {
}
@Test
@Ignore
// TODO: implement workaround like putToStackAsNonPlayable for abilities, see https://github.com/magefree/mage/issues/6685
public void test_PriceOfFame_Reduce() {
public void test_PriceOfFame_Reduce_Manual() {
// https://github.com/magefree/mage/issues/6685
// {3}{B}
// This spell costs {2} less to cast if it targets a legendary creature.
// Destroy target creature.
@ -50,4 +49,26 @@ public class CostReduceWithConditionTest extends CardTestPlayerBase {
assertGraveyardCount(playerB, "Anje Falkenrath", 1);
}
@Test
public void test_PriceOfFame_Reduce_AI() {
// https://github.com/magefree/mage/issues/6685
// {3}{B}
// This spell costs {2} less to cast if it targets a legendary creature.
// Destroy target creature.
addCard(Zone.HAND, playerA, "Price of Fame", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4 - 2);
addCard(Zone.BATTLEFIELD, playerB, "Anje Falkenrath", 1);
// AI must see and play that cards too
aiPlayPriority(1, PhaseStep.PRECOMBAT_MAIN, playerA);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertAllCommandsUsed();
assertGraveyardCount(playerB, "Anje Falkenrath", 1);
}
}