mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
Fix Knowledge Pool exile target
This commit is contained in:
parent
5bbcda3d4e
commit
ef4d48a654
2 changed files with 63 additions and 2 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
package mage.cards.k;
|
package mage.cards.k;
|
||||||
|
|
||||||
|
import mage.ApprovingObject;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
|
@ -26,7 +27,6 @@ import mage.target.targetpointer.FixedTarget;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.ApprovingObject;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
|
@ -181,7 +181,7 @@ class KnowledgePoolExileAndPlayEffect extends OneShotEffect {
|
||||||
FilterNonlandCard filter = new FilterNonlandCard("nonland card exiled with Knowledge Pool");
|
FilterNonlandCard filter = new FilterNonlandCard("nonland card exiled with Knowledge Pool");
|
||||||
filter.add(Predicates.not(new CardIdPredicate(spell.getSourceId())));
|
filter.add(Predicates.not(new CardIdPredicate(spell.getSourceId())));
|
||||||
|
|
||||||
TargetCardInExile target = new TargetCardInExile(0, 1, filter, source.getSourceId());
|
TargetCardInExile target = new TargetCardInExile(0, 1, filter, exileZoneId);
|
||||||
target.withNotTarget(true);
|
target.withNotTarget(true);
|
||||||
|
|
||||||
if (!spellController.choose(Outcome.PlayForFree, game.getExile().getExileZone(exileZoneId), target, source, game)) {
|
if (!spellController.choose(Outcome.PlayForFree, game.getExile().getExileZone(exileZoneId), target, source, game)) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,61 @@
|
||||||
|
package org.mage.test.cards.single.mbs;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jmlundeen
|
||||||
|
*/
|
||||||
|
public class KnowledgePoolTest extends CardTestPlayerBase {
|
||||||
|
|
||||||
|
/*
|
||||||
|
Knowledge Pool
|
||||||
|
{6}
|
||||||
|
Artifact
|
||||||
|
Imprint - When Knowledge Pool enters the battlefield, each player exiles the top three cards of their library.
|
||||||
|
Whenever a player casts a spell from their hand, that player exiles it. If the player does, they may cast another nonland card exiled with Knowledge Pool without paying that card's mana cost.
|
||||||
|
*/
|
||||||
|
private static final String knowledgePool = "Knowledge Pool";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Lightning Bolt
|
||||||
|
{R}
|
||||||
|
Instant
|
||||||
|
Lightning Bolt deals 3 damage to any target.
|
||||||
|
*/
|
||||||
|
private static final String lightningBolt = "Lightning Bolt";
|
||||||
|
|
||||||
|
/*
|
||||||
|
Shock
|
||||||
|
{R}
|
||||||
|
Instant
|
||||||
|
Shock deals 2 damage to any target.
|
||||||
|
*/
|
||||||
|
private static final String shock = "Shock";
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testKnowledgePool() {
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Mountain");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerB, "Mountain");
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, knowledgePool);
|
||||||
|
addCard(Zone.HAND, playerA, lightningBolt);
|
||||||
|
addCard(Zone.HAND, playerB, shock);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, lightningBolt, playerB);
|
||||||
|
setChoice(playerA, false);
|
||||||
|
|
||||||
|
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, shock, playerA);
|
||||||
|
setChoice(playerB, true);
|
||||||
|
setChoice(playerB, lightningBolt);
|
||||||
|
addTarget(playerB, playerA);
|
||||||
|
|
||||||
|
setStrictChooseMode(true);
|
||||||
|
setStopAt(1, PhaseStep.END_TURN);
|
||||||
|
execute();
|
||||||
|
assertLife(playerA, 20 - 3); // shock exiled, bolt cast from knowledge pool
|
||||||
|
assertLife(playerB, 20); // bolt exiled, no card to cast from knowledge pool
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue