Fixes to token image handling.

This commit is contained in:
LevelX2 2015-07-19 10:09:50 +02:00
parent 6ef50c42bf
commit 4324a6a683
14 changed files with 356 additions and 71 deletions

View file

@ -29,6 +29,8 @@ package org.mage.test.AI.basic;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.filter.Filter;
import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBaseAI;
@ -88,8 +90,10 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI {
// Destroy two target artifacts.
addCard(Zone.HAND, playerA, "Rack and Ruin"); // {2}{R}
addCard(Zone.BATTLEFIELD, playerB, "Mox Emerald", 2);
addCard(Zone.BATTLEFIELD, playerA, "Juggernaut");
addCard(Zone.BATTLEFIELD, playerB, "Mox Emerald", 4);
addCard(Zone.BATTLEFIELD, playerA, "Juggernaut", 1);
addCard(Zone.BATTLEFIELD, playerA, "Composite Golem", 1);
addCard(Zone.BATTLEFIELD, playerA, "Mox Emerald", 1);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
@ -99,4 +103,123 @@ public class TargetsAreChosenTest extends CardTestPlayerBaseAI {
}
/**
* Target only opponent creatures to tap
*/
@Test
public void testFrostBreath1() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
// Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.
addCard(Zone.HAND, playerA, "Frost Breath"); // {2}{U}
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1);
addCard(Zone.BATTLEFIELD, playerA, "Juggernaut", 1);
addCard(Zone.BATTLEFIELD, playerA, "Composite Golem", 1);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Frost Breath", 1);
assertTapped("Silvercoat Lion", true);
assertTapped("Pillarfield Ox", true);
assertTapped("Juggernaut", false);
assertTapped("Composite Golem", false);
}
/**
* Target only opponent creatures also if more targets are possible
*/
@Test
public void testFrostBreath2() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
// Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.
addCard(Zone.HAND, playerA, "Frost Breath"); // {2}{U}
addCard(Zone.BATTLEFIELD, playerB, "Pillarfield Ox", 1);
addCard(Zone.BATTLEFIELD, playerA, "Juggernaut", 1);
addCard(Zone.BATTLEFIELD, playerA, "Composite Golem", 1);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Frost Breath", 1);
assertTapped("Pillarfield Ox", true);
assertTapped("Juggernaut", false);
assertTapped("Composite Golem", false);
}
/**
* Spell is not cast if only own creatures can be targeted
*/
@Test
public void testFrostBreath3() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
// Tap up to two target creatures. Those creatures don't untap during their controller's next untap step.
addCard(Zone.HAND, playerA, "Frost Breath"); // {2}{U}
addCard(Zone.BATTLEFIELD, playerA, "Juggernaut", 1);
addCard(Zone.BATTLEFIELD, playerA, "Composite Golem", 1);
setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute();
assertGraveyardCount(playerA, "Frost Breath", 0);
assertTapped("Juggernaut", false);
assertTapped("Composite Golem", false);
}
/**
*
*/
@Test
public void testNefashu() {
// Whenever Nefashu attacks, up to five target creatures each get -1/-1 until end of turn.
addCard(Zone.BATTLEFIELD, playerA, "Nefashu"); // 5/3
addCard(Zone.BATTLEFIELD, playerB, "Bellows Lizard", 5);
// Whenever a creature an opponent controls dies, put a +1/+1 counter on Malakir Cullblade.
addCard(Zone.BATTLEFIELD, playerA, "Malakir Cullblade", 5);
attack(3, playerA, "Nefashu");
setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
execute();
assertGraveyardCount(playerB, "Bellows Lizard", 5);
assertPowerToughness(playerA, "Malakir Cullblade", 6, 6, Filter.ComparisonScope.All);
assertTapped("Nefashu", true);
assertLife(playerB, 15);
}
/**
* Test that AI counters creatire spell
*/
@Test
@Ignore // counter spells don't seem to be cast by AI
public void testRewind() {
addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
// Counter target spell. Untap up to four lands.
addCard(Zone.HAND, playerA, "Rewind"); // {2}{U}{U}
addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
// Renown 1 (When this creature deals combat damage to a player, if it isn't renowned, put a +1/+1 counter on it and it becomes renowned.)
// {W}{W}: Tap target creature.
addCard(Zone.HAND, playerB, "Kytheon's Irregulars", 1);
castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Kytheon's Irregulars");
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerB, "Kytheon's Irregulars", 0);
assertGraveyardCount(playerB, "Kytheon's Irregulars", 1);
assertGraveyardCount(playerA, "Rewind", 1);
assertTappedCount("Island", true, 0);
}
}