mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
Create token for a commander that instead of being exiled by (#3675)
Curse of the Swine was put into the command zone. #3669
This commit is contained in:
parent
f0d9988e9b
commit
e0a61b9918
2 changed files with 45 additions and 1 deletions
|
|
@ -35,6 +35,7 @@ import mage.cards.CardImpl;
|
||||||
import mage.cards.CardSetInfo;
|
import mage.cards.CardSetInfo;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
import mage.constants.Zone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.permanent.Permanent;
|
import mage.game.permanent.Permanent;
|
||||||
import mage.game.permanent.token.CurseOfTheSwineBoarToken;
|
import mage.game.permanent.token.CurseOfTheSwineBoarToken;
|
||||||
|
|
@ -94,7 +95,7 @@ class CurseOfTheSwineEffect extends OneShotEffect {
|
||||||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||||
Permanent creature = game.getPermanent(targetId);
|
Permanent creature = game.getPermanent(targetId);
|
||||||
if (creature != null) {
|
if (creature != null) {
|
||||||
if (creature.moveToExile(null, null, source.getSourceId(), game)) {
|
if (creature.moveToExile(null, null, source.getSourceId(), game) || creature.moveToZone(Zone.COMMAND, source.getSourceId(), game, false)) {
|
||||||
CurseOfTheSwineBoarToken swineToken = new CurseOfTheSwineBoarToken();
|
CurseOfTheSwineBoarToken swineToken = new CurseOfTheSwineBoarToken();
|
||||||
swineToken.putOntoBattlefield(1, game, source.getSourceId(), creature.getControllerId());
|
swineToken.putOntoBattlefield(1, game, source.getSourceId(), creature.getControllerId());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package org.mage.test.commander.duel;
|
||||||
|
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.GameException;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.mage.test.serverside.base.CardTestCommanderDuelBase;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author tamaroth on 14.07.2017.
|
||||||
|
*/
|
||||||
|
public class CurseOfTheSwineTest extends CardTestCommanderDuelBase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
|
||||||
|
setDecknamePlayerA("CommanderDuel_UW.dck"); // Commander = Daxos of Meletis
|
||||||
|
return super.createNewGameAndPlayers();
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
In a Commander game, if a commander is put into the command zone
|
||||||
|
instead of being exiled by Curse of the Swine, its controller will
|
||||||
|
still get a Boar token.
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void TestCurseOfTheSwine()
|
||||||
|
{
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
|
||||||
|
addCard(Zone.BATTLEFIELD, playerA, "Plains", 1);
|
||||||
|
addCard(Zone.HAND, playerA, "Curse of the Swine");
|
||||||
|
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis");
|
||||||
|
castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Curse of the Swine");
|
||||||
|
setChoice(playerA, "X=1");
|
||||||
|
addTarget(playerA, "Daxos of Meletis");
|
||||||
|
setStopAt(3, PhaseStep.BEGIN_COMBAT);
|
||||||
|
execute();
|
||||||
|
|
||||||
|
assertCommandZoneCount(playerA, "Daxos of Meletis", 1);
|
||||||
|
assertExileCount("Daxos of Meletis", 0);
|
||||||
|
assertPermanentCount(playerA, "Boar", 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue