mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
commit
4c5ea62cea
2 changed files with 31 additions and 4 deletions
|
|
@ -83,15 +83,16 @@ class ChaosWandEffect extends OneShotEffect {
|
|||
opponent.moveCards(card, Zone.EXILED, source, game);
|
||||
controller.revealCards(source, new CardsImpl(card), game);
|
||||
if (card.isInstant() || card.isSorcery()) {
|
||||
boolean cardWasCast = false;
|
||||
if (controller.chooseUse(Outcome.PlayForFree, "Cast " + card.getName()
|
||||
+ " without paying its mana cost?", source, game)) {
|
||||
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), Boolean.TRUE);
|
||||
Boolean cardWasCast = controller.cast(controller.chooseAbilityForCast(card, game, true),
|
||||
cardWasCast = controller.cast(controller.chooseAbilityForCast(card, game, true),
|
||||
game, true, new MageObjectReference(source.getSourceObject(game), game));
|
||||
game.getState().setValue("PlayFromNotOwnHandZone" + card.getId(), null);
|
||||
if (!cardWasCast) {
|
||||
cardsToShuffle.add(card);
|
||||
}
|
||||
}
|
||||
if (!cardWasCast) {
|
||||
cardsToShuffle.add(card);
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
package org.mage.test.cards.abilities.activated;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.permanent.Permanent;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
public class ChaosWandTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testChaosWant() {
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Chaos Wand");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
|
||||
addCard(Zone.LIBRARY, playerB, "Blood Tithe");
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{4}, {T}: ");
|
||||
setChoice(playerA, "Yes");
|
||||
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertLife(playerB, 17);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue