Merge remote-tracking branch 'magefree/master'

This commit is contained in:
Samuel Sandeen 2016-09-07 23:31:38 -04:00
commit 80da09471d
139 changed files with 5092 additions and 252 deletions

View file

@ -72,4 +72,32 @@ public class PutToGraveyardTest extends CardTestPlayerBase {
}
/**
* Oracle of Dust does not seem to actually move cards from exile into the
* opponent's graveyard, even though every other part of the ability works
* just fine.
*/
@Test
public void testExileToGraveyard2() {
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
// Devoid
// {2}, Put a card an opponent owns from exile into that player's graveyard: Draw a card, then discard a card.
addCard(Zone.BATTLEFIELD, playerA, "Oracle of Dust", 1); // {4}{U}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
// Exile target creature. Its controller gains life equal to its power.
addCard(Zone.HAND, playerA, "Swords to Plowshares");
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swords to Plowshares", "Silvercoat Lion");
activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{2}");
setStopAt(1, PhaseStep.END_TURN);
execute();
assertGraveyardCount(playerA, "Swords to Plowshares", 1);
assertGraveyardCount(playerB, "Silvercoat Lion", 1);
assertGraveyardCount(playerA, 2);
}
}

View file

@ -15,41 +15,74 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
*/
public class KalitasTraitorOfGhetTest extends CardTestPlayerBase {
/*
* Reported bug: Damnation with Kalitas, Traitor of Ghet on my side and 3 opponent creatures, it only exiled 1 creature giving me only 1 zombie instead of 3.
*/
*/
@Test
public void testDamnation() {
/*
Kalitas, Traitor of Ghet {2}{B}{B} 3/4 lifelink - Legendary Vampire
If a nontoken creature an opponent controls would die, instead exile that card and put a 2/2 black Zombie creature token onto the battlefield.
*/
*/
addCard(Zone.BATTLEFIELD, playerA, "Kalitas, Traitor of Ghet", 1);
/*
Damnation {2}{B}{B} - Sorcery
Destroy all creatures. They can't be regenerated.
*/
*/
addCard(Zone.HAND, playerA, "Damnation", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1);
addCard(Zone.BATTLEFIELD, playerB, "Wall of Roots", 1);
addCard(Zone.BATTLEFIELD, playerB, "Sigiled Starfish", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Damnation");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Kalitas, Traitor of Ghet", 1);
assertGraveyardCount(playerA, "Damnation", 1);
assertExileCount("Bronze Sable", 1);
assertExileCount("Wall of Roots", 1);
assertExileCount("Sigiled Starfish", 1);
assertExileCount("Sigiled Starfish", 1);
assertGraveyardCount(playerB, 0); // all 3 creatures of playerB should be exiled not in graveyard
assertExileCount("Kalitas, Traitor of Ghet", 0); // player controlled, not opponent so not exiled
assertExileCount("Kalitas, Traitor of Ghet", 0); // player controlled, not opponent so not exiled
assertPermanentCount(playerA, "Zombie", 3); // 3 tokens generated from exiling 3 opponent's creatures
}
@Test
public void testDamnationGraveyard() {
/*
Kalitas, Traitor of Ghet {2}{B}{B} 3/4 lifelink - Legendary Vampire
If a nontoken creature an opponent controls would die, instead exile that card and put a 2/2 black Zombie creature token onto the battlefield.
*/
addCard(Zone.GRAVEYARD, playerA, "Kalitas, Traitor of Ghet", 1);
/*
Damnation {2}{B}{B} - Sorcery
Destroy all creatures. They can't be regenerated.
*/
addCard(Zone.HAND, playerA, "Damnation", 1);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
addCard(Zone.BATTLEFIELD, playerB, "Bronze Sable", 1);
addCard(Zone.BATTLEFIELD, playerB, "Wall of Roots", 1);
addCard(Zone.BATTLEFIELD, playerB, "Sigiled Starfish", 1);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Damnation");
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Kalitas, Traitor of Ghet", 1);
assertGraveyardCount(playerA, "Damnation", 1);
assertGraveyardCount(playerB, "Bronze Sable", 1);
assertGraveyardCount(playerB, "Wall of Roots", 1);
assertGraveyardCount(playerB, "Sigiled Starfish", 1);
assertPermanentCount(playerA, "Zombie", 0); // 3 tokens generated from exiling 3 opponent's creatures
}
}

View file

@ -104,7 +104,6 @@ import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetCreaturePermanentAmount;
import mage.target.common.TargetPermanentOrPlayer;
import mage.util.MessageToClient;
import org.junit.Ignore;
/**
@ -976,12 +975,12 @@ public class TestPlayer implements Player {
@Override
public boolean chooseUse(Outcome outcome, String message, Ability source, Game game) {
return this.chooseUse(outcome, new MessageToClient(message), source, game);
return this.chooseUse(outcome, message, null, null, null, source, game);
}
@Override
public boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game) {
if (message.getMessage().equals("Scry 1?")) {
public boolean chooseUse(Outcome outcome, String message, String secondMessage, String trueText, String falseText, Ability source, Game game) {
if (message.equals("Scry 1?")) {
return false;
}
if (!choices.isEmpty()) {
@ -994,7 +993,7 @@ public class TestPlayer implements Player {
return true;
}
}
return computerPlayer.chooseUse(outcome, message, source, game);
return computerPlayer.chooseUse(outcome, message, secondMessage, trueText, falseText, source, game);
}
@Override

View file

@ -79,7 +79,6 @@ import mage.target.Target;
import mage.target.TargetAmount;
import mage.target.TargetCard;
import mage.target.common.TargetCardInLibrary;
import mage.util.MessageToClient;
/**
*
@ -849,7 +848,7 @@ public class PlayerStub implements Player {
}
@Override
public boolean chooseUse(Outcome outcome, MessageToClient message, Ability source, Game game) {
public boolean chooseUse(Outcome outcome, String message, String secondMessage, String trueText, String falseText, Ability source, Game game) {
return false;
}