add better comments + refactor card names into variables

This commit is contained in:
John Gray 2019-07-21 21:33:38 -04:00
parent f5d4046903
commit ca79db489a

View file

@ -13,44 +13,60 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*/ */
public class RepeatedReverberationTest extends CardTestPlayerBase { public class RepeatedReverberationTest extends CardTestPlayerBase {
/* Repeated Reverberation {2}{R}{R}
* When you next cast an instant spell, cast a sorcery spell, or activate a loyalty ability this turn, copy that spell or ability twice.
* You may choose new targets for the copies.
*/
String repeatedReverb = "Repeated Reverberation";
/** /**
* https://github.com/magefree/mage/issues/5882 * https://github.com/magefree/mage/issues/5882
* Repeated Reverberation was not working with loyalty counter abilities. * Repeated Reverberation was not working with loyalty counter abilities.
*/ */
@Test @Test
public void testRepeatedReverberationWorksWithLoyaltyAbilities() { public void testRepeatedReverberationWorksWithLoyaltyAbilities() {
// +1: You gain 2 life. /* Ajani Goldmane: {2}{W}{W} starts with 4 Loyality counters
// -1: Put a +1/+1 counter on each creature you control. Those creatures gain vigilance until end of turn. * +1: You gain 2 life.
// -6: Put a white Avatar creature token onto the battlefield. It has "This creature's power and toughness are each equal to your life total." * -1: Put a +1/+1 counter on each creature you control. Those creatures gain vigilance until end of turn.
addCard(Zone.HAND, playerA, "Ajani Goldmane"); // {2}{W}{W} starts with 4 Loyality counters * -6: Put a white Avatar creature token onto the battlefield. It has "This creature's power and toughness are each equal to your life total."
addCard(Zone.HAND, playerA, "Repeated Reverberation"); */
String ajani = "Ajani Goldmane";
addCard(Zone.HAND, playerA, ajani);
addCard(Zone.HAND, playerA, repeatedReverb);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ajani Goldmane"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, ajani);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Repeated Reverberation"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, repeatedReverb);
activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: You gain 2 life"); activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "+1: You gain 2 life");
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertPermanentCount(playerA, "Ajani Goldmane", 1); assertPermanentCount(playerA, ajani, 1);
assertGraveyardCount(playerA, "Repeated Reverberation", 1); assertGraveyardCount(playerA, repeatedReverb, 1);
assertCounterCount("Ajani Goldmane", CounterType.LOYALTY, 5); // 4 + 1 = 5 assertCounterCount(ajani, CounterType.LOYALTY, 5); // 4 + 1 = 5
assertLife(playerA, 26); assertLife(playerA, 26);
} }
@Test @Test
public void testRepeatedReverberationWorksWithInstants() { public void testRepeatedReverberationWorksWithInstants() {
addCard(Zone.HAND, playerA, "Soothing Balm"); // {1}{W} Target player gains 5 life /* Soothing Balm - Instant {1}{W}
addCard(Zone.HAND, playerA, "Repeated Reverberation"); * Target player gains 5 life
* Just an arbitrary instant to test reverb with.
*/
String soothingBalm = "Soothing Balm";
addCard(Zone.HAND, playerA, soothingBalm);
addCard(Zone.HAND, playerA, repeatedReverb);
addCard(Zone.BATTLEFIELD, playerA, "Plains", 4); addCard(Zone.BATTLEFIELD, playerA, "Plains", 4);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Repeated Reverberation"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, repeatedReverb);
waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA); waitStackResolved(1, PhaseStep.PRECOMBAT_MAIN, playerA);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soothing Balm"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, soothingBalm);
addTarget(playerA, playerA); addTarget(playerA, playerA);
addTarget(playerA, playerB); //Should be able to choose new targets for each copy addTarget(playerA, playerB); //Should be able to choose new targets for each copy
addTarget(playerA, playerA); addTarget(playerA, playerA);
@ -58,8 +74,8 @@ public class RepeatedReverberationTest extends CardTestPlayerBase {
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertGraveyardCount(playerA, "Soothing Balm", 1); assertGraveyardCount(playerA, soothingBalm, 1);
assertGraveyardCount(playerA, "Repeated Reverberation", 1); assertGraveyardCount(playerA, repeatedReverb, 1);
assertLife(playerA, 30); assertLife(playerA, 30);
assertLife(playerB, 25); assertLife(playerB, 25);
@ -67,20 +83,26 @@ public class RepeatedReverberationTest extends CardTestPlayerBase {
@Test @Test
public void testRepeatedReverberationWorksWithSorceries() { public void testRepeatedReverberationWorksWithSorceries() {
addCard(Zone.HAND, playerA, "Soul Feast"); // {3}{B}{B} Target player loses 4 life. You gain 4 life. /* Soul Feast - Sorcery {3}{B}{B}
addCard(Zone.HAND, playerA, "Repeated Reverberation"); * Target player loses 4 life. You gain 4 life.
* Just an arbitrary sorcery to test reverb with.
*/
String soulFeast = "Soul Feast";
addCard(Zone.HAND, playerA, soulFeast);
addCard(Zone.HAND, playerA, repeatedReverb);
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5); addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4); addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Repeated Reverberation"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, repeatedReverb);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul Feast"); castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, soulFeast);
addTarget(playerA, playerB); addTarget(playerA, playerB);
setStopAt(1, PhaseStep.BEGIN_COMBAT); setStopAt(1, PhaseStep.BEGIN_COMBAT);
execute(); execute();
assertGraveyardCount(playerA, "Soul Feast", 1); assertGraveyardCount(playerA, soulFeast, 1);
assertGraveyardCount(playerA, "Repeated Reverberation", 1); assertGraveyardCount(playerA, repeatedReverb, 1);
assertLife(playerA, 32); assertLife(playerA, 32);
assertLife(playerB, 8); assertLife(playerB, 8);