* Oath of Kaya - fixed that it doesn't triggers on attacks;

This commit is contained in:
Oleg Agafonov 2019-04-24 21:41:24 +04:00
parent 9ad7c4c83d
commit e51b054249
3 changed files with 126 additions and 52 deletions

View file

@ -0,0 +1,80 @@
package org.mage.test.cards.abilities.other;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
/**
* @author JayDi85
*/
public class OathOfKayaTest extends CardTestPlayerBase {
@Test
public void test_AttackingPlayer() {
// Whenever an opponent attacks a planeswalker you control with one or more creatures,
// Oath of Kaya deals 2 damage to that player and you gain 2 life.
addCard(Zone.BATTLEFIELD, playerB, "Oath of Kaya", 1);
//
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 2); // 2/2
addCard(Zone.BATTLEFIELD, playerB, "Liliana, Dreadhorde General", 1);
attack(1, playerA, "Grizzly Bears", playerB);
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerB, "Liliana, Dreadhorde General", CounterType.LOYALTY, 6);
assertLife(playerA, 20);
assertLife(playerB, 20 - 2);
}
@Test
public void test_AttackingPlaneswalker() {
// Whenever an opponent attacks a planeswalker you control with one or more creatures,
// Oath of Kaya deals 2 damage to that player and you gain 2 life.
addCard(Zone.BATTLEFIELD, playerB, "Oath of Kaya", 1);
//
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 2); // 2/2
addCard(Zone.BATTLEFIELD, playerB, "Liliana, Dreadhorde General", 1);
attack(1, playerA, "Grizzly Bears", "Liliana, Dreadhorde General");
attack(1, playerA, "Grizzly Bears", "Liliana, Dreadhorde General");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerB, "Liliana, Dreadhorde General", CounterType.LOYALTY, 6 - 2 * 2);
assertLife(playerA, 20 - 2);
assertLife(playerB, 20 + 2);
}
@Test
public void test_AttackingTwoPlaneswalkers() {
// Whenever an opponent attacks a planeswalker you control with one or more creatures,
// Oath of Kaya deals 2 damage to that player and you gain 2 life.
addCard(Zone.BATTLEFIELD, playerB, "Oath of Kaya", 1);
//
addCard(Zone.BATTLEFIELD, playerA, "Grizzly Bears", 2); // 2/2
addCard(Zone.BATTLEFIELD, playerB, "Liliana, Dreadhorde General", 1);
addCard(Zone.BATTLEFIELD, playerB, "Vivien, Champion of the Wilds", 1);
attack(1, playerA, "Grizzly Bears", "Liliana, Dreadhorde General");
attack(1, playerA, "Grizzly Bears", "Vivien, Champion of the Wilds");
setStrictChooseMode(true);
setStopAt(1, PhaseStep.END_TURN);
execute();
assertAllCommandsUsed();
assertCounterCount(playerB, "Liliana, Dreadhorde General", CounterType.LOYALTY, 6 - 2);
assertCounterCount(playerB, "Vivien, Champion of the Wilds", CounterType.LOYALTY, 4 - 2);
assertLife(playerA, 20 - 2);
assertLife(playerB, 20 + 2);
}
}