* Added test.

This commit is contained in:
LevelX2 2017-02-03 21:36:33 +01:00
parent 2a3e38f845
commit 067b72dcce
2 changed files with 48 additions and 4 deletions

View file

@ -79,9 +79,11 @@ public class GontiLordOfLuxuryEffectTest extends CardTestPlayerBase {
assertPermanentCount(playerB, "Rashmi, Eternities Crafter", 1);
}
/**
* Opponent using Gonti, Lord of Luxury took Mirari's Wake out of my library and cast it.
* I cast Cyclonic Rift on Mirari's Wake to put it back in my hand and was unable to recast Mirari's Wake.
* Opponent using Gonti, Lord of Luxury took Mirari's Wake out of my library
* and cast it. I cast Cyclonic Rift on Mirari's Wake to put it back in my
* hand and was unable to recast Mirari's Wake.
*/
@Test
public void testCanBeCastAgainCyclonicRift() {
@ -124,6 +126,48 @@ public class GontiLordOfLuxuryEffectTest extends CardTestPlayerBase {
assertPowerToughness(playerB, "Silvercoat Lion", 3, 3);
}
/**
* I noticed in a game that when you cast Lingering Souls off of Gonti, Lord
* of Luxury and then the lingering souls goes to the graveyard it cannot be
* flashed back. The gonti was my opponent's and the lingering souls was
* mine for reference.
*/
@Test
public void testCanBeCastLaterWithFlashBack() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 7);
// Deathtouch
// When Gonti, Lord of Luxury enters the battlefield, look at the top four cards of target opponent's library, exile one of them face down,
// then put the rest on the bottom of that library in a random order. For as long as that card remains exiled,
// you may look at it, you may cast it, and you may spend mana as though it were mana of any type to cast it.
addCard(Zone.HAND, playerA, "Gonti, Lord of Luxury", 1); // Creature 2/3 {2}{B}{B}
// Create two 1/1 white Spirit creature tokens with flying.
// Flashback {1}{B}
addCard(Zone.LIBRARY, playerB, "Lingering Souls"); // Sorcery {2}{W}
skipInitShuffling();
addCard(Zone.BATTLEFIELD, playerB, "Swamp", 2);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Gonti, Lord of Luxury");
addTarget(playerA, playerB);
setChoice(playerA, "Lingering Souls");
castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Lingering Souls");
activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Flashback");
setStopAt(2, PhaseStep.BEGIN_COMBAT);
execute();
assertPermanentCount(playerA, "Gonti, Lord of Luxury", 1);
assertPowerToughness(playerA, "Gonti, Lord of Luxury", 2, 3);
assertPermanentCount(playerA, "Spirit", 2);
assertPermanentCount(playerB, "Spirit", 2);
assertExileCount("Lingering Souls", 1);
}
}

View file

@ -275,7 +275,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
@Override
public Abilities<Ability> getAbilities(Game game) {
Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(objectId);
if (otherAbilities == null) {
if (otherAbilities == null || otherAbilities.isEmpty()) {
return abilities;
}
Abilities<Ability> all = new AbilitiesImpl<>();