mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
Merge origin/master
This commit is contained in:
commit
14c02bc756
9 changed files with 417 additions and 20 deletions
|
|
@ -0,0 +1,48 @@
|
|||
package org.mage.test.cards.abilities.equipped;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class KusariGamaTest extends CardTestPlayerBase {
|
||||
|
||||
// reported bug: trigger occurs but no damage is dealt
|
||||
@Test
|
||||
public void testTriggeredAbilityDealsDamage() {
|
||||
|
||||
// Kusari-Gama - Artifact Equipment - Equip {3}
|
||||
// Equipped creature has "2: This creature gets +1/+0 until end of turn."
|
||||
// Whenever equipped creature deals damage to a blocking creature, Kusari-Gama deals that much damage to each other creature defending player controls.
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Kusari-Gama");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Sylvan Advocate"); // 2/3 vigilance {1}{G}
|
||||
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Wall of Omens"); // 0/4 {1}{W}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 2); // 2/2 {1}{W}
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Hill Giant"); // 3/3 {3}{R}
|
||||
|
||||
activateAbility(1, PhaseStep.BEGIN_COMBAT, playerA, "Equip {3}", "Sylvan Advocate");
|
||||
attack(1, playerA, "Sylvan Advocate");
|
||||
block(1, playerB, "Wall of Omens", "Sylvan Advocate");
|
||||
setStopAt(1, PhaseStep.END_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Kusari-Gama", 1);
|
||||
assertPermanentCount(playerB, "Wall of Omens", 1);
|
||||
assertPermanentCount(playerB, "Hill Giant", 1);
|
||||
|
||||
Permanent wallPerm = getPermanent("Wall of Omens", playerB);
|
||||
Permanent giantPerm = getPermanent("Hill Giant", playerB);
|
||||
Assert.assertEquals("Wall of Omens should have 2 damage dealt to it", 2, wallPerm.getDamage());
|
||||
Assert.assertEquals("Hill Giant should have 2 damage dealt to it", 2, giantPerm.getDamage());
|
||||
|
||||
assertGraveyardCount(playerB, "Silvercoat Lion", 2);
|
||||
}
|
||||
}
|
||||
|
|
@ -115,5 +115,45 @@ public class EscalateTest extends CardTestPlayerBase {
|
|||
assertGraveyardCount(playerB, "Gaddock Teeg", 1);
|
||||
assertLife(playerB, 17);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSpellQuellerInteraction_ThreeCMC_ThreeModes() {
|
||||
|
||||
// {1}{W}{U} Flash Flying 2/3 Spirit
|
||||
// When Spell Queller enters the battlefield, exile target spell with converted mana cost 4 or less.
|
||||
// When Spell Queller leaves the battlefield, the exiled card's owner may cast that card without paying its mana cost.
|
||||
addCard(Zone.HAND, playerB, "Spell Queller");
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Wall of Omens"); // {1}{W} 0/4
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Plains", 1);
|
||||
|
||||
// Escalate {1} (Pay this cost for each mode chosen beyond the first.)
|
||||
// Choose one or more —
|
||||
// * Target player discards all the cards in his or her hand, then draws that many cards.
|
||||
// * Collective Defiance deals 4 damage to target creature.
|
||||
// * Collective Defiance deals 3 damage to target opponent.
|
||||
addCard(Zone.HAND, playerA, "Collective Defiance"); // {1}{R}{R} sorcery
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Collective Defiance", "mode=2Wall of Omens");
|
||||
setModeChoice(playerA, "1"); // opponent discards hand and draws that many
|
||||
setModeChoice(playerA, "2"); // deal 4 dmg to target creature (Wall of Omens)
|
||||
setModeChoice(playerA, "3"); // deal 3 dmg to opponent
|
||||
addTarget(playerA, playerB); // mode 1
|
||||
addTarget(playerA, playerB); // mode 3
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Spell Queller");
|
||||
addTarget(playerB, "Collective Defiance");
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertPermanentCount(playerB, "Spell Queller", 1);
|
||||
assertHandCount(playerA, "Collective Defiance", 0);
|
||||
assertExileCount("Collective Defiance", 1);
|
||||
assertGraveyardCount(playerA, "Collective Defiance", 0);
|
||||
assertPermanentCount(playerB, "Wall of Omens", 1);
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 20);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ public class UndyingTest extends CardTestPlayerBase {
|
|||
execute();
|
||||
|
||||
assertPermanentCount(playerA, "Elite Vanguard", 1);
|
||||
assertCounterCount(playerA, "Elite Vanguard", CounterType.P1P1, 1);
|
||||
assertPowerToughness(playerA, "Elite Vanguard", 3, 2);
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +113,7 @@ public class UndyingTest extends CardTestPlayerBase {
|
|||
assertGraveyardCount(playerA, "Lightning Bolt", 1);
|
||||
assertPermanentCount(playerB, "Strangleroot Geist", 0);
|
||||
assertPermanentCount(playerA, "Strangleroot Geist", 1);
|
||||
assertCounterCount(playerA, "Strangleroot Geist", CounterType.P1P1, 1);
|
||||
assertPowerToughness(playerA, "Strangleroot Geist", 3, 2);
|
||||
}
|
||||
|
||||
|
|
@ -211,6 +213,7 @@ public class UndyingTest extends CardTestPlayerBase {
|
|||
|
||||
assertPermanentCount(playerA, "Silvercoat Lion", 1);
|
||||
assertPermanentCount(playerA, "Mikaeus, the Unhallowed", 1);
|
||||
assertCounterCount(playerA, "Silvercoat Lion", CounterType.P1P1, 1);
|
||||
assertPowerToughness(playerA, "Silvercoat Lion", 4, 4);
|
||||
|
||||
}
|
||||
|
|
@ -271,5 +274,45 @@ public class UndyingTest extends CardTestPlayerBase {
|
|||
assertPowerToughness(playerA, "Tatterkite", 3, 2);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* I stole my opponents Vorapede using Simic Manipulator and shortly after someone played Wrath of God.
|
||||
* Instead of returning to my opponent's board, Vorapede came back under my control.
|
||||
* The rules text for Undying states that it should return under its owner's control, not its controller's.
|
||||
*/
|
||||
@Test
|
||||
public void testUndyingCreatureReturnsUnderOwnersControl() {
|
||||
|
||||
// Creature — Insect
|
||||
// Vigilance, trample
|
||||
// Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Vorapede"); // {2}{G}{G}{G} 5/4
|
||||
addCard(Zone.HAND, playerB, "Doom Blade"); // {1}{B} destroy target non-black creature
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
|
||||
|
||||
// {2}{R} sorcery - Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.
|
||||
addCard(Zone.HAND, playerA, "Act of Treason");
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
|
||||
|
||||
// playerA takes control of Vorapede from playerB
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Act of Treason", "Vorapede");
|
||||
attack(1, playerA, "Vorapede");
|
||||
// playerB kills Vorapede under the control of playerA now
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Doom Blade", "Vorapede");
|
||||
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertLife(playerA, 20);
|
||||
assertLife(playerB, 15);
|
||||
assertGraveyardCount(playerA, "Act of Treason", 1);
|
||||
assertGraveyardCount(playerB, "Doom Blade", 1);
|
||||
|
||||
// Vorapede should return under control of playerA, not playerB
|
||||
assertPermanentCount(playerA, "Vorapede", 1);
|
||||
assertPermanentCount(playerB, "Vorapede", 0);
|
||||
assertCounterCount(playerA, "Vorapede", CounterType.P1P1, 1);
|
||||
assertPowerToughness(playerA, "Vorapede", 6, 5);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,68 @@
|
|||
package org.mage.test.cards.replacement;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Zone;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
import org.mage.test.serverside.base.CardTestPlayerBase;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author escplan9 (Derek Monturo - dmontur1 at gmail dot com)
|
||||
*/
|
||||
public class ClergyOfTheHolyNimbusTest extends CardTestPlayerBase {
|
||||
|
||||
@Test
|
||||
public void testBasicRegeneration() {
|
||||
|
||||
// If Clergy of the Holy Nimbus would be destroyed, regenerate it.
|
||||
// {1}: Clergy of the Holy Nimbus can't be regenerated this turn. Only any opponent may activate this ability.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Clergy of the Holy Nimbus"); // {W} 1/1
|
||||
addCard(Zone.HAND, playerA, "Doom Blade"); // {1}{B} destroy target non-black creature
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Doom Blade", "Clergy of the Holy Nimbus");
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Doom Blade", 1);
|
||||
assertPermanentCount(playerB, "Clergy of the Holy Nimbus", 1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCannotBeRegeneratedSpell() {
|
||||
|
||||
// If Clergy of the Holy Nimbus would be destroyed, regenerate it.
|
||||
// {1}: Clergy of the Holy Nimbus can't be regenerated this turn. Only any opponent may activate this ability.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Clergy of the Holy Nimbus"); // {W} 1/1
|
||||
addCard(Zone.HAND, playerA, "Wrath of God"); // {2}{W}{W} destroy all creatures, they cannot be regenerated
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
|
||||
|
||||
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Wrath of God");
|
||||
setStopAt(1, PhaseStep.BEGIN_COMBAT);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Wrath of God", 1);
|
||||
assertGraveyardCount(playerB, "Clergy of the Holy Nimbus", 1);
|
||||
}
|
||||
|
||||
// in game testing works correctly - not sure if the ability is being activated or not here.
|
||||
@Ignore
|
||||
@Test
|
||||
public void testOpponentPaysOneToNotAllowRegeneration() {
|
||||
|
||||
// If Clergy of the Holy Nimbus would be destroyed, regenerate it.
|
||||
// {1}: Clergy of the Holy Nimbus can't be regenerated this turn. Only any opponent may activate this ability.
|
||||
addCard(Zone.BATTLEFIELD, playerB, "Clergy of the Holy Nimbus"); // {W} 1/1
|
||||
addCard(Zone.HAND, playerA, "Doom Blade"); // {1}{B} destroy target non-black creature
|
||||
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
|
||||
|
||||
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{1}:");
|
||||
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Doom Blade", "Clergy of the Holy Nimbus");
|
||||
setStopAt(1, PhaseStep.END_TURN);
|
||||
execute();
|
||||
|
||||
assertGraveyardCount(playerA, "Doom Blade", 1);
|
||||
assertGraveyardCount(playerB, "Clergy of the Holy Nimbus", 1);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue